diff --git a/ChangeLog b/ChangeLog index 4d88b80e95..0242cff582 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,65 @@ +2005-09-09 Michael Natterer + + Added parent window API to the GimpProgress interface and to + the libgimp progress stuff. Might look strange, but does + the right thing in almost all cases (image window, file dialog, + script-fu dialog etc). Fixes bug #62988. + + * app/core/gimpprogress.[ch]: added GimpProgress::get_window() + which should return a toplevel window ID if the progress is in a + window that wants to be the transient parent of plug-in dialogs. + + * app/widgets/gimpwidgets-utils.[ch] (gimp_window_get_native): new + function which returns the window handle of a GtkWindow's GdkWindow. + + * app/widgets/gimpfiledialog.c: implement ::get_window(). + + * app/display/gimpdisplay.[ch]: ditto. Removed window handle API. + + * app/gui/gui-vtable.c: changed accordingly. + + * libgimpbase/gimpbaseenums.[ch] (enum GimpProgressCommand): + added GIMP_PROGRESS_COMMAND_GET_WINDOW. + + * app/plug-in/plug-in-progress.[ch] (plug_in_progress_get_window): + new function. Also renamed some functions to match the + GimpProgress interface, and not the legacy PDB procedure names. + + * tools/pdbgen/pdb/progress.pdb + * app/core/gimppdbprogress.c: implement get_window() on both + sides of the wire, keeping backward compatibility (hopefully). + + * libgimp/gimpprogress.[ch]: deprecated gimp_progress_install() + and added gimp_progress_install_vtable() which takes a vtable with + padding to be extensible. Added get_window() vtable entry and + dispatch it accordingly. Also added pulse() which was implemented + in a hackish way before. Everything is of course backward + compatible. + + * libgimp/gimpprogressbar.c: inmplement the get_window() stuff + so a plug-in dialog containing a progress can be the transient + parent of another dialog in another plug-in. + + * libgimp/gimpui.[ch] (gimp_ui_get_progress_window): new function + which returns a foreign GdkWindow of this plug-ins progress + window. + + Renamed gimp_window_set_transient_for_default_display() to + gimp_window_set_transient() and make it use the progress' window + handle instead of the display's (which is the right thing to do in + almost all cases). + + * libgimp/gimp.def + * libgimp/gimpui.def: add the new functions. + + * tools/pdbgen/enums.pl + * app/pdb/internal_procs.c + * app/pdb/progress_cmds.c + * libgimp/gimpprogress_pdb.[ch]: regenerated. + + * libgimp/gimpexport.c + * plug-ins/*/*.c: follow API change. + 2005-09-09 Tor Lillqvist * gimptool-win32.c.in (get_prefix, maybe_append_exe) diff --git a/app/core/gimppdbprogress.c b/app/core/gimppdbprogress.c index 6db8b3ab5e..d0951e53db 100644 --- a/app/core/gimppdbprogress.c +++ b/app/core/gimppdbprogress.c @@ -60,18 +60,18 @@ static void gimp_pdb_progress_set_property (GObject *object, const GValue *value, GParamSpec *pspec); -static GimpProgress * - gimp_pdb_progress_progress_start (GimpProgress *progress, - const gchar *message, - gboolean cancelable); -static void gimp_pdb_progress_progress_end (GimpProgress *progress); -static gboolean gimp_pdb_progress_progress_is_active (GimpProgress *progress); -static void gimp_pdb_progress_progress_set_text (GimpProgress *progress, - const gchar *message); -static void gimp_pdb_progress_progress_set_value (GimpProgress *progress, - gdouble percentage); -static gdouble gimp_pdb_progress_progress_get_value (GimpProgress *progress); -static void gimp_pdb_progress_progress_pulse (GimpProgress *progress); +static GimpProgress * gimp_pdb_progress_progress_start(GimpProgress *progress, + const gchar *message, + gboolean cancelable); +static void gimp_pdb_progress_progress_end (GimpProgress *progress); +static gboolean gimp_pdb_progress_progress_is_active (GimpProgress *progress); +static void gimp_pdb_progress_progress_set_text (GimpProgress *progress, + const gchar *message); +static void gimp_pdb_progress_progress_set_value (GimpProgress *progress, + gdouble percentage); +static gdouble gimp_pdb_progress_progress_get_value (GimpProgress *progress); +static void gimp_pdb_progress_progress_pulse (GimpProgress *progress); +static guint32 gimp_pdb_progress_progress_get_window (GimpProgress *progress); static GObjectClass *parent_class = NULL; @@ -151,13 +151,14 @@ gimp_pdb_progress_init (GimpPdbProgress *progress, static void gimp_pdb_progress_progress_iface_init (GimpProgressInterface *progress_iface) { - progress_iface->start = gimp_pdb_progress_progress_start; - progress_iface->end = gimp_pdb_progress_progress_end; - progress_iface->is_active = gimp_pdb_progress_progress_is_active; - progress_iface->set_text = gimp_pdb_progress_progress_set_text; - progress_iface->set_value = gimp_pdb_progress_progress_set_value; - progress_iface->get_value = gimp_pdb_progress_progress_get_value; - progress_iface->pulse = gimp_pdb_progress_progress_pulse; + progress_iface->start = gimp_pdb_progress_progress_start; + progress_iface->end = gimp_pdb_progress_progress_end; + progress_iface->is_active = gimp_pdb_progress_progress_is_active; + progress_iface->set_text = gimp_pdb_progress_progress_set_text; + progress_iface->set_value = gimp_pdb_progress_progress_set_value; + progress_iface->get_value = gimp_pdb_progress_progress_get_value; + progress_iface->pulse = gimp_pdb_progress_progress_pulse; + progress_iface->get_window = gimp_pdb_progress_progress_get_window; } static GObject * @@ -233,12 +234,14 @@ gimp_pdb_progress_set_property (GObject *object, } } -static void +static gdouble gimp_pdb_progress_run_callback (GimpPdbProgress *progress, GimpProgressCommand command, const gchar *text, gdouble value) { + gdouble retval = 0; + if (progress->callback_name && ! progress->callback_busy) { Argument *return_vals; @@ -262,12 +265,18 @@ gimp_pdb_progress_run_callback (GimpPdbProgress *progress, "The corresponding plug-in may have crashed."), g_type_name (G_TYPE_FROM_INSTANCE (progress))); } + else if (n_return_vals >= 2 && return_vals[1].arg_type == GIMP_PDB_FLOAT) + { + retval = return_vals[1].value.pdb_float; + } if (return_vals) procedural_db_destroy_args (return_vals, n_return_vals); progress->callback_busy = FALSE; } + + return retval; } static GimpProgress * @@ -363,6 +372,17 @@ gimp_pdb_progress_progress_pulse (GimpProgress *progress) NULL, 0.0); } +static guint32 +gimp_pdb_progress_progress_get_window (GimpProgress *progress) +{ + GimpPdbProgress *pdb_progress = GIMP_PDB_PROGRESS (progress); + + return (guint32) + gimp_pdb_progress_run_callback (pdb_progress, + GIMP_PROGRESS_COMMAND_GET_WINDOW, + NULL, 0.0); +} + GimpPdbProgress * gimp_pdb_progress_get_by_callback (GimpPdbProgressClass *klass, const gchar *callback_name) diff --git a/app/core/gimpprogress.c b/app/core/gimpprogress.c index 822921cad8..47a482aa68 100644 --- a/app/core/gimpprogress.c +++ b/app/core/gimpprogress.c @@ -203,6 +203,21 @@ gimp_progress_pulse (GimpProgress *progress) progress_iface->pulse (progress); } +guint32 +gimp_progress_get_window (GimpProgress *progress) +{ + GimpProgressInterface *progress_iface; + + g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0); + + progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress); + + if (progress_iface->get_window) + return progress_iface->get_window (progress); + + return 0; +} + void gimp_progress_message (GimpProgress *progress, Gimp *gimp, diff --git a/app/core/gimpprogress.h b/app/core/gimpprogress.h index 1998e34d17..0b72c3cff5 100644 --- a/app/core/gimpprogress.h +++ b/app/core/gimpprogress.h @@ -36,26 +36,28 @@ struct _GimpProgressInterface GTypeInterface base_iface; /* virtual functions */ - GimpProgress * (* start) (GimpProgress *progress, - const gchar *message, - gboolean cancelable); - void (* end) (GimpProgress *progress); - gboolean (* is_active) (GimpProgress *progress); + GimpProgress * (* start) (GimpProgress *progress, + const gchar *message, + gboolean cancelable); + void (* end) (GimpProgress *progress); + gboolean (* is_active) (GimpProgress *progress); - void (* set_text) (GimpProgress *progress, - const gchar *message); - void (* set_value) (GimpProgress *progress, - gdouble percentage); - gdouble (* get_value) (GimpProgress *progress); - void (* pulse) (GimpProgress *progress); + void (* set_text) (GimpProgress *progress, + const gchar *message); + void (* set_value) (GimpProgress *progress, + gdouble percentage); + gdouble (* get_value) (GimpProgress *progress); + void (* pulse) (GimpProgress *progress); - void (* message) (GimpProgress *progress, - Gimp *gimp, - const gchar *domain, - const gchar *message); + guint32 (* get_window) (GimpProgress *progress); + + void (* message) (GimpProgress *progress, + Gimp *gimp, + const gchar *domain, + const gchar *message); /* signals */ - void (* cancel) (GimpProgress *progress); + void (* cancel) (GimpProgress *progress); }; @@ -74,6 +76,8 @@ void gimp_progress_set_value (GimpProgress *progress, gdouble gimp_progress_get_value (GimpProgress *progress); void gimp_progress_pulse (GimpProgress *progress); +guint32 gimp_progress_get_window (GimpProgress *progress); + void gimp_progress_message (GimpProgress *progress, Gimp *gimp, const gchar *domain, diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 214b7e31c5..10b22236d6 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -20,14 +20,6 @@ #include -#ifdef GDK_WINDOWING_WIN32 -#include -#endif - -#ifdef GDK_WINDOWING_X11 -#include -#endif - #include "display-types.h" #include "tools/tools-types.h" @@ -37,6 +29,8 @@ #include "core/gimplist.h" #include "core/gimpprogress.h" +#include "widgets/gimpwidgets-utils.h" + #include "tools/gimptool.h" #include "tools/tool_manager.h" @@ -64,37 +58,38 @@ static void gimp_display_class_init (GimpDisplayClass *klass); static void gimp_display_init (GimpDisplay *gdisp); static void gimp_display_progress_iface_init (GimpProgressInterface *progress_iface); -static void gimp_display_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); -static void gimp_display_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); +static void gimp_display_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void gimp_display_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); static GimpProgress * - gimp_display_progress_start (GimpProgress *progress, - const gchar *message, - gboolean cancelable); -static void gimp_display_progress_end (GimpProgress *progress); -static gboolean gimp_display_progress_is_active (GimpProgress *progress); -static void gimp_display_progress_set_text (GimpProgress *progress, - const gchar *message); -static void gimp_display_progress_set_value (GimpProgress *progress, - gdouble percentage); -static gdouble gimp_display_progress_get_value (GimpProgress *progress); -static void gimp_display_progress_pulse (GimpProgress *progress); -static void gimp_display_progress_canceled (GimpProgress *progress, - GimpDisplay *display); + gimp_display_progress_start (GimpProgress *progress, + const gchar *message, + gboolean cancelable); +static void gimp_display_progress_end (GimpProgress *progress); +static gboolean gimp_display_progress_is_active (GimpProgress *progress); +static void gimp_display_progress_set_text (GimpProgress *progress, + const gchar *message); +static void gimp_display_progress_set_value (GimpProgress *progress, + gdouble percentage); +static gdouble gimp_display_progress_get_value (GimpProgress *progress); +static void gimp_display_progress_pulse (GimpProgress *progress); +static guint32 gimp_display_progress_get_window (GimpProgress *progress); +static void gimp_display_progress_canceled (GimpProgress *progress, + GimpDisplay *display); -static void gimp_display_flush_whenever (GimpDisplay *gdisp, - gboolean now); -static void gimp_display_paint_area (GimpDisplay *gdisp, - gint x, - gint y, - gint w, - gint h); +static void gimp_display_flush_whenever (GimpDisplay *gdisp, + gboolean now); +static void gimp_display_paint_area (GimpDisplay *gdisp, + gint x, + gint y, + gint w, + gint h); static GimpObjectClass *parent_class = NULL; @@ -184,13 +179,14 @@ gimp_display_init (GimpDisplay *gdisp) static void gimp_display_progress_iface_init (GimpProgressInterface *progress_iface) { - progress_iface->start = gimp_display_progress_start; - progress_iface->end = gimp_display_progress_end; - progress_iface->is_active = gimp_display_progress_is_active; - progress_iface->set_text = gimp_display_progress_set_text; - progress_iface->set_value = gimp_display_progress_set_value; - progress_iface->get_value = gimp_display_progress_get_value; - progress_iface->pulse = gimp_display_progress_pulse; + progress_iface->start = gimp_display_progress_start; + progress_iface->end = gimp_display_progress_end; + progress_iface->is_active = gimp_display_progress_is_active; + progress_iface->set_text = gimp_display_progress_set_text; + progress_iface->set_value = gimp_display_progress_set_value; + progress_iface->get_value = gimp_display_progress_get_value; + progress_iface->pulse = gimp_display_progress_pulse; + progress_iface->get_window = gimp_display_progress_get_window; } static void @@ -344,6 +340,17 @@ gimp_display_progress_pulse (GimpProgress *progress) gimp_progress_pulse (GIMP_PROGRESS (shell->statusbar)); } +static guint32 +gimp_display_progress_get_window (GimpProgress *progress) +{ + GimpDisplay *display = GIMP_DISPLAY (progress); + + if (! display->shell) + return 0; + + return (guint32) gimp_window_get_native (GTK_WINDOW (display->shell)); +} + static void gimp_display_progress_canceled (GimpProgress *progress, GimpDisplay *display) @@ -446,46 +453,6 @@ gimp_display_get_ID (GimpDisplay *gdisp) return gdisp->ID; } -/** - * gimp_display_get_window: - * @display: a #GimpDisplayShell - * - * This function is used to pass a window handle to plug-ins so that - * they can set their dialog windows transient to the image display. - * - * Return value: a native window handle of the display's shell or 0 - * if the shell isn't realized yet - */ -GdkNativeWindow -gimp_display_get_window (GimpDisplay *display) -{ - GtkWidget *shell; - -#ifdef GDK_NATIVE_WINDOW_POINTER - g_return_val_if_fail (GIMP_IS_DISPLAY (display), NULL); -#else - g_return_val_if_fail (GIMP_IS_DISPLAY (display), 0); -#endif - - shell = display->shell; - -#ifdef GDK_WINDOWING_WIN32 - if (shell && GTK_WIDGET_REALIZED (shell)) - return GDK_WINDOW_HWND (shell->window); -#endif - -#ifdef GDK_WINDOWING_X11 - if (shell && GTK_WIDGET_REALIZED (shell)) - return GDK_WINDOW_XID (shell->window); -#endif - -#ifdef GDK_NATIVE_WINDOW_POINTER - return NULL; -#else - return 0; -#endif -} - GimpDisplay * gimp_display_get_by_ID (Gimp *gimp, gint ID) diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index d806010996..7d0e98d097 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -54,32 +54,31 @@ struct _GimpDisplayClass }; -GType gimp_display_get_type (void) G_GNUC_CONST; +GType gimp_display_get_type (void) G_GNUC_CONST; -GimpDisplay * gimp_display_new (GimpImage *gimage, - GimpUnit unit, - gdouble scale, - GimpMenuFactory *menu_factory, - GimpUIManager *popup_manager); -void gimp_display_delete (GimpDisplay *gdisp); +GimpDisplay * gimp_display_new (GimpImage *gimage, + GimpUnit unit, + gdouble scale, + GimpMenuFactory *menu_factory, + GimpUIManager *popup_manager); +void gimp_display_delete (GimpDisplay *gdisp); -gint gimp_display_get_ID (GimpDisplay *gdisp); -GdkNativeWindow gimp_display_get_window (GimpDisplay *gdisp); -GimpDisplay * gimp_display_get_by_ID (Gimp *gimp, - gint ID); +gint gimp_display_get_ID (GimpDisplay *gdisp); +GimpDisplay * gimp_display_get_by_ID (Gimp *gimp, + gint ID); -void gimp_display_reconnect (GimpDisplay *gdisp, - GimpImage *gimage); +void gimp_display_reconnect (GimpDisplay *gdisp, + GimpImage *gimage); -void gimp_display_update_area (GimpDisplay *gdisp, - gboolean now, - gint x, - gint y, - gint w, - gint h); +void gimp_display_update_area (GimpDisplay *gdisp, + gboolean now, + gint x, + gint y, + gint w, + gint h); -void gimp_display_flush (GimpDisplay *gdisp); -void gimp_display_flush_now (GimpDisplay *gdisp); +void gimp_display_flush (GimpDisplay *gdisp); +void gimp_display_flush_now (GimpDisplay *gdisp); #endif /* __GIMP_DISPLAY_H__ */ diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 1045d85f75..a770d1eb8d 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -58,6 +58,7 @@ #include "widgets/gimppatternselect.h" #include "widgets/gimpprogressdialog.h" #include "widgets/gimpuimanager.h" +#include "widgets/gimpwidgets-utils.h" #include "display/gimpdisplay.h" #include "display/gimpdisplay-foreach.h" @@ -333,14 +334,12 @@ gui_display_get_ID (GimpObject *display) static guint32 gui_display_get_window (GimpObject *display) { -#ifdef GDK_NATIVE_WINDOW_POINTER -#ifdef __GNUC__ -#warning gui_display_get_window() unimplementable for the target windowing system -#endif + GimpDisplay *disp = GIMP_DISPLAY (display); + + if (disp->shell) + return (guint32) gimp_window_get_native (GTK_WINDOW (disp->shell)); + return 0; -#else - return (guint32) gimp_display_get_window (GIMP_DISPLAY (display)); -#endif } static GimpObject * diff --git a/app/pdb/internal_procs.c b/app/pdb/internal_procs.c index 7ad80b9095..9dce3d0010 100644 --- a/app/pdb/internal_procs.c +++ b/app/pdb/internal_procs.c @@ -75,7 +75,7 @@ void register_undo_procs (Gimp *gimp); void register_unit_procs (Gimp *gimp); void register_vectors_procs (Gimp *gimp); -/* 474 procedures registered total */ +/* 475 procedures registered total */ void internal_procs_init (Gimp *gimp, @@ -102,13 +102,13 @@ internal_procs_init (Gimp *gimp, (* status_callback) (NULL, _("Context"), 0.12); register_context_procs (gimp); - (* status_callback) (NULL, _("Convert"), 0.167); + (* status_callback) (NULL, _("Convert"), 0.166); register_convert_procs (gimp); (* status_callback) (NULL, _("Display procedures"), 0.173); register_display_procs (gimp); - (* status_callback) (NULL, _("Drawable procedures"), 0.184); + (* status_callback) (NULL, _("Drawable procedures"), 0.183); register_drawable_procs (gimp); (* status_callback) (NULL, _("Transformation procedures"), 0.257); @@ -117,82 +117,82 @@ internal_procs_init (Gimp *gimp, (* status_callback) (NULL, _("Edit procedures"), 0.291); register_edit_procs (gimp); - (* status_callback) (NULL, _("File Operations"), 0.327); + (* status_callback) (NULL, _("File Operations"), 0.326); register_fileops_procs (gimp); - (* status_callback) (NULL, _("Floating selections"), 0.348); + (* status_callback) (NULL, _("Floating selections"), 0.347); register_floating_sel_procs (gimp); - (* status_callback) (NULL, _("Font UI"), 0.361); + (* status_callback) (NULL, _("Font UI"), 0.36); register_font_select_procs (gimp); - (* status_callback) (NULL, _("Fonts"), 0.367); + (* status_callback) (NULL, _("Fonts"), 0.366); register_fonts_procs (gimp); (* status_callback) (NULL, _("Gimprc procedures"), 0.371); register_gimprc_procs (gimp); - (* status_callback) (NULL, _("Gradient"), 0.386); + (* status_callback) (NULL, _("Gradient"), 0.385); register_gradient_procs (gimp); - (* status_callback) (NULL, _("Gradient UI"), 0.449); + (* status_callback) (NULL, _("Gradient UI"), 0.448); register_gradient_select_procs (gimp); - (* status_callback) (NULL, _("Gradients"), 0.456); + (* status_callback) (NULL, _("Gradients"), 0.455); register_gradients_procs (gimp); - (* status_callback) (NULL, _("Guide procedures"), 0.466); + (* status_callback) (NULL, _("Guide procedures"), 0.465); register_guides_procs (gimp); - (* status_callback) (NULL, _("Help procedures"), 0.479); + (* status_callback) (NULL, _("Help procedures"), 0.478); register_help_procs (gimp); - (* status_callback) (NULL, _("Image"), 0.481); + (* status_callback) (NULL, _("Image"), 0.48); register_image_procs (gimp); - (* status_callback) (NULL, _("Layer"), 0.614); + (* status_callback) (NULL, _("Layer"), 0.613); register_layer_procs (gimp); - (* status_callback) (NULL, _("Message procedures"), 0.671); + (* status_callback) (NULL, _("Message procedures"), 0.669); register_message_procs (gimp); - (* status_callback) (NULL, _("Miscellaneous"), 0.677); + (* status_callback) (NULL, _("Miscellaneous"), 0.676); register_misc_procs (gimp); - (* status_callback) (NULL, _("Paint Tool procedures"), 0.684); + (* status_callback) (NULL, _("Paint Tool procedures"), 0.682); register_paint_tools_procs (gimp); - (* status_callback) (NULL, _("Palette"), 0.715); + (* status_callback) (NULL, _("Palette"), 0.714); register_palette_procs (gimp); - (* status_callback) (NULL, _("Palette UI"), 0.745); + (* status_callback) (NULL, _("Palette UI"), 0.743); register_palette_select_procs (gimp); - (* status_callback) (NULL, _("Palettes"), 0.751); + (* status_callback) (NULL, _("Palettes"), 0.749); register_palettes_procs (gimp); - (* status_callback) (NULL, _("Parasite procedures"), 0.759); + (* status_callback) (NULL, _("Parasite procedures"), 0.758); register_parasite_procs (gimp); - (* status_callback) (NULL, _("Paths"), 0.785); + (* status_callback) (NULL, _("Paths"), 0.783); register_paths_procs (gimp); - (* status_callback) (NULL, _("Pattern"), 0.819); + (* status_callback) (NULL, _("Pattern"), 0.817); register_pattern_procs (gimp); - (* status_callback) (NULL, _("Pattern UI"), 0.823); + (* status_callback) (NULL, _("Pattern UI"), 0.821); register_pattern_select_procs (gimp); - (* status_callback) (NULL, _("Patterns"), 0.829); + (* status_callback) (NULL, _("Patterns"), 0.827); register_patterns_procs (gimp); - (* status_callback) (NULL, _("Plug-in"), 0.838); + (* status_callback) (NULL, _("Plug-in"), 0.836); register_plug_in_procs (gimp); - (* status_callback) (NULL, _("Procedural database"), 0.85); + (* status_callback) (NULL, _("Procedural database"), 0.848); register_procedural_db_procs (gimp); - (* status_callback) (NULL, _("Progress"), 0.869); + (* status_callback) (NULL, _("Progress"), 0.867); register_progress_procs (gimp); (* status_callback) (NULL, _("Image mask"), 0.884); @@ -201,13 +201,13 @@ internal_procs_init (Gimp *gimp, (* status_callback) (NULL, _("Selection Tool procedures"), 0.92); register_selection_tools_procs (gimp); - (* status_callback) (NULL, _("Text procedures"), 0.93); + (* status_callback) (NULL, _("Text procedures"), 0.931); register_text_tool_procs (gimp); (* status_callback) (NULL, _("Transform Tool procedures"), 0.939); register_transform_tools_procs (gimp); - (* status_callback) (NULL, _("Undo"), 0.951); + (* status_callback) (NULL, _("Undo"), 0.952); register_undo_procs (gimp); (* status_callback) (NULL, _("Units"), 0.966); diff --git a/app/pdb/progress_cmds.c b/app/pdb/progress_cmds.c index 212913ea58..538d84de46 100644 --- a/app/pdb/progress_cmds.c +++ b/app/pdb/progress_cmds.c @@ -34,6 +34,7 @@ static ProcRecord progress_init_proc; static ProcRecord progress_update_proc; static ProcRecord progress_pulse_proc; static ProcRecord progress_set_text_proc; +static ProcRecord progress_get_window_handle_proc; static ProcRecord progress_install_proc; static ProcRecord progress_uninstall_proc; static ProcRecord progress_cancel_proc; @@ -45,6 +46,7 @@ register_progress_procs (Gimp *gimp) procedural_db_register (gimp, &progress_update_proc); procedural_db_register (gimp, &progress_pulse_proc); procedural_db_register (gimp, &progress_set_text_proc); + procedural_db_register (gimp, &progress_get_window_handle_proc); procedural_db_register (gimp, &progress_install_proc); procedural_db_register (gimp, &progress_uninstall_proc); procedural_db_register (gimp, &progress_cancel_proc); @@ -126,7 +128,7 @@ progress_update_invoker (Gimp *gimp, if (gimp->current_plug_in && gimp->current_plug_in->open) { if (! gimp->no_interface) - plug_in_progress_update (gimp->current_plug_in, percentage); + plug_in_progress_set_value (gimp->current_plug_in, percentage); } else success = FALSE; @@ -250,6 +252,59 @@ static ProcRecord progress_set_text_proc = { { progress_set_text_invoker } } }; +static Argument * +progress_get_window_handle_invoker (Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + Argument *args) +{ + gboolean success = TRUE; + Argument *return_args; + gint32 window = 0; + + if (gimp->current_plug_in && gimp->current_plug_in->open) + { + if (! gimp->no_interface) + window = plug_in_progress_get_window (gimp->current_plug_in); + } + else + success = FALSE; + + return_args = procedural_db_return_args (&progress_get_window_handle_proc, success); + + if (success) + return_args[1].value.pdb_int = window; + + return return_args; +} + +static ProcArg progress_get_window_handle_outargs[] = +{ + { + GIMP_PDB_INT32, + "window", + "The progress bar's toplevel window" + } +}; + +static ProcRecord progress_get_window_handle_proc = +{ + "gimp-progress-get-window-handle", + "gimp-progress-get-window-handle", + "Returns the native window ID of the toplevel window this plug-in's progress is displayed in.", + "This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in.", + "Michael Natterer ", + "Michael Natterer", + "2004", + NULL, + GIMP_INTERNAL, + 0, + NULL, + 1, + progress_get_window_handle_outargs, + { { progress_get_window_handle_invoker } } +}; + static Argument * progress_install_invoker (Gimp *gimp, GimpContext *context, diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index 9edab7d69b..4a9dd88609 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -91,8 +91,52 @@ plug_in_progress_start (PlugIn *plug_in, } void -plug_in_progress_update (PlugIn *plug_in, - gdouble percentage) +plug_in_progress_end (PlugIn *plug_in) +{ + PlugInProcFrame *proc_frame; + + g_return_if_fail (plug_in != NULL); + + proc_frame = plug_in_get_proc_frame (plug_in); + + if (proc_frame->progress) + { + if (proc_frame->progress_cancel_id) + { + g_signal_handler_disconnect (proc_frame->progress, + proc_frame->progress_cancel_id); + proc_frame->progress_cancel_id = 0; + } + + if (gimp_progress_is_active (proc_frame->progress)) + gimp_progress_end (proc_frame->progress); + + if (proc_frame->progress_created) + { + gimp_free_progress (plug_in->gimp, proc_frame->progress); + g_object_unref (proc_frame->progress); + proc_frame->progress = NULL; + } + } +} + +void +plug_in_progress_set_text (PlugIn *plug_in, + const gchar *message) +{ + PlugInProcFrame *proc_frame; + + g_return_if_fail (plug_in != NULL); + + proc_frame = plug_in_get_proc_frame (plug_in); + + if (proc_frame->progress) + gimp_progress_set_text (proc_frame->progress, message); +} + +void +plug_in_progress_set_value (PlugIn *plug_in, + gdouble percentage) { PlugInProcFrame *proc_frame; @@ -131,48 +175,19 @@ plug_in_progress_pulse (PlugIn *plug_in) gimp_progress_pulse (proc_frame->progress); } -void -plug_in_progress_set_text (PlugIn *plug_in, - const gchar *message) +guint32 +plug_in_progress_get_window (PlugIn *plug_in) { PlugInProcFrame *proc_frame; - g_return_if_fail (plug_in != NULL); + g_return_val_if_fail (plug_in != NULL, 0); proc_frame = plug_in_get_proc_frame (plug_in); if (proc_frame->progress) - gimp_progress_set_text (proc_frame->progress, message); -} + return gimp_progress_get_window (proc_frame->progress); -void -plug_in_progress_end (PlugIn *plug_in) -{ - PlugInProcFrame *proc_frame; - - g_return_if_fail (plug_in != NULL); - - proc_frame = plug_in_get_proc_frame (plug_in); - - if (proc_frame->progress) - { - if (proc_frame->progress_cancel_id) - { - g_signal_handler_disconnect (proc_frame->progress, - proc_frame->progress_cancel_id); - proc_frame->progress_cancel_id = 0; - } - - if (gimp_progress_is_active (proc_frame->progress)) - gimp_progress_end (proc_frame->progress); - - if (proc_frame->progress_created) - { - gimp_free_progress (plug_in->gimp, proc_frame->progress); - g_object_unref (proc_frame->progress); - proc_frame->progress = NULL; - } - } + return 0; } gboolean diff --git a/app/plug-in/gimpplugin-progress.h b/app/plug-in/gimpplugin-progress.h index 110f0c7784..b14e57448b 100644 --- a/app/plug-in/gimpplugin-progress.h +++ b/app/plug-in/gimpplugin-progress.h @@ -22,25 +22,26 @@ #define __PLUG_IN_PROGRESS_H__ -void plug_in_progress_start (PlugIn *plug_in, - const gchar *message, - gint display_ID); -void plug_in_progress_update (PlugIn *plug_in, - gdouble percentage); -void plug_in_progress_pulse (PlugIn *plug_in); -void plug_in_progress_set_text (PlugIn *plug_in, - const gchar *message); -void plug_in_progress_end (PlugIn *plug_in); +void plug_in_progress_start (PlugIn *plug_in, + const gchar *message, + gint display_ID); +void plug_in_progress_end (PlugIn *plug_in); +void plug_in_progress_set_text (PlugIn *plug_in, + const gchar *message); +void plug_in_progress_set_value (PlugIn *plug_in, + gdouble percentage); +void plug_in_progress_pulse (PlugIn *plug_in); +guint32 plug_in_progress_get_window (PlugIn *plug_in); -gboolean plug_in_progress_install (PlugIn *plug_in, - const gchar *progress_callback); -gboolean plug_in_progress_uninstall (PlugIn *plug_in, - const gchar *progress_callback); -gboolean plug_in_progress_cancel (PlugIn *plug_in, - const gchar *progress_callback); +gboolean plug_in_progress_install (PlugIn *plug_in, + const gchar *progress_callback); +gboolean plug_in_progress_uninstall (PlugIn *plug_in, + const gchar *progress_callback); +gboolean plug_in_progress_cancel (PlugIn *plug_in, + const gchar *progress_callback); -void plug_in_progress_message (PlugIn *plug_in, - const gchar *message); +void plug_in_progress_message (PlugIn *plug_in, + const gchar *message); #endif /* __PLUG_IN_PROGRESS_H__ */ diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index 9edab7d69b..4a9dd88609 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -91,8 +91,52 @@ plug_in_progress_start (PlugIn *plug_in, } void -plug_in_progress_update (PlugIn *plug_in, - gdouble percentage) +plug_in_progress_end (PlugIn *plug_in) +{ + PlugInProcFrame *proc_frame; + + g_return_if_fail (plug_in != NULL); + + proc_frame = plug_in_get_proc_frame (plug_in); + + if (proc_frame->progress) + { + if (proc_frame->progress_cancel_id) + { + g_signal_handler_disconnect (proc_frame->progress, + proc_frame->progress_cancel_id); + proc_frame->progress_cancel_id = 0; + } + + if (gimp_progress_is_active (proc_frame->progress)) + gimp_progress_end (proc_frame->progress); + + if (proc_frame->progress_created) + { + gimp_free_progress (plug_in->gimp, proc_frame->progress); + g_object_unref (proc_frame->progress); + proc_frame->progress = NULL; + } + } +} + +void +plug_in_progress_set_text (PlugIn *plug_in, + const gchar *message) +{ + PlugInProcFrame *proc_frame; + + g_return_if_fail (plug_in != NULL); + + proc_frame = plug_in_get_proc_frame (plug_in); + + if (proc_frame->progress) + gimp_progress_set_text (proc_frame->progress, message); +} + +void +plug_in_progress_set_value (PlugIn *plug_in, + gdouble percentage) { PlugInProcFrame *proc_frame; @@ -131,48 +175,19 @@ plug_in_progress_pulse (PlugIn *plug_in) gimp_progress_pulse (proc_frame->progress); } -void -plug_in_progress_set_text (PlugIn *plug_in, - const gchar *message) +guint32 +plug_in_progress_get_window (PlugIn *plug_in) { PlugInProcFrame *proc_frame; - g_return_if_fail (plug_in != NULL); + g_return_val_if_fail (plug_in != NULL, 0); proc_frame = plug_in_get_proc_frame (plug_in); if (proc_frame->progress) - gimp_progress_set_text (proc_frame->progress, message); -} + return gimp_progress_get_window (proc_frame->progress); -void -plug_in_progress_end (PlugIn *plug_in) -{ - PlugInProcFrame *proc_frame; - - g_return_if_fail (plug_in != NULL); - - proc_frame = plug_in_get_proc_frame (plug_in); - - if (proc_frame->progress) - { - if (proc_frame->progress_cancel_id) - { - g_signal_handler_disconnect (proc_frame->progress, - proc_frame->progress_cancel_id); - proc_frame->progress_cancel_id = 0; - } - - if (gimp_progress_is_active (proc_frame->progress)) - gimp_progress_end (proc_frame->progress); - - if (proc_frame->progress_created) - { - gimp_free_progress (plug_in->gimp, proc_frame->progress); - g_object_unref (proc_frame->progress); - proc_frame->progress = NULL; - } - } + return 0; } gboolean diff --git a/app/plug-in/plug-in-progress.h b/app/plug-in/plug-in-progress.h index 110f0c7784..b14e57448b 100644 --- a/app/plug-in/plug-in-progress.h +++ b/app/plug-in/plug-in-progress.h @@ -22,25 +22,26 @@ #define __PLUG_IN_PROGRESS_H__ -void plug_in_progress_start (PlugIn *plug_in, - const gchar *message, - gint display_ID); -void plug_in_progress_update (PlugIn *plug_in, - gdouble percentage); -void plug_in_progress_pulse (PlugIn *plug_in); -void plug_in_progress_set_text (PlugIn *plug_in, - const gchar *message); -void plug_in_progress_end (PlugIn *plug_in); +void plug_in_progress_start (PlugIn *plug_in, + const gchar *message, + gint display_ID); +void plug_in_progress_end (PlugIn *plug_in); +void plug_in_progress_set_text (PlugIn *plug_in, + const gchar *message); +void plug_in_progress_set_value (PlugIn *plug_in, + gdouble percentage); +void plug_in_progress_pulse (PlugIn *plug_in); +guint32 plug_in_progress_get_window (PlugIn *plug_in); -gboolean plug_in_progress_install (PlugIn *plug_in, - const gchar *progress_callback); -gboolean plug_in_progress_uninstall (PlugIn *plug_in, - const gchar *progress_callback); -gboolean plug_in_progress_cancel (PlugIn *plug_in, - const gchar *progress_callback); +gboolean plug_in_progress_install (PlugIn *plug_in, + const gchar *progress_callback); +gboolean plug_in_progress_uninstall (PlugIn *plug_in, + const gchar *progress_callback); +gboolean plug_in_progress_cancel (PlugIn *plug_in, + const gchar *progress_callback); -void plug_in_progress_message (PlugIn *plug_in, - const gchar *message); +void plug_in_progress_message (PlugIn *plug_in, + const gchar *message); #endif /* __PLUG_IN_PROGRESS_H__ */ diff --git a/app/widgets/gimpfiledialog.c b/app/widgets/gimpfiledialog.c index fc30b5fd15..85a53c78ca 100644 --- a/app/widgets/gimpfiledialog.c +++ b/app/widgets/gimpfiledialog.c @@ -75,6 +75,7 @@ static void gimp_file_dialog_progress_set_value (GimpProgress *progress, gdouble percentage); static gdouble gimp_file_dialog_progress_get_value (GimpProgress *progress); static void gimp_file_dialog_progress_pulse (GimpProgress *progress); +static guint32 gimp_file_dialog_progress_get_window(GimpProgress *progress); static void gimp_file_dialog_add_preview (GimpFileDialog *dialog, Gimp *gimp); @@ -155,13 +156,14 @@ gimp_file_dialog_class_init (GimpFileDialogClass *klass) static void gimp_file_dialog_progress_iface_init (GimpProgressInterface *progress_iface) { - progress_iface->start = gimp_file_dialog_progress_start; - progress_iface->end = gimp_file_dialog_progress_end; - progress_iface->is_active = gimp_file_dialog_progress_is_active; - progress_iface->set_text = gimp_file_dialog_progress_set_text; - progress_iface->set_value = gimp_file_dialog_progress_set_value; - progress_iface->get_value = gimp_file_dialog_progress_get_value; - progress_iface->pulse = gimp_file_dialog_progress_pulse; + progress_iface->start = gimp_file_dialog_progress_start; + progress_iface->end = gimp_file_dialog_progress_end; + progress_iface->is_active = gimp_file_dialog_progress_is_active; + progress_iface->set_text = gimp_file_dialog_progress_set_text; + progress_iface->set_value = gimp_file_dialog_progress_set_value; + progress_iface->get_value = gimp_file_dialog_progress_get_value; + progress_iface->pulse = gimp_file_dialog_progress_pulse; + progress_iface->get_window = gimp_file_dialog_progress_get_window; } static gboolean @@ -294,6 +296,14 @@ gimp_file_dialog_progress_pulse (GimpProgress *progress) } } +static guint32 +gimp_file_dialog_progress_get_window (GimpProgress *progress) +{ + GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress); + + return (guint32) gimp_window_get_native (GTK_WINDOW (dialog)); +} + /* public functions */ diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index 13ba8cd482..36b850ec11 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -40,6 +40,14 @@ #include +#ifdef GDK_WINDOWING_WIN32 +#include +#endif + +#ifdef GDK_WINDOWING_X11 +#include +#endif + #include "libgimpbase/gimpbase.h" #include "libgimpcolor/gimpcolor.h" #include "libgimpwidgets/gimpwidgets.h" @@ -708,6 +716,40 @@ gimp_window_set_hint (GtkWindow *window, } } +/** + * gimp_window_get_native: + * @window: a #GtkWindow + * + * This function is used to pass a window handle to plug-ins so that + * they can set their dialog windows transient to the parent window. + * + * Return value: a native window handle of the window's #GdkWindow or 0 + * if the window isn't realized yet + */ +GdkNativeWindow +gimp_window_get_native (GtkWindow *window) +{ + g_return_val_if_fail (GTK_IS_WINDOW (window), 0); + +#ifdef GDK_NATIVE_WINDOW_POINTER +#ifdef __GNUC__ +#warning gimp_window_get_native() unimplementable for the target windowing system +#endif +#endif + +#ifdef GDK_WINDOWING_WIN32 + if (window && GTK_WIDGET_REALIZED (window)) + return GDK_WINDOW_HWND (GTK_WIDGET (window)->window); +#endif + +#ifdef GDK_WINDOWING_X11 + if (window && GTK_WIDGET_REALIZED (window)) + return GDK_WINDOW_XID (GTK_WIDGET (window)->window); +#endif + + return 0; +} + void gimp_dialog_set_sensitive (GtkDialog *dialog, gboolean sensitive) @@ -864,7 +906,7 @@ gimp_toggle_button_set_visible (GtkToggleButton *toggle, } #ifdef __GNUC__ -#warning FIXME: remove this function as soon as bug #141750 is fixed. +#warning FIXME: remove this function as soon as we depend on GTK >= 2.8 #endif GClosure * gimp_action_get_accel_closure (GtkAction *action) diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h index 7ca538d9b5..d2db6ff491 100644 --- a/app/widgets/gimpwidgets-utils.h +++ b/app/widgets/gimpwidgets-utils.h @@ -23,66 +23,67 @@ #define __GIMP_WIDGETS_UTILS_H__ -void gimp_menu_position (GtkMenu *menu, - gint *x, - gint *y); -void gimp_button_menu_position (GtkWidget *button, - GtkMenu *menu, - GtkPositionType position, - gint *x, - gint *y); +void gimp_menu_position (GtkMenu *menu, + gint *x, + gint *y); +void gimp_button_menu_position (GtkWidget *button, + GtkMenu *menu, + GtkPositionType position, + gint *x, + gint *y); -void gimp_table_attach_stock (GtkTable *table, - gint row, - const gchar *stock_id, - GtkWidget *widget, - gint colspan, - gboolean left_align); -void gimp_enum_radio_frame_add (GtkFrame *frame, - GtkWidget *widget, - gint enum_value); +void gimp_table_attach_stock (GtkTable *table, + gint row, + const gchar *stock_id, + GtkWidget *widget, + gint colspan, + gboolean left_align); +void gimp_enum_radio_frame_add (GtkFrame *frame, + GtkWidget *widget, + gint enum_value); -GtkIconSize gimp_get_icon_size (GtkWidget *widget, - const gchar *stock_id, - GtkIconSize max_size, - gint width, - gint height); +GtkIconSize gimp_get_icon_size (GtkWidget *widget, + const gchar *stock_id, + GtkIconSize max_size, + gint width, + gint height); -const gchar * gimp_get_mod_name_shift (void); -const gchar * gimp_get_mod_name_control (void); -const gchar * gimp_get_mod_name_alt (void); -const gchar * gimp_get_mod_separator (void); -const gchar * gimp_get_mod_string (GdkModifierType modifiers); -gchar * gimp_get_accel_string (guint key, - GdkModifierType modifiers); +const gchar * gimp_get_mod_name_shift (void); +const gchar * gimp_get_mod_name_control (void); +const gchar * gimp_get_mod_name_alt (void); +const gchar * gimp_get_mod_separator (void); +const gchar * gimp_get_mod_string (GdkModifierType modifiers); +gchar * gimp_get_accel_string (guint key, + GdkModifierType modifiers); -void gimp_get_screen_resolution (GdkScreen *screen, - gdouble *xres, - gdouble *yres); +void gimp_get_screen_resolution (GdkScreen *screen, + gdouble *xres, + gdouble *yres); -void gimp_rgb_get_gdk_color (const GimpRGB *rgb, - GdkColor *gdk_color); -void gimp_rgb_set_gdk_color (GimpRGB *rgb, - const GdkColor *gdk_color); +void gimp_rgb_get_gdk_color (const GimpRGB *rgb, + GdkColor *gdk_color); +void gimp_rgb_set_gdk_color (GimpRGB *rgb, + const GdkColor *gdk_color); -void gimp_window_set_hint (GtkWindow *window, - GimpWindowHint hint); +void gimp_window_set_hint (GtkWindow *window, + GimpWindowHint hint); +GdkNativeWindow gimp_window_get_native (GtkWindow *window); -void gimp_dialog_set_sensitive (GtkDialog *dialog, - gboolean sensitive); +void gimp_dialog_set_sensitive (GtkDialog *dialog, + gboolean sensitive); -gboolean gimp_text_buffer_load (GtkTextBuffer *buffer, - const gchar *filename, - GError **error); -gboolean gimp_text_buffer_save (GtkTextBuffer *buffer, - const gchar *filename, - gboolean selection_only, - GError **error); +gboolean gimp_text_buffer_load (GtkTextBuffer *buffer, + const gchar *filename, + GError **error); +gboolean gimp_text_buffer_save (GtkTextBuffer *buffer, + const gchar *filename, + gboolean selection_only, + GError **error); -void gimp_toggle_button_set_visible (GtkToggleButton *toggle, - GtkWidget *widget); +void gimp_toggle_button_set_visible (GtkToggleButton *toggle, + GtkWidget *widget); -GClosure * gimp_action_get_accel_closure (GtkAction *action); +GClosure * gimp_action_get_accel_closure (GtkAction *action); #endif /* __GIMP_WIDGETS_UTILS_H__ */ diff --git a/libgimp/gimp.def b/libgimp/gimp.def index 2b5b532436..f473b271f0 100644 --- a/libgimp/gimp.def +++ b/libgimp/gimp.def @@ -500,8 +500,10 @@ EXPORTS gimp_progress_cancel gimp_progress_init gimp_progress_install + gimp_progress_install_vtable gimp_progress_pulse gimp_progress_set_text + gimp_progress_get_window_handle gimp_progress_uninstall gimp_progress_update gimp_quit diff --git a/libgimp/gimpexport.c b/libgimp/gimpexport.c index 6c4d831e60..b950ba3941 100644 --- a/libgimp/gimpexport.c +++ b/libgimp/gimpexport.c @@ -393,6 +393,9 @@ confirm_save_dialog (const gchar *message, GTK_RESPONSE_CANCEL, -1); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gimp_window_set_transient (GTK_WINDOW (dialog)); + hbox = gtk_hbox_new (FALSE, 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); @@ -473,6 +476,7 @@ export_dialog (GSList *actions, -1); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gimp_window_set_transient (GTK_WINDOW (dialog)); hbox = gtk_hbox_new (FALSE, 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); diff --git a/libgimp/gimpprogress.c b/libgimp/gimpprogress.c index 742b2139f9..bcb9a63b75 100644 --- a/libgimp/gimpprogress.c +++ b/libgimp/gimpprogress.c @@ -21,6 +21,12 @@ #include "config.h" +#include + +#undef GIMP_DISABLE_DEPRECATED +#include "gimpprogress.h" +#define GIMP_DISABLE_DEPRECATED + #include "gimp.h" @@ -28,25 +34,19 @@ typedef struct _GimpProgressData GimpProgressData; struct _GimpProgressData { - gchar *progress_callback; - GimpProgressStartCallback start_callback; - GimpProgressEndCallback end_callback; - GimpProgressTextCallback text_callback; - GimpProgressValueCallback value_callback; - gpointer data; + gchar *progress_callback; + GimpProgressVtable vtable; + gpointer data; }; /* local function prototypes */ -static void gimp_temp_progress_run (const gchar *name, - gint nparams, - const GimpParam *param, - gint *nreturn_vals, - GimpParam **return_vals); -#if 0 -static gboolean gimp_temp_progress_run_idle (GimpProgressData *progress_data); -#endif +static void gimp_temp_progress_run (const gchar *name, + gint nparams, + const GimpParam *param, + gint *nreturn_vals, + GimpParam **return_vals); /* private variables */ @@ -79,6 +79,34 @@ gimp_progress_install (GimpProgressStartCallback start_callback, GimpProgressTextCallback text_callback, GimpProgressValueCallback value_callback, gpointer user_data) +{ + GimpProgressVtable vtable = { 0, }; + + g_return_val_if_fail (start_callback != NULL, NULL); + g_return_val_if_fail (end_callback != NULL, NULL); + g_return_val_if_fail (text_callback != NULL, NULL); + g_return_val_if_fail (value_callback != NULL, NULL); + + vtable.start = start_callback; + vtable.end = end_callback; + vtable.set_text = text_callback; + vtable.set_value = value_callback; + + return gimp_progress_install_vtable (&vtable, user_data); +} + +/** + * gimp_progress_install_vtable: + * @vtable: a pointer to a @GimpProgressVtable. + * @user_data: a pointer that is passed as user_data to all vtable functions. + * + * Return value: the name of the temporary procedure that's been installed + * + * Since: GIMP 2.4 + **/ +const gchar * +gimp_progress_install_vtable (const GimpProgressVtable *vtable, + gpointer user_data) { static const GimpParamDef args[] = { @@ -87,12 +115,18 @@ gimp_progress_install (GimpProgressStartCallback start_callback, { GIMP_PDB_FLOAT, "value", "" } }; + static const GimpParamDef values[] = + { + { GIMP_PDB_FLOAT, "value", "" } + }; + gchar *progress_callback; - g_return_val_if_fail (start_callback != NULL, NULL); - g_return_val_if_fail (end_callback != NULL, NULL); - g_return_val_if_fail (text_callback != NULL, NULL); - g_return_val_if_fail (value_callback != NULL, NULL); + g_return_val_if_fail (vtable != NULL, NULL); + g_return_val_if_fail (vtable->start != NULL, NULL); + g_return_val_if_fail (vtable->end != NULL, NULL); + g_return_val_if_fail (vtable->set_text != NULL, NULL); + g_return_val_if_fail (vtable->set_value != NULL, NULL); progress_callback = gimp_procedural_db_temp_name (); @@ -105,8 +139,8 @@ gimp_progress_install (GimpProgressStartCallback start_callback, NULL, "RGB*, GRAY*, INDEXED*", GIMP_TEMPORARY, - G_N_ELEMENTS (args), 0, - args, NULL, + G_N_ELEMENTS (args), G_N_ELEMENTS (values), + args, values, gimp_temp_progress_run); if (_gimp_progress_install (progress_callback)) @@ -123,10 +157,12 @@ gimp_progress_install (GimpProgressStartCallback start_callback, progress_data = g_new0 (GimpProgressData, 1); progress_data->progress_callback = progress_callback; - progress_data->start_callback = start_callback; - progress_data->end_callback = end_callback; - progress_data->text_callback = text_callback; - progress_data->value_callback = value_callback; + progress_data->vtable.start = vtable->start; + progress_data->vtable.end = vtable->end; + progress_data->vtable.set_text = vtable->set_text; + progress_data->vtable.set_value = vtable->set_value; + progress_data->vtable.pulse = vtable->pulse; + progress_data->vtable.get_window = vtable->get_window; progress_data->data = user_data; g_hash_table_insert (gimp_progress_ht, progress_callback, progress_data); @@ -224,14 +260,22 @@ gimp_temp_progress_run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpProgressData *progress_data; + *nreturn_vals = 1; + *return_vals = values; + + values[0].type = GIMP_PDB_STATUS; + values[0].data.d_status = GIMP_PDB_SUCCESS; + progress_data = g_hash_table_lookup (gimp_progress_ht, name); if (! progress_data) { g_warning ("Can't find internal progress data"); + + values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; } else { @@ -240,39 +284,46 @@ gimp_temp_progress_run (const gchar *name, switch (command) { case GIMP_PROGRESS_COMMAND_START: - progress_data->start_callback (param[1].data.d_string, - param[2].data.d_float != 0.0, - progress_data->data); + progress_data->vtable.start (param[1].data.d_string, + param[2].data.d_float != 0.0, + progress_data->data); break; case GIMP_PROGRESS_COMMAND_END: - progress_data->end_callback (progress_data->data); + progress_data->vtable.end (progress_data->data); break; case GIMP_PROGRESS_COMMAND_SET_TEXT: - progress_data->text_callback (param[1].data.d_string, - progress_data->data); + progress_data->vtable.set_text (param[1].data.d_string, + progress_data->data); break; case GIMP_PROGRESS_COMMAND_SET_VALUE: - progress_data->value_callback (param[2].data.d_float, - progress_data->data); + progress_data->vtable.set_value (param[2].data.d_float, + progress_data->data); break; case GIMP_PROGRESS_COMMAND_PULSE: - progress_data->value_callback (-1.0, - progress_data->data); + if (progress_data->vtable.pulse) + progress_data->vtable.pulse (progress_data->data); + else + progress_data->vtable.set_value (-1, progress_data->data); + break; + + case GIMP_PROGRESS_COMMAND_GET_WINDOW: + *nreturn_vals = 2; + values[1].type = GIMP_PDB_FLOAT; + + if (progress_data->vtable.get_window) + values[1].data.d_float = + (gdouble) progress_data->vtable.get_window (progress_data->data); + else + values[1].data.d_float = 0; break; default: - g_warning ("Unknown command passed to progress callback"); + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; break; } } - - *nreturn_vals = 1; - *return_vals = values; - - values[0].type = GIMP_PDB_STATUS; - values[0].data.d_status = GIMP_PDB_SUCCESS; } diff --git a/libgimp/gimpprogress.h b/libgimp/gimpprogress.h index dfcd16903d..b5ba134e46 100644 --- a/libgimp/gimpprogress.h +++ b/libgimp/gimpprogress.h @@ -25,6 +25,34 @@ G_BEGIN_DECLS +typedef struct _GimpProgressVtable GimpProgressVtable; + +struct _GimpProgressVtable +{ + void (* start) (const gchar *message, + gboolean cancelable, + gpointer user_data); + void (* end) (gpointer user_data); + void (* set_text) (const gchar *message, + gpointer user_data); + void (* set_value) (gdouble percentage, + gpointer user_data); + void (* pulse) (gpointer user_data); + + guint32 (* get_window) (gpointer user_data); + + /* Padding for future expansion. Must be initialized with NULL! */ + void (* _gimp_reserved1) (void); + void (* _gimp_reserved2) (void); + void (* _gimp_reserved3) (void); + void (* _gimp_reserved4) (void); + void (* _gimp_reserved5) (void); + void (* _gimp_reserved6) (void); + void (* _gimp_reserved7) (void); + void (* _gimp_reserved8) (void); +}; + +#ifndef GIMP_DISABLE_DEPRECATED typedef void (* GimpProgressStartCallback) (const gchar *message, gboolean cancelable, gpointer user_data); @@ -35,15 +63,19 @@ typedef void (* GimpProgressValueCallback) (gdouble percentage, gpointer user_data); -const gchar * gimp_progress_install (GimpProgressStartCallback start_callback, - GimpProgressEndCallback end_callback, - GimpProgressTextCallback text_callback, - GimpProgressValueCallback value_callback, - gpointer user_data); -gpointer gimp_progress_uninstall (const gchar *progress_callback); +const gchar * gimp_progress_install (GimpProgressStartCallback start_callback, + GimpProgressEndCallback end_callback, + GimpProgressTextCallback text_callback, + GimpProgressValueCallback value_callback, + gpointer user_data); +#endif /* GIMP_DISABLE_DEPRECATED */ -gboolean gimp_progress_set_text (const gchar *format, - ...) G_GNUC_PRINTF (1, 2); +const gchar * gimp_progress_install_vtable (const GimpProgressVtable *funcs, + gpointer user_data); +gpointer gimp_progress_uninstall (const gchar *progress_callback); + +gboolean gimp_progress_set_text (const gchar *format, + ...) G_GNUC_PRINTF (1, 2); G_END_DECLS diff --git a/libgimp/gimpprogress_pdb.c b/libgimp/gimpprogress_pdb.c index c9bf128a20..9b363ef2e3 100644 --- a/libgimp/gimpprogress_pdb.c +++ b/libgimp/gimpprogress_pdb.c @@ -153,6 +153,38 @@ _gimp_progress_set_text (const gchar *message) return success; } +/** + * gimp_progress_get_window_handle: + * + * Returns the native window ID of the toplevel window this plug-in's + * progress is displayed in. + * + * This function returns the native window ID of the toplevel window + * this plug-in\'s progress is displayed in. + * + * Returns: The progress bar's toplevel window. + * + * Since: GIMP 2.2 + */ +gint +gimp_progress_get_window_handle (void) +{ + GimpParam *return_vals; + gint nreturn_vals; + gint window = 0; + + return_vals = gimp_run_procedure ("gimp-progress-get-window-handle", + &nreturn_vals, + GIMP_PDB_END); + + if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS) + window = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return window; +} + /** * _gimp_progress_install: * @progress_callback: The callback PDB proc to call. diff --git a/libgimp/gimpprogress_pdb.h b/libgimp/gimpprogress_pdb.h index e71600922c..76d2a9b23f 100644 --- a/libgimp/gimpprogress_pdb.h +++ b/libgimp/gimpprogress_pdb.h @@ -29,13 +29,14 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -gboolean gimp_progress_init (const gchar *message); -gboolean gimp_progress_update (gdouble percentage); -gboolean gimp_progress_pulse (void); -gboolean _gimp_progress_set_text (const gchar *message); -gboolean _gimp_progress_install (const gchar *progress_callback); -gboolean _gimp_progress_uninstall (const gchar *progress_callback); -gboolean gimp_progress_cancel (const gchar *progress_callback); +gboolean gimp_progress_init (const gchar *message); +gboolean gimp_progress_update (gdouble percentage); +gboolean gimp_progress_pulse (void); +gboolean _gimp_progress_set_text (const gchar *message); +gint gimp_progress_get_window_handle (void); +gboolean _gimp_progress_install (const gchar *progress_callback); +gboolean _gimp_progress_uninstall (const gchar *progress_callback); +gboolean gimp_progress_cancel (const gchar *progress_callback); G_END_DECLS diff --git a/libgimp/gimpprogressbar.c b/libgimp/gimpprogressbar.c index 0db35244ae..f32b760b07 100644 --- a/libgimp/gimpprogressbar.c +++ b/libgimp/gimpprogressbar.c @@ -24,6 +24,14 @@ #include +#ifdef GDK_WINDOWING_WIN32 +#include +#endif + +#ifdef GDK_WINDOWING_X11 +#include +#endif + #include "gimpuitypes.h" #include "gimp.h" @@ -31,19 +39,21 @@ #include "gimpprogressbar.h" -static void gimp_progress_bar_class_init (GimpProgressBarClass *klass); -static void gimp_progress_bar_init (GimpProgressBar *bar); +static void gimp_progress_bar_class_init (GimpProgressBarClass *klass); +static void gimp_progress_bar_init (GimpProgressBar *bar); -static void gimp_progress_bar_destroy (GtkObject *object); +static void gimp_progress_bar_destroy (GtkObject *object); -static void gimp_progress_bar_start (const gchar *message, - gboolean cancelable, - gpointer user_data); -static void gimp_progress_bar_end (gpointer user_data); -static void gimp_progress_bar_set_text (const gchar *message, - gpointer user_data); -static void gimp_progress_bar_set_value (gdouble percentage, - gpointer user_data); +static void gimp_progress_bar_start (const gchar *message, + gboolean cancelable, + gpointer user_data); +static void gimp_progress_bar_end (gpointer user_data); +static void gimp_progress_bar_set_text (const gchar *message, + gpointer user_data); +static void gimp_progress_bar_set_value (gdouble percentage, + gpointer user_data); +static void gimp_progress_bar_pulse (gpointer user_data); +static guint32 gimp_progress_bar_get_window (gpointer user_data); static GtkProgressBarClass *parent_class = NULL; @@ -90,13 +100,18 @@ gimp_progress_bar_class_init (GimpProgressBarClass *klass) static void gimp_progress_bar_init (GimpProgressBar *bar) { + GimpProgressVtable vtable = { 0, }; + gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), " "); - bar->progress_callback = gimp_progress_install (gimp_progress_bar_start, - gimp_progress_bar_end, - gimp_progress_bar_set_text, - gimp_progress_bar_set_value, - bar); + vtable.start = gimp_progress_bar_start; + vtable.end = gimp_progress_bar_end; + vtable.set_text = gimp_progress_bar_set_text; + vtable.set_value = gimp_progress_bar_set_value; + vtable.pulse = gimp_progress_bar_pulse; + vtable.get_window = gimp_progress_bar_get_window; + + bar->progress_callback = gimp_progress_install_vtable (&vtable, bar); } static void @@ -170,6 +185,56 @@ gimp_progress_bar_set_value (gdouble percentage, g_main_context_iteration (NULL, TRUE); } +static void +gimp_progress_bar_pulse (gpointer user_data) +{ + GimpProgressBar *bar = GIMP_PROGRESS_BAR (user_data); + + gtk_progress_bar_pulse (GTK_PROGRESS_BAR (bar)); + + if (GTK_WIDGET_DRAWABLE (bar)) + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, TRUE); +} + +static GdkNativeWindow +gimp_window_get_native (GtkWindow *window) +{ + g_return_val_if_fail (GTK_IS_WINDOW (window), 0); + +#ifdef GDK_NATIVE_WINDOW_POINTER +#ifdef __GNUC__ +#warning gimp_window_get_native() unimplementable for the target windowing system +#endif +#endif + +#ifdef GDK_WINDOWING_WIN32 + if (window && GTK_WIDGET_REALIZED (window)) + return GDK_WINDOW_HWND (GTK_WIDGET (window)->window); +#endif + +#ifdef GDK_WINDOWING_X11 + if (window && GTK_WIDGET_REALIZED (window)) + return GDK_WINDOW_XID (GTK_WIDGET (window)->window); +#endif + + return 0; +} + +static guint32 +gimp_progress_bar_get_window (gpointer user_data) +{ + GimpProgressBar *bar = GIMP_PROGRESS_BAR (user_data); + GtkWidget *toplevel; + + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (bar)); + + if (GTK_IS_WINDOW (toplevel)) + return (guint32) gimp_window_get_native (GTK_WINDOW (toplevel)); + + return 0; +} + /** * gimp_progress_bar_new: * diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c index 8a3e4ec14e..56e12d6580 100644 --- a/libgimp/gimpui.c +++ b/libgimp/gimpui.c @@ -39,6 +39,8 @@ static void gimp_ui_help_func (const gchar *help_id, static void gimp_ensure_modules (void); static void gimp_window_transient_realized (GtkWidget *window, GdkWindow *parent); +static void gimp_window_set_transient_for (GtkWindow *window, + GdkWindow *parent); static gboolean gimp_ui_initialized = FALSE; @@ -141,11 +143,11 @@ gimp_ui_init (const gchar *prog_name, GdkWindow * gimp_ui_get_display_window (guint32 gdisp_ID) { +#ifndef GDK_NATIVE_WINDOW_POINTER GdkNativeWindow window; g_return_val_if_fail (gimp_ui_initialized, NULL); -#ifndef GDK_NATIVE_WINDOW_POINTER window = gimp_display_get_window_handle (gdisp_ID); if (window) return gdk_window_foreign_new_for_display (gdk_display_get_default (), @@ -155,6 +157,39 @@ gimp_ui_get_display_window (guint32 gdisp_ID) return NULL; } +/** + * gimp_ui_get_progress_window: + * + * Returns the #GdkWindow of the window this plug-in's progress bar is + * shown in. Use it to make plug-in dialogs transient to this window + * as explained with gdk_window_set_transient_for(). + * + * You shouldn't have to call this function directly. Use + * gimp_window_set_transient() instead. + * + * Return value: A reference to a #GdkWindow or %NULL. You should + * unref the window using g_object_unref() as soon as + * you don't need it any longer. + * + * Since: GIMP 2.4 + */ +GdkWindow * +gimp_ui_get_progress_window (void) +{ +#ifndef GDK_NATIVE_WINDOW_POINTER + GdkNativeWindow window; + + g_return_val_if_fail (gimp_ui_initialized, NULL); + + window = gimp_progress_get_window_handle (); + if (window) + return gdk_window_foreign_new_for_display (gdk_display_get_default (), + window); +#endif + + return NULL; +} + /** * gimp_window_set_transient_for_display: * @window: the #GtkWindow that should become transient @@ -165,7 +200,7 @@ gimp_ui_get_display_window (guint32 gdisp_ID) * display ID. See gdk_window_set_transient_for () for more information. * * Most of the time you will want to use the convenience function - * gimp_window_set_transient_for_default_display(). + * gimp_window_set_transient(). * * Since: GIMP 2.4 */ @@ -173,48 +208,30 @@ void gimp_window_set_transient_for_display (GtkWindow *window, guint32 gdisp_ID) { - GdkWindow *display; - g_return_if_fail (gimp_ui_initialized); g_return_if_fail (GTK_IS_WINDOW (window)); - gtk_window_set_transient_for (window, NULL); - - g_signal_handlers_disconnect_matched (window, G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, - gimp_window_transient_realized, - NULL); - - display = gimp_ui_get_display_window (gdisp_ID); - if (! display) - return; - - if (GTK_WIDGET_REALIZED (window)) - gdk_window_set_transient_for (GTK_WIDGET (window)->window, display); - - g_signal_connect_object (window, "realize", - G_CALLBACK (gimp_window_transient_realized), - display, 0); - g_object_unref (display); + gimp_window_set_transient_for (window, + gimp_ui_get_display_window (gdisp_ID)); } /** - * gimp_window_set_transient_for_default_display: + * gimp_window_set_transient: * @window: the #GtkWindow that should become transient * * Indicates to the window manager that @window is a transient dialog - * associated with the GIMP image window that the plug-in has been + * associated with the GIMP window that the plug-in has been * started from. See also gimp_window_set_transient_for_display(). * * Since: GIMP 2.4 */ void -gimp_window_set_transient_for_default_display (GtkWindow *window) +gimp_window_set_transient (GtkWindow *window) { g_return_if_fail (gimp_ui_initialized); g_return_if_fail (GTK_IS_WINDOW (window)); - gimp_window_set_transient_for_display (window, gimp_default_display ()); + gimp_window_set_transient_for (window, gimp_ui_get_progress_window ()); } @@ -254,3 +271,26 @@ gimp_window_transient_realized (GtkWidget *window, if (GTK_WIDGET_REALIZED (window)) gdk_window_set_transient_for (window->window, parent); } + +static void +gimp_window_set_transient_for (GtkWindow *window, + GdkWindow *parent) +{ + gtk_window_set_transient_for (window, NULL); + + g_signal_handlers_disconnect_matched (window, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, + gimp_window_transient_realized, + NULL); + + if (! parent) + return; + + if (GTK_WIDGET_REALIZED (window)) + gdk_window_set_transient_for (GTK_WIDGET (window)->window, parent); + + g_signal_connect_object (window, "realize", + G_CALLBACK (gimp_window_transient_realized), + parent, 0); + g_object_unref (parent); +} diff --git a/libgimp/gimpui.def b/libgimp/gimpui.def index 94f2023b26..619be3239e 100644 --- a/libgimp/gimpui.def +++ b/libgimp/gimpui.def @@ -45,5 +45,6 @@ EXPORTS gimp_progress_bar_new gimp_ui_init gimp_ui_get_display_window + gimp_ui_get_progress_window + gimp_window_set_transient gimp_window_set_transient_for_display - gimp_window_set_transient_for_default_display diff --git a/libgimp/gimpui.h b/libgimp/gimpui.h index 5306da31f6..737510a458 100644 --- a/libgimp/gimpui.h +++ b/libgimp/gimpui.h @@ -49,15 +49,15 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -void gimp_ui_init (const gchar *prog_name, - gboolean preview); +void gimp_ui_init (const gchar *prog_name, + gboolean preview); -GdkWindow * gimp_ui_get_display_window (guint32 gdisp_ID); - -void gimp_window_set_transient_for_display (GtkWindow *window, - guint32 gdisp_ID); -void gimp_window_set_transient_for_default_display (GtkWindow *window); +GdkWindow * gimp_ui_get_display_window (guint32 gdisp_ID); +GdkWindow * gimp_ui_get_progress_window (void); +void gimp_window_set_transient_for_display (GtkWindow *window, + guint32 gdisp_ID); +void gimp_window_set_transient (GtkWindow *window); G_END_DECLS diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c index ae85950187..3363f56d89 100644 --- a/libgimpbase/gimpbaseenums.c +++ b/libgimpbase/gimpbaseenums.c @@ -901,6 +901,7 @@ gimp_progress_command_get_type (void) { GIMP_PROGRESS_COMMAND_SET_TEXT, "GIMP_PROGRESS_COMMAND_SET_TEXT", "set-text" }, { GIMP_PROGRESS_COMMAND_SET_VALUE, "GIMP_PROGRESS_COMMAND_SET_VALUE", "set-value" }, { GIMP_PROGRESS_COMMAND_PULSE, "GIMP_PROGRESS_COMMAND_PULSE", "pulse" }, + { GIMP_PROGRESS_COMMAND_GET_WINDOW, "GIMP_PROGRESS_COMMAND_GET_WINDOW", "get-window" }, { 0, NULL, NULL } }; @@ -911,6 +912,7 @@ gimp_progress_command_get_type (void) { GIMP_PROGRESS_COMMAND_SET_TEXT, "GIMP_PROGRESS_COMMAND_SET_TEXT", NULL }, { GIMP_PROGRESS_COMMAND_SET_VALUE, "GIMP_PROGRESS_COMMAND_SET_VALUE", NULL }, { GIMP_PROGRESS_COMMAND_PULSE, "GIMP_PROGRESS_COMMAND_PULSE", NULL }, + { GIMP_PROGRESS_COMMAND_GET_WINDOW, "GIMP_PROGRESS_COMMAND_GET_WINDOW", NULL }, { 0, NULL, NULL } }; diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h index 9688611c79..bcb5851003 100644 --- a/libgimpbase/gimpbaseenums.h +++ b/libgimpbase/gimpbaseenums.h @@ -402,7 +402,8 @@ typedef enum GIMP_PROGRESS_COMMAND_END, GIMP_PROGRESS_COMMAND_SET_TEXT, GIMP_PROGRESS_COMMAND_SET_VALUE, - GIMP_PROGRESS_COMMAND_PULSE + GIMP_PROGRESS_COMMAND_PULSE, + GIMP_PROGRESS_COMMAND_GET_WINDOW } GimpProgressCommand; diff --git a/plug-ins/FractalExplorer/Dialogs.c b/plug-ins/FractalExplorer/Dialogs.c index 6add7816bf..d6475dfa64 100644 --- a/plug-ins/FractalExplorer/Dialogs.c +++ b/plug-ins/FractalExplorer/Dialogs.c @@ -556,7 +556,7 @@ explorer_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), diff --git a/plug-ins/Lighting/lighting_ui.c b/plug-ins/Lighting/lighting_ui.c index c749e90ec6..4af2c52b72 100644 --- a/plug-ins/Lighting/lighting_ui.c +++ b/plug-ins/Lighting/lighting_ui.c @@ -981,7 +981,7 @@ main_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (appwin)); + gimp_window_set_transient (GTK_WINDOW (appwin)); main_hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12); diff --git a/plug-ins/MapObject/mapobject_ui.c b/plug-ins/MapObject/mapobject_ui.c index a319c55273..14ab81c29e 100644 --- a/plug-ins/MapObject/mapobject_ui.c +++ b/plug-ins/MapObject/mapobject_ui.c @@ -1381,7 +1381,7 @@ main_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (appwin)); + gimp_window_set_transient (GTK_WINDOW (appwin)); main_hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12); diff --git a/plug-ins/common/AlienMap2.c b/plug-ins/common/AlienMap2.c index dc42d8b609..8be83d0199 100644 --- a/plug-ins/common/AlienMap2.c +++ b/plug-ins/common/AlienMap2.c @@ -406,7 +406,7 @@ alienmap2_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/CML_explorer.c b/plug-ins/common/CML_explorer.c index f50a9307e3..d019270e6d 100644 --- a/plug-ins/common/CML_explorer.c +++ b/plug-ins/common/CML_explorer.c @@ -1170,7 +1170,7 @@ logistic_function (CML_PARAM *param, static gint CML_explorer_dialog (void) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *hbox; GtkWidget *vbox; GtkWidget *frame; @@ -1181,27 +1181,28 @@ CML_explorer_dialog (void) gimp_ui_init (PLUG_IN_BINARY, TRUE); - dlg = gimp_dialog_new (_("Coupled-Map-Lattice Explorer"), PLUG_IN_BINARY, - NULL, 0, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("Coupled-Map-Lattice Explorer"), PLUG_IN_BINARY, + NULL, 0, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dialog)); CML_preview_defer = TRUE; hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + FALSE, FALSE, 0); gtk_widget_show (hbox); vbox = gtk_vbox_new (FALSE, 12); @@ -1520,14 +1521,14 @@ CML_explorer_dialog (void) /* Displaying preview might takes a long time. Thus, first, dialog itself * should be shown before making preview in it. */ - gtk_widget_show (dlg); + gtk_widget_show (dialog); CML_preview_defer = FALSE; preview_update (); - run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return run; } @@ -1817,22 +1818,23 @@ static void function_graph_new (GtkWidget *widget, gpointer *data) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *frame; GtkWidget *preview; - dlg = gimp_dialog_new (_("Graph of the Current Settings"), "cml_explorer", - gtk_widget_get_toplevel (widget), 0, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("Graph of the Current Settings"), "cml_explorer", + gtk_widget_get_toplevel (widget), 0, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, - NULL); + NULL); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_set_border_width (GTK_CONTAINER (frame), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame, + FALSE, FALSE, 0); gtk_widget_show (frame); preview = gtk_drawing_area_new (); @@ -1842,11 +1844,11 @@ function_graph_new (GtkWidget *widget, g_signal_connect (preview, "expose-event", G_CALLBACK (function_graph_expose), data); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - gimp_dialog_run (GIMP_DIALOG (dlg)); + gimp_dialog_run (GIMP_DIALOG (dialog)); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); } static void @@ -2078,23 +2080,23 @@ static gboolean force_overwrite (const gchar *filename, GtkWidget *parent) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *label; GtkWidget *hbox; gchar *buffer; gboolean overwrite; - dlg = gimp_dialog_new (_("CML Explorer: Overwrite File?"), "cml_explorer", - parent, GTK_DIALOG_MODAL, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("CML Explorer: Overwrite File?"), "cml_explorer", + parent, GTK_DIALOG_MODAL, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 12); gtk_widget_show (hbox); @@ -2107,11 +2109,11 @@ force_overwrite (const gchar *filename, gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 12); gtk_widget_show (label); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - overwrite = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + overwrite = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return overwrite; } @@ -2165,8 +2167,8 @@ CML_load_from_file_callback (GtkWidget *widget, static void CML_load_from_file_response (GtkWidget *dialog, - gint response_id, - gpointer data) + gint response_id, + gpointer data) { if (response_id == GTK_RESPONSE_OK) { diff --git a/plug-ins/common/align_layers.c b/plug-ins/common/align_layers.c index 62c7f8fa6c..1e7c253a06 100644 --- a/plug-ins/common/align_layers.c +++ b/plug-ins/common/align_layers.c @@ -74,7 +74,8 @@ static void align_layers_get_align_offsets (gint32 drawable_id, gint *x, gint *y); -static gint align_layers_dialog (void); +static gint align_layers_dialog (void); + GimpPlugInInfo PLUG_IN_INFO = { @@ -384,7 +385,7 @@ align_layers_get_align_offsets (gint32 drawable_id, static int align_layers_dialog (void) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *table; GtkWidget *combo; GtkWidget *toggle; @@ -393,27 +394,27 @@ align_layers_dialog (void) gimp_ui_init (PLUG_IN_BINARY, FALSE); - dlg = gimp_dialog_new (_("Align Visible Layers"), PLUG_IN_BINARY, - NULL, 0, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("Align Visible Layers"), PLUG_IN_BINARY, + NULL, 0, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dialog)); table = gtk_table_new (7, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_container_set_border_width (GTK_CONTAINER (table), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table, + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); @@ -508,11 +509,11 @@ align_layers_dialog (void) G_CALLBACK (gimp_toggle_button_update), &VALS.base_is_bottom_layer); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return run; } diff --git a/plug-ins/common/animationplay.c b/plug-ins/common/animationplay.c index 41e6939365..a0ac325daf 100644 --- a/plug-ins/common/animationplay.c +++ b/plug-ins/common/animationplay.c @@ -417,7 +417,7 @@ build_dialog (GimpImageBaseType basetype, g_free (windowname); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); g_signal_connect (dlg, "response", G_CALLBACK (window_response), diff --git a/plug-ins/common/apply_lens.c b/plug-ins/common/apply_lens.c index 8936415db8..363de27ea2 100644 --- a/plug-ins/common/apply_lens.c +++ b/plug-ins/common/apply_lens.c @@ -405,7 +405,7 @@ lens_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/blinds.c b/plug-ins/common/blinds.c index 93eb6d91c3..424eee6b43 100644 --- a/plug-ins/common/blinds.c +++ b/plug-ins/common/blinds.c @@ -241,7 +241,7 @@ blinds_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/borderaverage.c b/plug-ins/common/borderaverage.c index cdb4cb93a1..5129689654 100644 --- a/plug-ins/common/borderaverage.c +++ b/plug-ins/common/borderaverage.c @@ -362,7 +362,7 @@ borderaverage_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/bumpmap.c b/plug-ins/common/bumpmap.c index 59067893f8..7af28d2a93 100644 --- a/plug-ins/common/bumpmap.c +++ b/plug-ins/common/bumpmap.c @@ -845,7 +845,7 @@ bumpmap_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); paned = gtk_hpaned_new (); gtk_container_set_border_width (GTK_CONTAINER (paned), 12); diff --git a/plug-ins/common/cartoon.c b/plug-ins/common/cartoon.c index 2415215d3e..707a84fd11 100644 --- a/plug-ins/common/cartoon.c +++ b/plug-ins/common/cartoon.c @@ -822,7 +822,7 @@ cartoon_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/ccanalyze.c b/plug-ins/common/ccanalyze.c index 46b6a9901a..344bbeb756 100644 --- a/plug-ins/common/ccanalyze.c +++ b/plug-ins/common/ccanalyze.c @@ -365,7 +365,7 @@ doDialog (void) NULL); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/channel_mixer.c b/plug-ins/common/channel_mixer.c index 1846d20cdd..16de87b720 100644 --- a/plug-ins/common/channel_mixer.c +++ b/plug-ins/common/channel_mixer.c @@ -503,7 +503,7 @@ cm_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/checkerboard.c b/plug-ins/common/checkerboard.c index 663161b9f1..8201e3d5c1 100644 --- a/plug-ins/common/checkerboard.c +++ b/plug-ins/common/checkerboard.c @@ -356,7 +356,7 @@ checkerboard_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/colorify.c b/plug-ins/common/colorify.c index 02733ba5ee..c82764ca64 100644 --- a/plug-ins/common/colorify.c +++ b/plug-ins/common/colorify.c @@ -269,7 +269,7 @@ colorify_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/colortoalpha.c b/plug-ins/common/colortoalpha.c index ca0224e370..10310ebfd4 100644 --- a/plug-ins/common/colortoalpha.c +++ b/plug-ins/common/colortoalpha.c @@ -390,7 +390,7 @@ color_to_alpha_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index d4dce0edf3..432511cd5b 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -1288,7 +1288,7 @@ compose_dialog (const gchar *compose_type, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); /* parameter settings */ hbox = gtk_hbox_new (FALSE, 12); diff --git a/plug-ins/common/convmatrix.c b/plug-ins/common/convmatrix.c index b8fcd1abc8..61bb9fdd0b 100644 --- a/plug-ins/common/convmatrix.c +++ b/plug-ins/common/convmatrix.c @@ -885,7 +885,7 @@ convmatrix_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/cubism.c b/plug-ins/common/cubism.c index 8e9302fbb9..dcd2ae6e89 100644 --- a/plug-ins/common/cubism.c +++ b/plug-ins/common/cubism.c @@ -280,7 +280,7 @@ cubism_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/curve_bend.c b/plug-ins/common/curve_bend.c index 8791fcac52..6f5619c07e 100644 --- a/plug-ins/common/curve_bend.c +++ b/plug-ins/common/curve_bend.c @@ -1249,7 +1249,7 @@ bender_new_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (cd->shell)); + gimp_window_set_transient (GTK_WINDOW (cd->shell)); g_signal_connect (cd->shell, "response", G_CALLBACK (bender_response), diff --git a/plug-ins/common/decompose.c b/plug-ins/common/decompose.c index d4367b011f..03027317e3 100644 --- a/plug-ins/common/decompose.c +++ b/plug-ins/common/decompose.c @@ -1238,7 +1238,7 @@ decompose_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/deinterlace.c b/plug-ins/common/deinterlace.c index 3754a3670b..71bb0a27e2 100644 --- a/plug-ins/common/deinterlace.c +++ b/plug-ins/common/deinterlace.c @@ -338,7 +338,7 @@ deinterlace_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/depthmerge.c b/plug-ins/common/depthmerge.c index 2657419c9f..d3139a3626 100644 --- a/plug-ins/common/depthmerge.c +++ b/plug-ins/common/depthmerge.c @@ -638,7 +638,7 @@ DepthMerge_dialog (DepthMerge *dm) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/despeckle.c b/plug-ins/common/despeckle.c index 6252fcd07a..926a7dba3c 100644 --- a/plug-ins/common/despeckle.c +++ b/plug-ins/common/despeckle.c @@ -404,7 +404,7 @@ despeckle_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/destripe.c b/plug-ins/common/destripe.c index 768e897144..7bf22f9ffe 100644 --- a/plug-ins/common/destripe.c +++ b/plug-ins/common/destripe.c @@ -449,7 +449,7 @@ destripe_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/diffraction.c b/plug-ins/common/diffraction.c index 06bd82600d..bc9cc6864f 100644 --- a/plug-ins/common/diffraction.c +++ b/plug-ins/common/diffraction.c @@ -445,7 +445,7 @@ diffraction_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); diff --git a/plug-ins/common/displace.c b/plug-ins/common/displace.c index ab098cea95..89cd5055aa 100644 --- a/plug-ins/common/displace.c +++ b/plug-ins/common/displace.c @@ -324,7 +324,7 @@ displace_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/dog.c b/plug-ins/common/dog.c index 2df08915c3..5ecebde021 100755 --- a/plug-ins/common/dog.c +++ b/plug-ins/common/dog.c @@ -287,7 +287,7 @@ dog_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/edge.c b/plug-ins/common/edge.c index d2af195a92..2f83920946 100644 --- a/plug-ins/common/edge.c +++ b/plug-ins/common/edge.c @@ -655,7 +655,7 @@ edge_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/emboss.c b/plug-ins/common/emboss.c index fc5fca20d8..58766de233 100644 --- a/plug-ins/common/emboss.c +++ b/plug-ins/common/emboss.c @@ -462,7 +462,7 @@ emboss_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/engrave.c b/plug-ins/common/engrave.c index 6208008913..45ab594786 100644 --- a/plug-ins/common/engrave.c +++ b/plug-ins/common/engrave.c @@ -222,7 +222,7 @@ engrave_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/exchange.c b/plug-ins/common/exchange.c index 2a583c9d1c..7d96582d6e 100644 --- a/plug-ins/common/exchange.c +++ b/plug-ins/common/exchange.c @@ -299,7 +299,7 @@ exchange_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); /* do some boxes here */ main_vbox = gtk_vbox_new (FALSE, 12); diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c index 80adeabf11..998cf55757 100644 --- a/plug-ins/common/film.c +++ b/plug-ins/common/film.c @@ -1457,7 +1457,7 @@ film_dialog (gint32 image_ID) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/flarefx.c b/plug-ins/common/flarefx.c index b0af8b7a85..aa61a26cad 100644 --- a/plug-ins/common/flarefx.c +++ b/plug-ins/common/flarefx.c @@ -320,7 +320,7 @@ flare_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/fp.c b/plug-ins/common/fp.c index 0d5ca7b597..48d7c59743 100644 --- a/plug-ins/common/fp.c +++ b/plug-ins/common/fp.c @@ -1193,7 +1193,7 @@ fp_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); g_signal_connect (dlg, "response", G_CALLBACK (fp_response), diff --git a/plug-ins/common/fractaltrace.c b/plug-ins/common/fractaltrace.c index 98544c8fef..aaf95b621f 100644 --- a/plug-ins/common/fractaltrace.c +++ b/plug-ins/common/fractaltrace.c @@ -698,7 +698,7 @@ dialog_show (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); mainbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (mainbox), 12); diff --git a/plug-ins/common/gauss.c b/plug-ins/common/gauss.c index a792e3706c..b034065694 100644 --- a/plug-ins/common/gauss.c +++ b/plug-ins/common/gauss.c @@ -477,7 +477,7 @@ gauss_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/gif.c b/plug-ins/common/gif.c index 3a3807bcda..6b4fbc0d3a 100644 --- a/plug-ins/common/gif.c +++ b/plug-ins/common/gif.c @@ -1193,30 +1193,33 @@ save_image (const gchar *filename, static gboolean badbounds_dialog (void) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *label; GtkWidget *vbox; gboolean crop; - dlg = gimp_dialog_new (_("GIF Warning"), "gif_warning", - NULL, 0, - gimp_standard_help_func, "file-gif-save", + dialog = gimp_dialog_new (_("GIF Warning"), "gif_warning", + NULL, 0, + gimp_standard_help_func, "file-gif-save", - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gimp_window_set_transient (GTK_WINDOW (dialog)); + /* the warning message */ vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0); gtk_widget_show (vbox); label= gtk_label_new (_("The image which you are trying to save as a GIF\n" @@ -1228,11 +1231,11 @@ badbounds_dialog (void) gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); gtk_widget_show (label); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - crop = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + crop = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return crop; } @@ -1241,7 +1244,7 @@ badbounds_dialog (void) static gint save_dialog (gint32 image_ID) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *main_vbox; GtkWidget *toggle; GtkWidget *label; @@ -1263,23 +1266,25 @@ save_dialog (gint32 image_ID) gimp_image_get_layers (image_ID, &nlayers); - dlg = gimp_dialog_new (_("Save as GIF"), PLUG_IN_BINARY, - NULL, 0, - gimp_standard_help_func, SAVE_PROC, + dialog = gimp_dialog_new (_("Save as GIF"), PLUG_IN_BINARY, + NULL, 0, + gimp_standard_help_func, SAVE_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); + gimp_window_set_transient (GTK_WINDOW (dialog)); + main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), main_vbox); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox); gtk_widget_show (main_vbox); /* regular gif parameter settings */ @@ -1460,11 +1465,11 @@ save_dialog (gint32 image_ID) gtk_widget_set_sensitive (frame, FALSE); gtk_widget_show (frame); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return run; } diff --git a/plug-ins/common/glasstile.c b/plug-ins/common/glasstile.c index 80393fddbf..a8bdb5706f 100644 --- a/plug-ins/common/glasstile.c +++ b/plug-ins/common/glasstile.c @@ -263,7 +263,7 @@ glasstile_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/gqbist.c b/plug-ins/common/gqbist.c index 0944a33f76..1ed0742706 100644 --- a/plug-ins/common/gqbist.c +++ b/plug-ins/common/gqbist.c @@ -800,7 +800,7 @@ dialog_run (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/grid.c b/plug-ins/common/grid.c index 7405ab4143..ece3a91ca6 100644 --- a/plug-ins/common/grid.c +++ b/plug-ins/common/grid.c @@ -646,7 +646,7 @@ dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); /* Get the image resolution and unit */ gimp_image_get_resolution (image_ID, &xres, &yres); diff --git a/plug-ins/common/hot.c b/plug-ins/common/hot.c index 39417404f8..1244f4a27a 100644 --- a/plug-ins/common/hot.c +++ b/plug-ins/common/hot.c @@ -581,7 +581,7 @@ pluginCoreIA (piArgs *argp) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); diff --git a/plug-ins/common/illusion.c b/plug-ins/common/illusion.c index 3a2a51f500..e01ed3403c 100644 --- a/plug-ins/common/illusion.c +++ b/plug-ins/common/illusion.c @@ -402,7 +402,7 @@ illusion_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/iwarp.c b/plug-ins/common/iwarp.c index c6675f46ea..352aafd1ad 100644 --- a/plug-ins/common/iwarp.c +++ b/plug-ins/common/iwarp.c @@ -1164,7 +1164,7 @@ iwarp_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); g_signal_connect (dlg, "response", G_CALLBACK (iwarp_response), diff --git a/plug-ins/common/jigsaw.c b/plug-ins/common/jigsaw.c index 6ef483040d..92e3c4970e 100644 --- a/plug-ins/common/jigsaw.c +++ b/plug-ins/common/jigsaw.c @@ -2432,7 +2432,7 @@ jigsaw_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/lic.c b/plug-ins/common/lic.c index eeb0bdc27d..8703b1bdbf 100644 --- a/plug-ins/common/lic.c +++ b/plug-ins/common/lic.c @@ -653,7 +653,7 @@ create_main_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c index dddc67b65f..3318a92579 100644 --- a/plug-ins/common/mail.c +++ b/plug-ins/common/mail.c @@ -519,7 +519,7 @@ save_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/mapcolor.c b/plug-ins/common/mapcolor.c index eaf3b712fe..bedeec4a9f 100644 --- a/plug-ins/common/mapcolor.c +++ b/plug-ins/common/mapcolor.c @@ -366,7 +366,7 @@ mapcolor_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/max_rgb.c b/plug-ins/common/max_rgb.c index 418e90b130..51eef4de31 100644 --- a/plug-ins/common/max_rgb.c +++ b/plug-ins/common/max_rgb.c @@ -276,7 +276,7 @@ max_rgb_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/mblur.c b/plug-ins/common/mblur.c index 2c5a387c70..9cbeaf99e3 100644 --- a/plug-ins/common/mblur.c +++ b/plug-ins/common/mblur.c @@ -921,7 +921,7 @@ mblur_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/mosaic.c b/plug-ins/common/mosaic.c index 41faa68e05..3003f6acc8 100644 --- a/plug-ins/common/mosaic.c +++ b/plug-ins/common/mosaic.c @@ -595,7 +595,7 @@ mosaic_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/neon.c b/plug-ins/common/neon.c index 2d94c60e14..63cf1a4913 100644 --- a/plug-ins/common/neon.c +++ b/plug-ins/common/neon.c @@ -713,7 +713,7 @@ neon_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/newsprint.c b/plug-ins/common/newsprint.c index 2d13e32c23..b17b5a14be 100644 --- a/plug-ins/common/newsprint.c +++ b/plug-ins/common/newsprint.c @@ -1201,7 +1201,7 @@ newsprint_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); paned = gtk_hpaned_new (); gtk_container_set_border_width (GTK_CONTAINER (paned), 12); diff --git a/plug-ins/common/nlfilt.c b/plug-ins/common/nlfilt.c index 1ee0dcbad8..96f2dc17cb 100644 --- a/plug-ins/common/nlfilt.c +++ b/plug-ins/common/nlfilt.c @@ -1029,7 +1029,7 @@ nlfilter_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/noisify.c b/plug-ins/common/noisify.c index edcf720ac3..f0c444f039 100644 --- a/plug-ins/common/noisify.c +++ b/plug-ins/common/noisify.c @@ -459,7 +459,7 @@ noisify_dialog (GimpDrawable *drawable, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/nova.c b/plug-ins/common/nova.c index 8b131a430e..98f1b34025 100644 --- a/plug-ins/common/nova.c +++ b/plug-ins/common/nova.c @@ -316,7 +316,7 @@ nova_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/oilify.c b/plug-ins/common/oilify.c index 7b8dda26ba..7da94f7fbb 100644 --- a/plug-ins/common/oilify.c +++ b/plug-ins/common/oilify.c @@ -486,7 +486,7 @@ oilify_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/papertile.c b/plug-ins/common/papertile.c index 37f51cf303..59b35df2ba 100644 --- a/plug-ins/common/papertile.c +++ b/plug-ins/common/papertile.c @@ -245,7 +245,7 @@ open_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12); diff --git a/plug-ins/common/photocopy.c b/plug-ins/common/photocopy.c index c00f64b05b..73290549cb 100644 --- a/plug-ins/common/photocopy.c +++ b/plug-ins/common/photocopy.c @@ -851,7 +851,7 @@ photocopy_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/pixelize.c b/plug-ins/common/pixelize.c index f4a558d3ea..e1cb3b9ca2 100644 --- a/plug-ins/common/pixelize.c +++ b/plug-ins/common/pixelize.c @@ -325,7 +325,7 @@ pixelize_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/plasma.c b/plug-ins/common/plasma.c index aa1d9eeaac..622adf83eb 100644 --- a/plug-ins/common/plasma.c +++ b/plug-ins/common/plasma.c @@ -314,7 +314,7 @@ plasma_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/polar.c b/plug-ins/common/polar.c index 0de5fe1030..1864cd616f 100644 --- a/plug-ins/common/polar.c +++ b/plug-ins/common/polar.c @@ -594,7 +594,7 @@ polarize_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/randomize.c b/plug-ins/common/randomize.c index bcddf9ad90..bb681b530d 100644 --- a/plug-ins/common/randomize.c +++ b/plug-ins/common/randomize.c @@ -735,7 +735,7 @@ randomize_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); table = gtk_table_new (3, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); diff --git a/plug-ins/common/retinex.c b/plug-ins/common/retinex.c index 68425434a8..329e015924 100644 --- a/plug-ins/common/retinex.c +++ b/plug-ins/common/retinex.c @@ -302,7 +302,7 @@ retinex_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/ripple.c b/plug-ins/common/ripple.c index f7fedd2f0d..6303b4253e 100644 --- a/plug-ins/common/ripple.c +++ b/plug-ins/common/ripple.c @@ -484,7 +484,7 @@ ripple_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); /* The main vbox */ main_vbox = gtk_vbox_new (FALSE, 12); diff --git a/plug-ins/common/sample_colorize.c b/plug-ins/common/sample_colorize.c index 864fb35100..476d587443 100644 --- a/plug-ins/common/sample_colorize.c +++ b/plug-ins/common/sample_colorize.c @@ -1330,7 +1330,7 @@ smp_dialog (void) GTK_RESPONSE_CLOSE, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); g_signal_connect (dialog, "response", G_CALLBACK (smp_response_callback), diff --git a/plug-ins/common/scatter_hsv.c b/plug-ins/common/scatter_hsv.c index dbf52064da..b63ea36c3f 100644 --- a/plug-ins/common/scatter_hsv.c +++ b/plug-ins/common/scatter_hsv.c @@ -365,7 +365,7 @@ scatter_hsv_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/sel_gauss.c b/plug-ins/common/sel_gauss.c index 17a9ca20e0..2362aceb8b 100644 --- a/plug-ins/common/sel_gauss.c +++ b/plug-ins/common/sel_gauss.c @@ -237,7 +237,7 @@ sel_gauss_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/sharpen.c b/plug-ins/common/sharpen.c index 04b63c5c70..f8ed4de874 100644 --- a/plug-ins/common/sharpen.c +++ b/plug-ins/common/sharpen.c @@ -489,7 +489,7 @@ sharpen_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/shift.c b/plug-ins/common/shift.c index 2623ea8cc7..73452f1c6b 100644 --- a/plug-ins/common/shift.c +++ b/plug-ins/common/shift.c @@ -368,7 +368,7 @@ shift_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/sinus.c b/plug-ins/common/sinus.c index 859ca7aada..c3ef775364 100644 --- a/plug-ins/common/sinus.c +++ b/plug-ins/common/sinus.c @@ -659,7 +659,7 @@ sinus_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); main_hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12); diff --git a/plug-ins/common/smooth_palette.c b/plug-ins/common/smooth_palette.c index f1e45d1a71..7ab405f18a 100644 --- a/plug-ins/common/smooth_palette.c +++ b/plug-ins/common/smooth_palette.c @@ -423,7 +423,7 @@ dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); image_id = gimp_drawable_get_image (drawable->drawable_id); unit = gimp_image_get_unit (image_id); diff --git a/plug-ins/common/snoise.c b/plug-ins/common/snoise.c index 72bb69d424..8d12109f95 100644 --- a/plug-ins/common/snoise.c +++ b/plug-ins/common/snoise.c @@ -590,7 +590,7 @@ solid_noise_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/sobel.c b/plug-ins/common/sobel.c index e4ce7270eb..76b0aba120 100644 --- a/plug-ins/common/sobel.c +++ b/plug-ins/common/sobel.c @@ -240,7 +240,7 @@ sobel_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/softglow.c b/plug-ins/common/softglow.c index f072e0d2f1..36dfdd0e06 100644 --- a/plug-ins/common/softglow.c +++ b/plug-ins/common/softglow.c @@ -642,7 +642,7 @@ softglow_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/sparkle.c b/plug-ins/common/sparkle.c index e4f5ca04f1..6b58a7f355 100644 --- a/plug-ins/common/sparkle.c +++ b/plug-ins/common/sparkle.c @@ -351,7 +351,7 @@ sparkle_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/spheredesigner.c b/plug-ins/common/spheredesigner.c index 6b28579282..5c0f58b017 100644 --- a/plug-ins/common/spheredesigner.c +++ b/plug-ins/common/spheredesigner.c @@ -2519,7 +2519,7 @@ makewindow (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (window)); + gimp_window_set_transient (GTK_WINDOW (window)); g_signal_connect (window, "response", G_CALLBACK (sphere_response), diff --git a/plug-ins/common/spread.c b/plug-ins/common/spread.c index 99bd8b595a..f9e8bc66d7 100644 --- a/plug-ins/common/spread.c +++ b/plug-ins/common/spread.c @@ -358,7 +358,7 @@ spread_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/struc.c b/plug-ins/common/struc.c index d74adc47f5..8559be7540 100644 --- a/plug-ins/common/struc.c +++ b/plug-ins/common/struc.c @@ -1276,7 +1276,7 @@ struc_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/threshold_alpha.c b/plug-ins/common/threshold_alpha.c index 4425166d96..e9f29fc31c 100644 --- a/plug-ins/common/threshold_alpha.c +++ b/plug-ins/common/threshold_alpha.c @@ -259,7 +259,7 @@ threshold_alpha_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/tile.c b/plug-ins/common/tile.c index efd4a45ce0..5ee92c1dfa 100644 --- a/plug-ins/common/tile.c +++ b/plug-ins/common/tile.c @@ -405,7 +405,7 @@ tile_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/tileit.c b/plug-ins/common/tileit.c index 6786d8226b..4a5e25cab7 100644 --- a/plug-ins/common/tileit.c +++ b/plug-ins/common/tileit.c @@ -375,7 +375,7 @@ tileit_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/unsharp.c b/plug-ins/common/unsharp.c index 492a6435a2..16904606ee 100644 --- a/plug-ins/common/unsharp.c +++ b/plug-ins/common/unsharp.c @@ -643,7 +643,7 @@ unsharp_mask_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/video.c b/plug-ins/common/video.c index 7963d64058..0ffc4d778a 100644 --- a/plug-ins/common/video.c +++ b/plug-ins/common/video.c @@ -2028,7 +2028,7 @@ video_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); diff --git a/plug-ins/common/vpropagate.c b/plug-ins/common/vpropagate.c index a7e15fb8ad..cf6f307bd3 100644 --- a/plug-ins/common/vpropagate.c +++ b/plug-ins/common/vpropagate.c @@ -1064,7 +1064,7 @@ vpropagate_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/warp.c b/plug-ins/common/warp.c index 4935a966ba..a75b963b0a 100644 --- a/plug-ins/common/warp.c +++ b/plug-ins/common/warp.c @@ -403,7 +403,7 @@ warp_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dlg)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/common/waves.c b/plug-ins/common/waves.c index a719b81f70..cb694d63f7 100644 --- a/plug-ins/common/waves.c +++ b/plug-ins/common/waves.c @@ -257,7 +257,7 @@ waves_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/whirlpinch.c b/plug-ins/common/whirlpinch.c index 58d3c20efa..2583e18ab6 100644 --- a/plug-ins/common/whirlpinch.c +++ b/plug-ins/common/whirlpinch.c @@ -541,7 +541,7 @@ whirl_pinch_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/common/wind.c b/plug-ins/common/wind.c index 0cb9407b32..605ff3cf20 100644 --- a/plug-ins/common/wind.c +++ b/plug-ins/common/wind.c @@ -892,7 +892,7 @@ dialog_box (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); diff --git a/plug-ins/flame/flame.c b/plug-ins/flame/flame.c index c4650bcd15..5fdee79dd6 100644 --- a/plug-ins/flame/flame.c +++ b/plug-ins/flame/flame.c @@ -70,7 +70,7 @@ static void run (const gchar *name, GimpParam **return_vals); static void flame (GimpDrawable *drawable); -static gboolean dialog (void); +static gboolean flame_dialog (void); static void set_flame_preview (void); static void load_callback (GtkWidget *widget, gpointer data); @@ -86,13 +86,13 @@ static gchar buffer[BUFFER_SIZE]; static GtkWidget *cmap_preview; static GtkWidget *flame_preview; static gint preview_width, preview_height; -static GtkWidget *dlg; +static GtkWidget *dialog; static GtkWidget *load_button = NULL; static GtkWidget *save_button = NULL; -static GtkWidget *file_dlg = NULL; +static GtkWidget *file_dialog = NULL; static gint load_save; -static GtkWidget *edit_dlg = NULL; +static GtkWidget *edit_dialog = NULL; static control_point edit_cp; static control_point mutants[NMUTANTS]; @@ -203,7 +203,7 @@ run (const gchar *name, if (run_mode == GIMP_RUN_INTERACTIVE) { - if (! dialog ()) + if (! flame_dialog ()) { gimp_drawable_detach (drawable); @@ -429,7 +429,7 @@ file_response_callback (GtkFileChooser *chooser, /* i want to update the existing dialogue, but it's too painful */ gimp_set_data ("plug_in_flame", &config, sizeof (config)); - /* gtk_widget_destroy(dlg); */ + /* gtk_widget_destroy(dialog); */ set_flame_preview (); set_edit_preview (); } @@ -462,35 +462,35 @@ file_response_callback (GtkFileChooser *chooser, } static void -make_file_dlg (const gchar *title, - GtkWidget *parent) +make_file_dialog (const gchar *title, + GtkWidget *parent) { - file_dlg = gtk_file_chooser_dialog_new (title, GTK_WINDOW (parent), - load_save ? - GTK_FILE_CHOOSER_ACTION_OPEN : - GTK_FILE_CHOOSER_ACTION_SAVE, + file_dialog = gtk_file_chooser_dialog_new (title, GTK_WINDOW (parent), + load_save ? + GTK_FILE_CHOOSER_ACTION_OPEN : + GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_STOCK_CANCEL, - load_save ? - GTK_STOCK_OPEN : GTK_STOCK_SAVE, - GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_STOCK_CANCEL, + load_save ? + GTK_STOCK_OPEN : GTK_STOCK_SAVE, + GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (file_dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (file_dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - g_object_add_weak_pointer (G_OBJECT (file_dlg), (gpointer) &file_dlg); + g_object_add_weak_pointer (G_OBJECT (file_dialog), (gpointer) &file_dialog); - gtk_dialog_set_default_response (GTK_DIALOG (file_dlg), GTK_RESPONSE_OK); - gtk_window_set_destroy_with_parent (GTK_WINDOW (file_dlg), TRUE); + gtk_dialog_set_default_response (GTK_DIALOG (file_dialog), GTK_RESPONSE_OK); + gtk_window_set_destroy_with_parent (GTK_WINDOW (file_dialog), TRUE); - g_signal_connect (file_dlg, "delete-event", + g_signal_connect (file_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); - g_signal_connect (file_dlg, "response", + g_signal_connect (file_dialog, "response", G_CALLBACK (file_response_callback), NULL); } @@ -625,7 +625,7 @@ edit_callback (GtkWidget *widget, { edit_cp = config.cp; - if (edit_dlg == NULL) + if (edit_dialog == NULL) { GtkWidget *main_vbox; GtkWidget *frame; @@ -638,27 +638,27 @@ edit_callback (GtkWidget *widget, GtkObject *adj; gint i, j; - edit_dlg = gimp_dialog_new (_("Edit Flame"), "flame", - parent, GTK_DIALOG_DESTROY_WITH_PARENT, - gimp_standard_help_func, PLUG_IN_PROC, + edit_dialog = gimp_dialog_new (_("Edit Flame"), "flame", + parent, GTK_DIALOG_DESTROY_WITH_PARENT, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (edit_dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (edit_dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - g_signal_connect (edit_dlg, "response", + g_signal_connect (edit_dialog, "response", G_CALLBACK (edit_response), - edit_dlg); + edit_dialog); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_dlg)->vbox), main_vbox, + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_dialog)->vbox), main_vbox, FALSE, FALSE, 0); frame = gimp_frame_new (_("Directions")); @@ -770,37 +770,37 @@ edit_callback (GtkWidget *widget, set_edit_preview (); - gtk_window_present (GTK_WINDOW (edit_dlg)); + gtk_window_present (GTK_WINDOW (edit_dialog)); } static void load_callback (GtkWidget *widget, gpointer data) { - if (! file_dlg) + if (! file_dialog) { load_save = 1; - make_file_dlg (_("Load Flame"), gtk_widget_get_toplevel (widget)); + make_file_dialog (_("Load Flame"), gtk_widget_get_toplevel (widget)); gtk_widget_set_sensitive (save_button, FALSE); } - gtk_window_present (GTK_WINDOW (file_dlg)); + gtk_window_present (GTK_WINDOW (file_dialog)); } static void save_callback (GtkWidget *widget, gpointer data) { - if (! file_dlg) + if (! file_dialog) { load_save = 0; - make_file_dlg (_("Save Flame"), gtk_widget_get_toplevel (widget)); + make_file_dialog (_("Save Flame"), gtk_widget_get_toplevel (widget)); gtk_widget_set_sensitive (load_button, FALSE); } - gtk_window_present (GTK_WINDOW (file_dlg)); + gtk_window_present (GTK_WINDOW (file_dialog)); } static void @@ -922,7 +922,7 @@ cmap_constrain (gint32 image_id, static gboolean -dialog (void) +flame_dialog (void) { GtkWidget *main_vbox; GtkWidget *notebook; @@ -937,25 +937,25 @@ dialog (void) gimp_ui_init ("flame", TRUE); - dlg = gimp_dialog_new (_("Flame"), "flame", - NULL, 0, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("Flame"), "flame", + NULL, 0, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dialog)); main_vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), main_vbox, + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_vbox, FALSE, FALSE, 0); gtk_widget_show (main_vbox); @@ -1013,7 +1013,7 @@ dialog (void) g_signal_connect (button, "clicked", G_CALLBACK (edit_callback), - dlg); + dialog); load_button = button = gtk_button_new_from_stock (GTK_STOCK_OPEN); gtk_box_pack_start (GTK_BOX (vbbox), button, FALSE, FALSE, 0); @@ -1249,11 +1249,11 @@ dialog (void) set_flame_preview (); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return run; } diff --git a/plug-ins/gimpressionist/gimpressionist.c b/plug-ins/gimpressionist/gimpressionist.c index ca6e5724c8..b7f27bf5b8 100644 --- a/plug-ins/gimpressionist/gimpressionist.c +++ b/plug-ins/gimpressionist/gimpressionist.c @@ -28,7 +28,7 @@ #define RESPONSE_ABOUT 1 -static GtkWidget *dlg = NULL; +static GtkWidget *dialog = NULL; void store_values (void) @@ -193,34 +193,34 @@ create_dialog (void) gimp_ui_init ("gimpressionist", TRUE); - dlg = gimp_dialog_new (_("Gimpressionist"), "gimpressionist", - NULL, 0, - gimp_standard_help_func, HELP_ID, + dialog = gimp_dialog_new (_("Gimpressionist"), "gimpressionist", + NULL, 0, + gimp_standard_help_func, HELP_ID, - _("A_bout"), RESPONSE_ABOUT, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + _("A_bout"), RESPONSE_ABOUT, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), RESPONSE_ABOUT, GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dialog)); - g_signal_connect (dlg, "response", + g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL); - g_signal_connect (dlg, "destroy", + g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_main_quit), NULL); hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), hbox); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_widget_show (hbox); preview_box = create_preview (); @@ -248,9 +248,9 @@ create_dialog (void) * */ restore_values (); - gtk_widget_show (dlg); + gtk_widget_show (dialog); - return dlg; + return dialog; } gint diff --git a/plug-ins/ifscompose/ifscompose.c b/plug-ins/ifscompose/ifscompose.c index 525536b96e..4daff22eda 100644 --- a/plug-ins/ifscompose/ifscompose.c +++ b/plug-ins/ifscompose/ifscompose.c @@ -788,7 +788,7 @@ ifs_compose_dialog (GimpDrawable *drawable) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer) &dialog); diff --git a/plug-ins/imagemap/imap_default_dialog.c b/plug-ins/imagemap/imap_default_dialog.c index 17a93220a9..285b29e060 100644 --- a/plug-ins/imagemap/imap_default_dialog.c +++ b/plug-ins/imagemap/imap_default_dialog.c @@ -114,7 +114,7 @@ make_default_dialog (const gchar *title) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (data->dialog)); + gimp_window_set_transient (GTK_WINDOW (data->dialog)); g_signal_connect (data->dialog, "response", G_CALLBACK (dialog_response), diff --git a/plug-ins/maze/maze_face.c b/plug-ins/maze/maze_face.c index 01ccdaa5f6..6fc603e19f 100644 --- a/plug-ins/maze/maze_face.c +++ b/plug-ins/maze/maze_face.c @@ -191,7 +191,7 @@ maze_dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/metadata/interface.c b/plug-ins/metadata/interface.c index c18a68d72a..dee5eb4d7d 100644 --- a/plug-ins/metadata/interface.c +++ b/plug-ins/metadata/interface.c @@ -677,7 +677,7 @@ metadata_dialog (gint32 image_ID, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (mgui.dlg)); + gimp_window_set_transient (GTK_WINDOW (mgui.dlg)); g_signal_connect (mgui.dlg, "response", G_CALLBACK (metadata_dialog_response), diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c index b62b744fbf..dcbfdd4653 100644 --- a/plug-ins/pagecurl/pagecurl.c +++ b/plug-ins/pagecurl/pagecurl.c @@ -451,7 +451,7 @@ dialog (void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dialog)); + gimp_window_set_transient (GTK_WINDOW (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); diff --git a/plug-ins/print/gimp_main_window.c b/plug-ins/print/gimp_main_window.c index d88f1728a5..f31c8ea0f8 100644 --- a/plug-ins/print/gimp_main_window.c +++ b/plug-ins/print/gimp_main_window.c @@ -382,7 +382,7 @@ create_top_level_structure(void) GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (print_dialog)); + gimp_window_set_transient (GTK_WINDOW (print_dialog)); g_signal_connect (print_dialog, "response", G_CALLBACK (gimp_response_callback), diff --git a/plug-ins/rcm/rcm_dialog.c b/plug-ins/rcm/rcm_dialog.c index d4f9d35e77..24b3c07ea0 100644 --- a/plug-ins/rcm/rcm_dialog.c +++ b/plug-ins/rcm/rcm_dialog.c @@ -638,36 +638,34 @@ rcm_create_units (void) gboolean rcm_dialog (void) { - GtkWidget *dlg, *hbox, *notebook; + GtkWidget *dialog; + GtkWidget *hbox; + GtkWidget *notebook; GtkWidget *previews; gboolean run; Current.Bna = g_new (RcmBna, 1); - /* init GTK and install colormap */ gimp_ui_init (PLUG_IN_BINARY, TRUE); - - /* init stock icons */ rcm_stock_init (); - /* Create dialog */ - dlg = gimp_dialog_new (_("Colormap Rotation"), PLUG_IN_BINARY, - NULL, 0, - gimp_standard_help_func, PLUG_IN_PROC, + dialog = gimp_dialog_new (_("Colormap Rotation"), PLUG_IN_BINARY, + NULL, 0, + gimp_standard_help_func, PLUG_IN_PROC, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + NULL); - gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), + gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); - gimp_window_set_transient_for_default_display (GTK_WINDOW (dlg)); + gimp_window_set_transient (GTK_WINDOW (dialog)); - Current.Bna->dlg = dlg; + Current.Bna->dlg = dialog; /* Create sub-dialogs */ Current.reduced = rcm_reduce_image (Current.drawable, Current.mask, @@ -678,7 +676,8 @@ rcm_dialog (void) /* H-Box */ hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + TRUE, TRUE, 0); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (hbox), previews, TRUE, TRUE, 0); @@ -698,15 +697,15 @@ rcm_dialog (void) gtk_notebook_append_page (GTK_NOTEBOOK (notebook), rcm_create_units (), gtk_label_new (_("Units"))); - gtk_widget_show (dlg); + gtk_widget_show (dialog); rcm_render_circle (Current.From->preview, SUM, MARGIN); rcm_render_circle (Current.To->preview, SUM, MARGIN); rcm_render_circle (Current.Gray->preview, GRAY_SUM, GRAY_MARGIN); - run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dlg); + gtk_widget_destroy (dialog); return run; } diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index af8ddbc99d..2a7ee50276 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -302,12 +302,14 @@ package Gimp::CodeGen::enums; GIMP_PROGRESS_COMMAND_END GIMP_PROGRESS_COMMAND_SET_TEXT GIMP_PROGRESS_COMMAND_SET_VALUE - GIMP_PROGRESS_COMMAND_PULSE) ], + GIMP_PROGRESS_COMMAND_PULSE + GIMP_PROGRESS_COMMAND_GET_WINDOW) ], mapping => { GIMP_PROGRESS_COMMAND_START => '0', GIMP_PROGRESS_COMMAND_END => '1', GIMP_PROGRESS_COMMAND_SET_TEXT => '2', GIMP_PROGRESS_COMMAND_SET_VALUE => '3', - GIMP_PROGRESS_COMMAND_PULSE => '4' } + GIMP_PROGRESS_COMMAND_PULSE => '4', + GIMP_PROGRESS_COMMAND_GET_WINDOW => '5' } }, GimpHistogramChannel => { contig => 1, diff --git a/tools/pdbgen/pdb/progress.pdb b/tools/pdbgen/pdb/progress.pdb index 5efe55a887..ddfc2ad850 100644 --- a/tools/pdbgen/pdb/progress.pdb +++ b/tools/pdbgen/pdb/progress.pdb @@ -17,7 +17,7 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { +sub mitch_pdb_misc { $author = 'Michael Natterer '; $copyright = 'Michael Natterer'; $date = '2004'; @@ -86,7 +86,7 @@ HELP if (gimp->current_plug_in && gimp->current_plug_in->open) { if (! gimp->no_interface) - plug_in_progress_update (gimp->current_plug_in, percentage); + plug_in_progress_set_value (gimp->current_plug_in, percentage); } else success = FALSE; @@ -154,6 +154,34 @@ CODE ); } +sub progress_get_window_handle { + $blurb = 'Returns the native window ID of the toplevel window this plug-in\'s progress is displayed in.'; + + $help = <<'HELP'; +This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in. +HELP + + &mitch_pdb_misc; + + @outargs = ( + { name => 'window', type => 'int32', init => 1, + desc => 'The progress bar\'s toplevel window' } + ); + %invoke = ( + code => <<'CODE' +{ + if (gimp->current_plug_in && gimp->current_plug_in->open) + { + if (! gimp->no_interface) + window = plug_in_progress_get_window (gimp->current_plug_in); + } + else + success = FALSE; +} +CODE + ); +} + sub progress_install { $blurb = 'Installs a progress callback for the current plug-in.'; @@ -163,7 +191,7 @@ progress calls made by this plug-in and any procedure it calls. Calling this function multiple times simply replaces the old progress callbacks. HELP - &pdb_misc; + &mitch_pdb_misc; @inargs = ( { name => 'progress_callback', type => 'string', @@ -192,7 +220,7 @@ This function uninstalls any progress callback installed with gimp_progress_install() before. HELP - &pdb_misc; + &mitch_pdb_misc; @inargs = ( { name => 'progress_callback', type => 'string', @@ -220,7 +248,7 @@ sub progress_cancel { This function cancels the currently running progress. HELP - &pdb_misc; + &mitch_pdb_misc; @inargs = ( { name => 'progress_callback', type => 'string', @@ -243,6 +271,7 @@ CODE @headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-in-progress.h"); @procs = qw(progress_init progress_update progress_pulse progress_set_text + progress_get_window_handle progress_install progress_uninstall progress_cancel); %exports = (app => [@procs], lib => [@procs]);