Commit 9996bb7a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/dialogs/Makefile.am app/dialogs/dialogs-types.h app/dialogs/dialogs.c

2006-03-31  Sven Neumann  <sven@gimp.org>

	* app/dialogs/Makefile.am
	* app/dialogs/dialogs-types.h
	* app/dialogs/dialogs.c
	* app/dialogs/info-dialog.[ch]: good bye InfoDialog.

	* app/tools/gimpperspectivetool.[ch]
	* app/tools/gimprotatetool.[ch]
	* app/tools/gimpsheartool.[ch]
	* app/tools/gimptransformtool.[ch]: use GimpToolDialog instead of
	InfoDialog and add the widgets manually.

	* app/tools/gimpscaletool.c: commented out use of InfoDialog. This
	tools still needs to be ported to GimpToolDialog.
parent 49da8cb2
2006-03-31 Sven Neumann <sven@gimp.org>
* app/dialogs/Makefile.am
* app/dialogs/dialogs-types.h
* app/dialogs/dialogs.c
* app/dialogs/info-dialog.[ch]: good bye InfoDialog.
* app/tools/gimpperspectivetool.[ch]
* app/tools/gimprotatetool.[ch]
* app/tools/gimpsheartool.[ch]
* app/tools/gimptransformtool.[ch]: use GimpToolDialog instead of
InfoDialog and add the widgets manually.
* app/tools/gimpscaletool.c: commented out use of InfoDialog. This
tools still needs to be ported to GimpToolDialog.
2006-03-31 Michael Natterer <mitch@gimp.org>
* app/pdb/gimpprocedure.[ch]: added gimp_procedure_new() and
......
......@@ -46,8 +46,6 @@ libappdialogs_a_sources = \
image-properties-dialog.h \
image-scale-dialog.c \
image-scale-dialog.h \
info-dialog.c \
info-dialog.h \
keyboard-shortcuts-dialog.c \
keyboard-shortcuts-dialog.h \
layer-add-mask-dialog.c \
......
......@@ -23,7 +23,4 @@
#include "display/display-types.h"
typedef struct _InfoDialog InfoDialog;
#endif /* __DIALOGS_TYPES_H__ */
......@@ -34,8 +34,6 @@
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "info-dialog.h" /* EEK */
#include "gimp-intl.h"
......@@ -332,13 +330,3 @@ dialogs_get_toolbox (void)
return NULL;
}
void
dialogs_eek (void)
{
#ifdef __GNUC__
#warning FIXME: get rid of info-dialog
#endif
g_error ("eek we suck");
info_dialog_free (NULL);
}
This diff is collapsed.
/* 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.
*/
#ifndef __INFO_DIALOG_H__
#define __INFO_DIALOG_H__
typedef enum
{
INFO_LABEL,
INFO_ENTRY,
INFO_SCALE,
INFO_SPINBUTTON,
INFO_SIZEENTRY
} InfoFieldType;
typedef struct _InfoField InfoField;
struct _InfoField
{
InfoFieldType field_type;
GtkObject *obj;
gpointer value_ptr;
GCallback callback;
gpointer callback_data;
};
struct _InfoDialog
{
GtkWidget *shell;
GtkWidget *vbox;
GtkWidget *info_table;
GtkWidget *info_notebook;
GSList *field_list;
gint nfields;
gpointer user_data;
};
/* Info Dialog functions */
InfoDialog *info_dialog_new (GimpViewable *viewable,
const gchar *title,
const gchar *role,
const gchar *stock_id,
const gchar *desc,
GtkWidget *parent,
GimpHelpFunc help_func,
gpointer help_data);
InfoDialog *info_dialog_notebook_new (GimpViewable *viewable,
const gchar *title,
const gchar *role,
const gchar *stock_id,
const gchar *desc,
GtkWidget *parent,
GimpHelpFunc help_func,
gpointer help_data);
void info_dialog_free (InfoDialog *idialog);
void info_dialog_show (InfoDialog *idialog);
void info_dialog_present (InfoDialog *idialog);
void info_dialog_hide (InfoDialog *idialog);
void info_dialog_update (InfoDialog *idialog);
GtkWidget *info_dialog_add_label (InfoDialog *idialog,
gchar *title,
gchar *text_ptr);
GtkWidget *info_dialog_add_entry (InfoDialog *idialog,
gchar *title,
gchar *text_ptr,
GCallback callback,
gpointer callback_data);
GtkWidget *info_dialog_add_scale (InfoDialog *idialog,
gchar *title,
gdouble *value_ptr,
gfloat lower,
gfloat upper,
gfloat step_increment,
gfloat page_increment,
gfloat page_size,
gint digits,
GCallback callback,
gpointer callback_data);
GtkWidget *info_dialog_add_spinbutton (InfoDialog *idialog,
gchar *title,
gdouble *value_ptr,
gfloat lower,
gfloat upper,
gfloat step_increment,
gfloat page_increment,
gfloat page_size,
gfloat climb_rate,
gint digits,
GCallback callback,
gpointer callback_data);
GtkWidget *info_dialog_add_sizeentry (InfoDialog *idialog,
gchar *title,
gdouble *value_ptr,
gint nfields,
GimpUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUpdatePolicy update_policy,
GCallback callback,
gpointer callback_data);
#endif /* __INFO_DIALOG_H__ */
......@@ -34,12 +34,6 @@
#include "display/gimpdisplay.h"
#ifdef __GNUC__
#warning FIXME #include "dialogs/dialogs-types.h"
#endif
#include "dialogs/dialogs-types.h"
#include "dialogs/info-dialog.h"
#include "gimpperspectivetool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
......@@ -109,36 +103,55 @@ static void
gimp_perspective_tool_dialog (GimpTransformTool *tr_tool)
{
GimpPerspectiveTool *perspective = GIMP_PERSPECTIVE_TOOL (tr_tool);
info_dialog_add_label (tr_tool->info_dialog, _("Matrix:"),
perspective->matrix_row_buf[0]);
info_dialog_add_label (tr_tool->info_dialog, "",
perspective->matrix_row_buf[1]);
info_dialog_add_label (tr_tool->info_dialog, "",
perspective->matrix_row_buf[2]);
GtkWidget *frame;
GtkWidget *table;
gint x, y;
frame = gimp_frame_new (_("Transformation Matrix"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (tr_tool->dialog)->vbox), frame,
FALSE, FALSE, 0);
gtk_widget_show (frame);
table = gtk_table_new (3, 3, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
{
GtkWidget *label = gtk_label_new (" ");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
gtk_label_set_width_chars (GTK_LABEL (label), 12);
gtk_table_attach (GTK_TABLE (table), label,
x, x + 1, y, y + 1, GTK_EXPAND, GTK_FILL, 0, 0);
gtk_widget_show (label);
perspective->label[y][x] = label;
}
}
static void
gimp_perspective_tool_dialog_update (GimpTransformTool *tr_tool)
{
GimpPerspectiveTool *perspective = GIMP_PERSPECTIVE_TOOL (tr_tool);
gint i;
gint x, y;
for (i = 0; i < 3; i++)
{
gchar *p = perspective->matrix_row_buf[i];
gint j;
for (j = 0; j < 3; j++)
{
p += g_snprintf (p,
MAX_INFO_BUF - (p - perspective->matrix_row_buf[i]),
"%10.3g", tr_tool->transform.coeff[i][j]);
}
}
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
{
gchar buf[32];
g_snprintf (buf, sizeof (buf),
"%10.5f", tr_tool->transform.coeff[y][x]);
gtk_label_set_text (GTK_LABEL (perspective->label[y][x]), buf);
}
info_dialog_update (tr_tool->info_dialog);
info_dialog_show (tr_tool->info_dialog);
gtk_widget_show (tr_tool->dialog);
}
static void
......
......@@ -38,8 +38,7 @@ struct _GimpPerspectiveTool
{
GimpTransformTool parent_instance;
/* perspective dialog */
gchar matrix_row_buf [3][MAX_INFO_BUF];
GtkWidget *label[3][3];
};
struct _GimpPerspectiveToolClass
......
......@@ -35,12 +35,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#ifdef __GNUC__
#warning FIXME #include "dialogs/dialogs-types.h"
#endif
#include "dialogs/dialogs-types.h"
#include "dialogs/info-dialog.h"
#include "gimprotatetool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
......@@ -54,9 +48,10 @@
#define CENTER_X 2
#define CENTER_Y 3
#define EPSILON 0.018 /* ~ 1 degree */
#define FIFTEEN_DEG (G_PI / 12.0)
#define SB_WIDTH 10
/* local function prototypes */
......@@ -69,7 +64,7 @@ static void gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
static void gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *display);
static void rotate_angle_changed (GtkWidget *entry,
static void rotate_angle_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool);
static void rotate_center_changed (GtkWidget *entry,
GimpTransformTool *tr_tool);
......@@ -125,45 +120,53 @@ static void
gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
{
GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);
GtkWidget *widget;
GtkWidget *spinbutton2;
widget = info_dialog_add_spinbutton (tr_tool->info_dialog, _("Angle:"),
&rotate->angle_val,
-180, 180, 1, 15, 1, 1, 2,
G_CALLBACK (rotate_angle_changed),
tr_tool);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (widget), TRUE);
/* this looks strange (-180, 181), but it works */
widget = info_dialog_add_scale (tr_tool->info_dialog, "",
&rotate->angle_val,
-180, 181, 0.01, 0.1, 1, -1,
G_CALLBACK (rotate_angle_changed),
tr_tool);
gtk_widget_set_size_request (widget, 180, -1);
spinbutton2 = info_dialog_add_spinbutton (tr_tool->info_dialog,
_("Center X:"),
NULL,
-1, 1, 1, 10, 1, 1, 2,
NULL, NULL);
rotate->sizeentry = info_dialog_add_sizeentry (tr_tool->info_dialog,
_("Center Y:"),
rotate->center_vals, 1,
GIMP_UNIT_PIXEL, "%a",
TRUE, TRUE, FALSE,
GIMP_SIZE_ENTRY_UPDATE_SIZE,
G_CALLBACK (rotate_center_changed),
tr_tool);
GtkWidget *table;
GtkWidget *button;
GtkWidget *scale;
GtkObject *adj;
table = gtk_table_new (4, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (tr_tool->dialog)->vbox), table,
FALSE, FALSE, 0);
gtk_widget_show (table);
button = gimp_spin_button_new (&rotate->angle_adj,
0, -180, 180, 0.1, 15, 0, 2, 2);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (button), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Angle:"),
0.0, 0.5, button, 1, TRUE);
g_signal_connect (rotate->angle_adj, "value-changed",
G_CALLBACK (rotate_angle_changed),
tr_tool);
scale = gtk_hscale_new (GTK_ADJUSTMENT (rotate->angle_adj));
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (scale);
button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 1, 1, 2);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Center X:"),
0.0, 0.5, button, 1, TRUE);
rotate->sizeentry = gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
TRUE, TRUE, FALSE, SB_WIDTH,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (rotate->sizeentry),
GTK_SPIN_BUTTON (spinbutton2), NULL);
GTK_SPIN_BUTTON (button), NULL);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3, _("Center Y:"),
0.0, 0.5, rotate->sizeentry, 1, TRUE);
gtk_table_set_row_spacing (GTK_TABLE (tr_tool->info_dialog->info_table),
1, 6);
gtk_table_set_row_spacing (GTK_TABLE (tr_tool->info_dialog->info_table),
2, 0);
g_signal_connect (rotate->sizeentry, "value-changed",
G_CALLBACK (rotate_center_changed),
tr_tool);
}
static void
......@@ -171,12 +174,23 @@ gimp_rotate_tool_dialog_update (GimpTransformTool *tr_tool)
{
GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);
rotate->angle_val = gimp_rad_to_deg (tr_tool->trans_info[ANGLE]);
rotate->center_vals[0] = tr_tool->trans_info[CENTER_X];
rotate->center_vals[1] = tr_tool->trans_info[CENTER_Y];
gtk_adjustment_set_value (GTK_ADJUSTMENT (rotate->angle_adj),
gimp_rad_to_deg (tr_tool->trans_info[ANGLE]));
g_signal_handlers_block_by_func (rotate->sizeentry,
rotate_center_changed,
tr_tool);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (rotate->sizeentry), 0,
tr_tool->trans_info[CENTER_X]);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
tr_tool->trans_info[CENTER_Y]);
g_signal_handlers_unblock_by_func (rotate->sizeentry,
rotate_center_changed,
tr_tool);
info_dialog_update (tr_tool->info_dialog);
info_dialog_show (tr_tool->info_dialog);
gtk_widget_show (tr_tool->dialog);
}
static void
......@@ -185,9 +199,10 @@ gimp_rotate_tool_prepare (GimpTransformTool *tr_tool,
{
GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);
rotate->angle_val = 0.0;
rotate->center_vals[0] = tr_tool->cx;
rotate->center_vals[1] = tr_tool->cy;
tr_tool->trans_info[ANGLE] = 0.0;
tr_tool->trans_info[REAL_ANGLE] = 0.0;
tr_tool->trans_info[CENTER_X] = tr_tool->cx;
tr_tool->trans_info[CENTER_Y] = tr_tool->cy;
g_signal_handlers_block_by_func (rotate->sizeentry,
rotate_center_changed,
......@@ -213,19 +228,9 @@ gimp_rotate_tool_prepare (GimpTransformTool *tr_tool,
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
tr_tool->y1, tr_tool->y2);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (rotate->sizeentry), 0,
rotate->center_vals[0]);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
rotate->center_vals[1]);
g_signal_handlers_unblock_by_func (rotate->sizeentry,
rotate_center_changed,
tr_tool);
tr_tool->trans_info[ANGLE] = rotate->angle_val;
tr_tool->trans_info[REAL_ANGLE] = rotate->angle_val;
tr_tool->trans_info[CENTER_X] = rotate->center_vals[0];
tr_tool->trans_info[CENTER_Y] = rotate->center_vals[1];
}
static void
......@@ -309,10 +314,10 @@ gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
}
static void
rotate_angle_changed (GtkWidget *widget,
rotate_angle_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool)
{
gdouble value = gimp_deg_to_rad (GTK_ADJUSTMENT (widget)->value);
gdouble value = gimp_deg_to_rad (gtk_adjustment_get_value (adj));
#define ANGLE_EPSILON 0.0001
......
......@@ -38,10 +38,7 @@ struct _GimpRotateTool
{
GimpTransformTool parent_instance;
/* rotate dialog */
gdouble angle_val;
gdouble center_vals[2];
GtkObject *angle_adj;
GtkWidget *sizeentry;
};
......
......@@ -37,12 +37,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#ifdef __GNUC__
#warning FIXME #include "dialogs/dialogs-types.h"
#endif
#include "dialogs/dialogs-types.h"
#include "dialogs/info-dialog.h"
#include "gimpscaletool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
......@@ -119,6 +113,18 @@ static void
gimp_scale_tool_dialog (GimpTransformTool *tr_tool)
{
GimpScaleTool *scale = GIMP_SCALE_TOOL (tr_tool);
GtkWidget *table;
table = gtk_table_new (5, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (tr_tool->dialog)->vbox), table,
FALSE, FALSE, 0);
gtk_widget_show (table);
#if 0
GtkWidget *spinbutton;
info_dialog_add_label (tr_tool->info_dialog,
......@@ -165,11 +171,14 @@ gimp_scale_tool_dialog (GimpTransformTool *tr_tool)
1, 4);
gtk_table_set_row_spacing (GTK_TABLE (tr_tool->info_dialog->info_table),
2, 0);
#endif
}
static void
gimp_scale_tool_dialog_update (GimpTransformTool *tr_tool)
{
#if 0
GimpTool *tool = GIMP_TOOL (tr_tool);
GimpScaleTool *scale = GIMP_SCALE_TOOL (tr_tool);
GimpTransformOptions *options;
......@@ -253,7 +262,10 @@ gimp_scale_tool_dialog_update (GimpTransformTool *tr_tool)
"%0.2f", ratio_y);
info_dialog_update (tr_tool->info_dialog);
info_dialog_show (tr_tool->info_dialog);
#endif
gtk_widget_show (tr_tool->dialog);
}
static void
......@@ -265,6 +277,7 @@ gimp_scale_tool_prepare (GimpTransformTool *tr_tool,
scale->size_vals[0] = tr_tool->x2 - tr_tool->x1;
scale->size_vals[1] = tr_tool->y2 - tr_tool->y1;
#if 0
g_signal_handlers_block_by_func (scale->sizeentry,
gimp_scale_tool_size_changed,
tr_tool);
......@@ -304,6 +317,8 @@ gimp_scale_tool_prepare (GimpTransformTool *tr_tool,
gimp_scale_tool_unit_changed,
tr_tool);
#endif
tr_tool->trans_info[X0] = (gdouble) tr_tool->x1;
tr_tool->trans_info[Y0] = (gdouble) tr_tool->y1;
tr_tool->trans_info[X1] = (gdouble) tr_tool->x2;
......
......@@ -36,12 +36,6 @@
#include "display/gimpdisplay.h"
#ifdef __GNUC__
#warning FIXME #include "dialogs/dialogs-types.h"
#endif
#include "dialogs/dialogs-types.h"
#include "dialogs/info-dialog.h"
#include "gimpsheartool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
......@@ -57,6 +51,8 @@
/* the minimum movement before direction of shear can be determined (pixels) */
#define MIN_MOVE 5
#define SB_WIDTH 10
/* local function prototypes */
......@@ -70,9 +66,9 @@ static void gimp_shear_tool_motion (GimpTransformTool *tr_tool,
static void gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *display);
static void shear_x_mag_changed (GtkWidget *widget,
static void shear_x_mag_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool);
static void shear_y_mag_changed (GtkWidget *widget,
static void shear_y_mag_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool);
......@@ -125,20 +121,36 @@ static void
gimp_shear_tool_dialog (GimpTransformTool *tr_tool)
{
GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
info_dialog_add_spinbutton (tr_tool->info_dialog,
_("Shear magnitude X:"),
&shear->xshear_val,
-65536, 65536, 1, 15, 1, 1, 0,
G_CALLBACK (shear_x_mag_changed),
tr_tool);
info_dialog_add_spinbutton (tr_tool->info_dialog,
_("Shear magnitude Y:"),
&shear->yshear_val,
-65536, 65536, 1, 15, 1, 1, 0,
G_CALLBACK (shear_y_mag_changed),
tr_tool);
GtkWidget *table;
GtkWidget *button;
table = gtk_table_new (2, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (tr_tool->dialog)->vbox), table,
FALSE, FALSE, 0);
gtk_widget_show (table);
button = gimp_spin_button_new (&shear->x_adj,
0, -65536, 65536, 1, 15, 1, 1, 0);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Shear magnitude X:"),
0.0, 0.5, button, 1, TRUE);
g_signal_connect (shear->x_adj, "value-changed",
G_CALLBACK (shear_x_mag_changed),
tr_tool);
button = gimp_spin_button_new (&shear->y_adj,
0, -65536, 65536, 1, 15, 1, 1, 0);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Shear magnitude Y:"),
0.0, 0.5, button, 1, TRUE);
g_signal_connect (shear->y_adj, "value-changed",
G_CALLBACK (shear_y_mag_changed),
tr_tool);
}
static void
......@@ -146,11 +158,12 @@ gimp_shear_tool_dialog_update (GimpTransformTool *tr_tool)
{
GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
shear->xshear_val = tr_tool->trans_info[XSHEAR];
shear->yshear_val = tr_tool->trans_info[YSHEAR];
gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->x_adj),
tr_tool->trans_info[XSHEAR]);
gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->y_adj),
tr_tool->trans_info[YSHEAR]);
info_dialog_update (tr_tool->info_dialog);
info_dialog_show (tr_tool->info_dialog);
gtk_widget_show (tr_tool->dialog);
}
static void
......@@ -266,12 +279,10 @@ gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
}
static void
shear_x_mag_changed (GtkWidget *widget,
shear_x_mag_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool)
{
gdouble value;
value = GTK_ADJUSTMENT (widget)->value;
gdouble value = gtk_adjustment_get_value (adj);
if (value != tr_tool->trans_info[XSHEAR])
{
......@@ -291,12 +302,10 @@ shear_x_mag_changed (GtkWidget *widget,
}
static void
shear_y_mag_changed (GtkWidget *widget,
shear_y_mag_changed (GtkAdjustment *adj,
GimpTransformTool *tr_tool)
{
gdouble value;
value = GTK_ADJUSTMENT (widget)->value;
gdouble value = gtk_adjustment_get_value (adj);
if (value != tr_tool->trans_info[YSHEAR])
{
......
......@@ -38,9 +38,8 @@ struct _GimpShearTool
{
GimpTransformTool parent_instance;
/* shear dialog */
gdouble xshear_val;
gdouble yshear_val;
GtkObject *x_adj;
GtkObject *y_adj;
};
struct _GimpShearToolClass
......
......@@ -49,6 +49,7 @@
#include "vectors/gimpstroke.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimptooldialog.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -56,12 +57,6 @@
#include "display/gimpdisplayshell-appearance.h"
#include "display/gimpdisplayshell-transform.h"
#ifdef __GNUC__
#warning FIXME #include "dialogs/dialogs-types.h"
#endif