From dd27eb1ec9dd2f5243de1b6ace5c6a495451dd57 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 10 Jan 2003 19:30:32 +0000 Subject: [PATCH] app/widgets/gimpcolormapeditor.c app/widgets/gimpcontainereditor.[ch] pass 2003-01-10 Michael Natterer * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdataeditor.c: pass the editor widget as callback_data to GtkItemFactory callbacks, not a "Gimp" pointer. * app/gui/buffers-commands.c * app/gui/colormap-editor-commands.c * app/gui/data-commands.c * app/gui/documents-commands.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/images-commands.c * app/gui/palette-editor-commands.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c: simply cast the passed "data" pointer instead of calling gimp_widget_get_callback_context(). Don't #include "widgets/gimpwidgets-utils.h". --- ChangeLog | 21 ++++++ app/actions/buffers-commands.c | 21 ++---- app/actions/colormap-commands.c | 11 +-- app/actions/colormap-editor-commands.c | 11 +-- app/actions/data-commands.c | 46 +++--------- app/actions/documents-commands.c | 36 ++-------- app/actions/gradient-editor-commands.c | 98 ++++++-------------------- app/actions/gradients-commands.c | 6 +- app/actions/images-commands.c | 16 +---- app/actions/palette-editor-commands.c | 16 +---- app/actions/palettes-commands.c | 11 +-- app/gui/buffers-commands.c | 21 ++---- app/gui/colormap-editor-commands.c | 11 +-- app/gui/data-commands.c | 46 +++--------- app/gui/documents-commands.c | 36 ++-------- app/gui/gradient-editor-commands.c | 98 ++++++-------------------- app/gui/gradients-commands.c | 6 +- app/gui/images-commands.c | 16 +---- app/gui/palette-editor-commands.c | 16 +---- app/gui/palettes-commands.c | 11 +-- app/gui/patterns-commands.c | 1 - app/widgets/gimpcolormapeditor.c | 2 +- app/widgets/gimpcontainereditor.c | 2 +- app/widgets/gimpcontainereditor.h | 22 +++--- app/widgets/gimpdataeditor.c | 2 +- 25 files changed, 147 insertions(+), 436 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f7d285433..9fa7471d5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2003-01-10 Michael Natterer + + * app/widgets/gimpcolormapeditor.c + * app/widgets/gimpcontainereditor.[ch] + * app/widgets/gimpdataeditor.c: pass the editor widget as + callback_data to GtkItemFactory callbacks, not a "Gimp" pointer. + + * app/gui/buffers-commands.c + * app/gui/colormap-editor-commands.c + * app/gui/data-commands.c + * app/gui/documents-commands.c + * app/gui/gradient-editor-commands.c + * app/gui/gradients-commands.c + * app/gui/images-commands.c + * app/gui/palette-editor-commands.c + * app/gui/palettes-commands.c + + * app/gui/patterns-commands.c: simply cast the passed "data" + pointer instead of calling gimp_widget_get_callback_context(). + Don't #include "widgets/gimpwidgets-utils.h". + 2003-01-10 Michael Natterer Move away from creating all item_factories statically in diff --git a/app/actions/buffers-commands.c b/app/actions/buffers-commands.c index 848a549709..c71d51d781 100644 --- a/app/actions/buffers-commands.c +++ b/app/actions/buffers-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpitemfactory.h" #include "widgets/gimplistitem.h" -#include "widgets/gimpwidgets-utils.h" #include "buffers-commands.h" @@ -47,10 +46,7 @@ buffers_paste_buffer_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_button)); } @@ -61,10 +57,7 @@ buffers_paste_buffer_into_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_into_button)); } @@ -75,10 +68,7 @@ buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button)); } @@ -89,10 +79,7 @@ buffers_delete_buffer_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->delete_button)); } diff --git a/app/actions/colormap-commands.c b/app/actions/colormap-commands.c index 1e5b6343a9..6b2c4bcd5c 100644 --- a/app/actions/colormap-commands.c +++ b/app/actions/colormap-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcolormapeditor.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "color-notebook.h" #include "colormap-editor-commands.h" @@ -58,10 +57,7 @@ colormap_editor_add_color_cmd_callback (GtkWidget *widget, GimpColormapEditor *editor; GimpImage *gimage; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; @@ -85,10 +81,7 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget, GimpImage *gimage; GimpRGB color; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; diff --git a/app/actions/colormap-editor-commands.c b/app/actions/colormap-editor-commands.c index 1e5b6343a9..6b2c4bcd5c 100644 --- a/app/actions/colormap-editor-commands.c +++ b/app/actions/colormap-editor-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcolormapeditor.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "color-notebook.h" #include "colormap-editor-commands.h" @@ -58,10 +57,7 @@ colormap_editor_add_color_cmd_callback (GtkWidget *widget, GimpColormapEditor *editor; GimpImage *gimage; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; @@ -85,10 +81,7 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget, GimpImage *gimage; GimpRGB color; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c index bb0e1643b3..c478c4d2cb 100644 --- a/app/actions/data-commands.c +++ b/app/actions/data-commands.c @@ -23,7 +23,6 @@ #include "gui-types.h" #include "widgets/gimpdatafactoryview.h" -#include "widgets/gimpwidgets-utils.h" #include "data-commands.h" @@ -36,15 +35,10 @@ data_new_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->new_button)) - { - gtk_button_clicked (GTK_BUTTON (view->new_button)); - } + gtk_button_clicked (GTK_BUTTON (view->new_button)); } void @@ -53,15 +47,10 @@ data_duplicate_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->duplicate_button)) - { - gtk_button_clicked (GTK_BUTTON (view->duplicate_button)); - } + gtk_button_clicked (GTK_BUTTON (view->duplicate_button)); } void @@ -70,15 +59,10 @@ data_edit_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->edit_button)) - { - gtk_button_clicked (GTK_BUTTON (view->edit_button)); - } + gtk_button_clicked (GTK_BUTTON (view->edit_button)); } void @@ -87,15 +71,10 @@ data_delete_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->delete_button)) - { - gtk_button_clicked (GTK_BUTTON (view->delete_button)); - } + gtk_button_clicked (GTK_BUTTON (view->delete_button)); } void @@ -104,13 +83,8 @@ data_refresh_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->refresh_button)) - { - gtk_button_clicked (GTK_BUTTON (view->refresh_button)); - } + gtk_button_clicked (GTK_BUTTON (view->refresh_button)); } diff --git a/app/actions/documents-commands.c b/app/actions/documents-commands.c index a60c900ac4..7211eae5e3 100644 --- a/app/actions/documents-commands.c +++ b/app/actions/documents-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpdocumentview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "documents-commands.h" @@ -46,10 +45,7 @@ documents_open_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->open_button)); } @@ -60,10 +56,7 @@ documents_raise_or_open_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->open_button), GDK_SHIFT_MASK); @@ -75,10 +68,7 @@ documents_file_open_dialog_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->open_button), GDK_CONTROL_MASK); @@ -90,10 +80,7 @@ documents_remove_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->remove_button)); } @@ -105,10 +92,7 @@ documents_recreate_preview_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->refresh_button)); } @@ -119,10 +103,7 @@ documents_reload_previews_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button), GDK_SHIFT_MASK); @@ -134,10 +115,7 @@ documents_delete_dangling_documents_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button), GDK_CONTROL_MASK); diff --git a/app/actions/gradient-editor-commands.c b/app/actions/gradient-editor-commands.c index 8354f9fc6f..a552e4600c 100644 --- a/app/actions/gradient-editor-commands.c +++ b/app/actions/gradient-editor-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpgradienteditor.h" #include "widgets/gimpitemfactory.h" #include "widgets/gimpviewabledialog.h" -#include "widgets/gimpwidgets-utils.h" #include "color-notebook.h" #include "gradient-editor-commands.h" @@ -73,10 +72,7 @@ gradient_editor_left_color_cmd_callback (GtkWidget *widget, GimpGradientEditor *editor; GimpGradient *gradient; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -109,10 +105,7 @@ gradient_editor_load_left_cmd_callback (GtkWidget *widget, GimpRGB color; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -184,10 +177,7 @@ gradient_editor_save_left_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); editor->saved_colors[action] = editor->control_sel_l->left_color; } @@ -200,10 +190,7 @@ gradient_editor_right_color_cmd_callback (GtkWidget *widget, GimpGradientEditor *editor; GimpGradient *gradient; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -236,10 +223,7 @@ gradient_editor_load_right_cmd_callback (GtkWidget *widget, GimpRGB color; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -311,10 +295,7 @@ gradient_editor_save_right_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); editor->saved_colors[action] = editor->control_sel_l->left_color; } @@ -324,7 +305,7 @@ gradient_editor_blending_func_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegmentType type; GimpGradientSegment *seg, *aseg; @@ -332,10 +313,7 @@ gradient_editor_blending_func_cmd_callback (GtkWidget *widget, if (! GTK_CHECK_MENU_ITEM (widget)->active) return; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -362,7 +340,7 @@ gradient_editor_coloring_type_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegmentColor color; GimpGradientSegment *seg, *aseg; @@ -370,10 +348,7 @@ gradient_editor_coloring_type_cmd_callback (GtkWidget *widget, if (! GTK_CHECK_MENU_ITEM (widget)->active) return; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -400,17 +375,14 @@ gradient_editor_flip_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *oseg, *oaseg; GimpGradientSegment *seg, *prev, *tmp; GimpGradientSegment *lseg, *rseg; gdouble left, right; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -541,10 +513,7 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget, const gchar *title; const gchar *desc; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); if (editor->control_sel_l == editor->control_sel_r) { @@ -617,10 +586,7 @@ gradient_editor_split_midpoint_cmd_callback (GtkWidget *widget, GimpGradient *gradient; GimpGradientSegment *seg, *lseg, *rseg; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -655,10 +621,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget, const gchar *title; const gchar *desc; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); if (editor->control_sel_l == editor->control_sel_r) { @@ -730,15 +693,12 @@ gradient_editor_delete_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *lseg, *rseg, *seg, *aseg, *next; gdouble join; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -822,14 +782,11 @@ gradient_editor_recenter_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *seg, *aseg; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -855,17 +812,14 @@ gradient_editor_redistribute_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *seg, *aseg; gdouble left, right, seg_len; gint num_segs; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -921,10 +875,7 @@ gradient_editor_blend_color_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gimp_gradient_segments_blend_endpoints (editor->control_sel_l, editor->control_sel_r, @@ -944,10 +895,7 @@ gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gimp_gradient_segments_blend_endpoints (editor->control_sel_l, editor->control_sel_r, diff --git a/app/actions/gradients-commands.c b/app/actions/gradients-commands.c index 8de72a4eed..944ce946dd 100644 --- a/app/actions/gradients-commands.c +++ b/app/actions/gradients-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcontainerview.h" #include "widgets/gimpdatafactoryview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "gradients-commands.h" @@ -54,10 +53,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); gradients_save_as_pov_query (editor); } diff --git a/app/actions/images-commands.c b/app/actions/images-commands.c index fbb3b8d5c4..90180ecfeb 100644 --- a/app/actions/images-commands.c +++ b/app/actions/images-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpimageview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "images-commands.h" @@ -46,10 +45,7 @@ images_raise_displays_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->raise_button)); } @@ -60,10 +56,7 @@ images_new_display_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->new_button)); } @@ -74,10 +67,7 @@ images_delete_image_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->delete_button)); } diff --git a/app/actions/palette-editor-commands.c b/app/actions/palette-editor-commands.c index 132f983702..fd410c2f0b 100644 --- a/app/actions/palette-editor-commands.c +++ b/app/actions/palette-editor-commands.c @@ -30,7 +30,6 @@ #include "widgets/gimppaletteeditor.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "widgets/gimptoolbox-color-area.h" #include "color-notebook.h" @@ -59,10 +58,7 @@ palette_editor_new_color_cmd_callback (GtkWidget *widget, GimpContext *user_context; GimpRGB color; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); @@ -87,10 +83,7 @@ palette_editor_edit_color_cmd_callback (GtkWidget *widget, GimpPaletteEditor *editor; GimpPalette *palette; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); @@ -133,10 +126,7 @@ palette_editor_delete_color_cmd_callback (GtkWidget *widget, GimpPaletteEditor *editor; GimpPalette *palette; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); diff --git a/app/actions/palettes-commands.c b/app/actions/palettes-commands.c index 0927a6ee63..d089bffe41 100644 --- a/app/actions/palettes-commands.c +++ b/app/actions/palettes-commands.c @@ -33,7 +33,6 @@ #include "widgets/gimpitemfactory.h" #include "widgets/gimplistitem.h" #include "widgets/gimppreview.h" -#include "widgets/gimpwidgets-utils.h" #include "palette-import-dialog.h" #include "palettes-commands.h" @@ -63,10 +62,7 @@ palettes_import_palette_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); palette_import_dialog_show (editor->view->context->gimp); } @@ -77,10 +73,7 @@ palettes_merge_palettes_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); palettes_merge_palettes_query (editor); } diff --git a/app/gui/buffers-commands.c b/app/gui/buffers-commands.c index 848a549709..c71d51d781 100644 --- a/app/gui/buffers-commands.c +++ b/app/gui/buffers-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpitemfactory.h" #include "widgets/gimplistitem.h" -#include "widgets/gimpwidgets-utils.h" #include "buffers-commands.h" @@ -47,10 +46,7 @@ buffers_paste_buffer_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_button)); } @@ -61,10 +57,7 @@ buffers_paste_buffer_into_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_into_button)); } @@ -75,10 +68,7 @@ buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button)); } @@ -89,10 +79,7 @@ buffers_delete_buffer_cmd_callback (GtkWidget *widget, { GimpBufferView *view; - view = (GimpBufferView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_BUFFER_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->delete_button)); } diff --git a/app/gui/colormap-editor-commands.c b/app/gui/colormap-editor-commands.c index 1e5b6343a9..6b2c4bcd5c 100644 --- a/app/gui/colormap-editor-commands.c +++ b/app/gui/colormap-editor-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcolormapeditor.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "color-notebook.h" #include "colormap-editor-commands.h" @@ -58,10 +57,7 @@ colormap_editor_add_color_cmd_callback (GtkWidget *widget, GimpColormapEditor *editor; GimpImage *gimage; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; @@ -85,10 +81,7 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget, GimpImage *gimage; GimpRGB color; - editor = (GimpColormapEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_COLORMAP_EDITOR (data); gimage = editor->gimage; diff --git a/app/gui/data-commands.c b/app/gui/data-commands.c index bb0e1643b3..c478c4d2cb 100644 --- a/app/gui/data-commands.c +++ b/app/gui/data-commands.c @@ -23,7 +23,6 @@ #include "gui-types.h" #include "widgets/gimpdatafactoryview.h" -#include "widgets/gimpwidgets-utils.h" #include "data-commands.h" @@ -36,15 +35,10 @@ data_new_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->new_button)) - { - gtk_button_clicked (GTK_BUTTON (view->new_button)); - } + gtk_button_clicked (GTK_BUTTON (view->new_button)); } void @@ -53,15 +47,10 @@ data_duplicate_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->duplicate_button)) - { - gtk_button_clicked (GTK_BUTTON (view->duplicate_button)); - } + gtk_button_clicked (GTK_BUTTON (view->duplicate_button)); } void @@ -70,15 +59,10 @@ data_edit_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->edit_button)) - { - gtk_button_clicked (GTK_BUTTON (view->edit_button)); - } + gtk_button_clicked (GTK_BUTTON (view->edit_button)); } void @@ -87,15 +71,10 @@ data_delete_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->delete_button)) - { - gtk_button_clicked (GTK_BUTTON (view->delete_button)); - } + gtk_button_clicked (GTK_BUTTON (view->delete_button)); } void @@ -104,13 +83,8 @@ data_refresh_data_cmd_callback (GtkWidget *widget, { GimpDataFactoryView *view; - view = (GimpDataFactoryView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DATA_FACTORY_VIEW (data); if (GTK_WIDGET_SENSITIVE (view->refresh_button)) - { - gtk_button_clicked (GTK_BUTTON (view->refresh_button)); - } + gtk_button_clicked (GTK_BUTTON (view->refresh_button)); } diff --git a/app/gui/documents-commands.c b/app/gui/documents-commands.c index a60c900ac4..7211eae5e3 100644 --- a/app/gui/documents-commands.c +++ b/app/gui/documents-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpdocumentview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "documents-commands.h" @@ -46,10 +45,7 @@ documents_open_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->open_button)); } @@ -60,10 +56,7 @@ documents_raise_or_open_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->open_button), GDK_SHIFT_MASK); @@ -75,10 +68,7 @@ documents_file_open_dialog_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->open_button), GDK_CONTROL_MASK); @@ -90,10 +80,7 @@ documents_remove_document_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->remove_button)); } @@ -105,10 +92,7 @@ documents_recreate_preview_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->refresh_button)); } @@ -119,10 +103,7 @@ documents_reload_previews_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button), GDK_SHIFT_MASK); @@ -134,10 +115,7 @@ documents_delete_dangling_documents_cmd_callback (GtkWidget *widget, { GimpDocumentView *view; - view = (GimpDocumentView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_DOCUMENT_VIEW (data); gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button), GDK_CONTROL_MASK); diff --git a/app/gui/gradient-editor-commands.c b/app/gui/gradient-editor-commands.c index 8354f9fc6f..a552e4600c 100644 --- a/app/gui/gradient-editor-commands.c +++ b/app/gui/gradient-editor-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpgradienteditor.h" #include "widgets/gimpitemfactory.h" #include "widgets/gimpviewabledialog.h" -#include "widgets/gimpwidgets-utils.h" #include "color-notebook.h" #include "gradient-editor-commands.h" @@ -73,10 +72,7 @@ gradient_editor_left_color_cmd_callback (GtkWidget *widget, GimpGradientEditor *editor; GimpGradient *gradient; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -109,10 +105,7 @@ gradient_editor_load_left_cmd_callback (GtkWidget *widget, GimpRGB color; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -184,10 +177,7 @@ gradient_editor_save_left_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); editor->saved_colors[action] = editor->control_sel_l->left_color; } @@ -200,10 +190,7 @@ gradient_editor_right_color_cmd_callback (GtkWidget *widget, GimpGradientEditor *editor; GimpGradient *gradient; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -236,10 +223,7 @@ gradient_editor_load_right_cmd_callback (GtkWidget *widget, GimpRGB color; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -311,10 +295,7 @@ gradient_editor_save_right_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); editor->saved_colors[action] = editor->control_sel_l->left_color; } @@ -324,7 +305,7 @@ gradient_editor_blending_func_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegmentType type; GimpGradientSegment *seg, *aseg; @@ -332,10 +313,7 @@ gradient_editor_blending_func_cmd_callback (GtkWidget *widget, if (! GTK_CHECK_MENU_ITEM (widget)->active) return; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -362,7 +340,7 @@ gradient_editor_coloring_type_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegmentColor color; GimpGradientSegment *seg, *aseg; @@ -370,10 +348,7 @@ gradient_editor_coloring_type_cmd_callback (GtkWidget *widget, if (! GTK_CHECK_MENU_ITEM (widget)->active) return; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -400,17 +375,14 @@ gradient_editor_flip_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *oseg, *oaseg; GimpGradientSegment *seg, *prev, *tmp; GimpGradientSegment *lseg, *rseg; gdouble left, right; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -541,10 +513,7 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget, const gchar *title; const gchar *desc; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); if (editor->control_sel_l == editor->control_sel_r) { @@ -617,10 +586,7 @@ gradient_editor_split_midpoint_cmd_callback (GtkWidget *widget, GimpGradient *gradient; GimpGradientSegment *seg, *lseg, *rseg; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -655,10 +621,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget, const gchar *title; const gchar *desc; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); if (editor->control_sel_l == editor->control_sel_r) { @@ -730,15 +693,12 @@ gradient_editor_delete_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *lseg, *rseg, *seg, *aseg, *next; gdouble join; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -822,14 +782,11 @@ gradient_editor_recenter_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *seg, *aseg; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -855,17 +812,14 @@ gradient_editor_redistribute_cmd_callback (GtkWidget *widget, gpointer data, guint action) { - GimpGradientEditor *editor; + GimpGradientEditor *editor; GimpGradient *gradient; GimpGradientSegment *seg, *aseg; gdouble left, right, seg_len; gint num_segs; gint i; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data); @@ -921,10 +875,7 @@ gradient_editor_blend_color_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gimp_gradient_segments_blend_endpoints (editor->control_sel_l, editor->control_sel_r, @@ -944,10 +895,7 @@ gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget, { GimpGradientEditor *editor; - editor = (GimpGradientEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_GRADIENT_EDITOR (data); gimp_gradient_segments_blend_endpoints (editor->control_sel_l, editor->control_sel_r, diff --git a/app/gui/gradients-commands.c b/app/gui/gradients-commands.c index 8de72a4eed..944ce946dd 100644 --- a/app/gui/gradients-commands.c +++ b/app/gui/gradients-commands.c @@ -32,7 +32,6 @@ #include "widgets/gimpcontainerview.h" #include "widgets/gimpdatafactoryview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "gradients-commands.h" @@ -54,10 +53,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); gradients_save_as_pov_query (editor); } diff --git a/app/gui/images-commands.c b/app/gui/images-commands.c index fbb3b8d5c4..90180ecfeb 100644 --- a/app/gui/images-commands.c +++ b/app/gui/images-commands.c @@ -31,7 +31,6 @@ #include "widgets/gimpcontainerlistview.h" #include "widgets/gimpimageview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "images-commands.h" @@ -46,10 +45,7 @@ images_raise_displays_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->raise_button)); } @@ -60,10 +56,7 @@ images_new_display_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->new_button)); } @@ -74,10 +67,7 @@ images_delete_image_cmd_callback (GtkWidget *widget, { GimpImageView *view; - view = (GimpImageView *) gimp_widget_get_callback_context (widget); - - if (! view) - return; + view = GIMP_IMAGE_VIEW (data); gtk_button_clicked (GTK_BUTTON (view->delete_button)); } diff --git a/app/gui/palette-editor-commands.c b/app/gui/palette-editor-commands.c index 132f983702..fd410c2f0b 100644 --- a/app/gui/palette-editor-commands.c +++ b/app/gui/palette-editor-commands.c @@ -30,7 +30,6 @@ #include "widgets/gimppaletteeditor.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "widgets/gimptoolbox-color-area.h" #include "color-notebook.h" @@ -59,10 +58,7 @@ palette_editor_new_color_cmd_callback (GtkWidget *widget, GimpContext *user_context; GimpRGB color; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); @@ -87,10 +83,7 @@ palette_editor_edit_color_cmd_callback (GtkWidget *widget, GimpPaletteEditor *editor; GimpPalette *palette; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); @@ -133,10 +126,7 @@ palette_editor_delete_color_cmd_callback (GtkWidget *widget, GimpPaletteEditor *editor; GimpPalette *palette; - editor = (GimpPaletteEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_PALETTE_EDITOR (data); palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data); diff --git a/app/gui/palettes-commands.c b/app/gui/palettes-commands.c index 0927a6ee63..d089bffe41 100644 --- a/app/gui/palettes-commands.c +++ b/app/gui/palettes-commands.c @@ -33,7 +33,6 @@ #include "widgets/gimpitemfactory.h" #include "widgets/gimplistitem.h" #include "widgets/gimppreview.h" -#include "widgets/gimpwidgets-utils.h" #include "palette-import-dialog.h" #include "palettes-commands.h" @@ -63,10 +62,7 @@ palettes_import_palette_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); palette_import_dialog_show (editor->view->context->gimp); } @@ -77,10 +73,7 @@ palettes_merge_palettes_cmd_callback (GtkWidget *widget, { GimpContainerEditor *editor; - editor = (GimpContainerEditor *) gimp_widget_get_callback_context (widget); - - if (! editor) - return; + editor = GIMP_CONTAINER_EDITOR (data); palettes_merge_palettes_query (editor); } diff --git a/app/gui/patterns-commands.c b/app/gui/patterns-commands.c index 2d6e276890..3a6b862bdc 100644 --- a/app/gui/patterns-commands.c +++ b/app/gui/patterns-commands.c @@ -28,7 +28,6 @@ #include "widgets/gimpcontainerview.h" #include "widgets/gimpdatafactoryview.h" #include "widgets/gimpitemfactory.h" -#include "widgets/gimpwidgets-utils.h" #include "patterns-commands.h" diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c index 880752d9b4..eefa28f502 100644 --- a/app/widgets/gimpcolormapeditor.c +++ b/app/widgets/gimpcolormapeditor.c @@ -252,7 +252,7 @@ gimp_colormap_editor_new (GimpImage *gimage, editor->item_factory = gimp_menu_factory_menu_new (menu_factory, "", GTK_TYPE_MENU, - menu_factory->gimp, + editor, FALSE); /* The palette frame */ diff --git a/app/widgets/gimpcontainereditor.c b/app/widgets/gimpcontainereditor.c index 40d28fdab4..fe510be4bc 100644 --- a/app/widgets/gimpcontainereditor.c +++ b/app/widgets/gimpcontainereditor.c @@ -156,7 +156,7 @@ gimp_container_editor_construct (GimpContainerEditor *editor, editor->item_factory = gimp_menu_factory_menu_new (menu_factory, menu_identifier, GTK_TYPE_MENU, - context->gimp, + editor, FALSE); switch (view_type) diff --git a/app/widgets/gimpcontainereditor.h b/app/widgets/gimpcontainereditor.h index bcfd15a3d9..3e464f43a8 100644 --- a/app/widgets/gimpcontainereditor.h +++ b/app/widgets/gimpcontainereditor.h @@ -57,21 +57,21 @@ struct _GimpContainerEditorClass }; -GType gimp_container_editor_get_type (void) G_GNUC_CONST; +GType gimp_container_editor_get_type (void) G_GNUC_CONST; /* protected */ -gboolean gimp_container_editor_construct (GimpContainerEditor *editor, - GimpViewType view_type, - GimpContainer *container, - GimpContext *context, - gint preview_size, - gboolean reorderable, - gint min_items_x, - gint min_items_y, - GimpMenuFactory *menu_factory, - const gchar *menu_identifier); +gboolean gimp_container_editor_construct (GimpContainerEditor *editor, + GimpViewType view_type, + GimpContainer *container, + GimpContext *context, + gint preview_size, + gboolean reorderable, + gint min_items_x, + gint min_items_y, + GimpMenuFactory *menu_factory, + const gchar *menu_identifier); #endif /* __GIMP_CONTAINER_EDITOR_H__ */ diff --git a/app/widgets/gimpdataeditor.c b/app/widgets/gimpdataeditor.c index 8993f198c8..bf07e256d1 100644 --- a/app/widgets/gimpdataeditor.c +++ b/app/widgets/gimpdataeditor.c @@ -222,7 +222,7 @@ gimp_data_editor_construct (GimpDataEditor *editor, editor->item_factory = gimp_menu_factory_menu_new (menu_factory, menu_identifier, GTK_TYPE_MENU, - gimp, + editor, FALSE); data = (GimpData *)