Commit 301e5c2c authored by Martin Nordholts's avatar Martin Nordholts

app: Maintain a list of GimpImageWindow:s on an app instance level

parent 2d1d2aae
......@@ -232,6 +232,8 @@ gimp_init (Gimp *gimp)
gimp->next_display_ID = 1;
gimp->image_windows = NULL;
gimp->global_buffer = NULL;
gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER, TRUE);
gimp_object_set_static_name (GIMP_OBJECT (gimp->named_buffers),
......@@ -982,6 +984,14 @@ gimp_get_display_iter (Gimp *gimp)
return GIMP_LIST (gimp->displays)->list;
}
GList *
gimp_get_image_window_iter (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return gimp->image_windows;
}
GList *
gimp_get_tool_info_iter (Gimp *gimp)
{
......
......@@ -85,6 +85,8 @@ struct _Gimp
GimpContainer *displays;
gint next_display_ID;
GList *image_windows;
GimpBuffer *global_buffer;
GimpContainer *named_buffers;
......@@ -168,6 +170,7 @@ void gimp_exit (Gimp *gimp,
GList * gimp_get_image_iter (Gimp *gimp);
GList * gimp_get_display_iter (Gimp *gimp);
GList * gimp_get_image_window_iter(Gimp *gimp);
GList * gimp_get_tool_info_iter (Gimp *gimp);
void gimp_set_global_buffer (Gimp *gimp,
......
......@@ -406,16 +406,19 @@ gimp_display_new (Gimp *gimp,
}
if (! window)
window = g_object_new (GIMP_TYPE_IMAGE_WINDOW,
"menu-factory", menu_factory,
"display-factory", display_factory,
/* The window position will be overridden by the
* dialog factory, it is only really used on first
* startup.
*/
display->image ? NULL : "window-position",
GTK_WIN_POS_CENTER,
NULL);
{
window = g_object_new (GIMP_TYPE_IMAGE_WINDOW,
"menu-factory", menu_factory,
"display-factory", display_factory,
/* The window position will be overridden by the
* dialog factory, it is only really used on first
* startup.
*/
display->image ? NULL : "window-position",
GTK_WIN_POS_CENTER,
NULL);
gimp->image_windows = g_list_prepend (gimp->image_windows, window);
}
/* create the shell for the image */
display->shell = gimp_display_shell_new (display, unit, scale,
......@@ -493,6 +496,8 @@ gimp_display_delete (GimpDisplay *display)
}
else
{
Gimp *gimp = display->gimp;
gimp->image_windows = g_list_remove (gimp->image_windows, window);
gtk_widget_destroy (GTK_WIDGET (window));
}
}
......
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