1997-11-25 06:05:25 +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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2001-01-25 06:36:18 +08:00
|
|
|
|
1999-09-06 08:07:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <string.h>
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-08-31 05:00:42 +08:00
|
|
|
#include "widgets/gimpviewabledialog.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "info-dialog.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
1998-12-16 08:37:09 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
#define SB_WIDTH 10
|
2001-06-18 21:10:03 +08:00
|
|
|
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
/* local function prototypes */
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
static InfoDialog * info_dialog_new_extended (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
2003-11-08 01:29:02 +08:00
|
|
|
const gchar *role,
|
2002-09-08 00:47:39 +08:00
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
GtkWidget *parent,
|
2002-09-08 00:47:39 +08:00
|
|
|
GimpHelpFunc help_func,
|
|
|
|
gpointer help_data,
|
|
|
|
gboolean in_notebook);
|
|
|
|
static void info_dialog_field_new (InfoDialog *idialog,
|
|
|
|
InfoFieldType field_type,
|
|
|
|
gchar *title,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkObject *object,
|
|
|
|
gpointer value_ptr,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data);
|
|
|
|
static void info_dialog_update_field (InfoField *info_field);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
/* public functions */
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
InfoDialog *
|
|
|
|
info_dialog_new (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
2003-11-08 01:29:02 +08:00
|
|
|
const gchar *role,
|
2002-09-08 00:47:39 +08:00
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
GtkWidget *parent,
|
2002-09-08 00:47:39 +08:00
|
|
|
GimpHelpFunc help_func,
|
|
|
|
gpointer help_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-11-08 01:29:02 +08:00
|
|
|
return info_dialog_new_extended (viewable, title, role,
|
2002-09-08 00:47:39 +08:00
|
|
|
stock_id, desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
parent,
|
2002-09-08 00:47:39 +08:00
|
|
|
help_func, help_data, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-08-13 06:21:04 +08:00
|
|
|
InfoDialog *
|
2002-08-31 05:00:42 +08:00
|
|
|
info_dialog_notebook_new (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
2003-11-08 01:29:02 +08:00
|
|
|
const gchar *role,
|
2002-08-31 05:00:42 +08:00
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
GtkWidget *parent,
|
2002-08-31 05:00:42 +08:00
|
|
|
GimpHelpFunc help_func,
|
1999-09-28 01:58:10 +08:00
|
|
|
gpointer help_data)
|
1999-08-13 06:21:04 +08:00
|
|
|
{
|
2003-11-08 01:29:02 +08:00
|
|
|
return info_dialog_new_extended (viewable, title, role,
|
2002-08-31 05:00:42 +08:00
|
|
|
stock_id, desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
parent,
|
2002-08-31 05:00:42 +08:00
|
|
|
help_func, help_data, TRUE);
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
info_dialog_free (InfoDialog *idialog)
|
|
|
|
{
|
1999-04-03 03:46:59 +08:00
|
|
|
g_return_if_fail (idialog != NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
g_slist_foreach (idialog->field_list, (GFunc) g_free, NULL);
|
1998-01-29 16:03:27 +08:00
|
|
|
g_slist_free (idialog->field_list);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gtk_widget_destroy (idialog->shell);
|
|
|
|
|
|
|
|
g_free (idialog);
|
|
|
|
}
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
void
|
2004-01-21 19:16:57 +08:00
|
|
|
info_dialog_show (InfoDialog *idialog)
|
|
|
|
{
|
|
|
|
g_return_if_fail (idialog != NULL);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (idialog->shell))
|
|
|
|
gdk_window_show (idialog->shell->window);
|
|
|
|
else
|
|
|
|
gtk_widget_show (idialog->shell);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
info_dialog_present (InfoDialog *idialog)
|
1999-05-31 22:11:10 +08:00
|
|
|
{
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
g_return_if_fail (idialog != NULL);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2003-11-14 23:38:42 +08:00
|
|
|
gtk_window_present (GTK_WINDOW (idialog->shell));
|
1999-05-31 22:11:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-01-21 19:16:57 +08:00
|
|
|
info_dialog_hide (InfoDialog *idialog)
|
1999-05-31 22:11:10 +08:00
|
|
|
{
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
g_return_if_fail (idialog != NULL);
|
2003-11-14 23:38:42 +08:00
|
|
|
|
|
|
|
gtk_widget_hide (idialog->shell);
|
1999-05-31 22:11:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
info_dialog_update (InfoDialog *idialog)
|
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
g_return_if_fail (idialog != NULL);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
1999-08-24 10:52:40 +08:00
|
|
|
for (list = idialog->field_list; list; list = g_slist_next (list))
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_update_field ((InfoField *) list->data);
|
1999-05-31 22:11:10 +08:00
|
|
|
}
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
GtkWidget *
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_add_label (InfoDialog *idialog,
|
|
|
|
gchar *title,
|
|
|
|
gchar *text_ptr)
|
1999-04-03 03:46:59 +08:00
|
|
|
{
|
|
|
|
GtkWidget *label;
|
|
|
|
|
|
|
|
g_return_val_if_fail (idialog != NULL, NULL);
|
|
|
|
|
|
|
|
label = gtk_label_new (text_ptr);
|
2003-01-21 04:07:19 +08:00
|
|
|
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_field_new (idialog, INFO_LABEL, title, label, NULL,
|
|
|
|
text_ptr,
|
|
|
|
NULL, NULL);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
info_dialog_add_entry (InfoDialog *idialog,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
gchar *title,
|
|
|
|
gchar *text_ptr,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-04-03 03:46:59 +08:00
|
|
|
GtkWidget *entry;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
g_return_val_if_fail (idialog != NULL, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
entry = gtk_entry_new ();
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_set_size_request (entry, 50, -1);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_entry_set_text (GTK_ENTRY (entry), text_ptr ? text_ptr : "");
|
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (entry, "changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_field_new (idialog, INFO_ENTRY, title, entry, NULL,
|
|
|
|
text_ptr,
|
|
|
|
callback, callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
info_dialog_add_scale (InfoDialog *idialog,
|
1999-05-31 22:11:10 +08:00
|
|
|
gchar *title,
|
|
|
|
gdouble *value_ptr,
|
1999-04-03 03:46:59 +08:00
|
|
|
gfloat lower,
|
|
|
|
gfloat upper,
|
|
|
|
gfloat step_increment,
|
|
|
|
gfloat page_increment,
|
|
|
|
gfloat page_size,
|
|
|
|
gint digits,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
1999-04-03 03:46:59 +08:00
|
|
|
{
|
|
|
|
GtkObject *adjustment;
|
|
|
|
GtkWidget *scale;
|
|
|
|
|
|
|
|
g_return_val_if_fail (idialog != NULL, NULL);
|
|
|
|
|
|
|
|
adjustment = gtk_adjustment_new (value_ptr ? *value_ptr : 0, lower, upper,
|
|
|
|
step_increment, page_increment, page_size);
|
|
|
|
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
|
|
|
|
|
|
|
|
if (digits >= 0)
|
|
|
|
gtk_scale_set_digits (GTK_SCALE (scale), MAX (digits, 6));
|
|
|
|
else
|
|
|
|
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
|
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (adjustment, "value_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_field_new (idialog, INFO_SCALE, title, scale, adjustment,
|
|
|
|
value_ptr,
|
|
|
|
callback, callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
return scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
info_dialog_add_spinbutton (InfoDialog *idialog,
|
|
|
|
gchar *title,
|
1999-05-31 22:11:10 +08:00
|
|
|
gdouble *value_ptr,
|
1999-04-03 03:46:59 +08:00
|
|
|
gfloat lower,
|
|
|
|
gfloat upper,
|
|
|
|
gfloat step_increment,
|
|
|
|
gfloat page_increment,
|
|
|
|
gfloat page_size,
|
|
|
|
gfloat climb_rate,
|
|
|
|
gint digits,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
1999-04-03 03:46:59 +08:00
|
|
|
{
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkObject *adjustment;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
|
|
|
|
g_return_val_if_fail (idialog != NULL, NULL);
|
|
|
|
|
|
|
|
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
|
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
spinbutton = gimp_spin_button_new (&adjustment,
|
|
|
|
value_ptr ? *value_ptr : 0,
|
|
|
|
lower, upper,
|
|
|
|
step_increment, page_increment, page_size,
|
|
|
|
climb_rate, MAX (MIN (digits, 6), 0));
|
|
|
|
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (adjustment, "value_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), spinbutton);
|
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_field_new (idialog, INFO_SPINBUTTON, title, alignment,
|
|
|
|
adjustment,
|
|
|
|
value_ptr,
|
|
|
|
callback, callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
return spinbutton;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2000-02-08 04:35:13 +08:00
|
|
|
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,
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
1999-04-03 03:46:59 +08:00
|
|
|
{
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *sizeentry;
|
1999-08-24 10:52:40 +08:00
|
|
|
gint i;
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (idialog != NULL, NULL);
|
|
|
|
|
|
|
|
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
|
|
|
|
|
|
|
|
sizeentry = gimp_size_entry_new (nfields, unit, unit_format,
|
1999-04-05 20:48:48 +08:00
|
|
|
menu_show_pixels, menu_show_percent,
|
2002-09-08 00:47:39 +08:00
|
|
|
show_refval, SB_WIDTH,
|
1999-04-03 03:46:59 +08:00
|
|
|
update_policy);
|
|
|
|
if (value_ptr)
|
|
|
|
for (i = 0; i < nfields; i++)
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), i, value_ptr[i]);
|
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (sizeentry, "value_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), sizeentry);
|
|
|
|
gtk_widget_show (sizeentry);
|
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
info_dialog_field_new (idialog, INFO_SIZEENTRY, title, alignment,
|
|
|
|
GTK_OBJECT (sizeentry),
|
|
|
|
value_ptr,
|
|
|
|
callback, callback_data);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
|
|
|
return sizeentry;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-09-08 00:47:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static InfoDialog *
|
|
|
|
info_dialog_new_extended (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
2003-11-08 01:29:02 +08:00
|
|
|
const gchar *role,
|
2002-09-08 00:47:39 +08:00
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
GtkWidget *parent,
|
2002-09-08 00:47:39 +08:00
|
|
|
GimpHelpFunc help_func,
|
|
|
|
gpointer help_data,
|
|
|
|
gboolean in_notebook)
|
|
|
|
{
|
|
|
|
InfoDialog *idialog;
|
|
|
|
GtkWidget *shell;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *info_table;
|
|
|
|
GtkWidget *info_notebook;
|
|
|
|
|
|
|
|
idialog = g_new (InfoDialog, 1);
|
|
|
|
idialog->field_list = NULL;
|
|
|
|
idialog->nfields = 0;
|
|
|
|
|
|
|
|
shell = gimp_viewable_dialog_new (viewable,
|
2003-11-08 01:29:02 +08:00
|
|
|
title, role,
|
2002-09-08 00:47:39 +08:00
|
|
|
stock_id, desc,
|
2003-11-08 23:29:47 +08:00
|
|
|
parent,
|
2002-09-08 00:47:39 +08:00
|
|
|
help_func, help_data,
|
|
|
|
NULL);
|
|
|
|
|
2004-05-05 06:33:52 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 6);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
2002-09-08 00:47:39 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (shell)->vbox), vbox);
|
|
|
|
|
|
|
|
info_table = gtk_table_new (2, 0, FALSE);
|
|
|
|
|
|
|
|
if (in_notebook)
|
|
|
|
{
|
|
|
|
info_notebook = gtk_notebook_new ();
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (info_table), 4);
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (info_notebook),
|
|
|
|
info_table,
|
|
|
|
gtk_label_new (_("General")));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), info_notebook, FALSE, FALSE, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
info_notebook = NULL;
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), info_table, FALSE, FALSE, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
idialog->shell = shell;
|
|
|
|
idialog->vbox = vbox;
|
|
|
|
idialog->info_table = info_table;
|
|
|
|
idialog->info_notebook = info_notebook;
|
|
|
|
|
|
|
|
if (in_notebook)
|
|
|
|
gtk_widget_show (idialog->info_notebook);
|
|
|
|
|
|
|
|
gtk_widget_show (idialog->info_table);
|
|
|
|
gtk_widget_show (idialog->vbox);
|
|
|
|
|
|
|
|
return idialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
info_dialog_field_new (InfoDialog *idialog,
|
|
|
|
InfoFieldType field_type,
|
|
|
|
gchar *title,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkObject *obj,
|
|
|
|
gpointer value_ptr,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
GtkWidget *label;
|
|
|
|
InfoField *field;
|
|
|
|
gint row;
|
|
|
|
|
|
|
|
field = g_new (InfoField, 1);
|
|
|
|
|
|
|
|
row = idialog->nfields + 1;
|
|
|
|
gtk_table_resize (GTK_TABLE (idialog->info_table), 2, row);
|
|
|
|
|
|
|
|
label = gtk_label_new (title);
|
2004-05-12 19:37:21 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
2002-09-08 00:47:39 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (idialog->info_table), label,
|
|
|
|
0, 1, row - 1, row,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (idialog->info_table), widget,
|
|
|
|
1, 2, row - 1, row);
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (idialog->info_table), 0, 6);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (idialog->info_table), 2);
|
|
|
|
|
|
|
|
field->field_type = field_type;
|
|
|
|
|
|
|
|
if (obj == NULL)
|
|
|
|
field->obj = GTK_OBJECT (widget);
|
|
|
|
else
|
|
|
|
field->obj = obj;
|
|
|
|
|
|
|
|
field->value_ptr = value_ptr;
|
|
|
|
field->callback = callback;
|
|
|
|
field->callback_data = callback_data;
|
|
|
|
|
|
|
|
idialog->field_list = g_slist_prepend (idialog->field_list, field);
|
|
|
|
idialog->nfields++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
info_dialog_update_field (InfoField *field)
|
|
|
|
{
|
|
|
|
const gchar *old_text;
|
|
|
|
gint num;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if (field->value_ptr == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (field->field_type != INFO_LABEL)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_block_by_func (field->obj,
|
2002-09-08 00:47:39 +08:00
|
|
|
field->callback,
|
|
|
|
field->callback_data);
|
|
|
|
|
|
|
|
switch (field->field_type)
|
|
|
|
{
|
|
|
|
case INFO_LABEL:
|
|
|
|
gtk_label_set_text (GTK_LABEL (field->obj), (gchar *) field->value_ptr);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case INFO_ENTRY:
|
|
|
|
old_text = gtk_entry_get_text (GTK_ENTRY (field->obj));
|
|
|
|
if (strcmp (old_text, (gchar *) field->value_ptr))
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (field->obj), (gchar *) field->value_ptr);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case INFO_SCALE:
|
|
|
|
case INFO_SPINBUTTON:
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (field->obj),
|
|
|
|
*((gdouble *) field->value_ptr));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case INFO_SIZEENTRY:
|
|
|
|
num = GIMP_SIZE_ENTRY (field->obj)->number_of_fields;
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), i,
|
|
|
|
((gdouble *) field->value_ptr)[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2004-05-12 16:13:33 +08:00
|
|
|
g_warning ("%s: Unknown info_dialog field type.", G_STRFUNC);
|
2002-09-08 00:47:39 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field->field_type != INFO_LABEL)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_unblock_by_func (field->obj,
|
2002-09-08 00:47:39 +08:00
|
|
|
field->callback,
|
|
|
|
field->callback_data);
|
|
|
|
}
|