2001-04-29 04:14:32 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpmath/gimpmath.h"
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "tools-types.h"
|
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
|
|
|
|
2002-02-12 10:31:45 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2002-03-17 22:07:54 +08:00
|
|
|
#include "widgets/gimpenummenu.h"
|
2002-12-20 00:33:29 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2002-03-17 22:07:54 +08:00
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
#include "gimprotatetool.h"
|
|
|
|
#include "gimpscaletool.h"
|
2001-04-29 04:14:32 +08:00
|
|
|
#include "gimptransformtool.h"
|
|
|
|
#include "transform_options.h"
|
|
|
|
#include "tool_manager.h"
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
2001-04-29 04:14:32 +08:00
|
|
|
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
/* local function prototypes */
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
static void gimp_transform_tool_grid_type_update (GtkWidget *widget,
|
|
|
|
TransformOptions *options);
|
|
|
|
static void gimp_transform_tool_grid_density_update (GtkAdjustment *adj,
|
|
|
|
TransformOptions *options);
|
|
|
|
static void gimp_transform_tool_show_path_update (GtkWidget *widget,
|
|
|
|
TransformOptions *options);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
/* public functions */
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
GimpToolOptions *
|
|
|
|
transform_options_new (GimpToolInfo *tool_info)
|
2001-04-29 04:14:32 +08:00
|
|
|
{
|
|
|
|
TransformOptions *options;
|
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
options = g_new0 (TransformOptions, 1);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
transform_options_init (options, tool_info);
|
|
|
|
|
|
|
|
return (GimpToolOptions *) options;
|
2001-04-29 04:14:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-11-21 07:00:47 +08:00
|
|
|
transform_options_init (TransformOptions *options,
|
|
|
|
GimpToolInfo *tool_info)
|
2001-04-29 04:14:32 +08:00
|
|
|
{
|
2001-11-09 03:14:51 +08:00
|
|
|
GtkWidget *vbox;
|
2001-04-29 04:14:32 +08:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *frame;
|
2002-12-20 00:33:29 +08:00
|
|
|
GtkWidget *table;
|
2001-04-29 04:14:32 +08:00
|
|
|
GtkWidget *grid_density;
|
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
tool_options_init ((GimpToolOptions *) options, tool_info);
|
|
|
|
|
|
|
|
((GimpToolOptions *) options)->reset_func = transform_options_reset;
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
/* the main vbox */
|
|
|
|
vbox = options->tool_options.main_vbox;
|
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
options->direction = options->direction_d = GIMP_TRANSFORM_FORWARD;
|
2002-02-12 10:31:45 +08:00
|
|
|
options->interpolation = tool_info->gimp->config->interpolation_type;
|
2002-12-17 23:46:47 +08:00
|
|
|
options->show_path = options->show_path_d = TRUE;
|
|
|
|
options->clip = options->clip_d = FALSE;
|
|
|
|
options->grid_type = options->grid_type_d = TRANSFORM_GRID_TYPE_N_LINES;
|
|
|
|
options->grid_size = options->grid_size_d = 15;
|
|
|
|
options->constrain_1 = options->constrain_1_d = FALSE;
|
|
|
|
options->constrain_2 = options->constrain_2_d = FALSE;
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2002-03-19 06:26:41 +08:00
|
|
|
frame = gimp_enum_radio_frame_new (GIMP_TYPE_TRANSFORM_DIRECTION,
|
|
|
|
gtk_label_new (_("Transform Direction")),
|
|
|
|
2,
|
|
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
|
|
&options->direction,
|
|
|
|
&options->direction_w);
|
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->direction_w),
|
|
|
|
GINT_TO_POINTER (options->direction));
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
2001-04-29 04:14:32 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2002-02-12 10:31:45 +08:00
|
|
|
/* the interpolation menu */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2001-11-30 00:44:51 +08:00
|
|
|
|
2002-02-12 10:31:45 +08:00
|
|
|
label = gtk_label_new (_("Interpolation:"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2002-03-17 22:07:54 +08:00
|
|
|
options->interpolation_w =
|
|
|
|
gimp_enum_option_menu_new (GIMP_TYPE_INTERPOLATION_TYPE,
|
|
|
|
G_CALLBACK (gimp_menu_item_update),
|
|
|
|
&options->interpolation);
|
|
|
|
gimp_option_menu_set_history (GTK_OPTION_MENU (options->interpolation_w),
|
|
|
|
GINT_TO_POINTER (options->interpolation));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox),
|
|
|
|
options->interpolation_w, FALSE, FALSE, 0);
|
2002-02-12 10:31:45 +08:00
|
|
|
gtk_widget_show (options->interpolation_w);
|
2001-11-30 00:44:51 +08:00
|
|
|
|
|
|
|
/* the clip resulting image toggle button */
|
|
|
|
options->clip_w = gtk_check_button_new_with_label (_("Clip Result"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), options->clip_w, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->clip_w);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->clip_w, "toggled",
|
2001-11-30 00:44:51 +08:00
|
|
|
G_CALLBACK (gimp_toggle_button_update),
|
|
|
|
&options->clip);
|
|
|
|
|
2001-04-29 04:14:32 +08:00
|
|
|
/* the grid frame */
|
|
|
|
frame = gtk_frame_new (NULL);
|
2001-11-09 03:14:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
/* the grid type menu */
|
|
|
|
options->grid_type_w =
|
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (gimp_transform_tool_grid_type_update),
|
|
|
|
options,
|
|
|
|
GINT_TO_POINTER (options->grid_type_d),
|
|
|
|
|
|
|
|
_("Don't Show Grid"),
|
|
|
|
GINT_TO_POINTER (TRANSFORM_GRID_TYPE_NONE), NULL,
|
|
|
|
|
|
|
|
_("Number of Grid Lines"),
|
|
|
|
GINT_TO_POINTER (TRANSFORM_GRID_TYPE_N_LINES), NULL,
|
2001-11-30 00:44:51 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
_("Grid Line Spacing"),
|
|
|
|
GINT_TO_POINTER (TRANSFORM_GRID_TYPE_SPACING), NULL,
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
gtk_frame_set_label_widget (GTK_FRAME (frame), options->grid_type_w);
|
|
|
|
gtk_widget_show (options->grid_type_w);
|
|
|
|
|
2002-12-20 00:33:29 +08:00
|
|
|
/* the grid density scale */
|
|
|
|
table = gtk_table_new (1, 3, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
options->grid_size_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Density:"), -1, -1,
|
|
|
|
options->grid_size,
|
|
|
|
1.0, 128.0, 1.0, 8.0, 0,
|
|
|
|
TRUE, 0.0, 0.0,
|
|
|
|
NULL, NULL);
|
|
|
|
grid_density = GIMP_SCALE_ENTRY_SPINBUTTON (options->grid_size_w);
|
2001-11-30 00:44:51 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->grid_size_w, "value_changed",
|
2001-11-20 02:23:43 +08:00
|
|
|
G_CALLBACK (gimp_transform_tool_grid_density_update),
|
|
|
|
options);
|
2001-11-09 03:14:51 +08:00
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
/* the show_path toggle button */
|
|
|
|
options->show_path_w = gtk_check_button_new_with_label (_("Show Path"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), options->show_path_w, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->show_path_w);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->show_path_w, "toggled",
|
2001-11-30 00:44:51 +08:00
|
|
|
G_CALLBACK (gimp_transform_tool_show_path_update),
|
2001-12-04 01:59:48 +08:00
|
|
|
options);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
if (tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL ||
|
|
|
|
tool_info->tool_type == GIMP_TYPE_SCALE_TOOL)
|
|
|
|
{
|
2002-12-20 00:33:29 +08:00
|
|
|
GtkWidget *vbox2;
|
|
|
|
gchar *str;
|
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
/* the constraints frame */
|
|
|
|
frame = gtk_frame_new (_("Constraints"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
|
|
|
|
if (tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL)
|
|
|
|
{
|
2002-12-20 00:33:29 +08:00
|
|
|
str = g_strdup_printf (_("15 Degrees %s"),
|
|
|
|
gimp_get_mod_name_control ());
|
|
|
|
|
|
|
|
options->constrain_1_w = gtk_check_button_new_with_label (str);
|
2001-11-30 00:44:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), options->constrain_1_w,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->constrain_1_w);
|
|
|
|
|
2002-12-20 00:33:29 +08:00
|
|
|
g_free (str);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->constrain_1_w, "toggled",
|
2001-11-30 00:44:51 +08:00
|
|
|
G_CALLBACK (gimp_toggle_button_update),
|
|
|
|
&options->constrain_1);
|
|
|
|
}
|
|
|
|
else if (tool_info->tool_type == GIMP_TYPE_SCALE_TOOL)
|
|
|
|
{
|
2002-12-20 00:33:29 +08:00
|
|
|
str = g_strdup_printf (_("Keep Height %s"),
|
|
|
|
gimp_get_mod_name_control ());
|
|
|
|
|
|
|
|
options->constrain_1_w = gtk_check_button_new_with_label (str);
|
2001-11-30 00:44:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), options->constrain_1_w,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->constrain_1_w);
|
|
|
|
|
2002-12-20 00:33:29 +08:00
|
|
|
g_free (str);
|
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
gimp_help_set_help_data (options->constrain_1_w,
|
|
|
|
_("Activate both the \"Keep Height\" and\n"
|
|
|
|
"\"Keep Width\" toggles to constrain\n"
|
|
|
|
"the aspect ratio"), NULL);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->constrain_1_w, "toggled",
|
2001-11-30 00:44:51 +08:00
|
|
|
G_CALLBACK (gimp_toggle_button_update),
|
|
|
|
&options->constrain_1);
|
|
|
|
|
2002-12-20 00:33:29 +08:00
|
|
|
str = g_strdup_printf (_("Keep Width %s"),
|
|
|
|
gimp_get_mod_name_alt ());
|
|
|
|
|
|
|
|
options->constrain_2_w = gtk_check_button_new_with_label (str);
|
2001-11-30 00:44:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), options->constrain_2_w,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->constrain_2_w);
|
|
|
|
|
2002-12-20 00:33:29 +08:00
|
|
|
g_free (str);
|
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
gimp_help_set_help_data (options->constrain_2_w,
|
|
|
|
_("Activate both the \"Keep Height\" and\n"
|
|
|
|
"\"Keep Width\" toggles to constrain\n"
|
|
|
|
"the aspect ratio"), NULL);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (options->constrain_2_w, "toggled",
|
2001-11-30 00:44:51 +08:00
|
|
|
G_CALLBACK (gimp_toggle_button_update),
|
|
|
|
&options->constrain_2);
|
|
|
|
}
|
|
|
|
}
|
2001-04-30 20:54:33 +08:00
|
|
|
|
|
|
|
/* Set options to default values */
|
2001-07-18 04:50:01 +08:00
|
|
|
transform_options_reset ((GimpToolOptions *) options);
|
2001-04-29 04:14:32 +08:00
|
|
|
}
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
void
|
|
|
|
transform_options_reset (GimpToolOptions *tool_options)
|
2001-04-29 04:14:32 +08:00
|
|
|
{
|
|
|
|
TransformOptions *options;
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
options = (TransformOptions *) tool_options;
|
|
|
|
|
2002-03-19 06:26:41 +08:00
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->direction_w),
|
2001-11-23 01:11:52 +08:00
|
|
|
GINT_TO_POINTER (options->direction_d));
|
|
|
|
|
2002-02-12 10:31:45 +08:00
|
|
|
options->interpolation =
|
|
|
|
tool_options->tool_info->gimp->config->interpolation_type;
|
|
|
|
gimp_option_menu_set_history (GTK_OPTION_MENU (options->interpolation_w),
|
|
|
|
GINT_TO_POINTER (options->interpolation));
|
|
|
|
|
2001-11-30 00:44:51 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->clip_w),
|
|
|
|
options->clip_d);
|
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
gimp_option_menu_set_history (GTK_OPTION_MENU (options->grid_type_w),
|
|
|
|
GINT_TO_POINTER (options->grid_type_d));
|
|
|
|
options->grid_type = options->grid_type_d;
|
|
|
|
|
|
|
|
{
|
|
|
|
GimpToolOptions *tool_options;
|
|
|
|
GimpTool *active_tool;
|
|
|
|
|
|
|
|
tool_options = (GimpToolOptions *) options;
|
|
|
|
|
|
|
|
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
|
|
|
|
|
|
|
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
|
|
|
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (GTK_BIN (options->grid_type_w->parent)->child,
|
|
|
|
options->grid_type != TRANSFORM_GRID_TYPE_NONE);
|
|
|
|
}
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->grid_size_w),
|
2002-12-17 23:46:47 +08:00
|
|
|
options->grid_size_d);
|
2001-11-30 00:44:51 +08:00
|
|
|
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->show_path_w),
|
|
|
|
options->show_path_d);
|
|
|
|
|
|
|
|
if (options->constrain_1_w)
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->constrain_1_w),
|
|
|
|
options->constrain_1_d);
|
|
|
|
|
|
|
|
if (options->constrain_2_w)
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->constrain_2_w),
|
|
|
|
options->constrain_2_d);
|
2001-11-20 02:23:43 +08:00
|
|
|
}
|
2001-04-29 04:14:32 +08:00
|
|
|
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static void
|
2002-12-17 23:46:47 +08:00
|
|
|
gimp_transform_tool_grid_type_update (GtkWidget *widget,
|
|
|
|
TransformOptions *options)
|
2001-11-20 02:23:43 +08:00
|
|
|
{
|
2002-12-17 23:46:47 +08:00
|
|
|
GimpToolOptions *tool_options;
|
|
|
|
GimpTool *active_tool;
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
tool_options = (GimpToolOptions *) options;
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
gimp_menu_item_update (widget, &options->grid_type);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2001-12-04 01:59:48 +08:00
|
|
|
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
|
|
|
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
|
|
|
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
2002-12-17 23:46:47 +08:00
|
|
|
|
|
|
|
gtk_widget_set_sensitive (GTK_BIN (options->grid_type_w->parent)->child,
|
|
|
|
options->grid_type != TRANSFORM_GRID_TYPE_NONE);
|
2001-04-29 04:14:32 +08:00
|
|
|
}
|
|
|
|
|
2001-11-20 02:23:43 +08:00
|
|
|
static void
|
2002-12-17 23:46:47 +08:00
|
|
|
gimp_transform_tool_grid_density_update (GtkAdjustment *adj,
|
|
|
|
TransformOptions *options)
|
2001-11-20 02:23:43 +08:00
|
|
|
{
|
2002-12-17 23:46:47 +08:00
|
|
|
GimpToolOptions *tool_options;
|
|
|
|
GimpTool *active_tool;
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
tool_options = (GimpToolOptions *) options;
|
2001-12-04 01:59:48 +08:00
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
options->grid_size = (gint) (adj->value + 0.5);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2001-12-04 01:59:48 +08:00
|
|
|
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
|
|
|
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
|
|
|
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-12-17 23:46:47 +08:00
|
|
|
gimp_transform_tool_show_path_update (GtkWidget *widget,
|
|
|
|
TransformOptions *options)
|
2001-11-20 02:23:43 +08:00
|
|
|
{
|
2002-12-17 23:46:47 +08:00
|
|
|
GimpToolOptions *tool_options;
|
|
|
|
GimpTool *active_tool;
|
2001-12-04 01:59:48 +08:00
|
|
|
|
|
|
|
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
2001-11-20 02:23:43 +08:00
|
|
|
|
|
|
|
if (first_call)
|
|
|
|
{
|
|
|
|
first_call = FALSE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-12-17 23:46:47 +08:00
|
|
|
tool_options = (GimpToolOptions *) options;
|
2001-12-04 01:59:48 +08:00
|
|
|
|
|
|
|
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
|
|
|
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
2001-12-04 01:59:48 +08:00
|
|
|
{
|
|
|
|
GimpTransformTool *transform_tool;
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2001-12-04 01:59:48 +08:00
|
|
|
transform_tool = GIMP_TRANSFORM_TOOL (active_tool);
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2001-12-04 01:59:48 +08:00
|
|
|
gimp_transform_tool_show_path_changed (transform_tool, 1); /* pause */
|
2001-11-20 02:23:43 +08:00
|
|
|
|
2001-12-04 01:59:48 +08:00
|
|
|
gimp_toggle_button_update (widget, &options->show_path);
|
|
|
|
|
|
|
|
gimp_transform_tool_show_path_changed (transform_tool, 0); /* resume */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_toggle_button_update (widget, &options->show_path);
|
|
|
|
}
|
2001-11-20 02:23:43 +08:00
|
|
|
}
|