mirror of https://github.com/GNOME/gimp.git
Changed:- app/bezier_select.c app/bezier_selectP.h app/cursorutil.c
Thu May 13 22:41:26 BST 1999 Andy Thomas <alt@gimp.org> Changed:- * app/bezier_select.c * app/bezier_selectP.h * app/cursorutil.c * app/cursorutil.h * app/curves.c * app/paths_dialog.c New:- * cursor/mouse1_ap * cursor/mouse1_apmsk * cursor/mouse1_cp * cursor/mouse1_cpmsk * cursor/mouse1_mm * cursor/mouse1_mmmsk * cursor/mouse1_sel * cursor/mouse1_selm * cursor/mouse1_selmmsk * cursor/mouse1_selmsk * cursor/mouse1_selp * cursor/mouse1_selpmsk Paths changes:- Implemented multi-part paths. (Import the path (RMB in paths dialog brings menu up) http://www.picnic.demon.co.uk/tmp/gimp.path into a 600x256 (WxH) for an example). Can copy/paste paths. Fully custom cursors when using the Bezier tool. A number of bug fixes re boundary problems also fixed. Note that heavy use is made of the modifier keys in the bezier tool. MB1 inside a closed curve converts it to a selection. The modifiers change how the selection interacts with any current selection (in much the same way as the selection tool does). MB1 + ALT on control point will move a curve, if shift modifier active then single curve is moved. Curves:- In curves dialog you can now press MB1 + shift will add point to curves dialog corresponding to the current position in the currently selected channel. MB1 + CNTRL will add the point to all channels. (Thanks to Carey Bunks for the initial idea).
This commit is contained in:
parent
ea8841801b
commit
df68aba3a7
50
ChangeLog
50
ChangeLog
|
@ -1,3 +1,53 @@
|
|||
Thu May 13 22:41:26 BST 1999 Andy Thomas <alt@gimp.org>
|
||||
|
||||
Changed:-
|
||||
* app/bezier_select.c
|
||||
* app/bezier_selectP.h
|
||||
* app/cursorutil.c
|
||||
* app/cursorutil.h
|
||||
* app/curves.c
|
||||
* app/paths_dialog.c
|
||||
|
||||
New:-
|
||||
* cursor/mouse1_ap
|
||||
* cursor/mouse1_apmsk
|
||||
* cursor/mouse1_cp
|
||||
* cursor/mouse1_cpmsk
|
||||
* cursor/mouse1_mm
|
||||
* cursor/mouse1_mmmsk
|
||||
* cursor/mouse1_sel
|
||||
* cursor/mouse1_selm
|
||||
* cursor/mouse1_selmmsk
|
||||
* cursor/mouse1_selmsk
|
||||
* cursor/mouse1_selp
|
||||
* cursor/mouse1_selpmsk
|
||||
|
||||
Paths changes:-
|
||||
Implemented multi-part paths.
|
||||
(Import the path (RMB in paths dialog brings menu up)
|
||||
http://www.picnic.demon.co.uk/tmp/gimp.path
|
||||
into a 600x256 (WxH) for an example).
|
||||
|
||||
Can copy/paste paths.
|
||||
Fully custom cursors when using the Bezier tool. A number of bug
|
||||
fixes re boundary problems also fixed.
|
||||
|
||||
Note that heavy use is made of the modifier keys in the bezier tool.
|
||||
MB1 inside a closed curve converts it to a selection. The modifiers
|
||||
change how the selection interacts with any current selection (in
|
||||
much the same way as the selection tool does).
|
||||
|
||||
MB1 + ALT on control point will move a curve, if shift modifier active
|
||||
then single curve is moved.
|
||||
|
||||
|
||||
Curves:-
|
||||
|
||||
In curves dialog you can now press MB1 + shift will add point to
|
||||
curves dialog corresponding to the current position in
|
||||
the currently selected channel. MB1 + CNTRL will add the point
|
||||
to all channels. (Thanks to Carey Bunks for the initial idea).
|
||||
|
||||
1999-05-12 Scott Goehring <scott@poverty.bloomington.in.us>
|
||||
|
||||
* configure.in: fixed variable clobber for thread & MP options
|
||||
|
|
14
Makefile.am
14
Makefile.am
|
@ -7,12 +7,26 @@ bin_SCRIPTS = gimptool
|
|||
EXTRA_DIST = \
|
||||
cursors/bigcirc \
|
||||
cursors/bigcircmsk \
|
||||
cursors/dropper \
|
||||
cursors/droppermsk \
|
||||
cursors/mouse1 \
|
||||
cursors/mouse1msk \
|
||||
cursors/mouse1_ap \
|
||||
cursors/mouse1_apmsk \
|
||||
cursors/mouse1_cp \
|
||||
cursors/mouse1_cpmsk \
|
||||
cursors/mouse1_m \
|
||||
cursors/mouse1_mmsk \
|
||||
cursors/mouse1_mm \
|
||||
cursors/mouse1_mmmsk \
|
||||
cursors/mouse1_p \
|
||||
cursors/mouse1_pmsk \
|
||||
cursors/mouse1_sel \
|
||||
cursors/mouse1_selmsk \
|
||||
cursors/mouse1_selm \
|
||||
cursors/mouse1_selmmsk \
|
||||
cursors/mouse1_selp \
|
||||
cursors/mouse1_selpmsk \
|
||||
cursors/picker \
|
||||
cursors/pickermsk \
|
||||
pixmaps/anchor.xpm \
|
||||
|
|
|
@ -232,8 +232,34 @@ curves_colour_update(Tool *tool,
|
|||
curves_dialog->col_value[HISTOGRAM_VALUE] = MAXIMUM(maxval,color[BLUE_PIX]);
|
||||
|
||||
g_free(color);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
static void
|
||||
curves_add_point(GimpDrawable * drawable,gint x, gint y,gint cchan)
|
||||
{
|
||||
/* Add point onto the curve */
|
||||
int closest_point = 0;
|
||||
int distance;
|
||||
int curvex;
|
||||
int i;
|
||||
|
||||
curvex = curves_dialog->col_value[cchan];
|
||||
distance = G_MAXINT;
|
||||
for (i = 0; i < 17; i++)
|
||||
{
|
||||
if (curves_dialog->points[cchan][i][0] != -1)
|
||||
if (abs (curvex - curves_dialog->points[cchan][i][0]) < distance)
|
||||
{
|
||||
distance = abs (curvex - curves_dialog->points[cchan][i][0]);
|
||||
closest_point = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (distance > MIN_DISTANCE)
|
||||
closest_point = (curvex + 8) / 16;
|
||||
|
||||
curves_dialog->points[cchan][closest_point][0] = curvex;
|
||||
curves_dialog->points[cchan][closest_point][1] = curves_dialog->curve[cchan][curvex];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -254,6 +280,23 @@ curves_button_release (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
|
||||
if(bevent->state & GDK_SHIFT_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,curves_dialog->channel);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
else if(bevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_VALUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_RED);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_GREEN);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_BLUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_ALPHA);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -274,6 +317,7 @@ curves_motion (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -732,8 +776,8 @@ curves_update (CurvesDialog *cd,
|
|||
|
||||
/* draw the colour line */
|
||||
gdk_draw_line(cd->pixmap, cd->graph->style->black_gc,
|
||||
cd->col_value[cd->channel],RADIUS,
|
||||
cd->col_value[cd->channel],GRAPH_HEIGHT + RADIUS);
|
||||
cd->col_value[cd->channel]+RADIUS,RADIUS,
|
||||
cd->col_value[cd->channel]+RADIUS,GRAPH_HEIGHT + RADIUS);
|
||||
|
||||
gdk_draw_pixmap (cd->graph->window, cd->graph->style->black_gc, cd->pixmap,
|
||||
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
|
||||
|
@ -1006,7 +1050,11 @@ curves_free_callback (GtkWidget *w,
|
|||
if (cd->curve_type != GFREE)
|
||||
{
|
||||
cd->curve_type = GFREE;
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | DRAW);
|
||||
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1082,7 @@ curves_reset_callback (GtkWidget *widget,
|
|||
cd->points[cd->channel][16][0] = 255;
|
||||
cd->points[cd->channel][16][1] = 255;
|
||||
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | XRANGE_TOP | DRAW);
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
|
|
1299
app/bezier_select.c
1299
app/bezier_select.c
File diff suppressed because it is too large
Load Diff
|
@ -26,6 +26,7 @@
|
|||
|
||||
#define BEZIER_ANCHOR 1
|
||||
#define BEZIER_CONTROL 2
|
||||
#define BEZIER_MOVE 3
|
||||
|
||||
#define IMAGE_COORDS 1
|
||||
#define AA_IMAGE_COORDS 2
|
||||
|
@ -39,11 +40,12 @@ typedef struct _bezier_point BezierPoint;
|
|||
|
||||
struct _bezier_point
|
||||
{
|
||||
int type; /* type of point (anchor or control) */
|
||||
int x, y; /* location of point in image space */
|
||||
int type; /* type of point (anchor/control/move) */
|
||||
double x, y; /* location of point in image space */
|
||||
int sx, sy; /* location of point in screen space */
|
||||
BezierPoint *next; /* next point on curve */
|
||||
BezierPoint *prev; /* prev point on curve */
|
||||
BezierPoint *next_curve; /* Next curve segment */
|
||||
};
|
||||
|
||||
typedef struct _bezier_select BezierSelect;
|
||||
|
@ -52,7 +54,7 @@ struct _bezier_select
|
|||
{
|
||||
int state; /* start, add, edit or drag */
|
||||
int draw; /* all or part */
|
||||
int closed; /* is the curve closed */
|
||||
int closed; /* is the last curve closed */
|
||||
DrawCore *core; /* Core drawing object */
|
||||
BezierPoint *points; /* the curve */
|
||||
BezierPoint *cur_anchor; /* the current active anchor point */
|
||||
|
@ -63,13 +65,21 @@ struct _bezier_select
|
|||
GSList **scanlines; /* used in converting a curve */
|
||||
};
|
||||
|
||||
/* All udata that are passed to the bezier_draw_curve must
|
||||
* have this structure as the first element.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
gint count;
|
||||
} CountCurves;
|
||||
|
||||
typedef void (*BezierPointsFunc) (BezierSelect *, GdkPoint *, int,gpointer);
|
||||
|
||||
/* Functions */
|
||||
int bezier_select_load (void *, BezierPoint *, int, int);
|
||||
void bezier_draw_curve (BezierSelect *,BezierPointsFunc, int,gpointer);
|
||||
void bezier_select_reset (BezierSelect *);
|
||||
void bezier_add_point (BezierSelect *, int, int, int);
|
||||
void bezier_add_point (BezierSelect *, int, gdouble, gdouble);
|
||||
void bezier_paste_bezierselect_to_current (GDisplay *,BezierSelect *);
|
||||
void bezier_select_mode (gint);
|
||||
void bezier_stroke (BezierSelect *, GDisplay *, int, int);
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
#include "../cursors/bigcircmsk"
|
||||
#include "../cursors/dropper"
|
||||
#include "../cursors/droppermsk"
|
||||
#include "../cursors/mouse1_ap"
|
||||
#include "../cursors/mouse1_apmsk"
|
||||
#include "../cursors/mouse1_cp"
|
||||
#include "../cursors/mouse1_cpmsk"
|
||||
#include "../cursors/mouse1_mm"
|
||||
#include "../cursors/mouse1_mmmsk"
|
||||
#include "../cursors/mouse1_sel"
|
||||
#include "../cursors/mouse1_selmsk"
|
||||
#include "../cursors/mouse1_selm"
|
||||
#include "../cursors/mouse1_selmmsk"
|
||||
#include "../cursors/mouse1_selp"
|
||||
#include "../cursors/mouse1_selpmsk"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -52,6 +64,18 @@ static BM_Cursor gimp_cursors[] =
|
|||
bigcirc_x_hot, bigcirc_y_hot, NULL},
|
||||
{ dropper_bits, droppermsk_bits, dropper_width, dropper_height,
|
||||
dropper_x_hot, dropper_y_hot, NULL},
|
||||
{ mouse1_ap_bits, mouse1_apmsk_bits, mouse1_ap_width, mouse1_ap_height,
|
||||
mouse1_ap_x_hot, mouse1_ap_y_hot, NULL},
|
||||
{ mouse1_cp_bits, mouse1_cpmsk_bits, mouse1_cp_width, mouse1_cp_height,
|
||||
mouse1_cp_x_hot, mouse1_cp_y_hot, NULL},
|
||||
{ mouse1_mm_bits, mouse1_mmmsk_bits, mouse1_mm_width, mouse1_mm_height,
|
||||
mouse1_mm_x_hot, mouse1_mm_y_hot, NULL},
|
||||
{ mouse1_selp_bits, mouse1_selpmsk_bits, mouse1_selp_width, mouse1_selp_height,
|
||||
mouse1_selp_x_hot, mouse1_selp_y_hot, NULL},
|
||||
{ mouse1_selm_bits, mouse1_selmmsk_bits, mouse1_selm_width, mouse1_selm_height,
|
||||
mouse1_selm_x_hot, mouse1_selm_y_hot, NULL},
|
||||
{ mouse1_sel_bits, mouse1_selmsk_bits, mouse1_sel_width, mouse1_sel_height,
|
||||
mouse1_sel_x_hot, mouse1_sel_y_hot, NULL},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,12 @@ typedef enum
|
|||
GIMP_MOUSE1M_CURSOR,
|
||||
GIMP_BIGCIRC_CURSOR,
|
||||
GIMP_COLOR_PICKER_CURSOR,
|
||||
GIMP_MOUSE1AP_CURSOR,
|
||||
GIMP_MOUSE1CP_CURSOR,
|
||||
GIMP_MOUSE1MM_CURSOR,
|
||||
GIMP_MOUSE1SELP_CURSOR,
|
||||
GIMP_MOUSE1SELM_CURSOR,
|
||||
GIMP_MOUSE1SEL_CURSOR,
|
||||
GIMP_LAST_CURSOR_ENTRY
|
||||
} GimpCursorType;
|
||||
|
||||
|
|
55
app/curves.c
55
app/curves.c
|
@ -232,8 +232,34 @@ curves_colour_update(Tool *tool,
|
|||
curves_dialog->col_value[HISTOGRAM_VALUE] = MAXIMUM(maxval,color[BLUE_PIX]);
|
||||
|
||||
g_free(color);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
static void
|
||||
curves_add_point(GimpDrawable * drawable,gint x, gint y,gint cchan)
|
||||
{
|
||||
/* Add point onto the curve */
|
||||
int closest_point = 0;
|
||||
int distance;
|
||||
int curvex;
|
||||
int i;
|
||||
|
||||
curvex = curves_dialog->col_value[cchan];
|
||||
distance = G_MAXINT;
|
||||
for (i = 0; i < 17; i++)
|
||||
{
|
||||
if (curves_dialog->points[cchan][i][0] != -1)
|
||||
if (abs (curvex - curves_dialog->points[cchan][i][0]) < distance)
|
||||
{
|
||||
distance = abs (curvex - curves_dialog->points[cchan][i][0]);
|
||||
closest_point = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (distance > MIN_DISTANCE)
|
||||
closest_point = (curvex + 8) / 16;
|
||||
|
||||
curves_dialog->points[cchan][closest_point][0] = curvex;
|
||||
curves_dialog->points[cchan][closest_point][1] = curves_dialog->curve[cchan][curvex];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -254,6 +280,23 @@ curves_button_release (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
|
||||
if(bevent->state & GDK_SHIFT_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,curves_dialog->channel);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
else if(bevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_VALUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_RED);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_GREEN);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_BLUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_ALPHA);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -274,6 +317,7 @@ curves_motion (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -732,8 +776,8 @@ curves_update (CurvesDialog *cd,
|
|||
|
||||
/* draw the colour line */
|
||||
gdk_draw_line(cd->pixmap, cd->graph->style->black_gc,
|
||||
cd->col_value[cd->channel],RADIUS,
|
||||
cd->col_value[cd->channel],GRAPH_HEIGHT + RADIUS);
|
||||
cd->col_value[cd->channel]+RADIUS,RADIUS,
|
||||
cd->col_value[cd->channel]+RADIUS,GRAPH_HEIGHT + RADIUS);
|
||||
|
||||
gdk_draw_pixmap (cd->graph->window, cd->graph->style->black_gc, cd->pixmap,
|
||||
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
|
||||
|
@ -1006,7 +1050,11 @@ curves_free_callback (GtkWidget *w,
|
|||
if (cd->curve_type != GFREE)
|
||||
{
|
||||
cd->curve_type = GFREE;
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | DRAW);
|
||||
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1082,7 @@ curves_reset_callback (GtkWidget *widget,
|
|||
cd->points[cd->channel][16][0] = 255;
|
||||
cd->points[cd->channel][16][1] = 255;
|
||||
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | XRANGE_TOP | DRAW);
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
|
|
|
@ -98,6 +98,7 @@ typedef struct {
|
|||
} PATHSLIST, *PATHSLISTP;
|
||||
|
||||
static PATHSLISTP paths_dialog = NULL;
|
||||
static PATHP copy_pp = NULL;
|
||||
|
||||
typedef struct {
|
||||
GdkPixmap *paths_pixmap;
|
||||
|
@ -110,6 +111,11 @@ typedef struct {
|
|||
PATHP copy_path;
|
||||
} PATHUNDO;
|
||||
|
||||
typedef struct {
|
||||
CountCurves c_count; /* Must be the first element */
|
||||
gint total_count; /* Total number of curves */
|
||||
} PATHCOUNTS, *PATHCOUNTSP;
|
||||
|
||||
static gchar * unique_name(GimpImage *,gchar *);
|
||||
|
||||
static gint path_widget_preview_events (GtkWidget *, GdkEvent *);
|
||||
|
@ -122,6 +128,8 @@ static void paths_dialog_delete_path_callback (GtkWidget *, gpointer);
|
|||
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_unmap_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_dup_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_copy_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_paste_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_stroke_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_path_to_sel_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_destroy_cb (GimpImage *image);
|
||||
|
@ -136,18 +144,14 @@ static void paths_dialog_delete_point_callback (GtkWidget *, gpointer);
|
|||
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
|
||||
static void paths_dialog_import_path_callback (GtkWidget *, gpointer);
|
||||
static void paths_dialog_export_path_callback (GtkWidget *, gpointer);
|
||||
static void path_close(PATHP);
|
||||
|
||||
#define NEW_PATH_BUTTON 1
|
||||
#define DUP_PATH_BUTTON 2
|
||||
#define PATH_TO_SEL_BUTTON 3
|
||||
#define STROKE_PATH_BUTTON 4
|
||||
#define DEL_PATH_BUTTON 5
|
||||
|
||||
static MenuItem paths_ops[] =
|
||||
{
|
||||
{ N_("New Path"), 'N', GDK_CONTROL_MASK,
|
||||
paths_dialog_new_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Duplicate Path"), 'C', GDK_CONTROL_MASK,
|
||||
{ N_("Duplicate Path"), 'U', GDK_CONTROL_MASK,
|
||||
paths_dialog_dup_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Path to Selection"), 'S', GDK_CONTROL_MASK,
|
||||
paths_dialog_path_to_sel_callback, NULL, NULL, NULL },
|
||||
|
@ -159,9 +163,21 @@ static MenuItem paths_ops[] =
|
|||
paths_dialog_import_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Export Path"), 'E', GDK_CONTROL_MASK,
|
||||
paths_dialog_export_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Copy Path"), 'C', GDK_CONTROL_MASK,
|
||||
paths_dialog_copy_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Paste Path"), 'P', GDK_CONTROL_MASK,
|
||||
paths_dialog_paste_path_callback, NULL, NULL, NULL },
|
||||
{ NULL, 0, 0, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
#define NEW_PATH_BUTTON 1
|
||||
#define DUP_PATH_BUTTON 2
|
||||
#define PATH_TO_SEL_BUTTON 3
|
||||
#define STROKE_PATH_BUTTON 4
|
||||
#define DEL_PATH_BUTTON 5
|
||||
#define COPY_PATH_BUTTON 8
|
||||
#define PASTE_PATH_BUTTON 9
|
||||
|
||||
static OpsButton paths_ops_buttons[] =
|
||||
{
|
||||
{ new_xpm, paths_dialog_new_path_callback, NULL, N_("New Path"), NULL, 0 },
|
||||
|
@ -211,6 +227,12 @@ paths_ops_button_set_sensitive(gint but,gboolean sensitive)
|
|||
gtk_widget_set_sensitive(paths_ops[4].widget,sensitive);
|
||||
gtk_widget_set_sensitive(paths_ops_buttons[4].widget,sensitive);
|
||||
break;
|
||||
case COPY_PATH_BUTTON:
|
||||
gtk_widget_set_sensitive(paths_ops[7].widget,sensitive);
|
||||
break;
|
||||
case PASTE_PATH_BUTTON:
|
||||
gtk_widget_set_sensitive(paths_ops[8].widget,sensitive);
|
||||
break;
|
||||
default:
|
||||
g_warning(_("paths_ops_button_set_sensitive:: invalid button specified"));
|
||||
break;
|
||||
|
@ -342,6 +364,8 @@ GtkWidget * paths_dialog_create()
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -528,6 +552,23 @@ path_copy(GimpImage *gimage,PATHP p)
|
|||
return p_copy;
|
||||
}
|
||||
|
||||
static PATHPOINTP
|
||||
path_start_last_seg(GSList *plist)
|
||||
{
|
||||
PATHPOINTP retp = plist->data;
|
||||
while(plist)
|
||||
{
|
||||
if(((PATHPOINTP)(plist->data))->type == BEZIER_MOVE &&
|
||||
g_slist_next(plist))
|
||||
{
|
||||
plist = g_slist_next(plist);
|
||||
retp = plist->data;
|
||||
}
|
||||
plist = g_slist_next(plist);
|
||||
}
|
||||
return retp;
|
||||
}
|
||||
|
||||
static void
|
||||
path_close(PATHP bzp)
|
||||
{
|
||||
|
@ -552,11 +593,13 @@ path_close(PATHP bzp)
|
|||
}
|
||||
}
|
||||
pathpoint = g_new0(PATHPOINT,1);
|
||||
pdata = (PATHPOINTP)bzp->path_details->data;
|
||||
pdata = path_start_last_seg(bzp->path_details);
|
||||
pathpoint->type = BEZIER_CONTROL;
|
||||
pathpoint->x = pdata->x;
|
||||
pathpoint->y = pdata->y;
|
||||
/* printf("Closing to x,y %d,%d\n",(gint)pdata->x,(gint)pdata->y); */
|
||||
bzp->path_details = g_slist_append(bzp->path_details,pathpoint);
|
||||
bzp->state = BEZIER_EDIT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -570,7 +613,8 @@ static BezierSelect *
|
|||
path_to_beziersel(PATHP bzp)
|
||||
{
|
||||
BezierSelect *bezier_sel;
|
||||
GSList *list;
|
||||
BezierPoint *bpnt = NULL;
|
||||
GSList *list;
|
||||
|
||||
if(!bzp)
|
||||
{
|
||||
|
@ -592,14 +636,28 @@ path_to_beziersel(PATHP bzp)
|
|||
{
|
||||
PATHPOINTP pdata;
|
||||
pdata = (PATHPOINTP)list->data;
|
||||
bezier_add_point(bezier_sel,(gint)pdata->type,(gint)pdata->x,pdata->y);
|
||||
if(pdata->type == BEZIER_MOVE)
|
||||
{
|
||||
/* printf("Close last curve off\n"); */
|
||||
bezier_sel->last_point->next = bpnt;
|
||||
bpnt->prev = bezier_sel->last_point;
|
||||
bezier_sel->cur_anchor = NULL;
|
||||
bezier_sel->cur_control = NULL;
|
||||
bpnt = NULL;
|
||||
}
|
||||
bezier_add_point(bezier_sel,
|
||||
(gint)pdata->type,
|
||||
rint(pdata->x), /* ALT add rint() */
|
||||
rint(pdata->y));
|
||||
if(bpnt == NULL)
|
||||
bpnt = bezier_sel->last_point;
|
||||
list = g_slist_next(list);
|
||||
}
|
||||
|
||||
if ( bezier_sel->closed )
|
||||
{
|
||||
bezier_sel->last_point->next = bezier_sel->points;
|
||||
bezier_sel->points->prev = bezier_sel->last_point;
|
||||
bezier_sel->last_point->next = bpnt;
|
||||
bpnt->prev = bezier_sel->last_point;
|
||||
bezier_sel->cur_anchor = bezier_sel->points;
|
||||
bezier_sel->cur_control = bezier_sel-> points->next;
|
||||
}
|
||||
|
@ -975,6 +1033,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -1013,6 +1073,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -1025,6 +1087,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
|
@ -1255,6 +1319,8 @@ paths_dialog_new_path_callback (GtkWidget * widget, gpointer udata)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
|
@ -1302,12 +1368,104 @@ paths_dialog_delete_path_callback (GtkWidget * widget, gpointer udata)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_EDIT_BUTTON,new_sz);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
paths_dialog_paste_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
PATHP bzp;
|
||||
PATHIMAGELISTP plp;
|
||||
PATHPOINTP pp;
|
||||
BezierSelect * bezier_sel;
|
||||
gint tmprow;
|
||||
GDisplay *gdisp;
|
||||
|
||||
gint row = paths_dialog->selected_row_num;
|
||||
|
||||
g_return_if_fail(paths_dialog->current_path_list != NULL);
|
||||
|
||||
if(!copy_pp)
|
||||
return;
|
||||
|
||||
/* Get current selection... ignore if none */
|
||||
if(paths_dialog->selected_row_num < 0)
|
||||
return;
|
||||
|
||||
/* Get bzpath structure */
|
||||
plp = paths_dialog->current_path_list;
|
||||
if(!plp)
|
||||
return;
|
||||
bzp = (PATHP)g_slist_nth_data(plp->bz_paths,row);
|
||||
|
||||
if(bzp->path_details)
|
||||
{
|
||||
pp = bzp->path_details->data;
|
||||
pp->type = BEZIER_MOVE;
|
||||
bzp->path_details = g_slist_concat(copy_pp->path_details,bzp->path_details);
|
||||
}
|
||||
else
|
||||
{
|
||||
bzp->closed = TRUE;
|
||||
bzp->path_details = copy_pp->path_details;
|
||||
bzp->state = copy_pp->state;
|
||||
}
|
||||
|
||||
/* First point on new curve is a moveto */
|
||||
copy_pp->path_details = NULL;
|
||||
path_free(copy_pp,NULL);
|
||||
copy_pp = NULL;
|
||||
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
|
||||
/* Now fudge the drawing....*/
|
||||
bezier_sel = path_to_beziersel(bzp);
|
||||
tmprow = paths_dialog->current_path_list->last_selected_row;
|
||||
paths_dialog->current_path_list->last_selected_row = row;
|
||||
gdisp = gdisplays_check_valid(paths_dialog->current_path_list->gdisp,
|
||||
paths_dialog->gimage);
|
||||
bezier_paste_bezierselect_to_current(gdisp,bezier_sel);
|
||||
paths_update_preview(bezier_sel);
|
||||
beziersel_free(bezier_sel);
|
||||
paths_dialog->current_path_list->last_selected_row = tmprow;
|
||||
}
|
||||
|
||||
static void
|
||||
paths_dialog_copy_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
PATHP bzp;
|
||||
PATHIMAGELISTP plp;
|
||||
gint row = paths_dialog->selected_row_num;
|
||||
|
||||
g_return_if_fail(paths_dialog->current_path_list != NULL);
|
||||
|
||||
/* Get current selection... ignore if none */
|
||||
if(paths_dialog->selected_row_num < 0)
|
||||
return;
|
||||
|
||||
/* Get bzpath structure */
|
||||
plp = paths_dialog->current_path_list;
|
||||
bzp = (PATHP)g_slist_nth_data(plp->bz_paths,row);
|
||||
|
||||
if(!bzp->path_details || g_slist_length(bzp->path_details) <= 5)
|
||||
return;
|
||||
|
||||
/* And store in static array */
|
||||
copy_pp = path_copy(paths_dialog->gimage,bzp);
|
||||
|
||||
/* All paths that are in the cut buffer must be closed */
|
||||
if(!copy_pp->closed)
|
||||
path_close(copy_pp);
|
||||
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
paths_dialog_dup_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
|
@ -1483,12 +1641,29 @@ pathpoints_create(BezierSelect *sel)
|
|||
GSList *list = NULL;
|
||||
PATHPOINTP pathpoint;
|
||||
BezierPoint *pts = (BezierPoint *) sel->points;
|
||||
BezierPoint *start_pnt = pts;
|
||||
gint need_move = 0;
|
||||
|
||||
for (i=0; i< sel->num_points; i++)
|
||||
{
|
||||
pathpoint = pathpoint_new(pts->type,(gdouble)pts->x,(gdouble)pts->y);
|
||||
pathpoint = pathpoint_new((need_move)?BEZIER_MOVE:pts->type,
|
||||
(gdouble)pts->x,(gdouble)pts->y);
|
||||
need_move = 0;
|
||||
list = g_slist_append(list,pathpoint);
|
||||
pts = pts->next;
|
||||
if(pts->next_curve)
|
||||
{
|
||||
/* The curve must loop back on itself */
|
||||
if(start_pnt != pts->next)
|
||||
g_warning("Curve of of sync");
|
||||
|
||||
need_move = 1;
|
||||
pts = pts->next_curve;
|
||||
start_pnt = pts;
|
||||
}
|
||||
else
|
||||
{
|
||||
pts = pts->next;
|
||||
}
|
||||
}
|
||||
return(list);
|
||||
}
|
||||
|
@ -1541,6 +1716,22 @@ paths_replaced_current(PATHIMAGELISTP plp,BezierSelect *bezier_sel)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gint
|
||||
number_curves_in_path(GSList *plist)
|
||||
{
|
||||
gint count = 0;
|
||||
while(plist)
|
||||
{
|
||||
if(((PATHPOINTP)(plist->data))->type == BEZIER_MOVE &&
|
||||
g_slist_next(plist))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
plist = g_slist_next(plist);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
paths_draw_segment_points(BezierSelect *bezier_sel,
|
||||
GdkPoint *pnt,
|
||||
|
@ -1558,6 +1749,7 @@ paths_draw_segment_points(BezierSelect *bezier_sel,
|
|||
GdkPoint * last_pnt = NULL;
|
||||
PATHWIDGETP pwidget;
|
||||
gint row;
|
||||
PATHCOUNTSP curve_count = (PATHCOUNTSP)udata;
|
||||
|
||||
/* we could remove duplicate points here */
|
||||
|
||||
|
@ -1591,8 +1783,12 @@ paths_draw_segment_points(BezierSelect *bezier_sel,
|
|||
|
||||
g_return_if_fail(pwidget != NULL);
|
||||
|
||||
paths_set_dash_line(paths_dialog->gc,!bezier_sel->closed);
|
||||
|
||||
if(curve_count->c_count.count < curve_count->total_count ||
|
||||
bezier_sel->closed)
|
||||
paths_set_dash_line(paths_dialog->gc,FALSE);
|
||||
else
|
||||
paths_set_dash_line(paths_dialog->gc,TRUE);
|
||||
|
||||
gdk_draw_lines (pwidget->paths_pixmap,
|
||||
paths_dialog->gc, copy_pnt, pcount);
|
||||
|
||||
|
@ -1603,6 +1799,8 @@ static void
|
|||
paths_update_preview(BezierSelect *bezier_sel)
|
||||
{
|
||||
gint row;
|
||||
PATHCOUNTS curve_count;
|
||||
|
||||
if(paths_dialog &&
|
||||
paths_dialog->current_path_list &&
|
||||
(row = paths_dialog->current_path_list->last_selected_row) >= 0 &&
|
||||
|
@ -1614,8 +1812,9 @@ paths_update_preview(BezierSelect *bezier_sel)
|
|||
/* Clear pixmap */
|
||||
clear_pixmap_preview(pwidget);
|
||||
|
||||
curve_count.total_count = number_curves_in_path(pwidget->bzp->path_details);
|
||||
/* update .. */
|
||||
bezier_draw_curve (bezier_sel,paths_draw_segment_points,IMAGE_COORDS,NULL);
|
||||
bezier_draw_curve (bezier_sel,paths_draw_segment_points,IMAGE_COORDS,&curve_count);
|
||||
|
||||
/* update the pixmap */
|
||||
|
||||
|
@ -1713,6 +1912,8 @@ paths_newpoint_current(BezierSelect *bezier_sel,GDisplay * gdisp)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
|
@ -1846,17 +2047,24 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
if (load_store)
|
||||
{
|
||||
f = fopen(filename, "rb");
|
||||
|
||||
if(!f)
|
||||
{
|
||||
g_message(_("Unable to open file %s"),filename);
|
||||
return;
|
||||
}
|
||||
|
||||
while(!feof(f))
|
||||
{
|
||||
gchar *txt = g_new(gchar,512);
|
||||
gchar *txtstart = txt;
|
||||
gint readfields = 0;
|
||||
int val, x, y, type, closed, i, draw, state;
|
||||
int val, type, closed, i, draw, state;
|
||||
double x,y;
|
||||
|
||||
if(!fgets(txt,512,f) || strlen(txt) < 7)
|
||||
{
|
||||
g_warning("Failed to read from %s",filename);
|
||||
g_message(_("Failed to read from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1871,7 +2079,14 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
|
||||
if(readfields != 4)
|
||||
{
|
||||
g_warning("Failed to read path from %s",filename);
|
||||
g_message(_("Failed to read path from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
||||
if(val <= 0)
|
||||
{
|
||||
g_message(_("No points specified in path file %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1879,10 +2094,10 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
for(i=0; i< val; i++)
|
||||
{
|
||||
PATHPOINTP bpt;
|
||||
readfields = fscanf(f,"TYPE: %d X: %d Y: %d\n", &type, &x, &y);
|
||||
readfields = fscanf(f,"TYPE: %d X: %lg Y: %lg\n", &type, &x, &y);
|
||||
if(readfields != 3)
|
||||
{
|
||||
g_warning("Failed to read path points from %s",filename);
|
||||
g_message(_("Failed to read path points from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1916,6 +2131,8 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,val);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,val);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,val);
|
||||
|
@ -2129,7 +2346,9 @@ paths_transform_do_undo(GimpImage *gimage,void *data)
|
|||
plist = plp->bz_paths;
|
||||
loop = 0;
|
||||
|
||||
while(plist)
|
||||
while(plist &&
|
||||
g_slist_length(plist) &&
|
||||
paths_dialog->current_path_list)
|
||||
{
|
||||
bezier_sel = path_to_beziersel(plist->data);
|
||||
tmprow = paths_dialog->current_path_list->last_selected_row;
|
||||
|
@ -2143,7 +2362,7 @@ paths_transform_do_undo(GimpImage *gimage,void *data)
|
|||
}
|
||||
|
||||
/* Force selection .. it may have changed */
|
||||
if(bezier_tool_selected())
|
||||
if(bezier_tool_selected() && paths_dialog->current_path_list)
|
||||
{
|
||||
gtk_clist_select_row(GTK_CLIST(paths_dialog->paths_list),
|
||||
paths_dialog->current_path_list->last_selected_row,
|
||||
|
@ -2208,7 +2427,13 @@ paths_transform_current_path(GimpImage *gimage,
|
|||
points_list = points_list->next;
|
||||
}
|
||||
|
||||
if(paths_dialog)
|
||||
/* Only update if we have a dialog, we have a currently
|
||||
* selected path and its the showing the same image.
|
||||
*/
|
||||
|
||||
if(paths_dialog &&
|
||||
paths_dialog->current_path_list &&
|
||||
paths_dialog->gimage == gimage)
|
||||
{
|
||||
/* Now fudge the drawing....*/
|
||||
bezier_sel = path_to_beziersel(p_copy);
|
||||
|
@ -2420,6 +2645,8 @@ paths_set_path_points(GimpImage * gimage,
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
|
|
|
@ -98,6 +98,7 @@ typedef struct {
|
|||
} PATHSLIST, *PATHSLISTP;
|
||||
|
||||
static PATHSLISTP paths_dialog = NULL;
|
||||
static PATHP copy_pp = NULL;
|
||||
|
||||
typedef struct {
|
||||
GdkPixmap *paths_pixmap;
|
||||
|
@ -110,6 +111,11 @@ typedef struct {
|
|||
PATHP copy_path;
|
||||
} PATHUNDO;
|
||||
|
||||
typedef struct {
|
||||
CountCurves c_count; /* Must be the first element */
|
||||
gint total_count; /* Total number of curves */
|
||||
} PATHCOUNTS, *PATHCOUNTSP;
|
||||
|
||||
static gchar * unique_name(GimpImage *,gchar *);
|
||||
|
||||
static gint path_widget_preview_events (GtkWidget *, GdkEvent *);
|
||||
|
@ -122,6 +128,8 @@ static void paths_dialog_delete_path_callback (GtkWidget *, gpointer);
|
|||
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_unmap_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_dup_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_copy_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_paste_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_stroke_path_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_path_to_sel_callback(GtkWidget *w,gpointer client_data);
|
||||
static void paths_dialog_destroy_cb (GimpImage *image);
|
||||
|
@ -136,18 +144,14 @@ static void paths_dialog_delete_point_callback (GtkWidget *, gpointer);
|
|||
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
|
||||
static void paths_dialog_import_path_callback (GtkWidget *, gpointer);
|
||||
static void paths_dialog_export_path_callback (GtkWidget *, gpointer);
|
||||
static void path_close(PATHP);
|
||||
|
||||
#define NEW_PATH_BUTTON 1
|
||||
#define DUP_PATH_BUTTON 2
|
||||
#define PATH_TO_SEL_BUTTON 3
|
||||
#define STROKE_PATH_BUTTON 4
|
||||
#define DEL_PATH_BUTTON 5
|
||||
|
||||
static MenuItem paths_ops[] =
|
||||
{
|
||||
{ N_("New Path"), 'N', GDK_CONTROL_MASK,
|
||||
paths_dialog_new_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Duplicate Path"), 'C', GDK_CONTROL_MASK,
|
||||
{ N_("Duplicate Path"), 'U', GDK_CONTROL_MASK,
|
||||
paths_dialog_dup_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Path to Selection"), 'S', GDK_CONTROL_MASK,
|
||||
paths_dialog_path_to_sel_callback, NULL, NULL, NULL },
|
||||
|
@ -159,9 +163,21 @@ static MenuItem paths_ops[] =
|
|||
paths_dialog_import_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Export Path"), 'E', GDK_CONTROL_MASK,
|
||||
paths_dialog_export_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Copy Path"), 'C', GDK_CONTROL_MASK,
|
||||
paths_dialog_copy_path_callback, NULL, NULL, NULL },
|
||||
{ N_("Paste Path"), 'P', GDK_CONTROL_MASK,
|
||||
paths_dialog_paste_path_callback, NULL, NULL, NULL },
|
||||
{ NULL, 0, 0, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
#define NEW_PATH_BUTTON 1
|
||||
#define DUP_PATH_BUTTON 2
|
||||
#define PATH_TO_SEL_BUTTON 3
|
||||
#define STROKE_PATH_BUTTON 4
|
||||
#define DEL_PATH_BUTTON 5
|
||||
#define COPY_PATH_BUTTON 8
|
||||
#define PASTE_PATH_BUTTON 9
|
||||
|
||||
static OpsButton paths_ops_buttons[] =
|
||||
{
|
||||
{ new_xpm, paths_dialog_new_path_callback, NULL, N_("New Path"), NULL, 0 },
|
||||
|
@ -211,6 +227,12 @@ paths_ops_button_set_sensitive(gint but,gboolean sensitive)
|
|||
gtk_widget_set_sensitive(paths_ops[4].widget,sensitive);
|
||||
gtk_widget_set_sensitive(paths_ops_buttons[4].widget,sensitive);
|
||||
break;
|
||||
case COPY_PATH_BUTTON:
|
||||
gtk_widget_set_sensitive(paths_ops[7].widget,sensitive);
|
||||
break;
|
||||
case PASTE_PATH_BUTTON:
|
||||
gtk_widget_set_sensitive(paths_ops[8].widget,sensitive);
|
||||
break;
|
||||
default:
|
||||
g_warning(_("paths_ops_button_set_sensitive:: invalid button specified"));
|
||||
break;
|
||||
|
@ -342,6 +364,8 @@ GtkWidget * paths_dialog_create()
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -528,6 +552,23 @@ path_copy(GimpImage *gimage,PATHP p)
|
|||
return p_copy;
|
||||
}
|
||||
|
||||
static PATHPOINTP
|
||||
path_start_last_seg(GSList *plist)
|
||||
{
|
||||
PATHPOINTP retp = plist->data;
|
||||
while(plist)
|
||||
{
|
||||
if(((PATHPOINTP)(plist->data))->type == BEZIER_MOVE &&
|
||||
g_slist_next(plist))
|
||||
{
|
||||
plist = g_slist_next(plist);
|
||||
retp = plist->data;
|
||||
}
|
||||
plist = g_slist_next(plist);
|
||||
}
|
||||
return retp;
|
||||
}
|
||||
|
||||
static void
|
||||
path_close(PATHP bzp)
|
||||
{
|
||||
|
@ -552,11 +593,13 @@ path_close(PATHP bzp)
|
|||
}
|
||||
}
|
||||
pathpoint = g_new0(PATHPOINT,1);
|
||||
pdata = (PATHPOINTP)bzp->path_details->data;
|
||||
pdata = path_start_last_seg(bzp->path_details);
|
||||
pathpoint->type = BEZIER_CONTROL;
|
||||
pathpoint->x = pdata->x;
|
||||
pathpoint->y = pdata->y;
|
||||
/* printf("Closing to x,y %d,%d\n",(gint)pdata->x,(gint)pdata->y); */
|
||||
bzp->path_details = g_slist_append(bzp->path_details,pathpoint);
|
||||
bzp->state = BEZIER_EDIT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -570,7 +613,8 @@ static BezierSelect *
|
|||
path_to_beziersel(PATHP bzp)
|
||||
{
|
||||
BezierSelect *bezier_sel;
|
||||
GSList *list;
|
||||
BezierPoint *bpnt = NULL;
|
||||
GSList *list;
|
||||
|
||||
if(!bzp)
|
||||
{
|
||||
|
@ -592,14 +636,28 @@ path_to_beziersel(PATHP bzp)
|
|||
{
|
||||
PATHPOINTP pdata;
|
||||
pdata = (PATHPOINTP)list->data;
|
||||
bezier_add_point(bezier_sel,(gint)pdata->type,(gint)pdata->x,pdata->y);
|
||||
if(pdata->type == BEZIER_MOVE)
|
||||
{
|
||||
/* printf("Close last curve off\n"); */
|
||||
bezier_sel->last_point->next = bpnt;
|
||||
bpnt->prev = bezier_sel->last_point;
|
||||
bezier_sel->cur_anchor = NULL;
|
||||
bezier_sel->cur_control = NULL;
|
||||
bpnt = NULL;
|
||||
}
|
||||
bezier_add_point(bezier_sel,
|
||||
(gint)pdata->type,
|
||||
rint(pdata->x), /* ALT add rint() */
|
||||
rint(pdata->y));
|
||||
if(bpnt == NULL)
|
||||
bpnt = bezier_sel->last_point;
|
||||
list = g_slist_next(list);
|
||||
}
|
||||
|
||||
if ( bezier_sel->closed )
|
||||
{
|
||||
bezier_sel->last_point->next = bezier_sel->points;
|
||||
bezier_sel->points->prev = bezier_sel->last_point;
|
||||
bezier_sel->last_point->next = bpnt;
|
||||
bpnt->prev = bezier_sel->last_point;
|
||||
bezier_sel->cur_anchor = bezier_sel->points;
|
||||
bezier_sel->cur_control = bezier_sel-> points->next;
|
||||
}
|
||||
|
@ -975,6 +1033,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -1013,6 +1073,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,FALSE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,FALSE);
|
||||
|
@ -1025,6 +1087,8 @@ paths_dialog_update (GimpImage* gimage)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
|
@ -1255,6 +1319,8 @@ paths_dialog_new_path_callback (GtkWidget * widget, gpointer udata)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
|
@ -1302,12 +1368,104 @@ paths_dialog_delete_path_callback (GtkWidget * widget, gpointer udata)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,new_sz);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,new_sz);
|
||||
point_ops_button_set_sensitive(POINT_EDIT_BUTTON,new_sz);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
paths_dialog_paste_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
PATHP bzp;
|
||||
PATHIMAGELISTP plp;
|
||||
PATHPOINTP pp;
|
||||
BezierSelect * bezier_sel;
|
||||
gint tmprow;
|
||||
GDisplay *gdisp;
|
||||
|
||||
gint row = paths_dialog->selected_row_num;
|
||||
|
||||
g_return_if_fail(paths_dialog->current_path_list != NULL);
|
||||
|
||||
if(!copy_pp)
|
||||
return;
|
||||
|
||||
/* Get current selection... ignore if none */
|
||||
if(paths_dialog->selected_row_num < 0)
|
||||
return;
|
||||
|
||||
/* Get bzpath structure */
|
||||
plp = paths_dialog->current_path_list;
|
||||
if(!plp)
|
||||
return;
|
||||
bzp = (PATHP)g_slist_nth_data(plp->bz_paths,row);
|
||||
|
||||
if(bzp->path_details)
|
||||
{
|
||||
pp = bzp->path_details->data;
|
||||
pp->type = BEZIER_MOVE;
|
||||
bzp->path_details = g_slist_concat(copy_pp->path_details,bzp->path_details);
|
||||
}
|
||||
else
|
||||
{
|
||||
bzp->closed = TRUE;
|
||||
bzp->path_details = copy_pp->path_details;
|
||||
bzp->state = copy_pp->state;
|
||||
}
|
||||
|
||||
/* First point on new curve is a moveto */
|
||||
copy_pp->path_details = NULL;
|
||||
path_free(copy_pp,NULL);
|
||||
copy_pp = NULL;
|
||||
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,FALSE);
|
||||
|
||||
/* Now fudge the drawing....*/
|
||||
bezier_sel = path_to_beziersel(bzp);
|
||||
tmprow = paths_dialog->current_path_list->last_selected_row;
|
||||
paths_dialog->current_path_list->last_selected_row = row;
|
||||
gdisp = gdisplays_check_valid(paths_dialog->current_path_list->gdisp,
|
||||
paths_dialog->gimage);
|
||||
bezier_paste_bezierselect_to_current(gdisp,bezier_sel);
|
||||
paths_update_preview(bezier_sel);
|
||||
beziersel_free(bezier_sel);
|
||||
paths_dialog->current_path_list->last_selected_row = tmprow;
|
||||
}
|
||||
|
||||
static void
|
||||
paths_dialog_copy_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
PATHP bzp;
|
||||
PATHIMAGELISTP plp;
|
||||
gint row = paths_dialog->selected_row_num;
|
||||
|
||||
g_return_if_fail(paths_dialog->current_path_list != NULL);
|
||||
|
||||
/* Get current selection... ignore if none */
|
||||
if(paths_dialog->selected_row_num < 0)
|
||||
return;
|
||||
|
||||
/* Get bzpath structure */
|
||||
plp = paths_dialog->current_path_list;
|
||||
bzp = (PATHP)g_slist_nth_data(plp->bz_paths,row);
|
||||
|
||||
if(!bzp->path_details || g_slist_length(bzp->path_details) <= 5)
|
||||
return;
|
||||
|
||||
/* And store in static array */
|
||||
copy_pp = path_copy(paths_dialog->gimage,bzp);
|
||||
|
||||
/* All paths that are in the cut buffer must be closed */
|
||||
if(!copy_pp->closed)
|
||||
path_close(copy_pp);
|
||||
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
paths_dialog_dup_path_callback (GtkWidget * widget, gpointer udata)
|
||||
{
|
||||
|
@ -1483,12 +1641,29 @@ pathpoints_create(BezierSelect *sel)
|
|||
GSList *list = NULL;
|
||||
PATHPOINTP pathpoint;
|
||||
BezierPoint *pts = (BezierPoint *) sel->points;
|
||||
BezierPoint *start_pnt = pts;
|
||||
gint need_move = 0;
|
||||
|
||||
for (i=0; i< sel->num_points; i++)
|
||||
{
|
||||
pathpoint = pathpoint_new(pts->type,(gdouble)pts->x,(gdouble)pts->y);
|
||||
pathpoint = pathpoint_new((need_move)?BEZIER_MOVE:pts->type,
|
||||
(gdouble)pts->x,(gdouble)pts->y);
|
||||
need_move = 0;
|
||||
list = g_slist_append(list,pathpoint);
|
||||
pts = pts->next;
|
||||
if(pts->next_curve)
|
||||
{
|
||||
/* The curve must loop back on itself */
|
||||
if(start_pnt != pts->next)
|
||||
g_warning("Curve of of sync");
|
||||
|
||||
need_move = 1;
|
||||
pts = pts->next_curve;
|
||||
start_pnt = pts;
|
||||
}
|
||||
else
|
||||
{
|
||||
pts = pts->next;
|
||||
}
|
||||
}
|
||||
return(list);
|
||||
}
|
||||
|
@ -1541,6 +1716,22 @@ paths_replaced_current(PATHIMAGELISTP plp,BezierSelect *bezier_sel)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gint
|
||||
number_curves_in_path(GSList *plist)
|
||||
{
|
||||
gint count = 0;
|
||||
while(plist)
|
||||
{
|
||||
if(((PATHPOINTP)(plist->data))->type == BEZIER_MOVE &&
|
||||
g_slist_next(plist))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
plist = g_slist_next(plist);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
paths_draw_segment_points(BezierSelect *bezier_sel,
|
||||
GdkPoint *pnt,
|
||||
|
@ -1558,6 +1749,7 @@ paths_draw_segment_points(BezierSelect *bezier_sel,
|
|||
GdkPoint * last_pnt = NULL;
|
||||
PATHWIDGETP pwidget;
|
||||
gint row;
|
||||
PATHCOUNTSP curve_count = (PATHCOUNTSP)udata;
|
||||
|
||||
/* we could remove duplicate points here */
|
||||
|
||||
|
@ -1591,8 +1783,12 @@ paths_draw_segment_points(BezierSelect *bezier_sel,
|
|||
|
||||
g_return_if_fail(pwidget != NULL);
|
||||
|
||||
paths_set_dash_line(paths_dialog->gc,!bezier_sel->closed);
|
||||
|
||||
if(curve_count->c_count.count < curve_count->total_count ||
|
||||
bezier_sel->closed)
|
||||
paths_set_dash_line(paths_dialog->gc,FALSE);
|
||||
else
|
||||
paths_set_dash_line(paths_dialog->gc,TRUE);
|
||||
|
||||
gdk_draw_lines (pwidget->paths_pixmap,
|
||||
paths_dialog->gc, copy_pnt, pcount);
|
||||
|
||||
|
@ -1603,6 +1799,8 @@ static void
|
|||
paths_update_preview(BezierSelect *bezier_sel)
|
||||
{
|
||||
gint row;
|
||||
PATHCOUNTS curve_count;
|
||||
|
||||
if(paths_dialog &&
|
||||
paths_dialog->current_path_list &&
|
||||
(row = paths_dialog->current_path_list->last_selected_row) >= 0 &&
|
||||
|
@ -1614,8 +1812,9 @@ paths_update_preview(BezierSelect *bezier_sel)
|
|||
/* Clear pixmap */
|
||||
clear_pixmap_preview(pwidget);
|
||||
|
||||
curve_count.total_count = number_curves_in_path(pwidget->bzp->path_details);
|
||||
/* update .. */
|
||||
bezier_draw_curve (bezier_sel,paths_draw_segment_points,IMAGE_COORDS,NULL);
|
||||
bezier_draw_curve (bezier_sel,paths_draw_segment_points,IMAGE_COORDS,&curve_count);
|
||||
|
||||
/* update the pixmap */
|
||||
|
||||
|
@ -1713,6 +1912,8 @@ paths_newpoint_current(BezierSelect *bezier_sel,GDisplay * gdisp)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
|
@ -1846,17 +2047,24 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
if (load_store)
|
||||
{
|
||||
f = fopen(filename, "rb");
|
||||
|
||||
if(!f)
|
||||
{
|
||||
g_message(_("Unable to open file %s"),filename);
|
||||
return;
|
||||
}
|
||||
|
||||
while(!feof(f))
|
||||
{
|
||||
gchar *txt = g_new(gchar,512);
|
||||
gchar *txtstart = txt;
|
||||
gint readfields = 0;
|
||||
int val, x, y, type, closed, i, draw, state;
|
||||
int val, type, closed, i, draw, state;
|
||||
double x,y;
|
||||
|
||||
if(!fgets(txt,512,f) || strlen(txt) < 7)
|
||||
{
|
||||
g_warning("Failed to read from %s",filename);
|
||||
g_message(_("Failed to read from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1871,7 +2079,14 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
|
||||
if(readfields != 4)
|
||||
{
|
||||
g_warning("Failed to read path from %s",filename);
|
||||
g_message(_("Failed to read path from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
||||
if(val <= 0)
|
||||
{
|
||||
g_message(_("No points specified in path file %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1879,10 +2094,10 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
for(i=0; i< val; i++)
|
||||
{
|
||||
PATHPOINTP bpt;
|
||||
readfields = fscanf(f,"TYPE: %d X: %d Y: %d\n", &type, &x, &y);
|
||||
readfields = fscanf(f,"TYPE: %d X: %lg Y: %lg\n", &type, &x, &y);
|
||||
if(readfields != 3)
|
||||
{
|
||||
g_warning("Failed to read path points from %s",filename);
|
||||
g_message(_("Failed to read path points from %s"),filename);
|
||||
gtk_widget_hide (file_dlg);
|
||||
return;
|
||||
}
|
||||
|
@ -1916,6 +2131,8 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,val);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,val);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,val);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,val);
|
||||
|
@ -2129,7 +2346,9 @@ paths_transform_do_undo(GimpImage *gimage,void *data)
|
|||
plist = plp->bz_paths;
|
||||
loop = 0;
|
||||
|
||||
while(plist)
|
||||
while(plist &&
|
||||
g_slist_length(plist) &&
|
||||
paths_dialog->current_path_list)
|
||||
{
|
||||
bezier_sel = path_to_beziersel(plist->data);
|
||||
tmprow = paths_dialog->current_path_list->last_selected_row;
|
||||
|
@ -2143,7 +2362,7 @@ paths_transform_do_undo(GimpImage *gimage,void *data)
|
|||
}
|
||||
|
||||
/* Force selection .. it may have changed */
|
||||
if(bezier_tool_selected())
|
||||
if(bezier_tool_selected() && paths_dialog->current_path_list)
|
||||
{
|
||||
gtk_clist_select_row(GTK_CLIST(paths_dialog->paths_list),
|
||||
paths_dialog->current_path_list->last_selected_row,
|
||||
|
@ -2208,7 +2427,13 @@ paths_transform_current_path(GimpImage *gimage,
|
|||
points_list = points_list->next;
|
||||
}
|
||||
|
||||
if(paths_dialog)
|
||||
/* Only update if we have a dialog, we have a currently
|
||||
* selected path and its the showing the same image.
|
||||
*/
|
||||
|
||||
if(paths_dialog &&
|
||||
paths_dialog->current_path_list &&
|
||||
paths_dialog->gimage == gimage)
|
||||
{
|
||||
/* Now fudge the drawing....*/
|
||||
bezier_sel = path_to_beziersel(p_copy);
|
||||
|
@ -2420,6 +2645,8 @@ paths_set_path_points(GimpImage * gimage,
|
|||
paths_ops_button_set_sensitive(DEL_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(STROKE_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PATH_TO_SEL_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(COPY_PATH_BUTTON,TRUE);
|
||||
paths_ops_button_set_sensitive(PASTE_PATH_BUTTON,(copy_pp)?TRUE:FALSE);
|
||||
point_ops_button_set_sensitive(POINT_ADD_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_DEL_BUTTON,TRUE);
|
||||
point_ops_button_set_sensitive(POINT_NEW_BUTTON,TRUE);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -26,6 +26,7 @@
|
|||
|
||||
#define BEZIER_ANCHOR 1
|
||||
#define BEZIER_CONTROL 2
|
||||
#define BEZIER_MOVE 3
|
||||
|
||||
#define IMAGE_COORDS 1
|
||||
#define AA_IMAGE_COORDS 2
|
||||
|
@ -39,11 +40,12 @@ typedef struct _bezier_point BezierPoint;
|
|||
|
||||
struct _bezier_point
|
||||
{
|
||||
int type; /* type of point (anchor or control) */
|
||||
int x, y; /* location of point in image space */
|
||||
int type; /* type of point (anchor/control/move) */
|
||||
double x, y; /* location of point in image space */
|
||||
int sx, sy; /* location of point in screen space */
|
||||
BezierPoint *next; /* next point on curve */
|
||||
BezierPoint *prev; /* prev point on curve */
|
||||
BezierPoint *next_curve; /* Next curve segment */
|
||||
};
|
||||
|
||||
typedef struct _bezier_select BezierSelect;
|
||||
|
@ -52,7 +54,7 @@ struct _bezier_select
|
|||
{
|
||||
int state; /* start, add, edit or drag */
|
||||
int draw; /* all or part */
|
||||
int closed; /* is the curve closed */
|
||||
int closed; /* is the last curve closed */
|
||||
DrawCore *core; /* Core drawing object */
|
||||
BezierPoint *points; /* the curve */
|
||||
BezierPoint *cur_anchor; /* the current active anchor point */
|
||||
|
@ -63,13 +65,21 @@ struct _bezier_select
|
|||
GSList **scanlines; /* used in converting a curve */
|
||||
};
|
||||
|
||||
/* All udata that are passed to the bezier_draw_curve must
|
||||
* have this structure as the first element.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
gint count;
|
||||
} CountCurves;
|
||||
|
||||
typedef void (*BezierPointsFunc) (BezierSelect *, GdkPoint *, int,gpointer);
|
||||
|
||||
/* Functions */
|
||||
int bezier_select_load (void *, BezierPoint *, int, int);
|
||||
void bezier_draw_curve (BezierSelect *,BezierPointsFunc, int,gpointer);
|
||||
void bezier_select_reset (BezierSelect *);
|
||||
void bezier_add_point (BezierSelect *, int, int, int);
|
||||
void bezier_add_point (BezierSelect *, int, gdouble, gdouble);
|
||||
void bezier_paste_bezierselect_to_current (GDisplay *,BezierSelect *);
|
||||
void bezier_select_mode (gint);
|
||||
void bezier_stroke (BezierSelect *, GDisplay *, int, int);
|
||||
|
|
|
@ -232,8 +232,34 @@ curves_colour_update(Tool *tool,
|
|||
curves_dialog->col_value[HISTOGRAM_VALUE] = MAXIMUM(maxval,color[BLUE_PIX]);
|
||||
|
||||
g_free(color);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
static void
|
||||
curves_add_point(GimpDrawable * drawable,gint x, gint y,gint cchan)
|
||||
{
|
||||
/* Add point onto the curve */
|
||||
int closest_point = 0;
|
||||
int distance;
|
||||
int curvex;
|
||||
int i;
|
||||
|
||||
curvex = curves_dialog->col_value[cchan];
|
||||
distance = G_MAXINT;
|
||||
for (i = 0; i < 17; i++)
|
||||
{
|
||||
if (curves_dialog->points[cchan][i][0] != -1)
|
||||
if (abs (curvex - curves_dialog->points[cchan][i][0]) < distance)
|
||||
{
|
||||
distance = abs (curvex - curves_dialog->points[cchan][i][0]);
|
||||
closest_point = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (distance > MIN_DISTANCE)
|
||||
closest_point = (curvex + 8) / 16;
|
||||
|
||||
curves_dialog->points[cchan][closest_point][0] = curvex;
|
||||
curves_dialog->points[cchan][closest_point][1] = curves_dialog->curve[cchan][curvex];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -254,6 +280,23 @@ curves_button_release (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
|
||||
if(bevent->state & GDK_SHIFT_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,curves_dialog->channel);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
else if(bevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_VALUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_RED);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_GREEN);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_BLUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_ALPHA);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -274,6 +317,7 @@ curves_motion (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -732,8 +776,8 @@ curves_update (CurvesDialog *cd,
|
|||
|
||||
/* draw the colour line */
|
||||
gdk_draw_line(cd->pixmap, cd->graph->style->black_gc,
|
||||
cd->col_value[cd->channel],RADIUS,
|
||||
cd->col_value[cd->channel],GRAPH_HEIGHT + RADIUS);
|
||||
cd->col_value[cd->channel]+RADIUS,RADIUS,
|
||||
cd->col_value[cd->channel]+RADIUS,GRAPH_HEIGHT + RADIUS);
|
||||
|
||||
gdk_draw_pixmap (cd->graph->window, cd->graph->style->black_gc, cd->pixmap,
|
||||
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
|
||||
|
@ -1006,7 +1050,11 @@ curves_free_callback (GtkWidget *w,
|
|||
if (cd->curve_type != GFREE)
|
||||
{
|
||||
cd->curve_type = GFREE;
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | DRAW);
|
||||
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1082,7 @@ curves_reset_callback (GtkWidget *widget,
|
|||
cd->points[cd->channel][16][0] = 255;
|
||||
cd->points[cd->channel][16][1] = 255;
|
||||
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | XRANGE_TOP | DRAW);
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
|
|
|
@ -232,8 +232,34 @@ curves_colour_update(Tool *tool,
|
|||
curves_dialog->col_value[HISTOGRAM_VALUE] = MAXIMUM(maxval,color[BLUE_PIX]);
|
||||
|
||||
g_free(color);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
static void
|
||||
curves_add_point(GimpDrawable * drawable,gint x, gint y,gint cchan)
|
||||
{
|
||||
/* Add point onto the curve */
|
||||
int closest_point = 0;
|
||||
int distance;
|
||||
int curvex;
|
||||
int i;
|
||||
|
||||
curvex = curves_dialog->col_value[cchan];
|
||||
distance = G_MAXINT;
|
||||
for (i = 0; i < 17; i++)
|
||||
{
|
||||
if (curves_dialog->points[cchan][i][0] != -1)
|
||||
if (abs (curvex - curves_dialog->points[cchan][i][0]) < distance)
|
||||
{
|
||||
distance = abs (curvex - curves_dialog->points[cchan][i][0]);
|
||||
closest_point = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (distance > MIN_DISTANCE)
|
||||
closest_point = (curvex + 8) / 16;
|
||||
|
||||
curves_dialog->points[cchan][closest_point][0] = curvex;
|
||||
curves_dialog->points[cchan][closest_point][1] = curves_dialog->curve[cchan][curvex];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -254,6 +280,23 @@ curves_button_release (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
|
||||
if(bevent->state & GDK_SHIFT_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,curves_dialog->channel);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
else if(bevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_VALUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_RED);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_GREEN);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_BLUE);
|
||||
curves_add_point(drawable,x,y,HISTOGRAM_ALPHA);
|
||||
curves_calculate_curve(curves_dialog);
|
||||
}
|
||||
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -274,6 +317,7 @@ curves_motion (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE);
|
||||
curves_colour_update(tool,gdisp,drawable,x,y);
|
||||
curves_update (curves_dialog, GRAPH | DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -732,8 +776,8 @@ curves_update (CurvesDialog *cd,
|
|||
|
||||
/* draw the colour line */
|
||||
gdk_draw_line(cd->pixmap, cd->graph->style->black_gc,
|
||||
cd->col_value[cd->channel],RADIUS,
|
||||
cd->col_value[cd->channel],GRAPH_HEIGHT + RADIUS);
|
||||
cd->col_value[cd->channel]+RADIUS,RADIUS,
|
||||
cd->col_value[cd->channel]+RADIUS,GRAPH_HEIGHT + RADIUS);
|
||||
|
||||
gdk_draw_pixmap (cd->graph->window, cd->graph->style->black_gc, cd->pixmap,
|
||||
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
|
||||
|
@ -1006,7 +1050,11 @@ curves_free_callback (GtkWidget *w,
|
|||
if (cd->curve_type != GFREE)
|
||||
{
|
||||
cd->curve_type = GFREE;
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | DRAW);
|
||||
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1082,7 @@ curves_reset_callback (GtkWidget *widget,
|
|||
cd->points[cd->channel][16][0] = 255;
|
||||
cd->points[cd->channel][16][1] = 255;
|
||||
|
||||
curves_calculate_curve (cd);
|
||||
curves_update (cd, GRAPH | XRANGE_TOP | DRAW);
|
||||
if (cd->preview)
|
||||
curves_preview (cd);
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
#include "../cursors/bigcircmsk"
|
||||
#include "../cursors/dropper"
|
||||
#include "../cursors/droppermsk"
|
||||
#include "../cursors/mouse1_ap"
|
||||
#include "../cursors/mouse1_apmsk"
|
||||
#include "../cursors/mouse1_cp"
|
||||
#include "../cursors/mouse1_cpmsk"
|
||||
#include "../cursors/mouse1_mm"
|
||||
#include "../cursors/mouse1_mmmsk"
|
||||
#include "../cursors/mouse1_sel"
|
||||
#include "../cursors/mouse1_selmsk"
|
||||
#include "../cursors/mouse1_selm"
|
||||
#include "../cursors/mouse1_selmmsk"
|
||||
#include "../cursors/mouse1_selp"
|
||||
#include "../cursors/mouse1_selpmsk"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -52,6 +64,18 @@ static BM_Cursor gimp_cursors[] =
|
|||
bigcirc_x_hot, bigcirc_y_hot, NULL},
|
||||
{ dropper_bits, droppermsk_bits, dropper_width, dropper_height,
|
||||
dropper_x_hot, dropper_y_hot, NULL},
|
||||
{ mouse1_ap_bits, mouse1_apmsk_bits, mouse1_ap_width, mouse1_ap_height,
|
||||
mouse1_ap_x_hot, mouse1_ap_y_hot, NULL},
|
||||
{ mouse1_cp_bits, mouse1_cpmsk_bits, mouse1_cp_width, mouse1_cp_height,
|
||||
mouse1_cp_x_hot, mouse1_cp_y_hot, NULL},
|
||||
{ mouse1_mm_bits, mouse1_mmmsk_bits, mouse1_mm_width, mouse1_mm_height,
|
||||
mouse1_mm_x_hot, mouse1_mm_y_hot, NULL},
|
||||
{ mouse1_selp_bits, mouse1_selpmsk_bits, mouse1_selp_width, mouse1_selp_height,
|
||||
mouse1_selp_x_hot, mouse1_selp_y_hot, NULL},
|
||||
{ mouse1_selm_bits, mouse1_selmmsk_bits, mouse1_selm_width, mouse1_selm_height,
|
||||
mouse1_selm_x_hot, mouse1_selm_y_hot, NULL},
|
||||
{ mouse1_sel_bits, mouse1_selmsk_bits, mouse1_sel_width, mouse1_sel_height,
|
||||
mouse1_sel_x_hot, mouse1_sel_y_hot, NULL},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,12 @@ typedef enum
|
|||
GIMP_MOUSE1M_CURSOR,
|
||||
GIMP_BIGCIRC_CURSOR,
|
||||
GIMP_COLOR_PICKER_CURSOR,
|
||||
GIMP_MOUSE1AP_CURSOR,
|
||||
GIMP_MOUSE1CP_CURSOR,
|
||||
GIMP_MOUSE1MM_CURSOR,
|
||||
GIMP_MOUSE1SELP_CURSOR,
|
||||
GIMP_MOUSE1SELM_CURSOR,
|
||||
GIMP_MOUSE1SEL_CURSOR,
|
||||
GIMP_LAST_CURSOR_ENTRY
|
||||
} GimpCursorType;
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_ap_width 14
|
||||
#define mouse1_ap_height 17
|
||||
#define mouse1_ap_x_hot 1
|
||||
#define mouse1_ap_y_hot 1
|
||||
static unsigned char mouse1_ap_bits[] = {
|
||||
0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x3e, 0x00,
|
||||
0x7e, 0x00, 0xfe, 0x00, 0xfe, 0x01, 0x3e, 0x00, 0x06, 0x00, 0x02, 0x0e,
|
||||
0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x0e, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_apmsk_width 14
|
||||
#define mouse1_apmsk_height 17
|
||||
static unsigned char mouse1_apmsk_bits[] = {
|
||||
0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00, 0x7f, 0x00,
|
||||
0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x01, 0x3f, 0x1f, 0x87, 0x3f,
|
||||
0x83, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x00, 0x1f, };
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_cp_width 14
|
||||
#define mouse1_cp_height 17
|
||||
#define mouse1_cp_x_hot 1
|
||||
#define mouse1_cp_y_hot 1
|
||||
static unsigned char mouse1_cp_bits[] = {
|
||||
0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x3e, 0x00,
|
||||
0x7e, 0x00, 0xfe, 0x00, 0xfe, 0x01, 0x3e, 0x00, 0x06, 0x00, 0x02, 0x1f,
|
||||
0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x1f, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_cpmsk_width 14
|
||||
#define mouse1_cpmsk_height 17
|
||||
static unsigned char mouse1_cpmsk_bits[] = {
|
||||
0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00, 0x7f, 0x00,
|
||||
0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x01, 0xbf, 0x3f, 0x87, 0x3f,
|
||||
0x83, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x3f, };
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_mm_width 14
|
||||
#define mouse1_mm_height 17
|
||||
#define mouse1_mm_x_hot 1
|
||||
#define mouse1_mm_y_hot 1
|
||||
static unsigned char mouse1_mm_bits[] = {
|
||||
0x00, 0x00, 0x02, 0x00, 0x16, 0x00, 0x16, 0x00, 0xb6, 0x00, 0xb6, 0x01,
|
||||
0xb6, 0x03, 0xb6, 0x07, 0xb6, 0x0f, 0xb6, 0x1f, 0xb6, 0x3f, 0xb6, 0x3f,
|
||||
0xb2, 0x0f, 0xa0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_mmmsk_width 14
|
||||
#define mouse1_mmmsk_height 17
|
||||
static unsigned char mouse1_mmmsk_bits[] = {
|
||||
0x0e, 0x00, 0x1e, 0x00, 0x7e, 0x00, 0xfe, 0x00, 0xfe, 0x01, 0xfe, 0x03,
|
||||
0xfe, 0x07, 0xfe, 0x0f, 0xfe, 0x1f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f,
|
||||
0xfe, 0x3f, 0xf8, 0x0f, 0xe0, 0x07, 0xc0, 0x01, 0x00, 0x00, };
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_sel_width 14
|
||||
#define mouse1_sel_height 17
|
||||
#define mouse1_sel_x_hot 1
|
||||
#define mouse1_sel_y_hot 1
|
||||
static unsigned char mouse1_sel_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x01, 0x04, 0x00, 0x04, 0x01,
|
||||
0x00, 0x01, 0x04, 0x00, 0x04, 0x01, 0x00, 0x01, 0x04, 0x00, 0xb4, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_selm_width 14
|
||||
#define mouse1_selm_height 17
|
||||
#define mouse1_selm_x_hot 1
|
||||
#define mouse1_selm_y_hot 1
|
||||
static unsigned char mouse1_selm_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00,
|
||||
0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x04, 0x01, 0xd8, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_selmmsk_width 14
|
||||
#define mouse1_selmmsk_height 17
|
||||
static unsigned char mouse1_selmmsk_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x03, 0xfe, 0x03, 0xfe, 0x03, 0x8e, 0x03, 0x8e, 0x03,
|
||||
0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0xfe, 0x03, 0xfe, 0x03,
|
||||
0xfe, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_selmsk_width 14
|
||||
#define mouse1_selmsk_height 17
|
||||
static unsigned char mouse1_selmsk_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x03, 0xfe, 0x03, 0xfe, 0x03, 0x8e, 0x03, 0x8e, 0x03,
|
||||
0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0xfe, 0x03, 0xfe, 0x03,
|
||||
0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
|
@ -0,0 +1,8 @@
|
|||
#define mouse1_selp_width 14
|
||||
#define mouse1_selp_height 17
|
||||
#define mouse1_selp_x_hot 1
|
||||
#define mouse1_selp_y_hot 1
|
||||
static unsigned char mouse1_selp_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x01,
|
||||
0x04, 0x00, 0x00, 0x01, 0x04, 0x01, 0x04, 0x00, 0x00, 0x01, 0x6c, 0x05,
|
||||
0x00, 0x04, 0x00, 0x1f, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, };
|
|
@ -0,0 +1,6 @@
|
|||
#define mouse1_selpmsk_width 14
|
||||
#define mouse1_selpmsk_height 17
|
||||
static unsigned char mouse1_selpmsk_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x03, 0xfe, 0x03, 0xfe, 0x03, 0x8e, 0x03, 0x8e, 0x03,
|
||||
0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0x8e, 0x03, 0xfe, 0x03, 0xfe, 0x0f,
|
||||
0xfe, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x0e, 0x00, 0x00, };
|
Loading…
Reference in New Issue