Commit fb315d6c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/display/gimpdisplayshell.c (gimp_display_shell_real_scaled)

2004-10-08  Michael Natterer  <mitch@gimp.org>

	* 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.
parent de68f16e
2004-10-08 Michael Natterer <mitch@gimp.org>
* 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 <sven@gimp.org>
* libgimpthumb/gimpthumbnail.c: added some (disabled) debug output.
......
......@@ -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))
......
......@@ -551,12 +551,12 @@ gimp_display_shell_real_scaled (GimpDisplayShell *shell)
gimp_display_shell_title_update (shell);
/* update the <Image>/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);
}
}
......
......@@ -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 ("<Image>");
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment