Commit 79112edc authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/selection_options.h made a correct tool toption out of "Interactive"

2001-01-02  Michael Natterer  <mitch@gimp.org>

	* app/selection_options.h
	* app/tool_options.c: made a correct tool toption out of
	"Interactive" (added a default value and the "Reset" function,
	set unused pointers to NULL).

	* app/iscissors.c: fixed indentation and spacing.
parent 25ee0a1c
2001-01-02 Michael Natterer <mitch@gimp.org>
* app/selection_options.h
* app/tool_options.c: made a correct tool toption out of
"Interactive" (added a default value and the "Reset" function,
set unused pointers to NULL).
* app/iscissors.c: fixed indentation and spacing.
2001-01-02 Daniel Egger <egger@suse.de>
* app/iscissors.c:
* app/selection_options.h:
* app/tool_options.c: Applied patch by laramieleavitt@onetel.net.uk to add
an interactive update to the iscissors tool.
* app/tool_options.c: Applied patch by laramieleavitt@onetel.net.uk
to add an interactive update to the iscissors tool.
2001-01-02 Michael Natterer <mitch@gimp.org>
......
......@@ -177,6 +177,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height = options->fixed_height_d = 1;
options->fixed_width = options->fixed_width_d = 1;
options->fixed_unit = options->fixed_unit_d = GIMP_UNIT_PIXEL;
options->interactive = options->interactive_d = FALSE;
options->feather_w = NULL;
options->feather_radius_w = NULL;
......@@ -187,8 +188,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height_w = NULL;
options->fixed_width_w = NULL;
options->fixed_unit_w = NULL;
options->interactive = FALSE;
options->interactive_w = NULL;
/* the feather toggle button */
table = gtk_table_new (2, 2, FALSE);
......@@ -255,6 +255,7 @@ selection_options_init (SelectionOptions *options,
case FREE_SELECT:
case BEZIER_SELECT:
break;
case ISCISSORS:
case RECT_SELECT:
case ELLIPSE_SELECT:
......@@ -276,6 +277,8 @@ selection_options_init (SelectionOptions *options,
gtk_box_pack_start (GTK_BOX (vbox), options->interactive_w,
FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
gtk_signal_connect (GTK_OBJECT (options->interactive_w), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&options->interactive);
......@@ -468,6 +471,12 @@ selection_options_reset (SelectionOptions *options)
gtk_object_get_data (GTK_OBJECT (spinbutton), "set_digits");
}
}
if (options->interactive_w)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
}
}
......
......@@ -503,7 +503,7 @@ iscissors_button_press (Tool *tool,
iscissors->state = SEED_ADJUSTMENT;
iscissors->draw = DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
draw_core_resume (iscissors->core, tool);
......@@ -542,7 +542,8 @@ iscissors_button_press (Tool *tool,
{
iscissors->state = SEED_PLACEMENT;
iscissors->draw = DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
grab_pointer = TRUE;
......@@ -633,13 +634,13 @@ iscissors_button_release (Tool *tool,
{
case SEED_PLACEMENT:
iscissors->draw = DRAW_CURVE | DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
case SEED_ADJUSTMENT:
iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
default:
break;
......@@ -741,14 +742,15 @@ iscissors_motion (Tool *tool,
if (iscissors->state == SEED_PLACEMENT)
{
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
}
else if (iscissors->state == SEED_ADJUSTMENT)
iscissors->draw = DRAW_ACTIVE_CURVE;
{
iscissors->draw = DRAW_ACTIVE_CURVE;
}
draw_core_pause (iscissors->core, tool);
......@@ -826,25 +828,23 @@ iscissors_draw (Tool *tool)
tx2, ty2 + (TARGET_HEIGHT >> 1));
/* Draw a line boundary */
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE) )
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE))
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
}
/* Draw the livewire boundary */
if ( (iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point )
if ((iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point)
{
/* See if the mouse has moved. If so, create a new segment... */
if ( !iscissors->livewire ||
(iscissors->livewire
&& ( iscissors->ix != iscissors->livewire->x1
|| iscissors->x != iscissors->livewire->x2
|| iscissors->iy != iscissors->livewire->y1
|| iscissors->y != iscissors->livewire->y2 )
)
)
if (! iscissors->livewire ||
(iscissors->livewire &&
(iscissors->ix != iscissors->livewire->x1 ||
iscissors->x != iscissors->livewire->x2 ||
iscissors->iy != iscissors->livewire->y1 ||
iscissors->y != iscissors->livewire->y2)))
{
curve = g_new (ICurve, 1);
......@@ -855,7 +855,7 @@ iscissors_draw (Tool *tool)
curve->points = NULL;
TRC (("create new livewire segment\n"));
if ( iscissors->livewire )
if (iscissors->livewire)
{
if (iscissors->livewire->points)
{
......@@ -867,7 +867,7 @@ iscissors_draw (Tool *tool)
g_free (iscissors->livewire);
iscissors->livewire = NULL;
}
}
iscissors->livewire = curve;
TRC (("calculate curve\n"));
......@@ -875,7 +875,7 @@ iscissors_draw (Tool *tool)
curve = NULL;
}
/* plot the curve */
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire );
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire);
}
if ((iscissors->draw & DRAW_CURVE) && !iscissors->first_point)
......
......@@ -74,8 +74,8 @@ struct _SelectionOptions
/* used by iscissors */
gboolean interactive;
gboolean interactive_d;
GtkWidget *interactive_w;
};
......
......@@ -177,6 +177,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height = options->fixed_height_d = 1;
options->fixed_width = options->fixed_width_d = 1;
options->fixed_unit = options->fixed_unit_d = GIMP_UNIT_PIXEL;
options->interactive = options->interactive_d = FALSE;
options->feather_w = NULL;
options->feather_radius_w = NULL;
......@@ -187,8 +188,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height_w = NULL;
options->fixed_width_w = NULL;
options->fixed_unit_w = NULL;
options->interactive = FALSE;
options->interactive_w = NULL;
/* the feather toggle button */
table = gtk_table_new (2, 2, FALSE);
......@@ -255,6 +255,7 @@ selection_options_init (SelectionOptions *options,
case FREE_SELECT:
case BEZIER_SELECT:
break;
case ISCISSORS:
case RECT_SELECT:
case ELLIPSE_SELECT:
......@@ -276,6 +277,8 @@ selection_options_init (SelectionOptions *options,
gtk_box_pack_start (GTK_BOX (vbox), options->interactive_w,
FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
gtk_signal_connect (GTK_OBJECT (options->interactive_w), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&options->interactive);
......@@ -468,6 +471,12 @@ selection_options_reset (SelectionOptions *options)
gtk_object_get_data (GTK_OBJECT (spinbutton), "set_digits");
}
}
if (options->interactive_w)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
}
}
......
......@@ -503,7 +503,7 @@ iscissors_button_press (Tool *tool,
iscissors->state = SEED_ADJUSTMENT;
iscissors->draw = DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
draw_core_resume (iscissors->core, tool);
......@@ -542,7 +542,8 @@ iscissors_button_press (Tool *tool,
{
iscissors->state = SEED_PLACEMENT;
iscissors->draw = DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
grab_pointer = TRUE;
......@@ -633,13 +634,13 @@ iscissors_button_release (Tool *tool,
{
case SEED_PLACEMENT:
iscissors->draw = DRAW_CURVE | DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
case SEED_ADJUSTMENT:
iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
default:
break;
......@@ -741,14 +742,15 @@ iscissors_motion (Tool *tool,
if (iscissors->state == SEED_PLACEMENT)
{
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
}
else if (iscissors->state == SEED_ADJUSTMENT)
iscissors->draw = DRAW_ACTIVE_CURVE;
{
iscissors->draw = DRAW_ACTIVE_CURVE;
}
draw_core_pause (iscissors->core, tool);
......@@ -826,25 +828,23 @@ iscissors_draw (Tool *tool)
tx2, ty2 + (TARGET_HEIGHT >> 1));
/* Draw a line boundary */
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE) )
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE))
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
}
/* Draw the livewire boundary */
if ( (iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point )
if ((iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point)
{
/* See if the mouse has moved. If so, create a new segment... */
if ( !iscissors->livewire ||
(iscissors->livewire
&& ( iscissors->ix != iscissors->livewire->x1
|| iscissors->x != iscissors->livewire->x2
|| iscissors->iy != iscissors->livewire->y1
|| iscissors->y != iscissors->livewire->y2 )
)
)
if (! iscissors->livewire ||
(iscissors->livewire &&
(iscissors->ix != iscissors->livewire->x1 ||
iscissors->x != iscissors->livewire->x2 ||
iscissors->iy != iscissors->livewire->y1 ||
iscissors->y != iscissors->livewire->y2)))
{
curve = g_new (ICurve, 1);
......@@ -855,7 +855,7 @@ iscissors_draw (Tool *tool)
curve->points = NULL;
TRC (("create new livewire segment\n"));
if ( iscissors->livewire )
if (iscissors->livewire)
{
if (iscissors->livewire->points)
{
......@@ -867,7 +867,7 @@ iscissors_draw (Tool *tool)
g_free (iscissors->livewire);
iscissors->livewire = NULL;
}
}
iscissors->livewire = curve;
TRC (("calculate curve\n"));
......@@ -875,7 +875,7 @@ iscissors_draw (Tool *tool)
curve = NULL;
}
/* plot the curve */
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire );
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire);
}
if ((iscissors->draw & DRAW_CURVE) && !iscissors->first_point)
......
......@@ -74,8 +74,8 @@ struct _SelectionOptions
/* used by iscissors */
gboolean interactive;
gboolean interactive_d;
GtkWidget *interactive_w;
};
......
......@@ -503,7 +503,7 @@ iscissors_button_press (Tool *tool,
iscissors->state = SEED_ADJUSTMENT;
iscissors->draw = DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
draw_core_resume (iscissors->core, tool);
......@@ -542,7 +542,8 @@ iscissors_button_press (Tool *tool,
{
iscissors->state = SEED_PLACEMENT;
iscissors->draw = DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
grab_pointer = TRUE;
......@@ -633,13 +634,13 @@ iscissors_button_release (Tool *tool,
{
case SEED_PLACEMENT:
iscissors->draw = DRAW_CURVE | DRAW_CURRENT_SEED;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
case SEED_ADJUSTMENT:
iscissors->draw = DRAW_CURVE | DRAW_ACTIVE_CURVE;
if ( ((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw |= DRAW_LIVEWIRE;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw |= DRAW_LIVEWIRE;
break;
default:
break;
......@@ -741,14 +742,15 @@ iscissors_motion (Tool *tool,
if (iscissors->state == SEED_PLACEMENT)
{
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive )
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
iscissors->draw = DRAW_CURRENT_SEED;
if (((SelectionOptions *) iscissors_options)->interactive)
iscissors->draw = DRAW_CURRENT_SEED | DRAW_LIVEWIRE;
}
else if (iscissors->state == SEED_ADJUSTMENT)
iscissors->draw = DRAW_ACTIVE_CURVE;
{
iscissors->draw = DRAW_ACTIVE_CURVE;
}
draw_core_pause (iscissors->core, tool);
......@@ -826,25 +828,23 @@ iscissors_draw (Tool *tool)
tx2, ty2 + (TARGET_HEIGHT >> 1));
/* Draw a line boundary */
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE) )
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
if (!iscissors->first_point && !(iscissors->draw & DRAW_LIVEWIRE))
{
gdk_draw_line (iscissors->core->win, iscissors->core->gc,
tx1, ty1, tx2, ty2);
}
}
/* Draw the livewire boundary */
if ( (iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point )
if ((iscissors->draw & DRAW_LIVEWIRE) && !iscissors->first_point)
{
/* See if the mouse has moved. If so, create a new segment... */
if ( !iscissors->livewire ||
(iscissors->livewire
&& ( iscissors->ix != iscissors->livewire->x1
|| iscissors->x != iscissors->livewire->x2
|| iscissors->iy != iscissors->livewire->y1
|| iscissors->y != iscissors->livewire->y2 )
)
)
if (! iscissors->livewire ||
(iscissors->livewire &&
(iscissors->ix != iscissors->livewire->x1 ||
iscissors->x != iscissors->livewire->x2 ||
iscissors->iy != iscissors->livewire->y1 ||
iscissors->y != iscissors->livewire->y2)))
{
curve = g_new (ICurve, 1);
......@@ -855,7 +855,7 @@ iscissors_draw (Tool *tool)
curve->points = NULL;
TRC (("create new livewire segment\n"));
if ( iscissors->livewire )
if (iscissors->livewire)
{
if (iscissors->livewire->points)
{
......@@ -867,7 +867,7 @@ iscissors_draw (Tool *tool)
g_free (iscissors->livewire);
iscissors->livewire = NULL;
}
}
iscissors->livewire = curve;
TRC (("calculate curve\n"));
......@@ -875,7 +875,7 @@ iscissors_draw (Tool *tool)
curve = NULL;
}
/* plot the curve */
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire );
iscissors_draw_curve (gdisp, iscissors, iscissors->livewire);
}
if ((iscissors->draw & DRAW_CURVE) && !iscissors->first_point)
......
......@@ -74,8 +74,8 @@ struct _SelectionOptions
/* used by iscissors */
gboolean interactive;
gboolean interactive_d;
GtkWidget *interactive_w;
};
......
......@@ -177,6 +177,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height = options->fixed_height_d = 1;
options->fixed_width = options->fixed_width_d = 1;
options->fixed_unit = options->fixed_unit_d = GIMP_UNIT_PIXEL;
options->interactive = options->interactive_d = FALSE;
options->feather_w = NULL;
options->feather_radius_w = NULL;
......@@ -187,8 +188,7 @@ selection_options_init (SelectionOptions *options,
options->fixed_height_w = NULL;
options->fixed_width_w = NULL;
options->fixed_unit_w = NULL;
options->interactive = FALSE;
options->interactive_w = NULL;
/* the feather toggle button */
table = gtk_table_new (2, 2, FALSE);
......@@ -255,6 +255,7 @@ selection_options_init (SelectionOptions *options,
case FREE_SELECT:
case BEZIER_SELECT:
break;
case ISCISSORS:
case RECT_SELECT:
case ELLIPSE_SELECT:
......@@ -276,6 +277,8 @@ selection_options_init (SelectionOptions *options,
gtk_box_pack_start (GTK_BOX (vbox), options->interactive_w,
FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
gtk_signal_connect (GTK_OBJECT (options->interactive_w), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&options->interactive);
......@@ -468,6 +471,12 @@ selection_options_reset (SelectionOptions *options)
gtk_object_get_data (GTK_OBJECT (spinbutton), "set_digits");
}
}
if (options->interactive_w)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->interactive_w),
options->interactive_d);
}
}
......
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