diff --git a/ChangeLog b/ChangeLog index f92c89c106..80ee0e7390 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-05-22 Michael Natterer + + * app/Makefile.am + * app/resolution_calibrate.[ch]: removed + + * app/gui/Makefile.am + * app/gui/resolution-calibrate-dialog.[ch]: added + + * app/user_install.c + * app/gui/preferences-dialog.c + * po/POTFILES.in: changed accordingly. + + * app/core/gimplayer.c: irrelevant doc reformating. + 2001-05-22 Sven Neumann * app/module_db.c: ported bugfix for #55050 from stable branch. diff --git a/app/Makefile.am b/app/Makefile.am index 7f9c420c41..e7cdcdb20b 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -45,8 +45,6 @@ gimp_SOURCES = \ ops_buttons.h \ qmask.c \ qmask.h \ - resolution_calibrate.c \ - resolution_calibrate.h \ undo_history.c \ undo_history.h \ ## diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 838f92861a..8f423ffdc9 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -936,14 +936,14 @@ gimp_layer_scale_lowlevel (GimpLayer *layer, /** * gimp_layer_check_scaling: * @layer: Layer to check - * @new_width: proposed width of layer, in pixels - * @new_height: proposed height of layer, in pixels + * @new_width: proposed width of layer's image, in pixels + * @new_height: proposed height of layer's image, in pixels * * Scales layer dimensions, then snaps them to pixel centers * - * Returns FALSE if any dimension reduces to zero as a result - * of this; otherwise, returns TRUE. - */ + * Returns: #FALSE if any dimension reduces to zero as a result + * of this; otherwise, returns #TRUE. + **/ gboolean gimp_layer_check_scaling (GimpLayer *layer, gint new_width, @@ -968,13 +968,13 @@ gimp_layer_check_scaling (GimpLayer *layer, /** * gimp_layer_scale_by_factors: - * @layer: Layer to be transformed by explicit width and height factors. + * @layer: Layer to be transformed by explicit width and height factors. * @w_factor: scale factor to apply to width and horizontal offset * @h_factor: scale factor to apply to height and vertical offset * * Scales layer dimensions and offsets by uniform width and * height factors. - * + * * Use gimp_layer_scale_by_factors() in circumstances when the * same width and height scaling factors are to be uniformly * applied to a set of layers. In this context, the layer's @@ -983,7 +983,7 @@ gimp_layer_check_scaling (GimpLayer *layer, * the fixed point of the transform is the upper left hand * corner of the image. Returns gboolean FALSE if a requested * scale factor is zero or if a scaling zero's out a layer - * dimension; returns TRUE otherwise. + * dimension; returns #TRUE otherwise. * * Use gimp_layer_scale() in circumstances where new layer width * and height dimensions are predetermined instead. @@ -991,9 +991,9 @@ gimp_layer_check_scaling (GimpLayer *layer, * Side effects: Undo set created for layer. Old layer imagery * scaled & painted to new layer tiles. * - * Returns: TRUE, if the scaled layer has positive dimensions - * FALSE if the scaled layer has at least one zero dimension - */ + * Returns: #TRUE, if the scaled layer has positive dimensions + * #FALSE if the scaled layer has at least one zero dimension + **/ gboolean gimp_layer_scale_by_factors (GimpLayer *layer, gdouble w_factor, @@ -1050,7 +1050,7 @@ gimp_layer_scale_by_factors (GimpLayer *layer, * Side effects: undo set created for layer. * Old layer imagery scaled * & painted to new layer tiles - */ + **/ void gimp_layer_scale (GimpLayer *layer, gint new_width, diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 4be8be013f..8d491cefc4 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -36,6 +36,7 @@ #include "gdisplay.h" #include "layer-select.h" +#include "resolution-calibrate-dialog.h" #include "session.h" #include "colormaps.h" @@ -44,7 +45,6 @@ #include "gimphelp.h" #include "gimprc.h" #include "image_render.h" -#include "resolution_calibrate.h" #include "libgimp/gimpintl.h" diff --git a/app/dialogs/resolution-calibrate-dialog.c b/app/dialogs/resolution-calibrate-dialog.c index 878ca85e88..016ebff50c 100644 --- a/app/dialogs/resolution-calibrate-dialog.c +++ b/app/dialogs/resolution-calibrate-dialog.c @@ -24,24 +24,21 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" - -#include "gdisplay_ops.h" -#include "gimprc.h" -#include "resolution_calibrate.h" -#include "unitrc.h" +#include "resolution-calibrate-dialog.h" #include "libgimp/gimpintl.h" #define SET_STYLE(widget, style) if (style) gtk_widget_set_style (widget, style) + static GtkWidget *calibrate_entry = NULL; static gdouble calibrate_xres = 1.0; static gdouble calibrate_yres = 1.0; static gint ruler_width = 1; static gint ruler_height = 1; + static void resolution_calibrate_ok (GtkWidget *button, gpointer data) @@ -71,17 +68,20 @@ resolution_calibrate_ok (GtkWidget *button, /** * resolution_calibrate_dialog: - * @resolution_entry: a GimpSizeEntry to connect the dialog to - * @dialog_style: a GtkStyle for the main dialog (used by the user_installation_dialog) - * @ruler_style: a GtkStyle for the rulers and the entry area (used by the - * user_installation_dialog) - * @expose_callback: an "expose_event" handler used by the user_installation_dialog - * - * Displays a dialog that allows the user to interactively determine her monitor - * resolution. This dialog runs it's own GTK main loop and is connected to a - * GimpSizeEntry handling the resolution to be set. The style and callback parameters - * are supposed to be only used by the user_installation_dialog. - */ + * @resolution_entry: a #GimpSizeEntry to connect the dialog to + * @dialog_style: a #GtkStyle for the main dialog (used by the + * user_installation_dialog) + * @ruler_style: a #GtkStyle for the rulers and the entry area + * (used by the user_installation_dialog) + * @expose_callback: an "expose_event" handler used by the + * user_installation_dialog + * + * Displays a dialog that allows the user to interactively determine + * her monitor resolution. This dialog runs it's own GTK main loop and + * is connected to a #GimpSizeEntry handling the resolution to be + * set. The style and callback parameters are supposed to be only used + * by the user_installation_dialog. + **/ void resolution_calibrate_dialog (GtkWidget *resolution_entry, GtkStyle *dialog_style, @@ -129,7 +129,6 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, GTK_OBJECT (dialog)); SET_STYLE (dialog, dialog_style); - gimp_dialog_set_icon (GTK_WINDOW (dialog)); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 8); ruler_width = gdk_screen_width (); @@ -259,14 +258,14 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, list = g_list_next (list)) { GtkTableChild *child = (GtkTableChild *) list->data; - + if (child && GTK_IS_LABEL (child->widget)) SET_STYLE (GTK_WIDGET (child->widget), ruler_style); } } gtk_box_pack_end (GTK_BOX (hbox), calibrate_entry, FALSE, FALSE, 0); gtk_widget_show (calibrate_entry); - + gtk_widget_show (dialog); gtk_main (); diff --git a/app/dialogs/resolution-calibrate-dialog.h b/app/dialogs/resolution-calibrate-dialog.h index c5f9966f8a..aa00efd4a5 100644 --- a/app/dialogs/resolution-calibrate-dialog.h +++ b/app/dialogs/resolution-calibrate-dialog.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __RESOLUTION_CALIBRATE_H__ -#define __RESOLUTION_CALIBRATE_H__ +#ifndef __RESOLUTION_CALIBRATE_DIALOG_H__ +#define __RESOLUTION_CALIBRATE_DIALOG_H__ void resolution_calibrate_dialog (GtkWidget *resolution_entry, @@ -26,4 +26,4 @@ void resolution_calibrate_dialog (GtkWidget *resolution_entry, GtkSignalFunc expose_callback); -#endif /* __RESOLUTION_CALIBRATE_H__ */ +#endif /* __RESOLUTION_CALIBRATE_DIALOG_H__ */ diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index acda3ed250..007f50e575 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -38,10 +38,11 @@ #include "base/base-config.h" +#include "gui/resolution-calibrate-dialog.h" + #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "resolution_calibrate.h" #include "unitrc.h" #include "user_install.h" diff --git a/app/gui/Makefile.am b/app/gui/Makefile.am index fcfa6052af..b8e3d5f02a 100644 --- a/app/gui/Makefile.am +++ b/app/gui/Makefile.am @@ -3,81 +3,83 @@ noinst_LTLIBRARIES = libappgui.la libappgui_la_SOURCES = \ - about-dialog.c \ - about-dialog.h \ - brush-editor.c \ - brush-editor.h \ - brush-select.c \ - brush-select.h \ - channels-commands.c \ - channels-commands.h \ - color-area.c \ - color-area.h \ - color-notebook.c \ - color-notebook.h \ - color-select.c \ - color-select.h \ - colormap-dialog.c \ - colormap-dialog.h \ - commands.c \ - commands.h \ - convert-dialog.c \ - convert-dialog.h \ - dialogs.c \ - dialogs.h \ - dialogs-commands.c \ - dialogs-commands.h \ - dialogs-constructors.c \ - dialogs-constructors.h \ - file-dialog-utils.c \ - file-dialog-utils.h \ - file-new-dialog.c \ - file-new-dialog.h \ - file-open-dialog.c \ - file-open-dialog.h \ - file-save-dialog.c \ - file-save-dialog.h \ - gradient-editor.c \ - gradient-editor.h \ - gradient-select.h \ - gradient-select.c \ - gui.c \ - gui.h \ - indicator-area.c \ - indicator-area.h \ - info-dialog.c \ - info-dialog.h \ - info-window.c \ - info-window.h \ - layer-select.c \ - layer-select.h \ - layers-commands.c \ - layers-commands.h \ - menus.c \ - menus.h \ - offset-dialog.c \ - offset-dialog.h \ - palette-editor.c \ - palette-editor.h \ - palette-import-dialog.c \ - palette-import-dialog.h \ - palette-select.c \ - palette-select.h \ - paths-dialog.c \ - paths-dialog.h \ - pattern-select.c \ - pattern-select.h \ - preferences-dialog.c \ - preferences-dialog.h \ - session.c \ - session.h \ - splash.c \ - splash.h \ - test-commands.c \ - test-commands.h \ - tips-dialog.c \ - tips-dialog.h \ - toolbox.c \ + about-dialog.c \ + about-dialog.h \ + brush-editor.c \ + brush-editor.h \ + brush-select.c \ + brush-select.h \ + channels-commands.c \ + channels-commands.h \ + color-area.c \ + color-area.h \ + color-notebook.c \ + color-notebook.h \ + color-select.c \ + color-select.h \ + colormap-dialog.c \ + colormap-dialog.h \ + commands.c \ + commands.h \ + convert-dialog.c \ + convert-dialog.h \ + dialogs.c \ + dialogs.h \ + dialogs-commands.c \ + dialogs-commands.h \ + dialogs-constructors.c \ + dialogs-constructors.h \ + file-dialog-utils.c \ + file-dialog-utils.h \ + file-new-dialog.c \ + file-new-dialog.h \ + file-open-dialog.c \ + file-open-dialog.h \ + file-save-dialog.c \ + file-save-dialog.h \ + gradient-editor.c \ + gradient-editor.h \ + gradient-select.h \ + gradient-select.c \ + gui.c \ + gui.h \ + indicator-area.c \ + indicator-area.h \ + info-dialog.c \ + info-dialog.h \ + info-window.c \ + info-window.h \ + layer-select.c \ + layer-select.h \ + layers-commands.c \ + layers-commands.h \ + menus.c \ + menus.h \ + offset-dialog.c \ + offset-dialog.h \ + palette-editor.c \ + palette-editor.h \ + palette-import-dialog.c \ + palette-import-dialog.h \ + palette-select.c \ + palette-select.h \ + paths-dialog.c \ + paths-dialog.h \ + pattern-select.c \ + pattern-select.h \ + preferences-dialog.c \ + preferences-dialog.h \ + resolution-calibrate-dialog.c \ + resolution-calibrate-dialog.h \ + session.c \ + session.h \ + splash.c \ + splash.h \ + test-commands.c \ + test-commands.h \ + tips-dialog.c \ + tips-dialog.h \ + toolbox.c \ toolbox.h AM_CPPFLAGS = \ diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 4be8be013f..8d491cefc4 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -36,6 +36,7 @@ #include "gdisplay.h" #include "layer-select.h" +#include "resolution-calibrate-dialog.h" #include "session.h" #include "colormaps.h" @@ -44,7 +45,6 @@ #include "gimphelp.h" #include "gimprc.h" #include "image_render.h" -#include "resolution_calibrate.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/resolution-calibrate-dialog.c b/app/gui/resolution-calibrate-dialog.c index 878ca85e88..016ebff50c 100644 --- a/app/gui/resolution-calibrate-dialog.c +++ b/app/gui/resolution-calibrate-dialog.c @@ -24,24 +24,21 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" - -#include "gdisplay_ops.h" -#include "gimprc.h" -#include "resolution_calibrate.h" -#include "unitrc.h" +#include "resolution-calibrate-dialog.h" #include "libgimp/gimpintl.h" #define SET_STYLE(widget, style) if (style) gtk_widget_set_style (widget, style) + static GtkWidget *calibrate_entry = NULL; static gdouble calibrate_xres = 1.0; static gdouble calibrate_yres = 1.0; static gint ruler_width = 1; static gint ruler_height = 1; + static void resolution_calibrate_ok (GtkWidget *button, gpointer data) @@ -71,17 +68,20 @@ resolution_calibrate_ok (GtkWidget *button, /** * resolution_calibrate_dialog: - * @resolution_entry: a GimpSizeEntry to connect the dialog to - * @dialog_style: a GtkStyle for the main dialog (used by the user_installation_dialog) - * @ruler_style: a GtkStyle for the rulers and the entry area (used by the - * user_installation_dialog) - * @expose_callback: an "expose_event" handler used by the user_installation_dialog - * - * Displays a dialog that allows the user to interactively determine her monitor - * resolution. This dialog runs it's own GTK main loop and is connected to a - * GimpSizeEntry handling the resolution to be set. The style and callback parameters - * are supposed to be only used by the user_installation_dialog. - */ + * @resolution_entry: a #GimpSizeEntry to connect the dialog to + * @dialog_style: a #GtkStyle for the main dialog (used by the + * user_installation_dialog) + * @ruler_style: a #GtkStyle for the rulers and the entry area + * (used by the user_installation_dialog) + * @expose_callback: an "expose_event" handler used by the + * user_installation_dialog + * + * Displays a dialog that allows the user to interactively determine + * her monitor resolution. This dialog runs it's own GTK main loop and + * is connected to a #GimpSizeEntry handling the resolution to be + * set. The style and callback parameters are supposed to be only used + * by the user_installation_dialog. + **/ void resolution_calibrate_dialog (GtkWidget *resolution_entry, GtkStyle *dialog_style, @@ -129,7 +129,6 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, GTK_OBJECT (dialog)); SET_STYLE (dialog, dialog_style); - gimp_dialog_set_icon (GTK_WINDOW (dialog)); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 8); ruler_width = gdk_screen_width (); @@ -259,14 +258,14 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, list = g_list_next (list)) { GtkTableChild *child = (GtkTableChild *) list->data; - + if (child && GTK_IS_LABEL (child->widget)) SET_STYLE (GTK_WIDGET (child->widget), ruler_style); } } gtk_box_pack_end (GTK_BOX (hbox), calibrate_entry, FALSE, FALSE, 0); gtk_widget_show (calibrate_entry); - + gtk_widget_show (dialog); gtk_main (); diff --git a/app/gui/resolution-calibrate-dialog.h b/app/gui/resolution-calibrate-dialog.h index c5f9966f8a..aa00efd4a5 100644 --- a/app/gui/resolution-calibrate-dialog.h +++ b/app/gui/resolution-calibrate-dialog.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __RESOLUTION_CALIBRATE_H__ -#define __RESOLUTION_CALIBRATE_H__ +#ifndef __RESOLUTION_CALIBRATE_DIALOG_H__ +#define __RESOLUTION_CALIBRATE_DIALOG_H__ void resolution_calibrate_dialog (GtkWidget *resolution_entry, @@ -26,4 +26,4 @@ void resolution_calibrate_dialog (GtkWidget *resolution_entry, GtkSignalFunc expose_callback); -#endif /* __RESOLUTION_CALIBRATE_H__ */ +#endif /* __RESOLUTION_CALIBRATE_DIALOG_H__ */ diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index acda3ed250..007f50e575 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -38,10 +38,11 @@ #include "base/base-config.h" +#include "gui/resolution-calibrate-dialog.h" + #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "resolution_calibrate.h" #include "unitrc.h" #include "user_install.h" diff --git a/app/resolution_calibrate.c b/app/resolution_calibrate.c deleted file mode 100644 index 878ca85e88..0000000000 --- a/app/resolution_calibrate.c +++ /dev/null @@ -1,273 +0,0 @@ -/* 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 - -#include "libgimpmath/gimpmath.h" -#include "libgimpbase/gimpbase.h" -#include "libgimpwidgets/gimpwidgets.h" - -#include "core/core-types.h" - -#include "gdisplay_ops.h" -#include "gimprc.h" -#include "resolution_calibrate.h" -#include "unitrc.h" - -#include "libgimp/gimpintl.h" - - -#define SET_STYLE(widget, style) if (style) gtk_widget_set_style (widget, style) - -static GtkWidget *calibrate_entry = NULL; -static gdouble calibrate_xres = 1.0; -static gdouble calibrate_yres = 1.0; -static gint ruler_width = 1; -static gint ruler_height = 1; - -static void -resolution_calibrate_ok (GtkWidget *button, - gpointer data) -{ - GtkWidget *resolution_entry; - GtkWidget *chain_button; - gdouble x, y; - - resolution_entry = gtk_object_get_user_data (GTK_OBJECT (data)); - - x = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (calibrate_entry), 0); - y = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (calibrate_entry), 1); - - calibrate_xres = (gdouble)ruler_width * calibrate_xres / x; - calibrate_yres = (gdouble)ruler_height * calibrate_yres / y; - - chain_button = gtk_object_get_data (GTK_OBJECT (resolution_entry), "chain_button"); - if (chain_button && - ABS (x -y) > GIMP_MIN_RESOLUTION) - gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button), FALSE); - - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry), 0, calibrate_xres); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry), 1, calibrate_yres); - - gtk_widget_destroy (GTK_WIDGET (data)); -} - -/** - * resolution_calibrate_dialog: - * @resolution_entry: a GimpSizeEntry to connect the dialog to - * @dialog_style: a GtkStyle for the main dialog (used by the user_installation_dialog) - * @ruler_style: a GtkStyle for the rulers and the entry area (used by the - * user_installation_dialog) - * @expose_callback: an "expose_event" handler used by the user_installation_dialog - * - * Displays a dialog that allows the user to interactively determine her monitor - * resolution. This dialog runs it's own GTK main loop and is connected to a - * GimpSizeEntry handling the resolution to be set. The style and callback parameters - * are supposed to be only used by the user_installation_dialog. - */ -void -resolution_calibrate_dialog (GtkWidget *resolution_entry, - GtkStyle *dialog_style, - GtkStyle *ruler_style, - GtkSignalFunc expose_callback) -{ - GtkWidget *dialog; - GtkWidget *table; - GtkWidget *ebox; - GtkWidget *vbox; - GtkWidget *hbox; - GtkWidget *darea; - GtkWidget *ruler; - GtkWidget *label; - GList *list; - - g_return_if_fail (GIMP_IS_SIZE_ENTRY (resolution_entry)); - - /* this dialog can only exist once */ - if (calibrate_entry) - return; - - dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"), - "calibrate_resolution", - NULL, NULL, - GTK_WIN_POS_CENTER, - FALSE, FALSE, FALSE, - - _("OK"), resolution_calibrate_ok, - NULL, NULL, NULL, TRUE, FALSE, - _("Cancel"), gtk_widget_destroy, - NULL, 1, NULL, FALSE, TRUE, - - NULL); - - gtk_signal_connect (GTK_OBJECT (dialog), "destroy", - GTK_SIGNAL_FUNC (gtk_main_quit), - NULL); - gtk_object_set_user_data (GTK_OBJECT (dialog), resolution_entry); - gtk_signal_connect_object_while_alive (GTK_OBJECT (resolution_entry), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (dialog)); - gtk_signal_connect_object_while_alive (GTK_OBJECT (resolution_entry), "unmap", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (dialog)); - - SET_STYLE (dialog, dialog_style); - gimp_dialog_set_icon (GTK_WINDOW (dialog)); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 8); - - ruler_width = gdk_screen_width (); - ruler_height = gdk_screen_height (); - - ruler_width = ruler_width - 300 - (ruler_width % 100); - ruler_height = ruler_height - 300 - (ruler_height % 100); - - table = gtk_table_new (4, 4, FALSE); - gtk_container_set_border_width (GTK_CONTAINER (table), 16); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table); - gtk_widget_show (table); - - ruler = gtk_hruler_new (); - SET_STYLE (ruler, ruler_style); - gtk_widget_set_usize (ruler, ruler_width, 32); - gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_width, 0, ruler_width); - gtk_table_attach (GTK_TABLE (table), ruler, 1, 3, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (ruler); - - ruler = gtk_vruler_new (); - SET_STYLE (ruler, ruler_style); - gtk_widget_set_usize (ruler, 32, ruler_height); - gtk_ruler_set_range (GTK_RULER (ruler), 0, ruler_height, 0, ruler_height); - gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (ruler); - - ebox = gtk_event_box_new (); - SET_STYLE (ebox, ruler_style); - gtk_table_attach (GTK_TABLE (table), ebox, 1, 2, 1, 2, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (ebox); - - table = gtk_table_new (3, 3, FALSE); - gtk_container_add (GTK_CONTAINER (ebox), table); - gtk_widget_show (table); - - darea = gtk_drawing_area_new (); - SET_STYLE (darea, dialog_style); - gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 16, 16); - if (expose_callback) - gtk_signal_connect_after (GTK_OBJECT (darea), "expose_event", - GTK_SIGNAL_FUNC (expose_callback), - (gpointer) GTK_CORNER_TOP_LEFT); - gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (darea); - - darea = gtk_drawing_area_new (); - SET_STYLE (darea, dialog_style); - gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 16, 16); - if (expose_callback) - gtk_signal_connect_after (GTK_OBJECT (darea), "expose_event", - GTK_SIGNAL_FUNC (expose_callback), - (gpointer) GTK_CORNER_BOTTOM_LEFT); - gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 2, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (darea); - - darea = gtk_drawing_area_new (); - SET_STYLE (darea, dialog_style); - gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 16, 16); - if (expose_callback) - gtk_signal_connect_after (GTK_OBJECT (darea), "expose_event", - GTK_SIGNAL_FUNC (expose_callback), - (gpointer) GTK_CORNER_TOP_RIGHT); - gtk_table_attach (GTK_TABLE (table), darea, 2, 3, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (darea); - - darea = gtk_drawing_area_new (); - SET_STYLE (darea, dialog_style); - gtk_drawing_area_size (GTK_DRAWING_AREA (darea), 16, 16); - if (expose_callback) - gtk_signal_connect_after (GTK_OBJECT (darea), "expose_event", - GTK_SIGNAL_FUNC (expose_callback), - (gpointer) GTK_CORNER_BOTTOM_RIGHT); - gtk_table_attach (GTK_TABLE (table), darea, 2, 3, 2, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_widget_show (darea); - - vbox = gtk_vbox_new (FALSE, 16); - gtk_table_attach_defaults (GTK_TABLE (table), vbox, 1, 2, 1, 2); - gtk_widget_show (vbox); - - label = gtk_label_new (_("Measure the rulers and enter their lengths below.")); - SET_STYLE (label, ruler_style); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); - gtk_widget_show (label); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - calibrate_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (resolution_entry), 0); - calibrate_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (resolution_entry), 1); - - calibrate_entry = - gimp_coordinates_new (GIMP_UNIT_INCH, "%p", - FALSE, FALSE, 75, - GIMP_SIZE_ENTRY_UPDATE_SIZE, - FALSE, - FALSE, - _("Horizontal:"), - ruler_width, - calibrate_xres, - 1, GIMP_MAX_IMAGE_SIZE, - 0, 0, - _("Vertical:"), - ruler_height, - calibrate_yres, - 1, GIMP_MAX_IMAGE_SIZE, - 0, 0); - gtk_widget_hide (GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (calibrate_entry))); - gtk_signal_connect (GTK_OBJECT (dialog), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroyed), - &calibrate_entry); - - if (ruler_style) - { - for (list = GTK_TABLE (calibrate_entry)->children; - list; - list = g_list_next (list)) - { - GtkTableChild *child = (GtkTableChild *) list->data; - - if (child && GTK_IS_LABEL (child->widget)) - SET_STYLE (GTK_WIDGET (child->widget), ruler_style); - } - } - gtk_box_pack_end (GTK_BOX (hbox), calibrate_entry, FALSE, FALSE, 0); - gtk_widget_show (calibrate_entry); - - gtk_widget_show (dialog); - - gtk_main (); -} diff --git a/app/resolution_calibrate.h b/app/resolution_calibrate.h deleted file mode 100644 index c5f9966f8a..0000000000 --- a/app/resolution_calibrate.h +++ /dev/null @@ -1,29 +0,0 @@ -/* 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 __RESOLUTION_CALIBRATE_H__ -#define __RESOLUTION_CALIBRATE_H__ - - -void resolution_calibrate_dialog (GtkWidget *resolution_entry, - GtkStyle *dialog_style, - GtkStyle *ruler_style, - GtkSignalFunc expose_callback); - - -#endif /* __RESOLUTION_CALIBRATE_H__ */ diff --git a/app/user_install.c b/app/user_install.c index acda3ed250..007f50e575 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -38,10 +38,11 @@ #include "base/base-config.h" +#include "gui/resolution-calibrate-dialog.h" + #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "resolution_calibrate.h" #include "unitrc.h" #include "user_install.h" diff --git a/po/POTFILES.in b/po/POTFILES.in index 6f88b4cab7..32dc69842b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -26,7 +26,6 @@ app/nav_window.c app/plug_in.c app/qmask.c app/resize.c -app/resolution_calibrate.c app/scan_convert.c app/undo.c app/undo_history.c @@ -77,6 +76,7 @@ app/gui/palette-select.c app/gui/paths-dialog.c app/gui/pattern-select.c app/gui/preferences-dialog.c +app/gui/resolution-calibrate-dialog.c app/gui/splash.c app/gui/tips-dialog.c app/gui/toolbox.c