2001-04-22 08:38:56 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpimagedock.c
|
2001-10-18 00:11:28 +08:00
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
2001-04-22 08:38:56 +08:00
|
|
|
*
|
|
|
|
* 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 "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-08 11:48:54 +08:00
|
|
|
#include "widgets-types.h"
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2001-07-07 20:19:21 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpimage.h"
|
2002-05-10 21:09:19 +08:00
|
|
|
#include "core/gimplist.h"
|
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
#include "gimpdialogfactory.h"
|
|
|
|
#include "gimpimagedock.h"
|
|
|
|
#include "gimpcontainermenuimpl.h"
|
2001-05-08 11:48:54 +08:00
|
|
|
#include "gimpdnd.h"
|
2001-04-22 08:38:56 +08:00
|
|
|
#include "gimpdockbook.h"
|
2001-05-04 06:19:17 +08:00
|
|
|
#include "gimpmenuitem.h"
|
|
|
|
#include "gimppreview.h"
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
2001-04-22 08:38:56 +08:00
|
|
|
|
|
|
|
|
2002-05-10 22:50:27 +08:00
|
|
|
#define DEFAULT_MINIMAL_WIDTH 250
|
|
|
|
#define DEFAULT_MENU_PREVIEW_SIZE GTK_ICON_SIZE_SMALL_TOOLBAR
|
2002-03-15 01:07:02 +08:00
|
|
|
|
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
static void gimp_image_dock_class_init (GimpImageDockClass *klass);
|
|
|
|
static void gimp_image_dock_init (GimpImageDock *dock);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
static void gimp_image_dock_destroy (GtkObject *object);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
static void gimp_image_dock_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style);
|
2002-03-19 03:34:06 +08:00
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
static void gimp_image_dock_factory_display_changed (GimpContext *context,
|
|
|
|
GimpObject *gdisp,
|
|
|
|
GimpDock *dock);
|
|
|
|
static void gimp_image_dock_factory_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDock *dock);
|
|
|
|
static void gimp_image_dock_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDock *dock);
|
|
|
|
static void gimp_image_dock_auto_clicked (GtkWidget *widget,
|
|
|
|
GimpDock *dock);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
static GimpDockClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
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
|
|
|
GType
|
2001-04-22 08:38:56 +08:00
|
|
|
gimp_image_dock_get_type (void)
|
|
|
|
{
|
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
|
|
|
static GType dock_type = 0;
|
2001-04-22 08:38:56 +08:00
|
|
|
|
|
|
|
if (! dock_type)
|
|
|
|
{
|
2001-10-17 19:33:43 +08:00
|
|
|
static const GTypeInfo dock_info =
|
2001-04-22 08:38:56 +08:00
|
|
|
{
|
2001-10-17 19:33:43 +08:00
|
|
|
sizeof (GimpImageDockClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gimp_image_dock_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpImageDock),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_image_dock_init,
|
2001-04-22 08:38:56 +08:00
|
|
|
};
|
|
|
|
|
2001-10-17 19:33:43 +08:00
|
|
|
dock_type = g_type_register_static (GIMP_TYPE_DOCK,
|
|
|
|
"GimpImageDock",
|
|
|
|
&dock_info, 0);
|
2001-04-22 08:38:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return dock_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_dock_class_init (GimpImageDockClass *klass)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
2002-03-19 03:34:06 +08:00
|
|
|
GtkWidgetClass *widget_class;
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2001-10-17 19:33:43 +08:00
|
|
|
object_class = GTK_OBJECT_CLASS (klass);
|
2002-03-19 03:34:06 +08:00
|
|
|
widget_class = GTK_WIDGET_CLASS (klass);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
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
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2002-03-19 03:34:06 +08:00
|
|
|
object_class->destroy = gimp_image_dock_destroy;
|
|
|
|
|
|
|
|
widget_class->style_set = gimp_image_dock_style_set;
|
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
g_param_spec_int ("minimal_width",
|
|
|
|
NULL, NULL,
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
DEFAULT_MINIMAL_WIDTH,
|
|
|
|
G_PARAM_READABLE));
|
2002-05-10 21:09:19 +08:00
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2002-05-10 22:50:27 +08:00
|
|
|
g_param_spec_enum ("menu_preview_size",
|
|
|
|
NULL, NULL,
|
|
|
|
GTK_TYPE_ICON_SIZE,
|
|
|
|
DEFAULT_MENU_PREVIEW_SIZE,
|
|
|
|
G_PARAM_READABLE));
|
2001-04-22 08:38:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_dock_init (GimpImageDock *dock)
|
|
|
|
{
|
2001-04-24 00:58:18 +08:00
|
|
|
GtkWidget *hbox;
|
|
|
|
|
|
|
|
dock->image_container = NULL;
|
2002-05-10 21:09:19 +08:00
|
|
|
dock->display_container = NULL;
|
2002-03-15 01:07:02 +08:00
|
|
|
dock->show_image_menu = FALSE;
|
2001-04-24 00:58:18 +08:00
|
|
|
dock->auto_follow_active = TRUE;
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (GIMP_DOCK (dock)->main_vbox), hbox,
|
2001-04-22 08:38:56 +08:00
|
|
|
FALSE, FALSE, 0);
|
2001-04-24 00:58:18 +08:00
|
|
|
gtk_box_reorder_child (GTK_BOX (GIMP_DOCK (dock)->main_vbox), hbox, 0);
|
2002-03-15 01:07:02 +08:00
|
|
|
|
|
|
|
if (dock->show_image_menu)
|
|
|
|
gtk_widget_show (hbox);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
|
|
|
dock->option_menu = gtk_option_menu_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), dock->option_menu, TRUE, TRUE, 0);
|
2001-04-22 08:38:56 +08:00
|
|
|
gtk_widget_show (dock->option_menu);
|
|
|
|
|
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
|
|
|
g_signal_connect (G_OBJECT (dock->option_menu), "destroy",
|
|
|
|
G_CALLBACK (gtk_widget_destroyed),
|
|
|
|
&dock->option_menu);
|
|
|
|
|
2001-07-02 22:58:02 +08:00
|
|
|
dock->auto_button = gtk_toggle_button_new_with_label (_("Auto"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dock->auto_button),
|
2001-04-24 00:58:18 +08:00
|
|
|
dock->auto_follow_active);
|
2001-07-02 22:58:02 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), dock->auto_button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (dock->auto_button);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
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
|
|
|
g_signal_connect (G_OBJECT (dock->auto_button), "clicked",
|
|
|
|
G_CALLBACK (gimp_image_dock_auto_clicked),
|
|
|
|
dock);
|
2001-04-22 08:38:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_dock_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GimpImageDock *dock;
|
|
|
|
|
|
|
|
dock = GIMP_IMAGE_DOCK (object);
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
/* remove the image menu and the auto button manually here because
|
|
|
|
* of weird cross-connections with GimpDock's context
|
|
|
|
*/
|
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
|
|
|
if (GIMP_DOCK (dock)->main_vbox &&
|
|
|
|
dock->option_menu &&
|
|
|
|
dock->option_menu->parent)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
|
|
|
|
dock->option_menu->parent);
|
|
|
|
}
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
if (GTK_OBJECT_CLASS (parent_class))
|
|
|
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
|
|
|
}
|
|
|
|
|
2002-03-19 03:34:06 +08:00
|
|
|
static void
|
|
|
|
gimp_image_dock_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style)
|
|
|
|
{
|
2002-05-10 21:09:19 +08:00
|
|
|
GimpImageDock *image_dock;
|
|
|
|
gint minimal_width;
|
2002-05-10 22:50:27 +08:00
|
|
|
GtkIconSize menu_preview_size;
|
|
|
|
gint menu_preview_width = 18;
|
|
|
|
gint menu_preview_height = 18;
|
2002-05-10 21:09:19 +08:00
|
|
|
gint focus_line_width;
|
|
|
|
gint focus_padding;
|
|
|
|
gint ythickness;
|
|
|
|
|
|
|
|
image_dock = GIMP_IMAGE_DOCK (widget);
|
2002-03-19 03:34:06 +08:00
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
|
|
|
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
2002-05-10 22:50:27 +08:00
|
|
|
"minimal_width", &minimal_width,
|
|
|
|
"menu_preview_size", &menu_preview_size,
|
2002-03-19 03:34:06 +08:00
|
|
|
NULL);
|
|
|
|
|
2002-05-10 22:50:27 +08:00
|
|
|
gtk_icon_size_lookup (menu_preview_size,
|
|
|
|
&menu_preview_width,
|
|
|
|
&menu_preview_height);
|
|
|
|
|
2002-05-10 21:09:19 +08:00
|
|
|
gtk_widget_style_get (image_dock->auto_button,
|
|
|
|
"focus_line_width", &focus_line_width,
|
|
|
|
"focus_padding", &focus_padding,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
ythickness = image_dock->auto_button->style->ythickness;
|
|
|
|
|
2002-03-19 03:34:06 +08:00
|
|
|
gtk_widget_set_size_request (widget, minimal_width, -1);
|
2002-05-10 21:09:19 +08:00
|
|
|
|
|
|
|
gimp_container_menu_set_preview_size (GIMP_CONTAINER_MENU (image_dock->menu),
|
|
|
|
menu_preview_height);
|
|
|
|
|
|
|
|
gtk_widget_set_size_request (image_dock->auto_button, -1,
|
|
|
|
menu_preview_height +
|
|
|
|
2 * (1 /* CHILD_SPACING */ +
|
|
|
|
ythickness +
|
|
|
|
focus_padding +
|
|
|
|
focus_line_width));
|
2002-03-19 03:34:06 +08:00
|
|
|
}
|
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
GtkWidget *
|
2002-03-15 01:07:02 +08:00
|
|
|
gimp_image_dock_new (GimpDialogFactory *dialog_factory,
|
2002-05-10 21:09:19 +08:00
|
|
|
GimpContainer *image_container,
|
|
|
|
GimpContainer *display_container)
|
2001-04-22 08:38:56 +08:00
|
|
|
{
|
|
|
|
GimpImageDock *image_dock;
|
2002-03-15 01:07:02 +08:00
|
|
|
GimpContext *context;
|
2001-11-30 02:43:25 +08:00
|
|
|
gchar *title;
|
2002-05-10 22:50:27 +08:00
|
|
|
gint menu_preview_width;
|
|
|
|
gint menu_preview_height;
|
2001-11-30 02:43:25 +08:00
|
|
|
|
|
|
|
static gint dock_counter = 1;
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
|
2001-04-24 00:58:18 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTAINER (image_container), NULL);
|
2002-05-10 21:09:19 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTAINER (display_container), NULL);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-08-10 22:41:39 +08:00
|
|
|
image_dock = g_object_new (GIMP_TYPE_IMAGE_DOCK, NULL);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2001-11-30 02:43:25 +08:00
|
|
|
title = g_strdup_printf (_("Gimp Dock #%d"), dock_counter++);
|
|
|
|
gtk_window_set_title (GTK_WINDOW (image_dock), title);
|
|
|
|
g_free (title);
|
|
|
|
|
2002-05-10 21:09:19 +08:00
|
|
|
image_dock->image_container = image_container;
|
|
|
|
image_dock->display_container = display_container;
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
context = gimp_context_new (dialog_factory->context->gimp,
|
|
|
|
"Dock Context", NULL);
|
|
|
|
|
2002-10-25 21:21:54 +08:00
|
|
|
gimp_dock_construct (GIMP_DOCK (image_dock), dialog_factory, context);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
gimp_context_define_properties (context,
|
2001-08-12 03:53:35 +08:00
|
|
|
GIMP_CONTEXT_ALL_PROPS_MASK &
|
|
|
|
~(GIMP_CONTEXT_IMAGE_MASK |
|
|
|
|
GIMP_CONTEXT_DISPLAY_MASK),
|
|
|
|
FALSE);
|
2002-03-15 01:07:02 +08:00
|
|
|
gimp_context_set_parent (context, dialog_factory->context);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-05-07 00:14:34 +08:00
|
|
|
if (image_dock->auto_follow_active)
|
2002-05-08 20:39:01 +08:00
|
|
|
{
|
|
|
|
if (gimp_context_get_display (dialog_factory->context))
|
|
|
|
gimp_context_copy_property (dialog_factory->context, context,
|
|
|
|
GIMP_CONTEXT_PROP_DISPLAY);
|
|
|
|
else
|
|
|
|
gimp_context_copy_property (dialog_factory->context, context,
|
|
|
|
GIMP_CONTEXT_PROP_IMAGE);
|
|
|
|
}
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
g_signal_connect_object (G_OBJECT (dialog_factory->context), "display_changed",
|
|
|
|
G_CALLBACK (gimp_image_dock_factory_display_changed),
|
|
|
|
G_OBJECT (image_dock),
|
|
|
|
0);
|
2002-03-15 01:07:02 +08:00
|
|
|
g_signal_connect_object (G_OBJECT (dialog_factory->context), "image_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
|
|
|
G_CALLBACK (gimp_image_dock_factory_image_changed),
|
2002-03-15 01:07:02 +08:00
|
|
|
G_OBJECT (image_dock),
|
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
|
|
|
0);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
g_signal_connect_object (G_OBJECT (context), "image_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
|
|
|
G_CALLBACK (gimp_image_dock_image_changed),
|
2002-03-15 01:07:02 +08:00
|
|
|
G_OBJECT (image_dock),
|
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
|
|
|
0);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2002-05-10 22:50:27 +08:00
|
|
|
gtk_icon_size_lookup (DEFAULT_MENU_PREVIEW_SIZE,
|
|
|
|
&menu_preview_width, &menu_preview_height);
|
|
|
|
|
2002-05-10 21:09:19 +08:00
|
|
|
image_dock->menu = gimp_container_menu_new (image_container, context,
|
2002-05-10 22:50:27 +08:00
|
|
|
menu_preview_height);
|
2001-04-22 08:38:56 +08:00
|
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (image_dock->option_menu),
|
|
|
|
image_dock->menu);
|
|
|
|
gtk_widget_show (image_dock->menu);
|
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
g_object_unref (G_OBJECT (context));
|
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
return GTK_WIDGET (image_dock);
|
|
|
|
}
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-07-02 22:58:02 +08:00
|
|
|
void
|
|
|
|
gimp_image_dock_set_auto_follow_active (GimpImageDock *image_dock,
|
|
|
|
gboolean auto_follow_active)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE_DOCK (image_dock));
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_dock->auto_button),
|
|
|
|
auto_follow_active ? TRUE : FALSE);
|
|
|
|
}
|
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
void
|
|
|
|
gimp_image_dock_set_show_image_menu (GimpImageDock *image_dock,
|
|
|
|
gboolean show)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE_DOCK (image_dock));
|
|
|
|
|
|
|
|
if (show)
|
2002-05-08 20:39:01 +08:00
|
|
|
gtk_widget_show (image_dock->option_menu->parent);
|
2001-06-30 03:25:03 +08:00
|
|
|
else
|
2002-05-08 20:39:01 +08:00
|
|
|
gtk_widget_hide (image_dock->option_menu->parent);
|
2001-07-02 22:58:02 +08:00
|
|
|
|
|
|
|
image_dock->show_image_menu = show ? TRUE : FALSE;
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
|
2002-05-08 00:23:14 +08:00
|
|
|
static void
|
|
|
|
gimp_image_dock_factory_display_changed (GimpContext *context,
|
|
|
|
GimpObject *gdisp,
|
|
|
|
GimpDock *dock)
|
|
|
|
{
|
|
|
|
GimpImageDock *image_dock;
|
|
|
|
|
|
|
|
image_dock = GIMP_IMAGE_DOCK (dock);
|
|
|
|
|
|
|
|
if (gdisp && image_dock->auto_follow_active)
|
|
|
|
{
|
|
|
|
gimp_context_set_display (dock->context, gdisp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
static void
|
|
|
|
gimp_image_dock_factory_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDock *dock)
|
|
|
|
{
|
|
|
|
GimpImageDock *image_dock;
|
|
|
|
|
|
|
|
image_dock = GIMP_IMAGE_DOCK (dock);
|
|
|
|
|
|
|
|
if (gimage && image_dock->auto_follow_active)
|
|
|
|
{
|
2002-05-08 00:23:14 +08:00
|
|
|
/* won't do anything if we already set the display above
|
|
|
|
*/
|
2001-04-24 00:58:18 +08:00
|
|
|
gimp_context_set_image (dock->context, gimage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_dock_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDock *dock)
|
|
|
|
{
|
|
|
|
GimpImageDock *image_dock;
|
|
|
|
|
|
|
|
image_dock = GIMP_IMAGE_DOCK (dock);
|
|
|
|
|
2001-04-26 08:19:31 +08:00
|
|
|
if (! gimage && image_dock->image_container->num_children > 0)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
|
|
|
gimage = GIMP_IMAGE (gimp_container_get_child_by_index (image_dock->image_container, 0));
|
|
|
|
|
2001-04-26 08:19:31 +08:00
|
|
|
if (gimage)
|
|
|
|
{
|
|
|
|
/* this invokes this function recursively but we don't enter
|
|
|
|
* the if() branch the second time
|
|
|
|
*/
|
2002-05-10 21:09:19 +08:00
|
|
|
gimp_context_set_image (context, gimage);
|
2001-04-26 08:19:31 +08:00
|
|
|
|
|
|
|
/* stop the emission of the original signal (the emission of
|
|
|
|
* the recursive signal is finished)
|
|
|
|
*/
|
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
|
|
|
g_signal_stop_emission_by_name (G_OBJECT (context), "image_changed");
|
2001-04-26 08:19:31 +08:00
|
|
|
}
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
2002-05-10 21:09:19 +08:00
|
|
|
else if (image_dock->display_container->num_children > 0)
|
|
|
|
{
|
|
|
|
GimpObject *gdisp;
|
|
|
|
gboolean find_display = TRUE;
|
|
|
|
|
|
|
|
gdisp = gimp_context_get_display (context);
|
|
|
|
|
|
|
|
if (gdisp)
|
|
|
|
{
|
|
|
|
GimpImage *gdisp_gimage;
|
|
|
|
|
|
|
|
g_object_get (gdisp, "image", &gdisp_gimage, NULL);
|
|
|
|
g_object_unref (G_OBJECT (gdisp_gimage));
|
|
|
|
|
|
|
|
if (gdisp_gimage == gimage)
|
|
|
|
find_display = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (find_display)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = GIMP_LIST (image_dock->display_container)->list;
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpImage *gdisp_gimage;
|
|
|
|
|
|
|
|
gdisp = GIMP_OBJECT (list->data);
|
|
|
|
|
|
|
|
g_object_get (gdisp, "image", &gdisp_gimage, NULL);
|
|
|
|
g_object_unref (G_OBJECT (gdisp_gimage));
|
|
|
|
|
|
|
|
if (gdisp_gimage == gimage)
|
|
|
|
{
|
|
|
|
/* this invokes this function recursively but we don't enter
|
|
|
|
* the if(find_display) branch the second time
|
|
|
|
*/
|
|
|
|
gimp_context_set_display (context, gdisp);
|
|
|
|
|
|
|
|
/* don't stop signal emission here because the context's
|
|
|
|
* image was not changed by the recursive call
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_dock_auto_clicked (GtkWidget *widget,
|
|
|
|
GimpDock *dock)
|
|
|
|
{
|
|
|
|
GimpImageDock *image_dock;
|
|
|
|
|
|
|
|
image_dock = GIMP_IMAGE_DOCK (dock);
|
|
|
|
|
|
|
|
gimp_toggle_button_update (widget, &image_dock->auto_follow_active);
|
|
|
|
|
|
|
|
if (image_dock->auto_follow_active)
|
|
|
|
{
|
2002-05-08 20:39:01 +08:00
|
|
|
if (gimp_context_get_display (dock->dialog_factory->context))
|
|
|
|
gimp_context_copy_property (dock->dialog_factory->context, dock->context,
|
|
|
|
GIMP_CONTEXT_PROP_DISPLAY);
|
2002-05-08 00:23:14 +08:00
|
|
|
else
|
2002-05-08 20:39:01 +08:00
|
|
|
gimp_context_copy_property (dock->dialog_factory->context, dock->context,
|
|
|
|
GIMP_CONTEXT_PROP_IMAGE);
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
|
|
|
}
|