mirror of https://github.com/GNOME/gimp.git
added enum GimpRectSelectMode which can be one of "free", "fixed-size" and
2003-01-06 Michael Natterer <mitch@gimp.org> * libgimptool/gimptoolenums.[ch]: added enum GimpRectSelectMode which can be one of "free", "fixed-size" and "fixed-ratio". * app/tools/selection_options.[ch]: replaced the "Fixed Size / Aspect Ratio" toggle by a menu offering the choices above. * app/tools/gimprectselecttool.[ch]: changed accordingly. Removed the possibility to <shift>-switch from "fixed-size" to "fixed-ratio" mode. Fixes bug #100320.
This commit is contained in:
parent
8fd6272d61
commit
224ecade54
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2003-01-06 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimptool/gimptoolenums.[ch]: added enum GimpRectSelectMode
|
||||
which can be one of "free", "fixed-size" and "fixed-ratio".
|
||||
|
||||
* app/tools/selection_options.[ch]: replaced the "Fixed Size /
|
||||
Aspect Ratio" toggle by a menu offering the choices above.
|
||||
|
||||
* app/tools/gimprectselecttool.[ch]: changed accordingly. Removed
|
||||
the possibility to <shift>-switch from "fixed-size" to
|
||||
"fixed-ratio" mode. Fixes bug #100320.
|
||||
|
||||
2003-01-06 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* etc/gtkrc_user: give an example (commented out) how to change
|
||||
|
|
|
@ -185,7 +185,7 @@ gimp_rect_select_tool_button_press (GimpTool *tool,
|
|||
rect_sel->w = 0;
|
||||
rect_sel->h = 0;
|
||||
|
||||
rect_sel->fixed_size = sel_options->fixed_size;
|
||||
rect_sel->fixed_mode = sel_options->fixed_mode;
|
||||
rect_sel->fixed_width = sel_options->fixed_width;
|
||||
rect_sel->fixed_height = sel_options->fixed_height;
|
||||
unit = sel_options->fixed_unit;
|
||||
|
@ -281,7 +281,7 @@ gimp_rect_select_tool_button_release (GimpTool *tool,
|
|||
w = (rect_sel->w < 0) ? -rect_sel->w : rect_sel->w;
|
||||
h = (rect_sel->h < 0) ? -rect_sel->h : rect_sel->h;
|
||||
|
||||
if ((! w || ! h) && ! rect_sel->fixed_size)
|
||||
if ((! w || ! h) && rect_sel->fixed_mode == GIMP_RECT_SELECT_MODE_FREE)
|
||||
{
|
||||
/* If there is a floating selection, anchor it */
|
||||
if (gimp_image_floating_sel (gdisp->gimage))
|
||||
|
@ -349,55 +349,55 @@ gimp_rect_select_tool_motion (GimpTool *tool,
|
|||
oy = rect_sel->y;
|
||||
}
|
||||
|
||||
if (rect_sel->fixed_size)
|
||||
switch (rect_sel->fixed_mode)
|
||||
{
|
||||
if (state & GDK_SHIFT_MASK)
|
||||
{
|
||||
ratio = ((gdouble) rect_sel->fixed_height /
|
||||
(gdouble) rect_sel->fixed_width);
|
||||
tw = RINT (coords->x) - ox;
|
||||
th = RINT (coords->y) - oy;
|
||||
case GIMP_RECT_SELECT_MODE_FIXED_SIZE:
|
||||
w = (RINT (coords->x) - ox > 0 ?
|
||||
rect_sel->fixed_width : -rect_sel->fixed_width);
|
||||
|
||||
/* This is probably an inefficient way to do it, but it gives
|
||||
* nicer, more predictable results than the original agorithm
|
||||
*/
|
||||
if ((abs (th) < (ratio * abs (tw))) &&
|
||||
(abs (tw) > (abs (th) / ratio)))
|
||||
{
|
||||
w = tw;
|
||||
h = (gint) (tw * ratio);
|
||||
/* h should have the sign of th */
|
||||
if ((th < 0 && h > 0) || (th > 0 && h < 0))
|
||||
h = -h;
|
||||
}
|
||||
else
|
||||
{
|
||||
h = th;
|
||||
w = (gint) (th / ratio);
|
||||
/* w should have the sign of tw */
|
||||
if ((tw < 0 && w > 0) || (tw > 0 && w < 0))
|
||||
w = -w;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
w = (RINT (coords->x) - ox > 0 ?
|
||||
rect_sel->fixed_width : -rect_sel->fixed_width);
|
||||
h = (RINT (coords->y) - oy > 0 ?
|
||||
rect_sel->fixed_height : -rect_sel->fixed_height);
|
||||
break;
|
||||
|
||||
h = (RINT (coords->y) - oy > 0 ?
|
||||
rect_sel->fixed_height : -rect_sel->fixed_height);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
case GIMP_RECT_SELECT_MODE_FIXED_RATIO:
|
||||
ratio = ((gdouble) rect_sel->fixed_height /
|
||||
(gdouble) rect_sel->fixed_width);
|
||||
tw = RINT (coords->x) - ox;
|
||||
th = RINT (coords->y) - oy;
|
||||
|
||||
/* This is probably an inefficient way to do it, but it gives
|
||||
* nicer, more predictable results than the original agorithm
|
||||
*/
|
||||
if ((abs (th) < (ratio * abs (tw))) &&
|
||||
(abs (tw) > (abs (th) / ratio)))
|
||||
{
|
||||
w = tw;
|
||||
h = (gint) (tw * ratio);
|
||||
/* h should have the sign of th */
|
||||
if ((th < 0 && h > 0) || (th > 0 && h < 0))
|
||||
h = -h;
|
||||
}
|
||||
else
|
||||
{
|
||||
h = th;
|
||||
w = (gint) (th / ratio);
|
||||
/* w should have the sign of tw */
|
||||
if ((tw < 0 && w > 0) || (tw > 0 && w < 0))
|
||||
w = -w;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
w = (RINT (coords->x) - ox);
|
||||
h = (RINT (coords->y) - oy);
|
||||
break;
|
||||
}
|
||||
|
||||
/* If the shift key is down, then make the rectangle square (or
|
||||
* ellipse circular)
|
||||
*/
|
||||
if ((state & GDK_SHIFT_MASK) && ! rect_sel->fixed_size)
|
||||
if ((state & GDK_SHIFT_MASK) &&
|
||||
rect_sel->fixed_mode == GIMP_RECT_SELECT_MODE_FREE)
|
||||
{
|
||||
s = MAX (abs (w), abs (h));
|
||||
|
||||
|
@ -416,25 +416,25 @@ gimp_rect_select_tool_motion (GimpTool *tool,
|
|||
*/
|
||||
if (state & GDK_CONTROL_MASK)
|
||||
{
|
||||
if (rect_sel->fixed_size)
|
||||
{
|
||||
if (state & GDK_SHIFT_MASK)
|
||||
{
|
||||
rect_sel->x = ox - w;
|
||||
rect_sel->y = oy - h;
|
||||
rect_sel->w = w * 2;
|
||||
rect_sel->h = h * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
rect_sel->x = ox - w / 2;
|
||||
rect_sel->y = oy - h / 2;
|
||||
rect_sel->w = w;
|
||||
rect_sel->h = h;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rect_sel->center = TRUE;
|
||||
|
||||
switch (rect_sel->fixed_mode)
|
||||
{
|
||||
case GIMP_RECT_SELECT_MODE_FIXED_SIZE:
|
||||
rect_sel->x = ox - w / 2;
|
||||
rect_sel->y = oy - h / 2;
|
||||
rect_sel->w = w;
|
||||
rect_sel->h = h;
|
||||
break;
|
||||
|
||||
case GIMP_RECT_SELECT_MODE_FIXED_RATIO:
|
||||
rect_sel->x = ox - w;
|
||||
rect_sel->y = oy - h;
|
||||
rect_sel->w = w * 2;
|
||||
rect_sel->h = h * 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
w = abs (w);
|
||||
h = abs (h);
|
||||
|
||||
|
@ -442,17 +442,17 @@ gimp_rect_select_tool_motion (GimpTool *tool,
|
|||
rect_sel->y = oy - h;
|
||||
rect_sel->w = 2 * w + 1;
|
||||
rect_sel->h = 2 * h + 1;
|
||||
}
|
||||
rect_sel->center = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rect_sel->center = FALSE;
|
||||
|
||||
rect_sel->x = ox;
|
||||
rect_sel->y = oy;
|
||||
rect_sel->w = w;
|
||||
rect_sel->h = h;
|
||||
|
||||
rect_sel->center = FALSE;
|
||||
}
|
||||
|
||||
gimp_tool_pop_status (tool);
|
||||
|
|
|
@ -43,7 +43,7 @@ struct _GimpRectSelectTool
|
|||
gint center; /* is the selection being created from the
|
||||
* center out? */
|
||||
|
||||
gint fixed_size;
|
||||
GimpRectSelectMode fixed_mode;
|
||||
gdouble fixed_width;
|
||||
gdouble fixed_height;
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
|
||||
#include "gimpellipseselecttool.h"
|
||||
#include "gimpfuzzyselecttool.h"
|
||||
#include "gimpiscissorstool.h"
|
||||
|
@ -41,6 +43,14 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void selection_options_fixed_mode_update (GtkWidget *widget,
|
||||
SelectionOptions *options);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
selection_options_init (SelectionOptions *options,
|
||||
GimpToolInfo *tool_info)
|
||||
|
@ -71,7 +81,7 @@ selection_options_init (SelectionOptions *options,
|
|||
GIMP_GUI_CONFIG (tool_info->gimp->config)->default_threshold;
|
||||
options->auto_shrink = options->auto_shrink_d = FALSE;
|
||||
options->shrink_merged = options->shrink_merged_d = FALSE;
|
||||
options->fixed_size = options->fixed_size_d = FALSE;
|
||||
options->fixed_mode = options->fixed_mode_d = GIMP_RECT_SELECT_MODE_FREE;
|
||||
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;
|
||||
|
@ -85,7 +95,7 @@ selection_options_init (SelectionOptions *options,
|
|||
options->threshold_w = NULL;
|
||||
options->auto_shrink_w = NULL;
|
||||
options->shrink_merged_w = NULL;
|
||||
options->fixed_size_w = NULL;
|
||||
options->fixed_mode_w = NULL;
|
||||
options->fixed_height_w = NULL;
|
||||
options->fixed_width_w = NULL;
|
||||
options->fixed_unit_w = NULL;
|
||||
|
@ -377,16 +387,14 @@ selection_options_init (SelectionOptions *options,
|
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
options->fixed_size_w =
|
||||
gtk_check_button_new_with_label (_("Fixed Size / Aspect Ratio"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fixed_size_w),
|
||||
options->fixed_size);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame), options->fixed_size_w);
|
||||
gtk_widget_show (options->fixed_size_w);
|
||||
|
||||
g_signal_connect (options->fixed_size_w, "toggled",
|
||||
G_CALLBACK (gimp_toggle_button_update),
|
||||
&options->fixed_size);
|
||||
options->fixed_mode_w =
|
||||
gimp_enum_option_menu_new (GIMP_TYPE_RECT_SELECT_MODE,
|
||||
G_CALLBACK (selection_options_fixed_mode_update),
|
||||
options);
|
||||
gimp_option_menu_set_history (GTK_OPTION_MENU (options->fixed_mode_w),
|
||||
GINT_TO_POINTER (options->fixed_mode_d));
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame), options->fixed_mode_w);
|
||||
gtk_widget_show (options->fixed_mode_w);
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
|
@ -394,9 +402,7 @@ selection_options_init (SelectionOptions *options,
|
|||
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
gtk_widget_set_sensitive (table, options->fixed_size);
|
||||
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
|
||||
table);
|
||||
gtk_widget_set_sensitive (table, options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
|
||||
options->fixed_width_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Width:"), -1, 5,
|
||||
|
@ -500,13 +506,17 @@ selection_options_reset (GimpToolOptions *tool_options)
|
|||
options->shrink_merged_d);
|
||||
}
|
||||
|
||||
if (options->fixed_size_w)
|
||||
if (options->fixed_mode_w)
|
||||
{
|
||||
GtkWidget *spinbutton;
|
||||
gint digits;
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(options->fixed_size_w),
|
||||
options->fixed_size_d);
|
||||
options->fixed_mode = options->fixed_mode_d;
|
||||
gimp_option_menu_set_history (GTK_OPTION_MENU (options->fixed_mode_w),
|
||||
GINT_TO_POINTER (options->fixed_mode));
|
||||
gtk_widget_set_sensitive (GTK_BIN (options->fixed_mode_w->parent)->child,
|
||||
options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->fixed_width_w),
|
||||
options->fixed_width_d);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->fixed_height_w),
|
||||
|
@ -537,3 +547,16 @@ selection_options_reset (GimpToolOptions *tool_options)
|
|||
options->interactive_d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
selection_options_fixed_mode_update (GtkWidget *widget,
|
||||
SelectionOptions *options)
|
||||
{
|
||||
gimp_menu_item_update (widget, &options->fixed_mode);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_BIN (options->fixed_mode_w->parent)->child,
|
||||
options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
}
|
||||
|
|
|
@ -30,64 +30,64 @@ struct _SelectionOptions
|
|||
GimpToolOptions tool_options;
|
||||
|
||||
/* options used by all selection tools */
|
||||
SelectOps op;
|
||||
SelectOps op_d;
|
||||
GtkWidget *op_w[4]; /* 4 radio buttons */
|
||||
SelectOps op;
|
||||
SelectOps op_d;
|
||||
GtkWidget *op_w[4]; /* 4 radio buttons */
|
||||
|
||||
gboolean antialias;
|
||||
gboolean antialias_d;
|
||||
GtkWidget *antialias_w;
|
||||
gboolean antialias;
|
||||
gboolean antialias_d;
|
||||
GtkWidget *antialias_w;
|
||||
|
||||
gboolean feather;
|
||||
gboolean feather_d;
|
||||
GtkWidget *feather_w;
|
||||
gboolean feather;
|
||||
gboolean feather_d;
|
||||
GtkWidget *feather_w;
|
||||
|
||||
gdouble feather_radius;
|
||||
gdouble feather_radius_d;
|
||||
GtkObject *feather_radius_w;
|
||||
gdouble feather_radius;
|
||||
gdouble feather_radius_d;
|
||||
GtkObject *feather_radius_w;
|
||||
|
||||
/* used by fuzzy, by-color selection */
|
||||
gboolean select_transparent;
|
||||
gboolean select_transparent_d;
|
||||
GtkWidget *select_transparent_w;
|
||||
gboolean select_transparent;
|
||||
gboolean select_transparent_d;
|
||||
GtkWidget *select_transparent_w;
|
||||
|
||||
gboolean sample_merged;
|
||||
gboolean sample_merged_d;
|
||||
GtkWidget *sample_merged_w;
|
||||
gboolean sample_merged;
|
||||
gboolean sample_merged_d;
|
||||
GtkWidget *sample_merged_w;
|
||||
|
||||
gdouble threshold;
|
||||
/* gdouble threshold_d; (from gimprc) */
|
||||
GtkObject *threshold_w;
|
||||
gdouble threshold;
|
||||
/* gdouble threshold_d; (from gimprc) */
|
||||
GtkObject *threshold_w;
|
||||
|
||||
/* used by rect., ellipse selection */
|
||||
gboolean auto_shrink;
|
||||
gboolean auto_shrink_d;
|
||||
GtkWidget *auto_shrink_w;
|
||||
gboolean auto_shrink;
|
||||
gboolean auto_shrink_d;
|
||||
GtkWidget *auto_shrink_w;
|
||||
|
||||
gboolean shrink_merged;
|
||||
gboolean shrink_merged_d;
|
||||
GtkWidget *shrink_merged_w;
|
||||
gboolean shrink_merged;
|
||||
gboolean shrink_merged_d;
|
||||
GtkWidget *shrink_merged_w;
|
||||
|
||||
gboolean fixed_size;
|
||||
gboolean fixed_size_d;
|
||||
GtkWidget *fixed_size_w;
|
||||
GimpRectSelectMode fixed_mode;
|
||||
gboolean fixed_mode_d;
|
||||
GtkWidget *fixed_mode_w;
|
||||
|
||||
gdouble fixed_width;
|
||||
gdouble fixed_width_d;
|
||||
GtkObject *fixed_width_w;
|
||||
gdouble fixed_width;
|
||||
gdouble fixed_width_d;
|
||||
GtkObject *fixed_width_w;
|
||||
|
||||
gdouble fixed_height;
|
||||
gdouble fixed_height_d;
|
||||
GtkObject *fixed_height_w;
|
||||
gdouble fixed_height;
|
||||
gdouble fixed_height_d;
|
||||
GtkObject *fixed_height_w;
|
||||
|
||||
GimpUnit fixed_unit;
|
||||
GimpUnit fixed_unit_d;
|
||||
GtkWidget *fixed_unit_w;
|
||||
GimpUnit fixed_unit;
|
||||
GimpUnit fixed_unit_d;
|
||||
GtkWidget *fixed_unit_w;
|
||||
|
||||
/* used by iscissors */
|
||||
gboolean interactive;
|
||||
gboolean interactive_d;
|
||||
GtkWidget *interactive_w;
|
||||
gboolean interactive;
|
||||
gboolean interactive_d;
|
||||
GtkWidget *interactive_w;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
|
||||
#include "gimpellipseselecttool.h"
|
||||
#include "gimpfuzzyselecttool.h"
|
||||
#include "gimpiscissorstool.h"
|
||||
|
@ -41,6 +43,14 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void selection_options_fixed_mode_update (GtkWidget *widget,
|
||||
SelectionOptions *options);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
selection_options_init (SelectionOptions *options,
|
||||
GimpToolInfo *tool_info)
|
||||
|
@ -71,7 +81,7 @@ selection_options_init (SelectionOptions *options,
|
|||
GIMP_GUI_CONFIG (tool_info->gimp->config)->default_threshold;
|
||||
options->auto_shrink = options->auto_shrink_d = FALSE;
|
||||
options->shrink_merged = options->shrink_merged_d = FALSE;
|
||||
options->fixed_size = options->fixed_size_d = FALSE;
|
||||
options->fixed_mode = options->fixed_mode_d = GIMP_RECT_SELECT_MODE_FREE;
|
||||
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;
|
||||
|
@ -85,7 +95,7 @@ selection_options_init (SelectionOptions *options,
|
|||
options->threshold_w = NULL;
|
||||
options->auto_shrink_w = NULL;
|
||||
options->shrink_merged_w = NULL;
|
||||
options->fixed_size_w = NULL;
|
||||
options->fixed_mode_w = NULL;
|
||||
options->fixed_height_w = NULL;
|
||||
options->fixed_width_w = NULL;
|
||||
options->fixed_unit_w = NULL;
|
||||
|
@ -377,16 +387,14 @@ selection_options_init (SelectionOptions *options,
|
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
options->fixed_size_w =
|
||||
gtk_check_button_new_with_label (_("Fixed Size / Aspect Ratio"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fixed_size_w),
|
||||
options->fixed_size);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame), options->fixed_size_w);
|
||||
gtk_widget_show (options->fixed_size_w);
|
||||
|
||||
g_signal_connect (options->fixed_size_w, "toggled",
|
||||
G_CALLBACK (gimp_toggle_button_update),
|
||||
&options->fixed_size);
|
||||
options->fixed_mode_w =
|
||||
gimp_enum_option_menu_new (GIMP_TYPE_RECT_SELECT_MODE,
|
||||
G_CALLBACK (selection_options_fixed_mode_update),
|
||||
options);
|
||||
gimp_option_menu_set_history (GTK_OPTION_MENU (options->fixed_mode_w),
|
||||
GINT_TO_POINTER (options->fixed_mode_d));
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame), options->fixed_mode_w);
|
||||
gtk_widget_show (options->fixed_mode_w);
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
|
@ -394,9 +402,7 @@ selection_options_init (SelectionOptions *options,
|
|||
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
gtk_widget_set_sensitive (table, options->fixed_size);
|
||||
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
|
||||
table);
|
||||
gtk_widget_set_sensitive (table, options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
|
||||
options->fixed_width_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Width:"), -1, 5,
|
||||
|
@ -500,13 +506,17 @@ selection_options_reset (GimpToolOptions *tool_options)
|
|||
options->shrink_merged_d);
|
||||
}
|
||||
|
||||
if (options->fixed_size_w)
|
||||
if (options->fixed_mode_w)
|
||||
{
|
||||
GtkWidget *spinbutton;
|
||||
gint digits;
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(options->fixed_size_w),
|
||||
options->fixed_size_d);
|
||||
options->fixed_mode = options->fixed_mode_d;
|
||||
gimp_option_menu_set_history (GTK_OPTION_MENU (options->fixed_mode_w),
|
||||
GINT_TO_POINTER (options->fixed_mode));
|
||||
gtk_widget_set_sensitive (GTK_BIN (options->fixed_mode_w->parent)->child,
|
||||
options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->fixed_width_w),
|
||||
options->fixed_width_d);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->fixed_height_w),
|
||||
|
@ -537,3 +547,16 @@ selection_options_reset (GimpToolOptions *tool_options)
|
|||
options->interactive_d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
selection_options_fixed_mode_update (GtkWidget *widget,
|
||||
SelectionOptions *options)
|
||||
{
|
||||
gimp_menu_item_update (widget, &options->fixed_mode);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_BIN (options->fixed_mode_w->parent)->child,
|
||||
options->fixed_mode != GIMP_RECT_SELECT_MODE_FREE);
|
||||
}
|
||||
|
|
|
@ -30,64 +30,64 @@ struct _SelectionOptions
|
|||
GimpToolOptions tool_options;
|
||||
|
||||
/* options used by all selection tools */
|
||||
SelectOps op;
|
||||
SelectOps op_d;
|
||||
GtkWidget *op_w[4]; /* 4 radio buttons */
|
||||
SelectOps op;
|
||||
SelectOps op_d;
|
||||
GtkWidget *op_w[4]; /* 4 radio buttons */
|
||||
|
||||
gboolean antialias;
|
||||
gboolean antialias_d;
|
||||
GtkWidget *antialias_w;
|
||||
gboolean antialias;
|
||||
gboolean antialias_d;
|
||||
GtkWidget *antialias_w;
|
||||
|
||||
gboolean feather;
|
||||
gboolean feather_d;
|
||||
GtkWidget *feather_w;
|
||||
gboolean feather;
|
||||
gboolean feather_d;
|
||||
GtkWidget *feather_w;
|
||||
|
||||
gdouble feather_radius;
|
||||
gdouble feather_radius_d;
|
||||
GtkObject *feather_radius_w;
|
||||
gdouble feather_radius;
|
||||
gdouble feather_radius_d;
|
||||
GtkObject *feather_radius_w;
|
||||
|
||||
/* used by fuzzy, by-color selection */
|
||||
gboolean select_transparent;
|
||||
gboolean select_transparent_d;
|
||||
GtkWidget *select_transparent_w;
|
||||
gboolean select_transparent;
|
||||
gboolean select_transparent_d;
|
||||
GtkWidget *select_transparent_w;
|
||||
|
||||
gboolean sample_merged;
|
||||
gboolean sample_merged_d;
|
||||
GtkWidget *sample_merged_w;
|
||||
gboolean sample_merged;
|
||||
gboolean sample_merged_d;
|
||||
GtkWidget *sample_merged_w;
|
||||
|
||||
gdouble threshold;
|
||||
/* gdouble threshold_d; (from gimprc) */
|
||||
GtkObject *threshold_w;
|
||||
gdouble threshold;
|
||||
/* gdouble threshold_d; (from gimprc) */
|
||||
GtkObject *threshold_w;
|
||||
|
||||
/* used by rect., ellipse selection */
|
||||
gboolean auto_shrink;
|
||||
gboolean auto_shrink_d;
|
||||
GtkWidget *auto_shrink_w;
|
||||
gboolean auto_shrink;
|
||||
gboolean auto_shrink_d;
|
||||
GtkWidget *auto_shrink_w;
|
||||
|
||||
gboolean shrink_merged;
|
||||
gboolean shrink_merged_d;
|
||||
GtkWidget *shrink_merged_w;
|
||||
gboolean shrink_merged;
|
||||
gboolean shrink_merged_d;
|
||||
GtkWidget *shrink_merged_w;
|
||||
|
||||
gboolean fixed_size;
|
||||
gboolean fixed_size_d;
|
||||
GtkWidget *fixed_size_w;
|
||||
GimpRectSelectMode fixed_mode;
|
||||
gboolean fixed_mode_d;
|
||||
GtkWidget *fixed_mode_w;
|
||||
|
||||
gdouble fixed_width;
|
||||
gdouble fixed_width_d;
|
||||
GtkObject *fixed_width_w;
|
||||
gdouble fixed_width;
|
||||
gdouble fixed_width_d;
|
||||
GtkObject *fixed_width_w;
|
||||
|
||||
gdouble fixed_height;
|
||||
gdouble fixed_height_d;
|
||||
GtkObject *fixed_height_w;
|
||||
gdouble fixed_height;
|
||||
gdouble fixed_height_d;
|
||||
GtkObject *fixed_height_w;
|
||||
|
||||
GimpUnit fixed_unit;
|
||||
GimpUnit fixed_unit_d;
|
||||
GtkWidget *fixed_unit_w;
|
||||
GimpUnit fixed_unit;
|
||||
GimpUnit fixed_unit_d;
|
||||
GtkWidget *fixed_unit_w;
|
||||
|
||||
/* used by iscissors */
|
||||
gboolean interactive;
|
||||
gboolean interactive_d;
|
||||
GtkWidget *interactive_w;
|
||||
gboolean interactive;
|
||||
gboolean interactive_d;
|
||||
GtkWidget *interactive_w;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -111,6 +111,26 @@ gimp_motion_mode_get_type (void)
|
|||
}
|
||||
|
||||
|
||||
static const GEnumValue gimp_rect_select_mode_enum_values[] =
|
||||
{
|
||||
{ GIMP_RECT_SELECT_MODE_FREE, N_("Free Select"), "free" },
|
||||
{ GIMP_RECT_SELECT_MODE_FIXED_SIZE, N_("Fixed Size"), "fixed-size" },
|
||||
{ GIMP_RECT_SELECT_MODE_FIXED_RATIO, N_("Fixed Aspect Ratio"), "fixed-ratio" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
GType
|
||||
gimp_rect_select_mode_get_type (void)
|
||||
{
|
||||
static GType enum_type = 0;
|
||||
|
||||
if (!enum_type)
|
||||
enum_type = g_enum_register_static ("GimpRectSelectMode", gimp_rect_select_mode_enum_values);
|
||||
|
||||
return enum_type;
|
||||
}
|
||||
|
||||
|
||||
static const GEnumValue transform_action_enum_values[] =
|
||||
{
|
||||
{ TRANSFORM_CREATING, "TRANSFORM_CREATING", "creating" },
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#define GIMP_TYPE_CROP_TYPE (gimp_crop_type_get_type ())
|
||||
|
||||
GType gimp_crop_type_get_type (void); /* G_GNUC_CONST;*/
|
||||
GType gimp_crop_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum /*< pdb-skip >*/
|
||||
{
|
||||
|
@ -86,7 +86,19 @@ typedef enum /*< pdb-skip >*/ /*< skip >*/
|
|||
} GimpMotionMode;
|
||||
|
||||
|
||||
/* possible transform functions */
|
||||
#define GIMP_TYPE_RECT_SELECT_MODE (gimp_rect_select_mode_get_type ())
|
||||
|
||||
GType gimp_rect_select_mode_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum /*< pdb-skip >*/
|
||||
{
|
||||
GIMP_RECT_SELECT_MODE_FREE, /*< desc="Free Select" >*/
|
||||
GIMP_RECT_SELECT_MODE_FIXED_SIZE, /*< desc="Fixed Size" >*/
|
||||
GIMP_RECT_SELECT_MODE_FIXED_RATIO /*< desc="Fixed Aspect Ratio" >*/
|
||||
} GimpRectSelectMode;
|
||||
|
||||
|
||||
/* Possible transform functions */
|
||||
typedef enum /*< pdb-skip >*/ /*< skip >*/
|
||||
{
|
||||
TRANSFORM_CREATING,
|
||||
|
|
Loading…
Reference in New Issue