Commit e56ff58b authored by Sven Neumann's avatar Sven Neumann

applied a patch from Simon.


--Sven
parent e422b59e
Wed Sep 15 12:43:39 MEST 1999 Simon Budig <Simon.Budig@unix-ag.org>
* app/tools.c
* app/pixmaps2.h
* app/path_tool.c
* app/path_toolP.h
Own pixmap for the Path Tool. It is now possible to connect
open ends of curves. Simply activate one end and shift click
on the other. Control-Click deletes points.
Still no bezier/painting functions...
1999-09-14 Tor Lillqvist <tml@iki.fi>
* app/brush_select.c: Include config.h, guard inclusion of
......
This diff is collapsed.
......@@ -40,45 +40,46 @@ typedef enum { SEGMENT_LINE, SEGMENT_BEZIER } SegmentType;
typedef struct _path_segment PathSegment;
typedef struct _path_curve PathCurve;
typedef struct _path Path;
typedef struct _path_tool PathTool;
struct _path_segment
{
SegmentType type; /* What type of segment */
gdouble x, y; /* location of starting-point in image space */
gpointer data; /* Additional data, dependant of segment-type */
guint32 flags; /* Various Flags: Is the Segment active? */
PathCurve *parent; /* the parent Curve */
PathSegment *next; /* Next Segment or NULL */
PathSegment *prev; /* Previous Segment or NULL */
gpointer data; /* Additional data, dependant of segment-type */
};
typedef struct _path_curve PathCurve;
struct _path_curve
{
PathSegment * segments; /* The segments of the curve */
PathSegment * cur_segment; /* the current segment */
Path * parent; /* the parent Path */
PathCurve * next; /* Next Curve or NULL */
PathCurve * prev; /* Previous Curve or NULL */
};
typedef struct _path Path;
struct _path
{
PathCurve * curves; /* the curves */
PathCurve * cur_curve; /* the current curve */
GString * name; /* the name of the path */
guint32 state; /* is the path locked? */
PathTool * path_tool; /* The parent Path Tool */
};
typedef struct _path_tool PathTool;
struct _path_tool
{
gint click_pos; /* where did the user click? */
......@@ -90,6 +91,14 @@ struct _path_tool
PathCurve *click_curve; /* was the click? */
PathSegment *click_segment;
gint active_count; /* How many segments are active? */
/*
* WARNING: single_active_segment may contain non NULL Values
* which point to the nirvana. But they are important!
* The pointer is garantueed to be valid, when active_count==1
*/
PathSegment *single_active_segment; /* The only active segment */
gint state; /* state of tool */
gint draw; /* all or part */
DrawCore *core; /* Core drawing object */
......
......@@ -1004,3 +1004,34 @@ static char *xinput_airbrush_bits [] =
"......................"
};
/* GIMP icon image format -- S. Kimball, P. Mattis */
/* Image name: path_tool */
#define path_tool_width 22
#define path_tool_height 22
static char *path_tool_bits [] =
{
"......................",
"......aaa.............",
"......ahae............",
"......aaae............",
".......ee..aaae.......",
"......a..aae..aae.....",
"......e.a.......ae....",
".....a.a.........aa...",
"......a.........aaaa..",
"....aa..........aaaae.",
".....a..a........aaee.",
"...aa....aa.......ee..",
"..aae....aaaa.........",
".ahha.....aaaa........",
".ahhae....aaa.........",
"..aaee.....a.a........",
"..aee.........a.......",
"..a...................",
"..a...................",
"..a...................",
"..a...................",
"......................"
};
......@@ -520,7 +520,7 @@ ToolInfo tool_info[] =
26,
N_("/Tools/Path"),
"",
(char **) measure_bits,
(char **) path_tool_bits,
N_("Manipulate paths"),
"ContextHelp/path",
PATH_TOOL,
......
This diff is collapsed.
......@@ -40,45 +40,46 @@ typedef enum { SEGMENT_LINE, SEGMENT_BEZIER } SegmentType;
typedef struct _path_segment PathSegment;
typedef struct _path_curve PathCurve;
typedef struct _path Path;
typedef struct _path_tool PathTool;
struct _path_segment
{
SegmentType type; /* What type of segment */
gdouble x, y; /* location of starting-point in image space */
gpointer data; /* Additional data, dependant of segment-type */
guint32 flags; /* Various Flags: Is the Segment active? */
PathCurve *parent; /* the parent Curve */
PathSegment *next; /* Next Segment or NULL */
PathSegment *prev; /* Previous Segment or NULL */
gpointer data; /* Additional data, dependant of segment-type */
};
typedef struct _path_curve PathCurve;
struct _path_curve
{
PathSegment * segments; /* The segments of the curve */
PathSegment * cur_segment; /* the current segment */
Path * parent; /* the parent Path */
PathCurve * next; /* Next Curve or NULL */
PathCurve * prev; /* Previous Curve or NULL */
};
typedef struct _path Path;
struct _path
{
PathCurve * curves; /* the curves */
PathCurve * cur_curve; /* the current curve */
GString * name; /* the name of the path */
guint32 state; /* is the path locked? */
PathTool * path_tool; /* The parent Path Tool */
};
typedef struct _path_tool PathTool;
struct _path_tool
{
gint click_pos; /* where did the user click? */
......@@ -90,6 +91,14 @@ struct _path_tool
PathCurve *click_curve; /* was the click? */
PathSegment *click_segment;
gint active_count; /* How many segments are active? */
/*
* WARNING: single_active_segment may contain non NULL Values
* which point to the nirvana. But they are important!
* The pointer is garantueed to be valid, when active_count==1
*/
PathSegment *single_active_segment; /* The only active segment */
gint state; /* state of tool */
gint draw; /* all or part */
DrawCore *core; /* Core drawing object */
......
......@@ -520,7 +520,7 @@ ToolInfo tool_info[] =
26,
N_("/Tools/Path"),
"",
(char **) measure_bits,
(char **) path_tool_bits,
N_("Manipulate paths"),
"ContextHelp/path",
PATH_TOOL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment