diff --git a/ChangeLog b/ChangeLog index ebbb85d5ae..e39b04968f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-10-08 Michael Natterer + + * app/display/gimpdisplayshell.c (gimp_display_shell_real_scaled) + (gimp_display_shell_flush) + * app/gui/gui-vtable.c (gui_display_create): always pass a + GimpDisplay, not a GimpDisplayShell as "data" to + gimp_ui_manager_update(). + + * app/actions/actions.c (action_data_get_*): removed checks if the + passed data is a GimpDisplayShell and temporarily added g_assert() + to be sure. The assertions will be removed before 2.2. + 2004-10-07 Sven Neumann * libgimpthumb/gimpthumbnail.c: added some (disabled) debug output. diff --git a/app/actions/actions.c b/app/actions/actions.c index fd4c1141bc..b9f8d4aedc 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -227,10 +227,13 @@ action_data_get_gimp (gpointer data) if (! data) return NULL; +#ifdef __GNUC__ +#warning FIXME: remove g_assert() before 2.2 +#endif + g_assert (! GIMP_IS_DISPLAY_SHELL (data)); + if (GIMP_IS_DISPLAY (data)) return ((GimpDisplay *) data)->gimage->gimp; - else if (GIMP_IS_DISPLAY_SHELL (data)) - return ((GimpDisplayShell *) data)->gdisp->gimage->gimp; else if (GIMP_IS_ITEM_TREE_VIEW (data)) return ((GimpItemTreeView *) data)->context->gimp; else if (GIMP_IS_IMAGE_EDITOR (data)) @@ -251,10 +254,13 @@ action_data_get_context (gpointer data) if (! data) return NULL; +#ifdef __GNUC__ +#warning FIXME: remove g_assert() before 2.2 +#endif + g_assert (! GIMP_IS_DISPLAY_SHELL (data)); + if (GIMP_IS_DISPLAY (data)) return gimp_get_user_context (((GimpDisplay *) data)->gimage->gimp); - else if (GIMP_IS_DISPLAY_SHELL (data)) - return gimp_get_user_context (((GimpDisplayShell *) data)->gdisp->gimage->gimp); else if (GIMP_IS_ITEM_TREE_VIEW (data)) return ((GimpItemTreeView *) data)->context; else if (GIMP_IS_CONTAINER_VIEW (data)) @@ -279,10 +285,13 @@ action_data_get_image (gpointer data) if (! data) return NULL; +#ifdef __GNUC__ +#warning FIXME: remove g_assert() before 2.2 +#endif + g_assert (! GIMP_IS_DISPLAY_SHELL (data)); + if (GIMP_IS_DISPLAY (data)) return ((GimpDisplay *) data)->gimage; - else if (GIMP_IS_DISPLAY_SHELL (data)) - return ((GimpDisplayShell *) data)->gdisp->gimage; else if (GIMP_IS_ITEM_TREE_VIEW (data)) return ((GimpItemTreeView *) data)->gimage; else if (GIMP_IS_IMAGE_EDITOR (data)) @@ -303,10 +312,13 @@ action_data_get_display (gpointer data) if (! data) return NULL; +#ifdef __GNUC__ +#warning FIXME: remove g_assert() before 2.2 +#endif + g_assert (! GIMP_IS_DISPLAY_SHELL (data)); + if (GIMP_IS_DISPLAY (data)) return data; - else if (GIMP_IS_DISPLAY_SHELL (data)) - return ((GimpDisplayShell *) data)->gdisp; else if (GIMP_IS_NAVIGATION_EDITOR (data)) return gimp_context_get_display (((GimpNavigationEditor *) data)->context); else if (GIMP_IS_GIMP (data)) @@ -323,6 +335,11 @@ action_data_get_widget (gpointer data) if (! data) return NULL; +#ifdef __GNUC__ +#warning FIXME: remove g_assert() before 2.2 +#endif + g_assert (! GIMP_IS_DISPLAY_SHELL (data)); + if (GIMP_IS_DISPLAY (data)) return ((GimpDisplay *) data)->shell; else if (GIMP_IS_GIMP (data)) diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 1af58fe976..51ad34e39d 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -551,12 +551,12 @@ gimp_display_shell_real_scaled (GimpDisplayShell *shell) gimp_display_shell_title_update (shell); /* update the /View/Zoom menu */ - gimp_ui_manager_update (shell->menubar_manager, shell); + gimp_ui_manager_update (shell->menubar_manager, shell->gdisp); user_context = gimp_get_user_context (shell->gdisp->gimage->gimp); if (shell->gdisp == gimp_context_get_display (user_context)) - gimp_ui_manager_update (shell->popup_manager, shell); + gimp_ui_manager_update (shell->popup_manager, shell->gdisp); } GtkWidget * @@ -1239,12 +1239,12 @@ gimp_display_shell_flush (GimpDisplayShell *shell, { GimpContext *user_context; - gimp_ui_manager_update (shell->menubar_manager, shell); + gimp_ui_manager_update (shell->menubar_manager, shell->gdisp); user_context = gimp_get_user_context (shell->gdisp->gimage->gimp); if (shell->gdisp == gimp_context_get_display (user_context)) - gimp_ui_manager_update (shell->popup_manager, shell); + gimp_ui_manager_update (shell->popup_manager, shell->gdisp); } } diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 0a3f123b4c..7dab6d3152 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -327,9 +327,8 @@ gui_display_create (GimpImage *gimage, GimpUnit unit, gdouble scale) { - GimpDisplayShell *shell; - GimpDisplay *gdisp; - GList *image_managers; + GimpDisplay *gdisp; + GList *image_managers; image_managers = gimp_ui_managers_from_name (""); @@ -338,11 +337,10 @@ gui_display_create (GimpImage *gimage, image_managers->data); - shell = GIMP_DISPLAY_SHELL (gdisp->shell); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), gdisp); - gimp_ui_manager_update (shell->menubar_manager, shell); + gimp_ui_manager_update (GIMP_DISPLAY_SHELL (gdisp->shell)->menubar_manager, + gdisp); return GIMP_OBJECT (gdisp); }