diff --git a/ChangeLog b/ChangeLog index 10cb1be77f..b7e0dfb086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,68 @@ +2003-11-07 Michael Natterer + + * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", + "display_name" and "monitor_number" to the GPConfig message. + Increased protocol version number. + + * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig + message and remember them. + Added public accessors for the new config values. + + * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to + gtk_init() and export the display/screen to use to the + environment. + + * app/core/gimp.[ch]: added vtable entries to get the values + from the GUI. + + * app/gui/gui-vtable.c: implement the vtable entries. + + * app/plug-in/plug-in-run.c: fill in the GPConfig values using + the new Gimp vtable functions. + + * app/display/gimpdisplayshell-layer-select.c + * app/display/gimpdisplayshell.c + * app/gui/about-dialog.c + * app/gui/channels-commands.c + * app/gui/color-notebook.c + * app/gui/convert-dialog.c + * app/gui/file-dialog-utils.[ch] + * app/gui/file-new-dialog.c + * app/gui/file-open-dialog.c + * app/gui/file-save-dialog.c + * app/gui/gradient-editor-commands.c + * app/gui/gradients-commands.c + * app/gui/grid-dialog.c + * app/gui/image-commands.c + * app/gui/info-dialog.[ch] + * app/gui/info-window.c + * app/gui/layers-commands.c + * app/gui/module-browser.c + * app/gui/offset-dialog.c + * app/gui/palette-import-dialog.c + * app/gui/qmask-commands.c + * app/gui/resize-dialog.c + * app/gui/splash.c + * app/gui/stroke-dialog.c + * app/gui/templates-commands.c + * app/gui/tips-dialog.c + * app/gui/vectors-commands.c + * app/tools/gimpcurvestool.c + * app/tools/gimplevelstool.c + * app/widgets/gimpdock.c + * app/widgets/gimperrorconsole.c + * app/widgets/gimptexteditor.c + * app/widgets/gimptoolbox.c + * app/widgets/gimpviewabledialog.[ch] + * libgimpwidgets/gimpfileselection.c + * libgimpwidgets/gimpquerybox.c + * libgimpwidgets/gimpunitmenu.c + * plug-ins/helpbrowser/dialog.c + * plug-ins/ifscompose/ifscompose.c: replaced all calls to + gtk_window_set_wmclass() by gtk_window_set_role() and all + "const gchar *wmclass_name" parameters by "const gchar *role". + Cleaned up the window role strings. + 2003-11-07 Michael Natterer * libgimp/gimpexport.c: beautified and cleaned up the export diff --git a/app/actions/channels-commands.c b/app/actions/channels-commands.c index 98ea8ebac8..8987b35a2f 100644 --- a/app/actions/channels-commands.c +++ b/app/actions/channels-commands.c @@ -342,7 +342,7 @@ channels_new_channel_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Channel"), "new_channel_options", + _("New Channel"), "gimp-channel-new", GIMP_STOCK_CHANNEL, _("New Channel Options"), gimp_standard_help_func, @@ -503,7 +503,7 @@ channels_edit_channel_query (GimpChannel *channel) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (channel), - _("Channel Attributes"), "edit_channel_attributes", + _("Channel Attributes"), "gimp-channel-edit", GIMP_STOCK_EDIT, _("Edit Channel Attributes"), gimp_standard_help_func, diff --git a/app/actions/gradient-editor-commands.c b/app/actions/gradient-editor-commands.c index 2771dc59ef..dcfef925aa 100644 --- a/app/actions/gradient-editor-commands.c +++ b/app/actions/gradient-editor-commands.c @@ -524,7 +524,7 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget, dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data), - title, "gradient_segment_replicate", + title, "gimp-gradient-segment-replicate", GIMP_STOCK_TOOL_BLEND, desc, gimp_standard_help_func, GIMP_HELP_GRADIENT_EDITOR_REPLICATE, @@ -629,7 +629,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget, dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data), - title, "gradient_segment_split_uniformly", + title, "gimp-gradient-segment_split-uniformly", GIMP_STOCK_TOOL_BLEND, desc, gimp_standard_help_func, GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM, diff --git a/app/actions/gradients-commands.c b/app/actions/gradients-commands.c index d263a0ac89..2a85462df0 100644 --- a/app/actions/gradients-commands.c +++ b/app/actions/gradients-commands.c @@ -78,7 +78,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor) g_free (title); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "save_gradient", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-gradient-save-pov"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); @@ -100,7 +100,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor) g_signal_connect_object (filesel, "destroy", G_CALLBACK (g_object_unref), - gradient, + gradient, G_CONNECT_SWAPPED); gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c index 44a8daccb7..b3015d9024 100644 --- a/app/actions/image-commands.c +++ b/app/actions/image-commands.c @@ -380,7 +380,7 @@ image_layers_merge_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("Merge Layers"), "layers_merge_options", + _("Merge Layers"), "gimp-image-merge-layers", GIMP_STOCK_MERGE_DOWN, _("Layers Merge Options"), gimp_standard_help_func, diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 7f54818306..f845c7b1db 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -665,7 +665,7 @@ layers_new_layer_query (GimpImage *gimage, options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Layer"), "new_layer_options", + _("New Layer"), "gimp-layer-new", GIMP_STOCK_LAYER, _("Create a New Layer"), gimp_standard_help_func, @@ -845,8 +845,7 @@ layers_edit_layer_query (GimpLayer *layer) options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (layer), - _("Layer Attributes"), - "edit_layer_attributes", + _("Layer Attributes"), "gimp-layer-edit", GIMP_STOCK_EDIT, _("Edit Layer Attributes"), gimp_standard_help_func, @@ -956,7 +955,7 @@ layers_add_mask_query (GimpLayer *layer) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (layer), - _("Add Layer Mask"), "add_mask_options", + _("Add Layer Mask"), "gimp-layer-add-mask", GTK_STOCK_ADD, _("Add a Mask to the Layer"), gimp_standard_help_func, diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index f9671befc7..bf01e35b3d 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.c @@ -146,7 +146,7 @@ qmask_channel_query (GimpDisplayShell *shell) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage), - _("Qmask Attributes"), "edit_qmask_attributes", + _("Qmask Attributes"), "gimp-qmask-edit", GIMP_STOCK_QMASK_ON, _("Edit QuickMask Attributes"), gimp_standard_help_func, diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index f9671befc7..bf01e35b3d 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -146,7 +146,7 @@ qmask_channel_query (GimpDisplayShell *shell) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage), - _("Qmask Attributes"), "edit_qmask_attributes", + _("Qmask Attributes"), "gimp-qmask-edit", GIMP_STOCK_QMASK_ON, _("Edit QuickMask Attributes"), gimp_standard_help_func, diff --git a/app/actions/templates-commands.c b/app/actions/templates-commands.c index 2b5dfede24..dddacfffac 100644 --- a/app/actions/templates-commands.c +++ b/app/actions/templates-commands.c @@ -123,7 +123,7 @@ templates_new_template_dialog (Gimp *gimp, GtkWidget *editor; dialog = gimp_viewable_dialog_new (NULL, - _("New Template"), "new_template", + _("New Template"), "gimp-template-new", GIMP_STOCK_TEMPLATE, _("Create a New Template"), gimp_standard_help_func, @@ -194,7 +194,7 @@ templates_edit_template_dialog (Gimp *gimp, GtkWidget *editor; dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (template), - _("Edit Template"), "edit_template", + _("Edit Template"), "gimp-template-edit", GIMP_STOCK_EDIT, _("Edit Template"), gimp_standard_help_func, diff --git a/app/actions/vectors-commands.c b/app/actions/vectors-commands.c index 37031f1198..196a40a868 100644 --- a/app/actions/vectors-commands.c +++ b/app/actions/vectors-commands.c @@ -32,6 +32,7 @@ #include "core/gimpcontainer.h" #include "core/gimpcontext.h" #include "core/gimpimage.h" +#include "core/gimpimage-merge.h" #include "core/gimptoolinfo.h" #include "pdb/procedural_db.h" @@ -448,7 +449,7 @@ vectors_new_vectors_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Path"), "new_path_options", + _("New Path"), "gimp-vectors-new", GIMP_STOCK_TOOL_PATH, _("New Path Options"), gimp_standard_help_func, @@ -564,7 +565,7 @@ vectors_edit_vectors_query (GimpVectors *vectors) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (vectors), - _("Path Attributes"), "edit_path_attributes", + _("Path Attributes"), "gimp-vectors-edit", GIMP_STOCK_EDIT, _("Edit Path Attributes"), gimp_standard_help_func, @@ -666,7 +667,7 @@ vectors_import_query (GimpImage *gimage) g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy, filesel); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "gimp-vectors-import", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-import"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); @@ -728,7 +729,7 @@ vectors_export_query (GimpImage *gimage, g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy, filesel); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "gimp-vectors-export", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-export"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); diff --git a/app/core/gimp.c b/app/core/gimp.c index 5433c289ea..ac44817aaf 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -1137,6 +1137,33 @@ gimp_pdb_dialogs_check (Gimp *gimp) gimp->gui_pdb_dialogs_check_func (gimp); } +const gchar * +gimp_get_program_class (Gimp *gimp) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->gui_get_program_class_func) + return gimp->gui_get_program_class_func (gimp); + + return NULL; +} + +gchar * +gimp_get_display_name (Gimp *gimp, + gint gdisp_ID, + gint *monitor_number) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + g_return_val_if_fail (monitor_number != NULL, NULL); + + if (gimp->gui_get_display_name_func) + return gimp->gui_get_display_name_func (gimp, gdisp_ID, monitor_number); + + *monitor_number = 0; + + return NULL; +} + GimpImage * gimp_create_image (Gimp *gimp, gint width, diff --git a/app/core/gimp.h b/app/core/gimp.h index 04eb56e0df..e528694ee0 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -57,6 +57,10 @@ typedef void (* GimpProgressUpdateFunc) (Gimp *gimp, typedef void (* GimpProgressEndFunc) (Gimp *gimp, GimpProgress *progress); typedef void (* GimpPDBDialogsCheckFunc) (Gimp *gimp); +typedef const gchar * (* GimpGetProgramClassFunc) (Gimp *gimp); +typedef gchar * (* GimpGetDisplayNameFunc) (Gimp *gimp, + gint gdisp_ID, + gint *monitor_number); #define GIMP_TYPE_GIMP (gimp_get_type ()) @@ -100,6 +104,8 @@ struct _Gimp GimpProgressUpdateFunc gui_progress_update_func; GimpProgressEndFunc gui_progress_end_func; GimpPDBDialogsCheckFunc gui_pdb_dialogs_check_func; + GimpGetProgramClassFunc gui_get_program_class_func; + GimpGetDisplayNameFunc gui_get_display_name_func; gint busy; guint busy_idle_id; @@ -257,6 +263,10 @@ void gimp_update_progress (Gimp *gimp, void gimp_end_progress (Gimp *gimp, GimpProgress *progress); void gimp_pdb_dialogs_check (Gimp *gimp); +const gchar * gimp_get_program_class (Gimp *gimp); +gchar * gimp_get_display_name (Gimp *gimp, + gint gdisp_ID, + gint *monitor_number); GimpImage * gimp_create_image (Gimp *gimp, gint width, diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index 31067e7760..c357cdf2ad 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -202,8 +202,8 @@ static gint cur_scroll_text = 0; static gint cur_scroll_index = 0; static gint shuffle_array[G_N_ELEMENTS (authors)]; -static gchar *drop_text[] = -{ +static gchar *drop_text[] = +{ "We are The GIMP." , "Prepare to be manipulated.", "Resistance is futile." @@ -235,8 +235,7 @@ about_dialog_create (void) about_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint (GTK_WINDOW (about_dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_wmclass (GTK_WINDOW (about_dialog), - "about_dialog", "Gimp"); + gtk_window_set_role (GTK_WINDOW (about_dialog), "gimp-about"); gtk_window_set_title (GTK_WINDOW (about_dialog), _("About The GIMP")); gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE); @@ -256,13 +255,13 @@ about_dialog_create (void) g_signal_connect (about_dialog, "key_press_event", G_CALLBACK (about_dialog_key), NULL); - + /* dnd stuff */ gtk_drag_dest_set (about_dialog, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, NULL, 0, - GDK_ACTION_COPY); + GDK_ACTION_COPY); gimp_dnd_viewable_dest_add (about_dialog, GIMP_TYPE_TOOL_INFO, about_dialog_tool_drop, NULL); @@ -323,7 +322,7 @@ about_dialog_create (void) gtk_widget_show (aboutframe); scroll_layout = gtk_widget_create_pango_layout (aboutframe, NULL); - g_object_weak_ref (G_OBJECT (aboutframe), + g_object_weak_ref (G_OBJECT (aboutframe), (GWeakNotify) g_object_unref, scroll_layout); max_width = 0; @@ -375,17 +374,17 @@ about_dialog_create (void) { GRand *gr = g_rand_new (); - for (i = 0; i < nscroll_texts; i++) + for (i = 0; i < nscroll_texts; i++) { shuffle_array[i] = i; } - for (i = 0; i < nscroll_texts; i++) + for (i = 0; i < nscroll_texts; i++) { gint j; j = g_rand_int_range (gr, 0, nscroll_texts); - if (i != j) + if (i != j) { gint t; @@ -395,8 +394,8 @@ about_dialog_create (void) } } - cur_scroll_text = g_rand_int_range (gr, 0, nscroll_texts); - pango_layout_set_text (scroll_layout, + cur_scroll_text = g_rand_int_range (gr, 0, nscroll_texts); + pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); g_rand_free (gr); @@ -512,7 +511,7 @@ about_dialog_logo_expose (GtkWidget *widget, gdk_draw_drawable (widget->window, widget->style->black_gc, - logo_pixmap, + logo_pixmap, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); @@ -545,10 +544,10 @@ about_dialog_key (GtkWidget *widget, gpointer data) { gint i; - + if (hadja_state == 7) return FALSE; - + switch (event->keyval) { case GDK_h: @@ -587,22 +586,22 @@ about_dialog_key (GtkWidget *widget, { scroll_text = hadja_text; nscroll_texts = G_N_ELEMENTS (hadja_text); - + for (i = 0; i < nscroll_texts; i++) { shuffle_array[i] = i; pango_layout_set_text (scroll_layout, scroll_text[i], -1); - pango_layout_get_pixel_size (scroll_layout, + pango_layout_get_pixel_size (scroll_layout, &scroll_text_widths[i], NULL); } - + scroll_state = 0; cur_scroll_index = 0; cur_scroll_text = 0; offset = 0; pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); } - + return FALSE; } @@ -674,7 +673,7 @@ about_dialog_tool_drop (GtkWidget *widget, { shuffle_array[i] = i; pango_layout_set_text (scroll_layout, scroll_text[i], -1); - pango_layout_get_pixel_size (scroll_layout, + pango_layout_get_pixel_size (scroll_layout, &scroll_text_widths[i], NULL); } @@ -757,7 +756,7 @@ about_dialog_timer (gpointer data) cur_scroll_index = 0; cur_scroll_text = shuffle_array[cur_scroll_index]; - pango_layout_set_text (scroll_layout, + pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); offset = 0; } diff --git a/app/dialogs/color-dialog.c b/app/dialogs/color-dialog.c index 2856a8bed1..97a0581baa 100644 --- a/app/dialogs/color-dialog.c +++ b/app/dialogs/color-dialog.c @@ -84,7 +84,7 @@ struct _ColorNotebook static ColorNotebook * color_notebook_new_internal (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpDialogFactory *dialog_factory, @@ -151,7 +151,7 @@ color_notebook_new (const gchar *title, { return color_notebook_new_internal (NULL, title, - "color_selection", + "gimp-color-selection", NULL, NULL, dialog_factory, @@ -176,7 +176,7 @@ color_notebook_viewable_new (GimpViewable *viewable, { return color_notebook_new_internal (viewable, title, - "color_selection", + "gimp-color-selection", stock_id, desc, dialog_factory, diff --git a/app/dialogs/convert-dialog.c b/app/dialogs/convert-dialog.c index cb632682cd..14bda5e6b9 100644 --- a/app/dialogs/convert-dialog.c +++ b/app/dialogs/convert-dialog.c @@ -128,7 +128,7 @@ convert_to_indexed (GimpImage *gimage) dialog->shell = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), _("Indexed Color Conversion"), - "indexed_color_conversion", + "gimp-image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED, _("Convert Image to Indexed Colors"), gimp_standard_help_func, diff --git a/app/dialogs/file-dialog-utils.c b/app/dialogs/file-dialog-utils.c index b63e847331..0eaaecad44 100644 --- a/app/dialogs/file-dialog-utils.c +++ b/app/dialogs/file-dialog-utils.c @@ -47,7 +47,7 @@ file_dialog_new (Gimp *gimp, GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *help_id, GCallback ok_callback) { @@ -60,7 +60,7 @@ file_dialog_new (Gimp *gimp, g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL); g_return_val_if_fail (menu_identifier != NULL, NULL); g_return_val_if_fail (title != NULL, NULL); - g_return_val_if_fail (wmclass_name != NULL, NULL); + g_return_val_if_fail (role != NULL, NULL); g_return_val_if_fail (help_id != NULL, NULL); g_return_val_if_fail (ok_callback != NULL, NULL); @@ -71,7 +71,7 @@ file_dialog_new (Gimp *gimp, g_object_set_data (G_OBJECT (filesel), "gimp", gimp); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); - gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), role); gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL); diff --git a/app/dialogs/file-dialog-utils.h b/app/dialogs/file-dialog-utils.h index 476cde5284..974b6e5f5b 100644 --- a/app/dialogs/file-dialog-utils.h +++ b/app/dialogs/file-dialog-utils.h @@ -26,7 +26,7 @@ GtkWidget * file_dialog_new (Gimp *gimp, GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *help_id, GCallback ok_callback); diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c index 8f0d6198d9..4b7f3827c2 100644 --- a/app/dialogs/file-open-dialog.c +++ b/app/dialogs/file-open-dialog.c @@ -181,7 +181,7 @@ file_open_dialog_create (Gimp *gimp, global_dialog_factory, "gimp-file-open-dialog", menu_factory, "", - _("Open Image"), "open_image", + _("Open Image"), "gimp-file-open", GIMP_HELP_FILE_OPEN, G_CALLBACK (file_open_ok_callback)); @@ -202,7 +202,7 @@ file_open_dialog_create (Gimp *gimp, GtkWidget *progress; GtkStyle *style; gchar *str; - + /* Catch file-list clicks so we can update the preview thumbnail */ g_signal_connect (tree_sel, "changed", G_CALLBACK (file_open_selchanged_callback), @@ -220,7 +220,7 @@ file_open_dialog_create (Gimp *gimp, &style->base[GTK_STATE_NORMAL]); gtk_widget_modify_bg (ebox, GTK_STATE_INSENSITIVE, &style->base[GTK_STATE_NORMAL]); - + gtk_container_add (GTK_CONTAINER (open_options_frame), ebox); gtk_widget_show (ebox); @@ -240,16 +240,16 @@ file_open_dialog_create (Gimp *gimp, vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (ebox), vbox); gtk_widget_show (vbox); - + button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - + label = gtk_label_new_with_mnemonic (_("_Preview")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_container_add (GTK_CONTAINER (button), label); gtk_widget_show (label); - + g_signal_connect (button, "button_press_event", G_CALLBACK (gtk_true), NULL); @@ -262,22 +262,22 @@ file_open_dialog_create (Gimp *gimp, g_signal_connect (button, "leave_notify_event", G_CALLBACK (gtk_true), NULL); - + vbox2 = gtk_vbox_new (FALSE, 2); gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2); gtk_container_add (GTK_CONTAINER (vbox), vbox2); gtk_widget_show (vbox2); - + hbox = gtk_hbox_new (TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - + open_options_imagefile = gimp_imagefile_new (gimp, NULL); - + open_options_preview = gimp_preview_new (GIMP_VIEWABLE (open_options_imagefile), gimp->config->thumbnail_size, 0, FALSE); - + gtk_widget_ensure_style (open_options_preview); style = gtk_widget_get_style (open_options_preview); gtk_widget_modify_bg (open_options_preview, GTK_STATE_NORMAL, @@ -309,11 +309,11 @@ file_open_dialog_create (Gimp *gimp, /* eek */ { GtkRequisition requisition; - + gtk_widget_size_request (label, &requisition); gtk_widget_set_size_request (label, -1, requisition.height); } - + g_signal_connect (open_options_imagefile, "info_changed", G_CALLBACK (file_open_imagefile_info_changed), label); @@ -329,17 +329,17 @@ file_open_dialog_create (Gimp *gimp, gtk_widget_set_sensitive (GTK_WIDGET (open_options_frame), FALSE); /* The progress bar */ - + progress = gtk_progress_bar_new (); gtk_box_pack_end (GTK_BOX (vbox2), progress, FALSE, FALSE, 0); /* don't gtk_widget_show (progress); */ - + open_options_progress = GTK_PROGRESS_BAR (progress); - + /* eek */ { GtkRequisition requisition; - + gtk_progress_bar_set_text (open_options_progress, "foo"); gtk_widget_size_request (progress, &requisition); gtk_widget_set_size_request (open_options_title, requisition.width, -1); @@ -643,7 +643,7 @@ file_open_ok_callback (GtkWidget *widget, file_open_dialog_open_image (open_dialog, gimp, uri, - entered_filename, + entered_filename, load_file_proc); g_free (uri); @@ -669,7 +669,7 @@ file_open_ok_callback (GtkWidget *widget, } g_strfreev (selections); - + gtk_widget_set_sensitive (open_dialog, TRUE); } @@ -686,7 +686,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog, gimage = file_open_with_proc_and_display (gimp, uri, - entered_filename, + entered_filename, load_proc, &status, &error); diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c index 7a31f24e9a..0a7b2d3664 100644 --- a/app/dialogs/file-save-dialog.c +++ b/app/dialogs/file-save-dialog.c @@ -204,7 +204,7 @@ file_save_dialog_create (Gimp *gimp, global_dialog_factory, "gimp-file-save-dialog", menu_factory, "", - _("Save Image"), "save_image", + _("Save Image"), "gimp-file-save", GIMP_HELP_FILE_SAVE, G_CALLBACK (file_save_ok_callback)); } diff --git a/app/dialogs/grid-dialog.c b/app/dialogs/grid-dialog.c index 389a617e47..69706fc242 100644 --- a/app/dialogs/grid-dialog.c +++ b/app/dialogs/grid-dialog.c @@ -77,7 +77,7 @@ grid_dialog_new (GimpImage *gimage) grid_backup = gimp_config_duplicate (GIMP_CONFIG (grid)); dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("Configure Grid"), "configure_grid", + _("Configure Grid"), "gimp-grid-configure", GIMP_STOCK_GRID, _("Configure Image Grid"), gimp_standard_help_func, GIMP_HELP_IMAGE_GRID, diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index 0f3aab6fd3..6f9e1c596c 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -98,7 +98,7 @@ file_new_dialog_new (Gimp *gimp) dialog->dialog = gimp_viewable_dialog_new (NULL, - _("New Image"), "new_image", + _("New Image"), "gimp-image-new", GIMP_STOCK_IMAGE, _("Create a New Image"), gimp_standard_help_func, diff --git a/app/dialogs/info-dialog.c b/app/dialogs/info-dialog.c index d43bbc5cae..8a715e71c2 100644 --- a/app/dialogs/info-dialog.c +++ b/app/dialogs/info-dialog.c @@ -40,7 +40,7 @@ static InfoDialog * info_dialog_new_extended (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, @@ -62,13 +62,13 @@ static void info_dialog_update_field (InfoField *info_field); InfoDialog * info_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data) { - return info_dialog_new_extended (viewable, title, wmclass_name, + return info_dialog_new_extended (viewable, title, role, stock_id, desc, help_func, help_data, FALSE); } @@ -76,13 +76,13 @@ info_dialog_new (GimpViewable *viewable, InfoDialog * info_dialog_notebook_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data) { - return info_dialog_new_extended (viewable, title, wmclass_name, + return info_dialog_new_extended (viewable, title, role, stock_id, desc, help_func, help_data, TRUE); } @@ -312,7 +312,7 @@ info_dialog_add_sizeentry (InfoDialog *idialog, static InfoDialog * info_dialog_new_extended (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, @@ -330,7 +330,7 @@ info_dialog_new_extended (GimpViewable *viewable, idialog->nfields = 0; shell = gimp_viewable_dialog_new (viewable, - title, wmclass_name, + title, role, stock_id, desc, help_func, help_data, NULL); diff --git a/app/dialogs/info-dialog.h b/app/dialogs/info-dialog.h index 9046a0edf0..0b82a4cb8e 100644 --- a/app/dialogs/info-dialog.h +++ b/app/dialogs/info-dialog.h @@ -21,7 +21,7 @@ typedef enum -{ +{ INFO_LABEL, INFO_ENTRY, INFO_SCALE, @@ -59,14 +59,14 @@ struct _InfoDialog InfoDialog *info_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data); InfoDialog *info_dialog_notebook_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, diff --git a/app/dialogs/info-window.c b/app/dialogs/info-window.c index f1081d5b00..7276727380 100644 --- a/app/dialogs/info-window.c +++ b/app/dialogs/info-window.c @@ -228,7 +228,7 @@ info_window_create (GimpDisplay *gdisp) type = gimp_image_base_type (gdisp->gimage); info_win = info_dialog_notebook_new (GIMP_VIEWABLE (gdisp->gimage), - _("Info Window"), "info_window", + _("Info Window"), "gimp-info-window", GIMP_STOCK_INFO, _("Image Information"), gimp_standard_help_func, diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index c80701e5aa..a1916cf882 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -119,7 +119,7 @@ module_browser_new (Gimp *gimp) browser->gimp = gimp; shell = gimp_viewable_dialog_new (NULL, - _("Module Manager"), "module_db_dialog", + _("Module Manager"), "gimp-modules", GTK_STOCK_EXECUTE, _("Manage Loadable Modules"), gimp_standard_help_func, diff --git a/app/dialogs/offset-dialog.c b/app/dialogs/offset-dialog.c index fe1a9bf0de..fd4dd6cb3c 100644 --- a/app/dialogs/offset-dialog.c +++ b/app/dialogs/offset-dialog.c @@ -100,7 +100,7 @@ offset_dialog_create (GimpDrawable *drawable) g_warning ("%s: unexpected drawable type", G_STRLOC); off_d->dlg = gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable), - _("Offset"), "offset", + _("Offset"), "gimp-drawable-offset", GIMP_STOCK_TOOL_MOVE, title, gimp_standard_help_func, diff --git a/app/dialogs/palette-import-dialog.c b/app/dialogs/palette-import-dialog.c index ebff70b2cc..f548f68bfd 100644 --- a/app/dialogs/palette-import-dialog.c +++ b/app/dialogs/palette-import-dialog.c @@ -163,7 +163,7 @@ palette_import_dialog_new (Gimp *gimp) gimp_get_user_context (gimp)); import_dialog->dialog = - gimp_viewable_dialog_new (NULL, _("Import Palette"), "import_palette", + gimp_viewable_dialog_new (NULL, _("Import Palette"), "gimp-palette-import", GTK_STOCK_CONVERT, _("Import a New Palette"), gimp_standard_help_func, diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index e9b18d1d93..6c4dc1567d 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -185,7 +185,7 @@ resize_widget_new (GimpViewable *viewable, /* dialog box */ { - const gchar *wmclass = NULL; + const gchar *role = NULL; const gchar *window_title = NULL; const gchar *stock_id = NULL; const gchar *window_desc = NULL; @@ -199,7 +199,7 @@ resize_widget_new (GimpViewable *viewable, switch (resize->target) { case ResizeLayer: - wmclass = "scale_layer"; + role = "gimp-layer-scale"; window_title = _("Scale Layer"); window_desc = _("Scale Layer Options"); help_page = GIMP_HELP_LAYER_SCALE; @@ -207,7 +207,7 @@ resize_widget_new (GimpViewable *viewable, break; case ResizeImage: - wmclass = "scale_image"; + role = "gimp-image-scale"; window_title = _("Scale Image"); window_desc = _("Scale Image Options"); help_page = GIMP_HELP_IMAGE_SCALE; @@ -222,14 +222,14 @@ resize_widget_new (GimpViewable *viewable, switch (resize->target) { case ResizeLayer: - wmclass = "resize_layer"; + role = "gimp-layer-resize"; window_title = _("Layer Boundary Size"); window_desc = _("Set Layer Boundary Size"); help_page = GIMP_HELP_LAYER_RESIZE; break; case ResizeImage: - wmclass = "resize_image"; + role = "gimp-image-resize"; window_title = _("Canvas Size"); window_desc = _("Set Image Canvas Size"); help_page = GIMP_HELP_IMAGE_RESIZE; @@ -241,7 +241,7 @@ resize_widget_new (GimpViewable *viewable, resize->resize_shell = gimp_viewable_dialog_new (viewable, - window_title, wmclass, + window_title, role, stock_id, window_desc, gimp_standard_help_func, help_page, diff --git a/app/dialogs/stroke-dialog.c b/app/dialogs/stroke-dialog.c index 71c100cf1f..0088bfb033 100644 --- a/app/dialogs/stroke-dialog.c +++ b/app/dialogs/stroke-dialog.c @@ -95,7 +95,7 @@ stroke_dialog_new (GimpItem *item, /* the dialog */ dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (item), - _("Stroke Options"), "stroke_options", + _("Stroke Options"), "gimp-stroke-options", stock_id, _("Choose Stroke Style"), gimp_standard_help_func, diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index 280096847d..ca94d31ce9 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -129,7 +129,7 @@ tips_dialog_create (Gimp *gimp) tips_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint (GTK_WINDOW (tips_dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_wmclass (GTK_WINDOW (tips_dialog), "tip_of_the_day", "Gimp"); + gtk_window_set_role (GTK_WINDOW (tips_dialog), "gimp-tip-of-the-day"); gtk_window_set_title (GTK_WINDOW (tips_dialog), _("GIMP Tip of the Day")); gtk_window_set_position (GTK_WINDOW (tips_dialog), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (tips_dialog), TRUE); diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index e91917f9c5..5df7d2da94 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -287,7 +287,7 @@ gimp_display_shell_init (GimpDisplayShell *shell) shell->scroll_start_y = 0; shell->button_press_before_focus = FALSE; - gtk_window_set_wmclass (GTK_WINDOW (shell), "image_window", "Gimp"); + gtk_window_set_role (GTK_WINDOW (shell), "gimp-image-window"); gtk_window_set_resizable (GTK_WINDOW (shell), TRUE); gtk_widget_set_events (GTK_WIDGET (shell), (GDK_POINTER_MOTION_MASK | diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index f9016935c0..1b23fdf17a 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -111,8 +111,7 @@ layer_select_new (GimpImage *gimage, layer_select->orig_layer = layer; layer_select->shell = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_wmclass (GTK_WINDOW (layer_select->shell), - "layer_select", "Gimp"); + gtk_window_set_role (GTK_WINDOW (layer_select->shell), "gimp-layer-select"); gtk_window_set_title (GTK_WINDOW (layer_select->shell), _("Layer Select")); gtk_window_set_position (GTK_WINDOW (layer_select->shell), diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index e91917f9c5..5df7d2da94 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -287,7 +287,7 @@ gimp_display_shell_init (GimpDisplayShell *shell) shell->scroll_start_y = 0; shell->button_press_before_focus = FALSE; - gtk_window_set_wmclass (GTK_WINDOW (shell), "image_window", "Gimp"); + gtk_window_set_role (GTK_WINDOW (shell), "gimp-image-window"); gtk_window_set_resizable (GTK_WINDOW (shell), TRUE); gtk_widget_set_events (GTK_WIDGET (shell), (GDK_POINTER_MOTION_MASK | diff --git a/app/gui/about-dialog.c b/app/gui/about-dialog.c index 31067e7760..c357cdf2ad 100644 --- a/app/gui/about-dialog.c +++ b/app/gui/about-dialog.c @@ -202,8 +202,8 @@ static gint cur_scroll_text = 0; static gint cur_scroll_index = 0; static gint shuffle_array[G_N_ELEMENTS (authors)]; -static gchar *drop_text[] = -{ +static gchar *drop_text[] = +{ "We are The GIMP." , "Prepare to be manipulated.", "Resistance is futile." @@ -235,8 +235,7 @@ about_dialog_create (void) about_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint (GTK_WINDOW (about_dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_wmclass (GTK_WINDOW (about_dialog), - "about_dialog", "Gimp"); + gtk_window_set_role (GTK_WINDOW (about_dialog), "gimp-about"); gtk_window_set_title (GTK_WINDOW (about_dialog), _("About The GIMP")); gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE); @@ -256,13 +255,13 @@ about_dialog_create (void) g_signal_connect (about_dialog, "key_press_event", G_CALLBACK (about_dialog_key), NULL); - + /* dnd stuff */ gtk_drag_dest_set (about_dialog, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, NULL, 0, - GDK_ACTION_COPY); + GDK_ACTION_COPY); gimp_dnd_viewable_dest_add (about_dialog, GIMP_TYPE_TOOL_INFO, about_dialog_tool_drop, NULL); @@ -323,7 +322,7 @@ about_dialog_create (void) gtk_widget_show (aboutframe); scroll_layout = gtk_widget_create_pango_layout (aboutframe, NULL); - g_object_weak_ref (G_OBJECT (aboutframe), + g_object_weak_ref (G_OBJECT (aboutframe), (GWeakNotify) g_object_unref, scroll_layout); max_width = 0; @@ -375,17 +374,17 @@ about_dialog_create (void) { GRand *gr = g_rand_new (); - for (i = 0; i < nscroll_texts; i++) + for (i = 0; i < nscroll_texts; i++) { shuffle_array[i] = i; } - for (i = 0; i < nscroll_texts; i++) + for (i = 0; i < nscroll_texts; i++) { gint j; j = g_rand_int_range (gr, 0, nscroll_texts); - if (i != j) + if (i != j) { gint t; @@ -395,8 +394,8 @@ about_dialog_create (void) } } - cur_scroll_text = g_rand_int_range (gr, 0, nscroll_texts); - pango_layout_set_text (scroll_layout, + cur_scroll_text = g_rand_int_range (gr, 0, nscroll_texts); + pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); g_rand_free (gr); @@ -512,7 +511,7 @@ about_dialog_logo_expose (GtkWidget *widget, gdk_draw_drawable (widget->window, widget->style->black_gc, - logo_pixmap, + logo_pixmap, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); @@ -545,10 +544,10 @@ about_dialog_key (GtkWidget *widget, gpointer data) { gint i; - + if (hadja_state == 7) return FALSE; - + switch (event->keyval) { case GDK_h: @@ -587,22 +586,22 @@ about_dialog_key (GtkWidget *widget, { scroll_text = hadja_text; nscroll_texts = G_N_ELEMENTS (hadja_text); - + for (i = 0; i < nscroll_texts; i++) { shuffle_array[i] = i; pango_layout_set_text (scroll_layout, scroll_text[i], -1); - pango_layout_get_pixel_size (scroll_layout, + pango_layout_get_pixel_size (scroll_layout, &scroll_text_widths[i], NULL); } - + scroll_state = 0; cur_scroll_index = 0; cur_scroll_text = 0; offset = 0; pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); } - + return FALSE; } @@ -674,7 +673,7 @@ about_dialog_tool_drop (GtkWidget *widget, { shuffle_array[i] = i; pango_layout_set_text (scroll_layout, scroll_text[i], -1); - pango_layout_get_pixel_size (scroll_layout, + pango_layout_get_pixel_size (scroll_layout, &scroll_text_widths[i], NULL); } @@ -757,7 +756,7 @@ about_dialog_timer (gpointer data) cur_scroll_index = 0; cur_scroll_text = shuffle_array[cur_scroll_index]; - pango_layout_set_text (scroll_layout, + pango_layout_set_text (scroll_layout, scroll_text[cur_scroll_text], -1); offset = 0; } diff --git a/app/gui/channels-commands.c b/app/gui/channels-commands.c index 98ea8ebac8..8987b35a2f 100644 --- a/app/gui/channels-commands.c +++ b/app/gui/channels-commands.c @@ -342,7 +342,7 @@ channels_new_channel_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Channel"), "new_channel_options", + _("New Channel"), "gimp-channel-new", GIMP_STOCK_CHANNEL, _("New Channel Options"), gimp_standard_help_func, @@ -503,7 +503,7 @@ channels_edit_channel_query (GimpChannel *channel) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (channel), - _("Channel Attributes"), "edit_channel_attributes", + _("Channel Attributes"), "gimp-channel-edit", GIMP_STOCK_EDIT, _("Edit Channel Attributes"), gimp_standard_help_func, diff --git a/app/gui/color-notebook.c b/app/gui/color-notebook.c index 2856a8bed1..97a0581baa 100644 --- a/app/gui/color-notebook.c +++ b/app/gui/color-notebook.c @@ -84,7 +84,7 @@ struct _ColorNotebook static ColorNotebook * color_notebook_new_internal (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpDialogFactory *dialog_factory, @@ -151,7 +151,7 @@ color_notebook_new (const gchar *title, { return color_notebook_new_internal (NULL, title, - "color_selection", + "gimp-color-selection", NULL, NULL, dialog_factory, @@ -176,7 +176,7 @@ color_notebook_viewable_new (GimpViewable *viewable, { return color_notebook_new_internal (viewable, title, - "color_selection", + "gimp-color-selection", stock_id, desc, dialog_factory, diff --git a/app/gui/convert-dialog.c b/app/gui/convert-dialog.c index cb632682cd..14bda5e6b9 100644 --- a/app/gui/convert-dialog.c +++ b/app/gui/convert-dialog.c @@ -128,7 +128,7 @@ convert_to_indexed (GimpImage *gimage) dialog->shell = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), _("Indexed Color Conversion"), - "indexed_color_conversion", + "gimp-image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED, _("Convert Image to Indexed Colors"), gimp_standard_help_func, diff --git a/app/gui/file-dialog-utils.c b/app/gui/file-dialog-utils.c index b63e847331..0eaaecad44 100644 --- a/app/gui/file-dialog-utils.c +++ b/app/gui/file-dialog-utils.c @@ -47,7 +47,7 @@ file_dialog_new (Gimp *gimp, GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *help_id, GCallback ok_callback) { @@ -60,7 +60,7 @@ file_dialog_new (Gimp *gimp, g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL); g_return_val_if_fail (menu_identifier != NULL, NULL); g_return_val_if_fail (title != NULL, NULL); - g_return_val_if_fail (wmclass_name != NULL, NULL); + g_return_val_if_fail (role != NULL, NULL); g_return_val_if_fail (help_id != NULL, NULL); g_return_val_if_fail (ok_callback != NULL, NULL); @@ -71,7 +71,7 @@ file_dialog_new (Gimp *gimp, g_object_set_data (G_OBJECT (filesel), "gimp", gimp); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); - gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), role); gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL); diff --git a/app/gui/file-dialog-utils.h b/app/gui/file-dialog-utils.h index 476cde5284..974b6e5f5b 100644 --- a/app/gui/file-dialog-utils.h +++ b/app/gui/file-dialog-utils.h @@ -26,7 +26,7 @@ GtkWidget * file_dialog_new (Gimp *gimp, GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *help_id, GCallback ok_callback); diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index 0f3aab6fd3..6f9e1c596c 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -98,7 +98,7 @@ file_new_dialog_new (Gimp *gimp) dialog->dialog = gimp_viewable_dialog_new (NULL, - _("New Image"), "new_image", + _("New Image"), "gimp-image-new", GIMP_STOCK_IMAGE, _("Create a New Image"), gimp_standard_help_func, diff --git a/app/gui/file-open-dialog.c b/app/gui/file-open-dialog.c index 8f0d6198d9..4b7f3827c2 100644 --- a/app/gui/file-open-dialog.c +++ b/app/gui/file-open-dialog.c @@ -181,7 +181,7 @@ file_open_dialog_create (Gimp *gimp, global_dialog_factory, "gimp-file-open-dialog", menu_factory, "", - _("Open Image"), "open_image", + _("Open Image"), "gimp-file-open", GIMP_HELP_FILE_OPEN, G_CALLBACK (file_open_ok_callback)); @@ -202,7 +202,7 @@ file_open_dialog_create (Gimp *gimp, GtkWidget *progress; GtkStyle *style; gchar *str; - + /* Catch file-list clicks so we can update the preview thumbnail */ g_signal_connect (tree_sel, "changed", G_CALLBACK (file_open_selchanged_callback), @@ -220,7 +220,7 @@ file_open_dialog_create (Gimp *gimp, &style->base[GTK_STATE_NORMAL]); gtk_widget_modify_bg (ebox, GTK_STATE_INSENSITIVE, &style->base[GTK_STATE_NORMAL]); - + gtk_container_add (GTK_CONTAINER (open_options_frame), ebox); gtk_widget_show (ebox); @@ -240,16 +240,16 @@ file_open_dialog_create (Gimp *gimp, vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (ebox), vbox); gtk_widget_show (vbox); - + button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - + label = gtk_label_new_with_mnemonic (_("_Preview")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_container_add (GTK_CONTAINER (button), label); gtk_widget_show (label); - + g_signal_connect (button, "button_press_event", G_CALLBACK (gtk_true), NULL); @@ -262,22 +262,22 @@ file_open_dialog_create (Gimp *gimp, g_signal_connect (button, "leave_notify_event", G_CALLBACK (gtk_true), NULL); - + vbox2 = gtk_vbox_new (FALSE, 2); gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2); gtk_container_add (GTK_CONTAINER (vbox), vbox2); gtk_widget_show (vbox2); - + hbox = gtk_hbox_new (TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - + open_options_imagefile = gimp_imagefile_new (gimp, NULL); - + open_options_preview = gimp_preview_new (GIMP_VIEWABLE (open_options_imagefile), gimp->config->thumbnail_size, 0, FALSE); - + gtk_widget_ensure_style (open_options_preview); style = gtk_widget_get_style (open_options_preview); gtk_widget_modify_bg (open_options_preview, GTK_STATE_NORMAL, @@ -309,11 +309,11 @@ file_open_dialog_create (Gimp *gimp, /* eek */ { GtkRequisition requisition; - + gtk_widget_size_request (label, &requisition); gtk_widget_set_size_request (label, -1, requisition.height); } - + g_signal_connect (open_options_imagefile, "info_changed", G_CALLBACK (file_open_imagefile_info_changed), label); @@ -329,17 +329,17 @@ file_open_dialog_create (Gimp *gimp, gtk_widget_set_sensitive (GTK_WIDGET (open_options_frame), FALSE); /* The progress bar */ - + progress = gtk_progress_bar_new (); gtk_box_pack_end (GTK_BOX (vbox2), progress, FALSE, FALSE, 0); /* don't gtk_widget_show (progress); */ - + open_options_progress = GTK_PROGRESS_BAR (progress); - + /* eek */ { GtkRequisition requisition; - + gtk_progress_bar_set_text (open_options_progress, "foo"); gtk_widget_size_request (progress, &requisition); gtk_widget_set_size_request (open_options_title, requisition.width, -1); @@ -643,7 +643,7 @@ file_open_ok_callback (GtkWidget *widget, file_open_dialog_open_image (open_dialog, gimp, uri, - entered_filename, + entered_filename, load_file_proc); g_free (uri); @@ -669,7 +669,7 @@ file_open_ok_callback (GtkWidget *widget, } g_strfreev (selections); - + gtk_widget_set_sensitive (open_dialog, TRUE); } @@ -686,7 +686,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog, gimage = file_open_with_proc_and_display (gimp, uri, - entered_filename, + entered_filename, load_proc, &status, &error); diff --git a/app/gui/file-save-dialog.c b/app/gui/file-save-dialog.c index 7a31f24e9a..0a7b2d3664 100644 --- a/app/gui/file-save-dialog.c +++ b/app/gui/file-save-dialog.c @@ -204,7 +204,7 @@ file_save_dialog_create (Gimp *gimp, global_dialog_factory, "gimp-file-save-dialog", menu_factory, "", - _("Save Image"), "save_image", + _("Save Image"), "gimp-file-save", GIMP_HELP_FILE_SAVE, G_CALLBACK (file_save_ok_callback)); } diff --git a/app/gui/gradient-editor-commands.c b/app/gui/gradient-editor-commands.c index 2771dc59ef..dcfef925aa 100644 --- a/app/gui/gradient-editor-commands.c +++ b/app/gui/gradient-editor-commands.c @@ -524,7 +524,7 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget, dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data), - title, "gradient_segment_replicate", + title, "gimp-gradient-segment-replicate", GIMP_STOCK_TOOL_BLEND, desc, gimp_standard_help_func, GIMP_HELP_GRADIENT_EDITOR_REPLICATE, @@ -629,7 +629,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget, dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data), - title, "gradient_segment_split_uniformly", + title, "gimp-gradient-segment_split-uniformly", GIMP_STOCK_TOOL_BLEND, desc, gimp_standard_help_func, GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM, diff --git a/app/gui/gradients-commands.c b/app/gui/gradients-commands.c index d263a0ac89..2a85462df0 100644 --- a/app/gui/gradients-commands.c +++ b/app/gui/gradients-commands.c @@ -78,7 +78,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor) g_free (title); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "save_gradient", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-gradient-save-pov"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); @@ -100,7 +100,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor) g_signal_connect_object (filesel, "destroy", G_CALLBACK (g_object_unref), - gradient, + gradient, G_CONNECT_SWAPPED); gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, diff --git a/app/gui/grid-dialog.c b/app/gui/grid-dialog.c index 389a617e47..69706fc242 100644 --- a/app/gui/grid-dialog.c +++ b/app/gui/grid-dialog.c @@ -77,7 +77,7 @@ grid_dialog_new (GimpImage *gimage) grid_backup = gimp_config_duplicate (GIMP_CONFIG (grid)); dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("Configure Grid"), "configure_grid", + _("Configure Grid"), "gimp-grid-configure", GIMP_STOCK_GRID, _("Configure Image Grid"), gimp_standard_help_func, GIMP_HELP_IMAGE_GRID, diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 3bb591c851..04b057bc8b 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -84,6 +84,10 @@ static void gui_update_progress (Gimp *gimp, static void gui_end_progress (Gimp *gimp, GimpProgress *progress); static void gui_pdb_dialogs_check (Gimp *gimp); +static const gchar * gui_get_program_class (Gimp *gimp); +static gchar * gui_get_display_name (Gimp *gimp, + gint gdisp_ID, + gint *monitor_number); /* public functions */ @@ -107,6 +111,8 @@ gui_vtable_init (Gimp *gimp) gimp->gui_progress_update_func = gui_update_progress; gimp->gui_progress_end_func = gui_end_progress; gimp->gui_pdb_dialogs_check_func = gui_pdb_dialogs_check; + gimp->gui_get_program_class_func = gui_get_program_class; + gimp->gui_get_display_name_func = gui_get_display_name; } @@ -264,3 +270,42 @@ gui_pdb_dialogs_check (Gimp *gimp) palette_select_dialogs_check (); pattern_select_dialogs_check (); } + +static const gchar * +gui_get_program_class (Gimp *gimp) +{ + return gdk_get_program_class (); +} + +static gchar * +gui_get_display_name (Gimp *gimp, + gint gdisp_ID, + gint *monitor_number) +{ + GimpDisplay *gdisp; + GdkScreen *screen; + gint monitor; + + gdisp = gimp_display_get_by_ID (gimp, gdisp_ID); + + if (gdisp) + { + screen = gtk_widget_get_screen (gdisp->shell); + monitor = gdk_screen_get_monitor_at_window (screen, gdisp->shell->window); + } + else + { + gint x, y; + + gdk_display_get_pointer (gdk_display_get_default (), + &screen, &x, &y, NULL); + monitor = gdk_screen_get_monitor_at_point (screen, x, y); + } + + *monitor_number = monitor; + + if (screen) + return gdk_screen_make_display_name (screen); + + return NULL; +} diff --git a/app/gui/image-commands.c b/app/gui/image-commands.c index 44a8daccb7..b3015d9024 100644 --- a/app/gui/image-commands.c +++ b/app/gui/image-commands.c @@ -380,7 +380,7 @@ image_layers_merge_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("Merge Layers"), "layers_merge_options", + _("Merge Layers"), "gimp-image-merge-layers", GIMP_STOCK_MERGE_DOWN, _("Layers Merge Options"), gimp_standard_help_func, diff --git a/app/gui/info-dialog.c b/app/gui/info-dialog.c index d43bbc5cae..8a715e71c2 100644 --- a/app/gui/info-dialog.c +++ b/app/gui/info-dialog.c @@ -40,7 +40,7 @@ static InfoDialog * info_dialog_new_extended (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, @@ -62,13 +62,13 @@ static void info_dialog_update_field (InfoField *info_field); InfoDialog * info_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data) { - return info_dialog_new_extended (viewable, title, wmclass_name, + return info_dialog_new_extended (viewable, title, role, stock_id, desc, help_func, help_data, FALSE); } @@ -76,13 +76,13 @@ info_dialog_new (GimpViewable *viewable, InfoDialog * info_dialog_notebook_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data) { - return info_dialog_new_extended (viewable, title, wmclass_name, + return info_dialog_new_extended (viewable, title, role, stock_id, desc, help_func, help_data, TRUE); } @@ -312,7 +312,7 @@ info_dialog_add_sizeentry (InfoDialog *idialog, static InfoDialog * info_dialog_new_extended (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, @@ -330,7 +330,7 @@ info_dialog_new_extended (GimpViewable *viewable, idialog->nfields = 0; shell = gimp_viewable_dialog_new (viewable, - title, wmclass_name, + title, role, stock_id, desc, help_func, help_data, NULL); diff --git a/app/gui/info-dialog.h b/app/gui/info-dialog.h index 9046a0edf0..0b82a4cb8e 100644 --- a/app/gui/info-dialog.h +++ b/app/gui/info-dialog.h @@ -21,7 +21,7 @@ typedef enum -{ +{ INFO_LABEL, INFO_ENTRY, INFO_SCALE, @@ -59,14 +59,14 @@ struct _InfoDialog InfoDialog *info_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, gpointer help_data); InfoDialog *info_dialog_notebook_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, diff --git a/app/gui/info-window.c b/app/gui/info-window.c index f1081d5b00..7276727380 100644 --- a/app/gui/info-window.c +++ b/app/gui/info-window.c @@ -228,7 +228,7 @@ info_window_create (GimpDisplay *gdisp) type = gimp_image_base_type (gdisp->gimage); info_win = info_dialog_notebook_new (GIMP_VIEWABLE (gdisp->gimage), - _("Info Window"), "info_window", + _("Info Window"), "gimp-info-window", GIMP_STOCK_INFO, _("Image Information"), gimp_standard_help_func, diff --git a/app/gui/layers-commands.c b/app/gui/layers-commands.c index 7f54818306..f845c7b1db 100644 --- a/app/gui/layers-commands.c +++ b/app/gui/layers-commands.c @@ -665,7 +665,7 @@ layers_new_layer_query (GimpImage *gimage, options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Layer"), "new_layer_options", + _("New Layer"), "gimp-layer-new", GIMP_STOCK_LAYER, _("Create a New Layer"), gimp_standard_help_func, @@ -845,8 +845,7 @@ layers_edit_layer_query (GimpLayer *layer) options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (layer), - _("Layer Attributes"), - "edit_layer_attributes", + _("Layer Attributes"), "gimp-layer-edit", GIMP_STOCK_EDIT, _("Edit Layer Attributes"), gimp_standard_help_func, @@ -956,7 +955,7 @@ layers_add_mask_query (GimpLayer *layer) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (layer), - _("Add Layer Mask"), "add_mask_options", + _("Add Layer Mask"), "gimp-layer-add-mask", GTK_STOCK_ADD, _("Add a Mask to the Layer"), gimp_standard_help_func, diff --git a/app/gui/module-browser.c b/app/gui/module-browser.c index c80701e5aa..a1916cf882 100644 --- a/app/gui/module-browser.c +++ b/app/gui/module-browser.c @@ -119,7 +119,7 @@ module_browser_new (Gimp *gimp) browser->gimp = gimp; shell = gimp_viewable_dialog_new (NULL, - _("Module Manager"), "module_db_dialog", + _("Module Manager"), "gimp-modules", GTK_STOCK_EXECUTE, _("Manage Loadable Modules"), gimp_standard_help_func, diff --git a/app/gui/offset-dialog.c b/app/gui/offset-dialog.c index fe1a9bf0de..fd4dd6cb3c 100644 --- a/app/gui/offset-dialog.c +++ b/app/gui/offset-dialog.c @@ -100,7 +100,7 @@ offset_dialog_create (GimpDrawable *drawable) g_warning ("%s: unexpected drawable type", G_STRLOC); off_d->dlg = gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable), - _("Offset"), "offset", + _("Offset"), "gimp-drawable-offset", GIMP_STOCK_TOOL_MOVE, title, gimp_standard_help_func, diff --git a/app/gui/palette-import-dialog.c b/app/gui/palette-import-dialog.c index ebff70b2cc..f548f68bfd 100644 --- a/app/gui/palette-import-dialog.c +++ b/app/gui/palette-import-dialog.c @@ -163,7 +163,7 @@ palette_import_dialog_new (Gimp *gimp) gimp_get_user_context (gimp)); import_dialog->dialog = - gimp_viewable_dialog_new (NULL, _("Import Palette"), "import_palette", + gimp_viewable_dialog_new (NULL, _("Import Palette"), "gimp-palette-import", GTK_STOCK_CONVERT, _("Import a New Palette"), gimp_standard_help_func, diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index f9671befc7..bf01e35b3d 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.c @@ -146,7 +146,7 @@ qmask_channel_query (GimpDisplayShell *shell) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage), - _("Qmask Attributes"), "edit_qmask_attributes", + _("Qmask Attributes"), "gimp-qmask-edit", GIMP_STOCK_QMASK_ON, _("Edit QuickMask Attributes"), gimp_standard_help_func, diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index e9b18d1d93..6c4dc1567d 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -185,7 +185,7 @@ resize_widget_new (GimpViewable *viewable, /* dialog box */ { - const gchar *wmclass = NULL; + const gchar *role = NULL; const gchar *window_title = NULL; const gchar *stock_id = NULL; const gchar *window_desc = NULL; @@ -199,7 +199,7 @@ resize_widget_new (GimpViewable *viewable, switch (resize->target) { case ResizeLayer: - wmclass = "scale_layer"; + role = "gimp-layer-scale"; window_title = _("Scale Layer"); window_desc = _("Scale Layer Options"); help_page = GIMP_HELP_LAYER_SCALE; @@ -207,7 +207,7 @@ resize_widget_new (GimpViewable *viewable, break; case ResizeImage: - wmclass = "scale_image"; + role = "gimp-image-scale"; window_title = _("Scale Image"); window_desc = _("Scale Image Options"); help_page = GIMP_HELP_IMAGE_SCALE; @@ -222,14 +222,14 @@ resize_widget_new (GimpViewable *viewable, switch (resize->target) { case ResizeLayer: - wmclass = "resize_layer"; + role = "gimp-layer-resize"; window_title = _("Layer Boundary Size"); window_desc = _("Set Layer Boundary Size"); help_page = GIMP_HELP_LAYER_RESIZE; break; case ResizeImage: - wmclass = "resize_image"; + role = "gimp-image-resize"; window_title = _("Canvas Size"); window_desc = _("Set Image Canvas Size"); help_page = GIMP_HELP_IMAGE_RESIZE; @@ -241,7 +241,7 @@ resize_widget_new (GimpViewable *viewable, resize->resize_shell = gimp_viewable_dialog_new (viewable, - window_title, wmclass, + window_title, role, stock_id, window_desc, gimp_standard_help_func, help_page, diff --git a/app/gui/splash.c b/app/gui/splash.c index fa4082c396..c6960aa252 100644 --- a/app/gui/splash.c +++ b/app/gui/splash.c @@ -21,7 +21,7 @@ #include #include - + #include "libgimpbase/gimpbase.h" #include "gui-types.h" @@ -56,7 +56,7 @@ splash_create (gboolean show_image) GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); gtk_window_set_title (GTK_WINDOW (win_initstatus), _("GIMP Startup")); - gtk_window_set_wmclass (GTK_WINDOW (win_initstatus), "gimp_startup", "Gimp"); + gtk_window_set_role (GTK_WINDOW (win_initstatus), "gimp-startup"); gtk_window_set_position (GTK_WINDOW (win_initstatus), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (win_initstatus), FALSE); @@ -82,11 +82,11 @@ splash_create (gboolean show_image) { gchar *filename; - filename = g_build_filename (gimp_data_directory (), + filename = g_build_filename (gimp_data_directory (), "images", "gimp_splash.png", NULL); pixbuf = gdk_pixbuf_new_from_file (filename, NULL); g_free (filename); - + if (pixbuf) { GtkWidget *align; @@ -98,7 +98,7 @@ splash_create (gboolean show_image) align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, TRUE, 0); gtk_widget_show (align); - + gtk_container_add (GTK_CONTAINER (align), image); gtk_widget_show (image); } @@ -111,14 +111,14 @@ splash_create (gboolean show_image) label1 = gtk_label_new (_("The GIMP")); gtk_box_pack_start_defaults (GTK_BOX (vbox), label1); gtk_widget_show (label1); - + label2 = gtk_label_new (GIMP_VERSION); gtk_box_pack_start_defaults (GTK_BOX (vbox), label2); gtk_widget_show (label2); line = gtk_hseparator_new (); gtk_box_pack_start_defaults (GTK_BOX (vbox), line); - gtk_widget_show (line); + gtk_widget_show (line); gtk_widget_set_size_request (win_initstatus, DEFAULT_WIDTH, -1); } @@ -161,10 +161,10 @@ splash_update (const gchar *text1, if (text2) gtk_label_set_text (GTK_LABEL (label2), text2); - - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), + + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), CLAMP (percentage, 0.0, 1.0)); - + while (gtk_events_pending ()) gtk_main_iteration (); } @@ -176,7 +176,7 @@ static void splash_map (void) { /* Reenable startup notification after the splash has been shown - * so that the next window that is mapped sends the notification. + * so that the next window that is mapped sends the notification. */ gtk_window_set_auto_startup_notification (TRUE); } diff --git a/app/gui/stroke-dialog.c b/app/gui/stroke-dialog.c index 71c100cf1f..0088bfb033 100644 --- a/app/gui/stroke-dialog.c +++ b/app/gui/stroke-dialog.c @@ -95,7 +95,7 @@ stroke_dialog_new (GimpItem *item, /* the dialog */ dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (item), - _("Stroke Options"), "stroke_options", + _("Stroke Options"), "gimp-stroke-options", stock_id, _("Choose Stroke Style"), gimp_standard_help_func, diff --git a/app/gui/templates-commands.c b/app/gui/templates-commands.c index 2b5dfede24..dddacfffac 100644 --- a/app/gui/templates-commands.c +++ b/app/gui/templates-commands.c @@ -123,7 +123,7 @@ templates_new_template_dialog (Gimp *gimp, GtkWidget *editor; dialog = gimp_viewable_dialog_new (NULL, - _("New Template"), "new_template", + _("New Template"), "gimp-template-new", GIMP_STOCK_TEMPLATE, _("Create a New Template"), gimp_standard_help_func, @@ -194,7 +194,7 @@ templates_edit_template_dialog (Gimp *gimp, GtkWidget *editor; dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (template), - _("Edit Template"), "edit_template", + _("Edit Template"), "gimp-template-edit", GIMP_STOCK_EDIT, _("Edit Template"), gimp_standard_help_func, diff --git a/app/gui/tips-dialog.c b/app/gui/tips-dialog.c index 280096847d..ca94d31ce9 100644 --- a/app/gui/tips-dialog.c +++ b/app/gui/tips-dialog.c @@ -129,7 +129,7 @@ tips_dialog_create (Gimp *gimp) tips_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint (GTK_WINDOW (tips_dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_wmclass (GTK_WINDOW (tips_dialog), "tip_of_the_day", "Gimp"); + gtk_window_set_role (GTK_WINDOW (tips_dialog), "gimp-tip-of-the-day"); gtk_window_set_title (GTK_WINDOW (tips_dialog), _("GIMP Tip of the Day")); gtk_window_set_position (GTK_WINDOW (tips_dialog), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (tips_dialog), TRUE); diff --git a/app/gui/vectors-commands.c b/app/gui/vectors-commands.c index 37031f1198..196a40a868 100644 --- a/app/gui/vectors-commands.c +++ b/app/gui/vectors-commands.c @@ -32,6 +32,7 @@ #include "core/gimpcontainer.h" #include "core/gimpcontext.h" #include "core/gimpimage.h" +#include "core/gimpimage-merge.h" #include "core/gimptoolinfo.h" #include "pdb/procedural_db.h" @@ -448,7 +449,7 @@ vectors_new_vectors_query (GimpImage *gimage, /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), - _("New Path"), "new_path_options", + _("New Path"), "gimp-vectors-new", GIMP_STOCK_TOOL_PATH, _("New Path Options"), gimp_standard_help_func, @@ -564,7 +565,7 @@ vectors_edit_vectors_query (GimpVectors *vectors) /* The dialog */ options->query_box = gimp_viewable_dialog_new (GIMP_VIEWABLE (vectors), - _("Path Attributes"), "edit_path_attributes", + _("Path Attributes"), "gimp-vectors-edit", GIMP_STOCK_EDIT, _("Edit Path Attributes"), gimp_standard_help_func, @@ -666,7 +667,7 @@ vectors_import_query (GimpImage *gimage) g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy, filesel); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "gimp-vectors-import", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-import"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); @@ -728,7 +729,7 @@ vectors_export_query (GimpImage *gimage, g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy, filesel); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "gimp-vectors-export", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-export"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 2cab5aea6d..09df3bbeac 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -86,6 +86,7 @@ plug_in_run (Gimp *gimp, { GPConfig config; GPProcRun proc_run; + gint monitor; if (! plug_in_open (plug_in)) { @@ -102,6 +103,10 @@ plug_in_run (Gimp *gimp, config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips; config.min_colors = CLAMP (gimp->config->min_colors, 27, 256); config.gdisp_ID = gdisp_ID; + config.wm_name = g_get_prgname (); + config.wm_class = gimp_get_program_class (gimp); + config.display_name = gimp_get_display_name (gimp, gdisp_ID, &monitor); + config.monitor_number = monitor; proc_run.name = proc_rec->name; proc_run.nparams = argc; @@ -111,10 +116,15 @@ plug_in_run (Gimp *gimp, ! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || ! wire_flush (plug_in->my_write, plug_in)) { + g_free (config.display_name); + return_vals = procedural_db_return_args (proc_rec, FALSE); + goto done; } + g_free (config.display_name); + plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE); plug_in_ref (plug_in); diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 2cab5aea6d..09df3bbeac 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -86,6 +86,7 @@ plug_in_run (Gimp *gimp, { GPConfig config; GPProcRun proc_run; + gint monitor; if (! plug_in_open (plug_in)) { @@ -102,6 +103,10 @@ plug_in_run (Gimp *gimp, config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips; config.min_colors = CLAMP (gimp->config->min_colors, 27, 256); config.gdisp_ID = gdisp_ID; + config.wm_name = g_get_prgname (); + config.wm_class = gimp_get_program_class (gimp); + config.display_name = gimp_get_display_name (gimp, gdisp_ID, &monitor); + config.monitor_number = monitor; proc_run.name = proc_rec->name; proc_run.nparams = argc; @@ -111,10 +116,15 @@ plug_in_run (Gimp *gimp, ! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || ! wire_flush (plug_in->my_write, plug_in)) { + g_free (config.display_name); + return_vals = procedural_db_return_args (proc_rec, FALSE); + goto done; } + g_free (config.display_name); + plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE); plug_in_ref (plug_in); diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 2cab5aea6d..09df3bbeac 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -86,6 +86,7 @@ plug_in_run (Gimp *gimp, { GPConfig config; GPProcRun proc_run; + gint monitor; if (! plug_in_open (plug_in)) { @@ -102,6 +103,10 @@ plug_in_run (Gimp *gimp, config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips; config.min_colors = CLAMP (gimp->config->min_colors, 27, 256); config.gdisp_ID = gdisp_ID; + config.wm_name = g_get_prgname (); + config.wm_class = gimp_get_program_class (gimp); + config.display_name = gimp_get_display_name (gimp, gdisp_ID, &monitor); + config.monitor_number = monitor; proc_run.name = proc_rec->name; proc_run.nparams = argc; @@ -111,10 +116,15 @@ plug_in_run (Gimp *gimp, ! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) || ! wire_flush (plug_in->my_write, plug_in)) { + g_free (config.display_name); + return_vals = procedural_db_return_args (proc_rec, FALSE); + goto done; } + g_free (config.display_name); + plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE); plug_in_ref (plug_in); diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 15dcbc3638..0b3923b881 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -1242,7 +1242,7 @@ file_dialog_create (GimpCurvesTool *c_tool) file_dlg = GTK_FILE_SELECTION (c_tool->file_dialog); - gtk_window_set_wmclass (GTK_WINDOW (file_dlg), "load_save_curves", "Gimp"); + gtk_window_set_role (GTK_WINDOW (file_dlg), "gimp-load-save-curves"); gtk_window_set_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (file_dlg), 2); diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 5e1aaf4768..d5d493fc89 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -1442,7 +1442,7 @@ file_dialog_create (GimpLevelsTool *l_tool) file_dlg = GTK_FILE_SELECTION (l_tool->file_dialog); - gtk_window_set_wmclass (GTK_WINDOW (file_dlg), "load_save_levels", "Gimp"); + gtk_window_set_role (GTK_WINDOW (file_dlg), "gimp-load-save-levels"); gtk_window_set_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (file_dlg), 2); diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index 2856a8bed1..97a0581baa 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -84,7 +84,7 @@ struct _ColorNotebook static ColorNotebook * color_notebook_new_internal (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpDialogFactory *dialog_factory, @@ -151,7 +151,7 @@ color_notebook_new (const gchar *title, { return color_notebook_new_internal (NULL, title, - "color_selection", + "gimp-color-selection", NULL, NULL, dialog_factory, @@ -176,7 +176,7 @@ color_notebook_viewable_new (GimpViewable *viewable, { return color_notebook_new_internal (viewable, title, - "color_selection", + "gimp-color-selection", stock_id, desc, dialog_factory, diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c index 80ce738845..d2b98164a4 100644 --- a/app/widgets/gimpdock.c +++ b/app/widgets/gimpdock.c @@ -189,7 +189,7 @@ gimp_dock_init (GimpDock *dock) dock->context = NULL; - gtk_window_set_wmclass (GTK_WINDOW (dock), "dock", "Gimp"); + gtk_window_set_role (GTK_WINDOW (dock), "gimp-dock"); gtk_window_set_type_hint (GTK_WINDOW (dock), GDK_WINDOW_TYPE_HINT_UTILITY); gtk_window_set_resizable (GTK_WINDOW (dock), TRUE); diff --git a/app/widgets/gimperrorconsole.c b/app/widgets/gimperrorconsole.c index a2776a1261..a3d236e468 100644 --- a/app/widgets/gimperrorconsole.c +++ b/app/widgets/gimperrorconsole.c @@ -361,7 +361,7 @@ gimp_error_console_save_ext_clicked (GtkWidget *button, filesel = GTK_FILE_SELECTION (console->filesel); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "save_errors", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-save-errors"); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 2); diff --git a/app/widgets/gimptexteditor.c b/app/widgets/gimptexteditor.c index 77ba09c694..c1d8218a5c 100644 --- a/app/widgets/gimptexteditor.c +++ b/app/widgets/gimptexteditor.c @@ -172,7 +172,7 @@ gimp_text_editor_new (const gchar *title, "title", title, NULL); - gtk_window_set_role (GTK_WINDOW (editor), "text_editor"); + gtk_window_set_role (GTK_WINDOW (editor), "gimp-text-editor"); gimp_help_connect (GTK_WIDGET (editor), gimp_standard_help_func, GIMP_HELP_TEXT_EDITOR_DIALOG, NULL); @@ -318,7 +318,7 @@ gimp_text_editor_load (GtkWidget *widget, filesel = GTK_FILE_SELECTION (gtk_file_selection_new (_("Open Text File (UTF-8)"))); - gtk_window_set_wmclass (GTK_WINDOW (filesel), "gimp-text-load-file", "Gimp"); + gtk_window_set_role (GTK_WINDOW (filesel), "gimp-text-load-file"); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index d83c8be7fd..276c48d6f7 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -164,7 +164,7 @@ gimp_toolbox_init (GimpToolbox *toolbox) GtkWidget *main_vbox; GtkWidget *vbox; - gtk_window_set_wmclass (GTK_WINDOW (toolbox), "toolbox", "Gimp"); + gtk_window_set_role (GTK_WINDOW (toolbox), "gimp-toolbox"); gtk_window_set_title (GTK_WINDOW (toolbox), _("The GIMP")); /* Docks are utility windows by default, but the toolbox doesn't fit diff --git a/app/widgets/gimpviewabledialog.c b/app/widgets/gimpviewabledialog.c index 327e6c4ee7..6ad76ddc15 100644 --- a/app/widgets/gimpviewabledialog.c +++ b/app/widgets/gimpviewabledialog.c @@ -154,7 +154,7 @@ gimp_viewable_dialog_destroy (GtkObject *object) GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, @@ -168,13 +168,13 @@ gimp_viewable_dialog_new (GimpViewable *viewable, g_return_val_if_fail (! viewable || GIMP_IS_VIEWABLE (viewable), NULL); g_return_val_if_fail (title != NULL, NULL); - g_return_val_if_fail (wmclass_name != NULL, NULL); + g_return_val_if_fail (role != NULL, NULL); dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG, "title", title, NULL); - gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp"); + gtk_window_set_role (GTK_WINDOW (dialog), role); if (help_func) gimp_help_connect (GTK_WIDGET (dialog), help_func, help_id, dialog); diff --git a/app/widgets/gimpviewabledialog.h b/app/widgets/gimpviewabledialog.h index a66829e382..ab1416ce1f 100644 --- a/app/widgets/gimpviewabledialog.h +++ b/app/widgets/gimpviewabledialog.h @@ -57,7 +57,7 @@ GType gimp_viewable_dialog_get_type (void) G_GNUC_CONST; GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable, const gchar *title, - const gchar *wmclass_name, + const gchar *role, const gchar *stock_id, const gchar *desc, GimpHelpFunc help_func, diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 43cc38af96..6bfed9b479 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -162,6 +162,10 @@ static gboolean _install_cmap = FALSE; static gboolean _show_tool_tips = TRUE; static gint _min_colors = 144; static gint _gdisp_ID = -1; +static gchar *_wm_name = NULL; +static gchar *_wm_class = NULL; +static gchar *_display_name = NULL; +static gint _monitor_number = 0; static const gchar *progname = NULL; static guint8 write_buffer[WRITE_BUFFER_SIZE]; @@ -194,11 +198,11 @@ static GimpPlugInInfo PLUG_IN_INFO; * @info: the PLUG_IN_INFO structure * @argc: the number of arguments * @argv: the arguments - * + * * The main procedure that must be called with the PLUG_IN_INFO structure * and the 'argc' and 'argv' that are passed to "main". - * - * Return value: + * + * Return value: **/ gint gimp_main (const GimpPlugInInfo *info, @@ -382,7 +386,7 @@ gimp_main (const GimpPlugInInfo *info, if (PLUG_IN_INFO.query_proc) (* PLUG_IN_INFO.query_proc) (); - + gimp_close (); return 0; } @@ -394,7 +398,7 @@ gimp_main (const GimpPlugInInfo *info, if (PLUG_IN_INFO.init_proc) (* PLUG_IN_INFO.init_proc) (); - + gimp_close (); return 0; } @@ -417,7 +421,7 @@ gimp_main (const GimpPlugInInfo *info, /** * gimp_quit: - * + * * Forcefully causes the gimp library to exit and close down its * connection to main gimp application. This function never returns. **/ @@ -445,7 +449,7 @@ gimp_quit (void) * @n_return_vals: the number of return values the procedure returns. * @params: the procedure's parameters. * @return_vals: the procedure's return values. - * + * * Installs a new procedure with the PDB (procedural database). * * Call this function from within your Plug-In's query() function for @@ -544,7 +548,7 @@ gimp_install_procedure (const gchar *name, * @params: the procedure's parameters. * @return_vals: the procedure's return values. * @run_proc: the function to call for executing the procedure. - * + * * Installs a new temporary procedure with the PDB (procedural database). * * A temporary procedure is a procedure which is only available while @@ -605,7 +609,7 @@ gimp_install_temp_proc (const gchar *name, /** * gimp_uninstall_temp_proc: * @name: the procedure's name - * + * * Uninstalls a temporary procedure which has previously been * installed using gimp_install_temp_proc(). **/ @@ -622,7 +626,7 @@ gimp_uninstall_temp_proc (const gchar *name) if (! gp_proc_uninstall_write (_writechannel, &proc_uninstall, NULL)) gimp_quit (); - + found = g_hash_table_lookup_extended (temp_proc_ht, name, &hash_name, NULL); if (found) { @@ -635,7 +639,7 @@ gimp_uninstall_temp_proc (const gchar *name) * gimp_run_procedure: * @name: the name of the procedure to run * @n_return_vals: return location for the number of return values - * @Varargs: list of procedure parameters + * @Varargs: list of procedure parameters * * This function calls a GIMP procedure and returns its return values. * @@ -833,14 +837,14 @@ gimp_run_procedure (const gchar *name, } void -gimp_read_expect_msg (WireMessage *msg, +gimp_read_expect_msg (WireMessage *msg, gint type) { while (TRUE) { if (! wire_read_msg (_readchannel, msg, NULL)) gimp_quit (); - + if (msg->type != type) { if (msg->type == GP_TEMP_PROC_RUN || msg->type == GP_QUIT) @@ -863,7 +867,7 @@ gimp_read_expect_msg (WireMessage *msg, * @n_return_vals: return location for the number of return values * @n_params: the number of parameters the procedure takes. * @params: the procedure's parameters array. - * + * * This function calls a GIMP procedure and returns its return values. * * Return value: the procedure's return values. @@ -917,7 +921,7 @@ gimp_run_procedure2 (const gchar *name, * gimp_destroy_params: * @params: the #GimpParam array to destroy * @n_params: the number of elements in the array - * + * * Destroys a #GimpParam array as returned by gimp_run_procedure() **/ void @@ -933,7 +937,7 @@ gimp_destroy_params (GimpParam *params, * gimp_destroy_paramdefs: * @paramdefs: the #GimpParamDef array to destroy * @n_params: the number of elements in the array - * + * * Destroys a #GimpParamDef array as returned by gimp_query_procedure() **/ void @@ -951,10 +955,10 @@ gimp_destroy_paramdefs (GimpParamDef *paramdefs, /** * gimp_tile_width: - * + * * Returns the tile_width the GIMP is using. This is a constant value * given at Plug-In config time. - * + * * Return value: the tile_width **/ guint @@ -965,10 +969,10 @@ gimp_tile_width (void) /** * gimp_tile_height: - * + * * Returns the tile_height the GIMP is using. This is a constant value * given at Plug-In config time. - * + * * Return value: the tile_height **/ guint @@ -979,11 +983,11 @@ gimp_tile_height (void) /** * gimp_shm_ID: - * + * * Returns the shared memory ID used for passing tile data between the GIMP * core and the Plug-In. This is a constant value * given at Plug-In config time. - * + * * Return value: the shared memory ID **/ gint @@ -994,11 +998,11 @@ gimp_shm_ID (void) /** * gimp_shm_addr: - * + * * Returns the address of the shared memory segment used for passing * tile data between the GIMP core and the Plug-In. This is a constant * value given at Plug-In config time. - * + * * Return value: the shared memory address **/ guchar * @@ -1009,12 +1013,12 @@ gimp_shm_addr (void) /** * gimp_gamma: - * + * * Returns the global gamma value the GIMP and all its Plug-Ins should * use. This is a constant value given at Plug-In config time. * * NOTE: this feature is unimplemented. - * + * * Return value: the gamma value **/ gdouble @@ -1025,13 +1029,13 @@ gimp_gamma (void) /** * gimp_install_cmap: - * + * * Returns whether or not the Plug-In should allocate an own colormap * when running on an 8 bit display. This is a constant value given at * Plug-In config time. - * + * * See also: gimp_min_colors() - * + * * Return value: the install_cmap boolean **/ gboolean @@ -1042,13 +1046,13 @@ gimp_install_cmap (void) /** * gimp_min_colors: - * + * * Returns the minimum number of colors to use when allocating an own * colormap on 8 bit displays. This is a constant value given at * Plug-In config time. * * See also: gimp_install_cmap() - * + * * Return value: the minimum number of colors to allocate **/ gint @@ -1059,10 +1063,10 @@ gimp_min_colors (void) /** * gimp_show_tool_tips: - * + * * Returns whether or not the Plug-In should show tooltips. This is a * constant value given at Plug-In config time. - * + * * Return value: the show_tool_tips boolean **/ gboolean @@ -1073,11 +1077,11 @@ gimp_show_tool_tips (void) /** * gimp_default_display: - * + * * Returns the default display ID. This corresponds to the display the * running procedure's menu entry was invoked from. This is a * constant value given at Plug-In config time. - * + * * Return value: the default display ID **/ gint32 @@ -1086,11 +1090,67 @@ gimp_default_display (void) return _gdisp_ID; } +/** + * gimp_wm_name: + * + * Returns the window manager name to be used for plug-in windows. + * This is a constant value given at Plug-In config time. + * + * Return value: the window manager name + **/ +const gchar * +gimp_wm_name (void) +{ + return (const gchar *) _wm_name; +} + +/** + * gimp_wm_class: + * + * Returns the window manager class to be used for plug-in windows. + * This is a constant value given at Plug-In config time. + * + * Return value: the window manager class + **/ +const gchar * +gimp_wm_class (void) +{ + return (const gchar *) _wm_class; +} + +/** + * gimp_display_name: + * + * Returns the display to be used for plug-in windows. + * This is a constant value given at Plug-In config time. + * + * Return value: the display name + **/ +const gchar * +gimp_display_name (void) +{ + return (const gchar *) _display_name; +} + +/** + * gimp_monitor_number: + * + * Returns the monitor number to be used for plug-in windows. + * This is a constant value given at Plug-In config time. + * + * Return value: the monitor number + **/ +gint +gimp_monitor_number (void) +{ + return _monitor_number; +} + /** * gimp_get_progname: - * + * * Returns the Plug-In's executable name. - * + * * Return value: the executable name **/ const gchar * @@ -1101,7 +1161,7 @@ gimp_get_progname (void) /** * gimp_extension_ack: - * + * * Notify the main GIMP application that the extension has been properly * initialized and is ready to run. * @@ -1123,7 +1183,7 @@ gimp_extension_ack (void) /** * gimp_extension_enable: - * + * * Enables asnychronous processing of messages from the main GIMP * application. * @@ -1237,7 +1297,7 @@ gimp_extension_process (guint timeout) void gimp_attach_new_parasite (const gchar *name, gint flags, - gint size, + gint size, gconstpointer data) { GimpParasite *parasite = gimp_parasite_new (name, flags, size, data); @@ -1356,8 +1416,8 @@ gimp_plugin_io_error_handler (GIOChannel *channel, } static gboolean -gimp_write (GIOChannel *channel, - guint8 *buf, +gimp_write (GIOChannel *channel, + guint8 *buf, gulong count, gpointer user_data) { @@ -1502,7 +1562,7 @@ gimp_config (GPConfig *config) else if (config->version > GP_VERSION) { g_message ("Could not execute plug-in \"%s\"\n(%s)\n" - "because it uses an obsolete version of the " + "because it uses an obsolete version of the " "plug-in protocol.", g_get_prgname (), progname); gimp_quit (); @@ -1516,6 +1576,10 @@ gimp_config (GPConfig *config) _show_tool_tips = config->show_tool_tips; _min_colors = config->min_colors; _gdisp_ID = config->gdisp_ID; + _wm_name = g_strdup (config->wm_name); + _wm_class = g_strdup (config->wm_class); + _display_name = g_strdup (config->display_name); + _monitor_number = config->monitor_number; if (_shm_ID != -1) { @@ -1592,7 +1656,7 @@ gimp_temp_proc_run (GPProcRun *proc_run) { GimpRunProc run_proc; - run_proc = (GimpRunProc) g_hash_table_lookup (temp_proc_ht, + run_proc = (GimpRunProc) g_hash_table_lookup (temp_proc_ht, (gpointer) proc_run->name); if (run_proc) @@ -1667,7 +1731,7 @@ gimp_single_message (void) gimp_quit (); gimp_process_message (&msg); - + wire_destroy (&msg); } diff --git a/libgimp/gimp.h b/libgimp/gimp.h index f4b175b67a..cac530550b 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -307,6 +307,10 @@ gboolean gimp_install_cmap (void) G_GNUC_CONST; gint gimp_min_colors (void) G_GNUC_CONST; gboolean gimp_show_tool_tips (void) G_GNUC_CONST; gint32 gimp_default_display (void) G_GNUC_CONST; +const gchar * gimp_wm_name (void) G_GNUC_CONST; +const gchar * gimp_wm_class (void) G_GNUC_CONST; +const gchar * gimp_display_name (void) G_GNUC_CONST; +gint gimp_monitor_number (void) G_GNUC_CONST; const gchar * gimp_get_progname (void) G_GNUC_CONST; diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c index 77f9cdf5b7..dc38ef340e 100644 --- a/libgimp/gimpui.c +++ b/libgimp/gimpui.c @@ -7,8 +7,8 @@ * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -44,8 +44,8 @@ static void gimp_ui_help_func (const gchar *help_id, * used GIMP Library widgets contains a preview (like the image * menu returned by gimp_image_menu_new()). * - * This function initializes GTK+ with gtk_init() and initializes GDK's - * image rendering subsystem (GdkRGB) to follow the GIMP main program's + * This function initializes GTK+ with gtk_init() and initializes GDK's + * image rendering subsystem (GdkRGB) to follow the GIMP main program's * colormap allocation/installation policy. * * The GIMP's colormap policy can be determinded by the user with the @@ -59,20 +59,38 @@ gimp_ui_init (const gchar *prog_name, GimpWidgetsVTable vtable; - gint argc; - gchar **argv; - gchar *user_gtkrc; - - GdkScreen *screen; + const gchar *display_name; + gint argc; + gchar **argv; + gchar *user_gtkrc; + GdkScreen *screen; g_return_if_fail (prog_name != NULL); if (initialized) return; - argc = 1; - argv = g_new (gchar *, 1); + display_name = gimp_display_name (); + + if (display_name) + { + const gchar *var_name; + +#if defined (GDK_WINDOWING_X11) + var_name = "DISPLAY"; +#elif defined (GDK_WINDOWING_DIRECTFB) || defined (GDK_WINDOWING_FB) + var_name = "GDK_DISPLAY"; +#endif + + if (var_name) + putenv (g_strdup_printf ("%s=%s", var_name, display_name)); + } + + argc = 3; + argv = g_new (gchar *, 3); argv[0] = g_strdup (prog_name); + argv[1] = g_strdup_printf ("--name=%s", gimp_wm_name ()); + argv[2] = g_strdup_printf ("--class=%s", gimp_wm_class ()); gtk_init (&argc, &argv); gtk_rc_parse (gimp_gtkrc ()); diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c index 18c0ed492f..b3d44d3baf 100644 --- a/libgimpbase/gimpprotocol.c +++ b/libgimpbase/gimpprotocol.c @@ -451,7 +451,7 @@ _gp_config_read (GIOChannel *channel, { GPConfig *config; - config = g_new (GPConfig, 1); + config = g_new0 (GPConfig, 1); if (! wire_read_int32 (channel, &config->version, 1, user_data)) goto cleanup; @@ -472,10 +472,22 @@ _gp_config_read (GIOChannel *channel, if (! wire_read_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data)) goto cleanup; + if (! wire_read_string (channel, &config->wm_name, 1, user_data)) + goto cleanup; + if (! wire_read_string (channel, &config->wm_class, 1, user_data)) + goto cleanup; + if (! wire_read_string (channel, &config->display_name, 1, user_data)) + goto cleanup; + if (! wire_read_int32 (channel, (guint32*) &config->monitor_number, 1, user_data)) + goto cleanup; + msg->data = config; return; cleanup: + g_free (config->wm_name); + g_free (config->wm_class); + g_free (config->display_name); g_free (config); } @@ -505,12 +517,27 @@ _gp_config_write (GIOChannel *channel, return; if (! wire_write_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data)) return; + if (! wire_write_string (channel, &config->wm_name, 1, user_data)) + return; + if (! wire_write_string (channel, &config->wm_class, 1, user_data)) + return; + if (! wire_write_string (channel, &config->display_name, 1, user_data)) + return; + if (! wire_write_int32 (channel, (guint32*) &config->monitor_number, 1, user_data)) + return; } static void _gp_config_destroy (WireMessage *msg) { - g_free (msg->data); + GPConfig *config; + + config = msg->data; + + g_free (config->wm_name); + g_free (config->wm_class); + g_free (config->display_name); + g_free (config); } /* tile_req */ @@ -522,7 +549,7 @@ _gp_tile_req_read (GIOChannel *channel, { GPTileReq *tile_req; - tile_req = g_new (GPTileReq, 1); + tile_req = g_new0 (GPTileReq, 1); if (! wire_read_int32 (channel, (guint32*) &tile_req->drawable_ID, 1, user_data)) @@ -683,7 +710,7 @@ _gp_proc_run_read (GIOChannel *channel, { GPProcRun *proc_run; - proc_run = g_new (GPProcRun, 1); + proc_run = g_new0 (GPProcRun, 1); if (! wire_read_string (channel, &proc_run->name, 1, user_data)) goto cleanup; @@ -735,7 +762,7 @@ _gp_proc_return_read (GIOChannel *channel, { GPProcReturn *proc_return; - proc_return = g_new (GPProcReturn, 1); + proc_return = g_new0 (GPProcReturn, 1); if (! wire_read_string (channel, &proc_return->name, 1, user_data)) goto cleanup; @@ -1053,7 +1080,7 @@ _gp_proc_uninstall_read (GIOChannel *channel, { GPProcUninstall *proc_uninstall; - proc_uninstall = g_new (GPProcUninstall, 1); + proc_uninstall = g_new0 (GPProcUninstall, 1); if (! wire_read_string (channel, &proc_uninstall->name, 1, user_data)) goto cleanup; @@ -1129,7 +1156,7 @@ _gp_params_read (GIOChannel *channel, return; } - *params = g_new (GPParam, *nparams); + *params = g_new0 (GPParam, *nparams); for (i = 0; i < *nparams; i++) { diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h index 2a9038a115..22cd5135c1 100644 --- a/libgimpbase/gimpprotocol.h +++ b/libgimpbase/gimpprotocol.h @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,7 @@ G_BEGIN_DECLS /* Increment every time the protocol changes */ -#define GP_VERSION 0x000E +#define GP_VERSION 0x000F enum @@ -62,15 +62,19 @@ typedef struct _GPProcUninstall GPProcUninstall; struct _GPConfig { - guint32 version; - guint32 tile_width; - guint32 tile_height; - gint32 shm_ID; - gdouble gamma; - gint8 install_cmap; - gint8 show_tool_tips; - gint32 min_colors; - gint32 gdisp_ID; + guint32 version; + guint32 tile_width; + guint32 tile_height; + gint32 shm_ID; + gdouble gamma; + gint8 install_cmap; + gint8 show_tool_tips; + gint32 min_colors; + gint32 gdisp_ID; + gchar *wm_name; + gchar *wm_class; + gchar *display_name; + gint32 monitor_number; }; struct _GPTileReq diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c index 9c0e87285e..e064daeb54 100644 --- a/libgimpwidgets/gimpfileentry.c +++ b/libgimpwidgets/gimpfileentry.c @@ -1,4 +1,4 @@ -/* LIBGIMP - The GIMP Library +/* LIBGIMP - The GIMP Library * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * * gimpfileselection.c @@ -8,10 +8,10 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -114,7 +114,7 @@ gimp_file_selection_class_init (GimpFileSelectionClass *klass) parent_class = g_type_class_peek_parent (klass); - gimp_file_selection_signals[FILENAME_CHANGED] = + gimp_file_selection_signals[FILENAME_CHANGED] = g_signal_new ("filename_changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, @@ -283,11 +283,11 @@ gimp_file_selection_entry_callback (GtkWidget *widget, (filename[len - 1] == G_DIR_SEPARATOR)) filename[len - 1] = '\0'; - g_signal_handlers_block_by_func (selection->entry, + g_signal_handlers_block_by_func (selection->entry, gimp_file_selection_entry_callback, selection); gtk_entry_set_text (GTK_ENTRY (selection->entry), filename); - g_signal_handlers_unblock_by_func (selection->entry, + g_signal_handlers_unblock_by_func (selection->entry, gimp_file_selection_entry_callback, selection); @@ -342,13 +342,13 @@ gimp_file_selection_browse_callback (GtkWidget *widget, selection = GIMP_FILE_SELECTION (data); filename = gtk_editable_get_chars (GTK_EDITABLE (selection->entry), 0, -1); - + if (selection->file_selection == NULL) { if (selection->dir_only) { - selection->file_selection = - gtk_file_selection_new (selection->title ? + selection->file_selection = + gtk_file_selection_new (selection->title ? selection->title : _("Select Folder")); /* hiding these widgets uses internal gtk+ knowledge, but it's @@ -361,15 +361,15 @@ gimp_file_selection_browse_callback (GtkWidget *widget, } else { - selection->file_selection = - gtk_file_selection_new (selection->title ? + selection->file_selection = + gtk_file_selection_new (selection->title ? selection->title : _("Select File")); } gtk_window_set_position (GTK_WINDOW (selection->file_selection), GTK_WIN_POS_MOUSE); - gtk_window_set_wmclass (GTK_WINDOW (selection->file_selection), - "file_select", "Gimp"); + gtk_window_set_role (GTK_WINDOW (selection->file_selection), + "gimp-file-entry-file-selection"); /* slightly compress the dialog */ gtk_container_set_border_width (GTK_CONTAINER (selection->file_selection), @@ -429,6 +429,6 @@ gimp_file_selection_check_filename (GimpFileSelection *selection) g_free (filename); gtk_image_set_from_stock (GTK_IMAGE (selection->file_exists), - exists ? GTK_STOCK_YES : GTK_STOCK_NO, + exists ? GTK_STOCK_YES : GTK_STOCK_NO, GTK_ICON_SIZE_BUTTON); } diff --git a/libgimpwidgets/gimpfileselection.c b/libgimpwidgets/gimpfileselection.c index 9c0e87285e..e064daeb54 100644 --- a/libgimpwidgets/gimpfileselection.c +++ b/libgimpwidgets/gimpfileselection.c @@ -1,4 +1,4 @@ -/* LIBGIMP - The GIMP Library +/* LIBGIMP - The GIMP Library * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * * gimpfileselection.c @@ -8,10 +8,10 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -114,7 +114,7 @@ gimp_file_selection_class_init (GimpFileSelectionClass *klass) parent_class = g_type_class_peek_parent (klass); - gimp_file_selection_signals[FILENAME_CHANGED] = + gimp_file_selection_signals[FILENAME_CHANGED] = g_signal_new ("filename_changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, @@ -283,11 +283,11 @@ gimp_file_selection_entry_callback (GtkWidget *widget, (filename[len - 1] == G_DIR_SEPARATOR)) filename[len - 1] = '\0'; - g_signal_handlers_block_by_func (selection->entry, + g_signal_handlers_block_by_func (selection->entry, gimp_file_selection_entry_callback, selection); gtk_entry_set_text (GTK_ENTRY (selection->entry), filename); - g_signal_handlers_unblock_by_func (selection->entry, + g_signal_handlers_unblock_by_func (selection->entry, gimp_file_selection_entry_callback, selection); @@ -342,13 +342,13 @@ gimp_file_selection_browse_callback (GtkWidget *widget, selection = GIMP_FILE_SELECTION (data); filename = gtk_editable_get_chars (GTK_EDITABLE (selection->entry), 0, -1); - + if (selection->file_selection == NULL) { if (selection->dir_only) { - selection->file_selection = - gtk_file_selection_new (selection->title ? + selection->file_selection = + gtk_file_selection_new (selection->title ? selection->title : _("Select Folder")); /* hiding these widgets uses internal gtk+ knowledge, but it's @@ -361,15 +361,15 @@ gimp_file_selection_browse_callback (GtkWidget *widget, } else { - selection->file_selection = - gtk_file_selection_new (selection->title ? + selection->file_selection = + gtk_file_selection_new (selection->title ? selection->title : _("Select File")); } gtk_window_set_position (GTK_WINDOW (selection->file_selection), GTK_WIN_POS_MOUSE); - gtk_window_set_wmclass (GTK_WINDOW (selection->file_selection), - "file_select", "Gimp"); + gtk_window_set_role (GTK_WINDOW (selection->file_selection), + "gimp-file-entry-file-selection"); /* slightly compress the dialog */ gtk_container_set_border_width (GTK_CONTAINER (selection->file_selection), @@ -429,6 +429,6 @@ gimp_file_selection_check_filename (GimpFileSelection *selection) g_free (filename); gtk_image_set_from_stock (GTK_IMAGE (selection->file_exists), - exists ? GTK_STOCK_YES : GTK_STOCK_NO, + exists ? GTK_STOCK_YES : GTK_STOCK_NO, GTK_ICON_SIZE_BUTTON); } diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index b00f73c1dd..2916a07183 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -116,7 +116,7 @@ create_query_box (const gchar *title, query_box = g_new0 (QueryBox, 1); - query_box->qbox = gimp_dialog_new (title, "query_box", + query_box->qbox = gimp_dialog_new (title, "gimp-query-box", NULL, 0, help_func, help_data, diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index 19d07b9450..4041f4c2fa 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -575,7 +575,7 @@ gimp_unit_menu_create_selection (GimpUnitMenu *menu) GimpUnit unit; gint num_units; - menu->selection = gimp_dialog_new (_("Unit Selection"), "unit_selection", + menu->selection = gimp_dialog_new (_("Unit Selection"), "gimp-unit-selection", GTK_WIDGET (menu), GTK_DIALOG_DESTROY_WITH_PARENT, gimp_standard_help_func, diff --git a/plug-ins/helpbrowser/dialog.c b/plug-ins/helpbrowser/dialog.c index de29f9b895..d30e6217bf 100644 --- a/plug-ins/helpbrowser/dialog.c +++ b/plug-ins/helpbrowser/dialog.c @@ -148,8 +148,8 @@ browser_dialog_open (void) /* the dialog window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_wmclass (GTK_WINDOW (window), "helpbrowser", "Gimp"); gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser")); + gtk_window_set_role (GTK_WINDOW (window), "helpbrowser"); g_signal_connect (window, "destroy", G_CALLBACK (close_callback), diff --git a/plug-ins/ifscompose/ifscompose.c b/plug-ins/ifscompose/ifscompose.c index 974f0e0dd9..b8bab1a6be 100644 --- a/plug-ins/ifscompose/ifscompose.c +++ b/plug-ins/ifscompose/ifscompose.c @@ -2564,7 +2564,7 @@ ifscompose_message_dialog (GtkMessageType type, if (title) gtk_window_set_title (GTK_WINDOW (dlg), title); - gtk_window_set_wmclass (GTK_WINDOW (dlg), "message", "Gimp"); + gtk_window_set_role (GTK_WINDOW (dlg), "ifscompose-message"); gtk_dialog_run (GTK_DIALOG (dlg)); gtk_widget_destroy (dlg); }