Commit a748e3f5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

add new functions gimp_get_image_iter(), display_iter() and

2008-11-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp.[ch]: add new functions gimp_get_image_iter(),
	display_iter() and tool_info_iter().

	* app/tools/gimp-tools.c
	* app/tools/gimptexttool.c
	* app/tools/gimpvectortool.c
	* app/dialogs/quit-dialog.c
	* app/gui/gui.c
	* app/menus/windows-menu.c
	* app/actions/images-commands.c
	* app/actions/tools-actions.c
	* app/actions/windows-actions.c
	* app/actions/tool-options-commands.c
	* app/display/gimpdisplay.c
	* app/display/gimpdisplay-foreach.c
	* app/widgets/gimptoolbox.c
	* tools/pdbgen/pdb/image.pdb: use them here.

	* app/pdb/image-cmds.c: regenerated.


svn path=/trunk/; revision=27526
parent 189ae4c7
2008-11-02 Michael Natterer <mitch@gimp.org>
* app/core/gimp.[ch]: add new functions gimp_get_image_iter(),
display_iter() and tool_info_iter().
* app/tools/gimp-tools.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/dialogs/quit-dialog.c
* app/gui/gui.c
* app/menus/windows-menu.c
* app/actions/images-commands.c
* app/actions/tools-actions.c
* app/actions/windows-actions.c
* app/actions/tool-options-commands.c
* app/display/gimpdisplay.c
* app/display/gimpdisplay-foreach.c
* app/widgets/gimptoolbox.c
* tools/pdbgen/pdb/image.pdb: use them here.
* app/pdb/image-cmds.c: regenerated.
2008-11-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: add new functions
......
......@@ -24,9 +24,9 @@
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpimageview.h"
......@@ -56,7 +56,7 @@ images_raise_views_cmd_callback (GtkAction *action,
{
GList *list;
for (list = GIMP_LIST (image->gimp->displays)->list;
for (list = gimp_get_display_iter (image->gimp);
list;
list = g_list_next (list))
{
......
......@@ -28,7 +28,6 @@
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "core/gimptooloptions.h"
#include "core/gimptoolpresets.h"
......@@ -215,7 +214,7 @@ tool_options_reset_all_cmd_callback (GtkAction *action,
Gimp *gimp = editor->ui_manager->gimp;
GList *list;
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......
......@@ -27,8 +27,8 @@
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimpactiongroup.h"
......@@ -639,7 +639,7 @@ tools_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (tools_object_2_actions),
G_CALLBACK (tools_object_2_cmd_callback));
for (list = GIMP_LIST (group->gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (group->gimp);
list;
list = g_list_next (list))
{
......
......@@ -107,7 +107,7 @@ windows_actions_setup (GimpActionGroup *group)
G_CALLBACK (windows_actions_display_remove),
group, 0);
for (list = GIMP_LIST (group->gimp->displays)->list;
for (list = gimp_get_display_iter (group->gimp);
list;
list = g_list_next (list))
{
......
......@@ -905,6 +905,30 @@ gimp_exit (Gimp *gimp,
&handled);
}
GList *
gimp_get_image_iter (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return GIMP_LIST (gimp->images)->list;
}
GList *
gimp_get_display_iter (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return GIMP_LIST (gimp->displays)->list;
}
GList *
gimp_get_tool_info_iter (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return GIMP_LIST (gimp->tool_info_list)->list;
}
void
gimp_set_global_buffer (Gimp *gimp,
GimpBuffer *buffer)
......
......@@ -161,6 +161,10 @@ gboolean gimp_is_restored (Gimp *gimp);
void gimp_exit (Gimp *gimp,
gboolean force);
GList * gimp_get_image_iter (Gimp *gimp);
GList * gimp_get_display_iter (Gimp *gimp);
GList * gimp_get_tool_info_iter (Gimp *gimp);
void gimp_set_global_buffer (Gimp *gimp,
GimpBuffer *buffer);
......
......@@ -29,8 +29,8 @@
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
......@@ -252,7 +252,7 @@ quit_close_all_dialog_image_activated (GimpContainerView *view,
{
GList *list;
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......
......@@ -24,9 +24,9 @@
#include "display-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "gimpdisplay.h"
#include "gimpdisplay-foreach.h"
......@@ -41,7 +41,7 @@ gimp_displays_dirty (Gimp *gimp)
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -124,7 +124,7 @@ gimp_displays_get_dirty_images (Gimp *gimp)
G_CALLBACK (gimp_displays_image_clean_callback),
container);
for (list = GIMP_LIST (gimp->images)->list;
for (list = gimp_get_image_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -156,7 +156,7 @@ gimp_displays_delete (Gimp *gimp)
*/
while (! gimp_container_is_empty (gimp->displays))
{
GimpDisplay *display = GIMP_LIST (gimp->displays)->list->data;
GimpDisplay *display = gimp_get_display_iter (gimp)->data;
gimp_display_delete (display);
}
......@@ -177,7 +177,7 @@ gimp_displays_close (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
list = g_list_copy (GIMP_LIST (gimp->displays)->list);
list = g_list_copy (gimp_get_display_iter (gimp));
for (iter = list; iter; iter = g_list_next (iter))
{
......@@ -210,7 +210,7 @@ gimp_displays_reconnect (Gimp *gimp,
contexts = g_list_prepend (contexts, list->data);
}
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -236,7 +236,7 @@ gimp_displays_get_num_visible (Gimp *gimp)
g_return_val_if_fail (GIMP_IS_GIMP (gimp), 0);
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -264,7 +264,7 @@ gimp_displays_set_busy (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -282,7 +282,7 @@ gimp_displays_unset_busy (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......
......@@ -30,8 +30,8 @@
#include "core/gimp.h"
#include "core/gimparea.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimpprogress.h"
#include "tools/gimptool.h"
......@@ -479,7 +479,7 @@ gimp_display_get_by_ID (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......
......@@ -35,7 +35,6 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "plug-in/gimpenvirontable.h"
......@@ -714,7 +713,7 @@ gui_display_changed (GimpContext *context,
{
GList *list;
for (list = GIMP_LIST (gimp->displays)->list;
for (list = gimp_get_display_iter (gimp);
list;
list = g_list_next (list))
{
......
......@@ -95,7 +95,7 @@ windows_menu_setup (GimpUIManager *manager,
G_CALLBACK (windows_menu_display_remove),
manager, 0);
for (list = GIMP_LIST (manager->gimp->displays)->list;
for (list = gimp_get_display_iter (manager->gimp);
list;
list = g_list_next (list))
{
......
......@@ -32,6 +32,7 @@
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage-colormap.h"
#include "core/gimpimage-crop.h"
......@@ -45,7 +46,6 @@
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "core/gimplayermask.h"
#include "core/gimplist.h"
#include "core/gimpparamspecs.h"
#include "core/gimppickable.h"
#include "core/gimpprogress.h"
......@@ -106,7 +106,7 @@ image_list_invoker (GimpProcedure *procedure,
gint32 num_images = 0;
gint32 *image_ids = NULL;
GList *list = GIMP_LIST (gimp->images)->list;
GList *list = gimp_get_image_iter (gimp);
num_images = g_list_length (list);
......
......@@ -195,7 +195,7 @@ gimp_tools_init (Gimp *gimp)
gimp_container_thaw (gimp->tool_info_list);
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -280,7 +280,7 @@ gimp_tools_restore (Gimp *gimp)
g_free (filename);
g_object_unref (gimp_list);
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -297,7 +297,7 @@ gimp_tools_restore (Gimp *gimp)
g_clear_error (&error);
}
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -364,7 +364,7 @@ gimp_tools_save (Gimp *gimp,
gimp_tool_options_create_folder ();
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -396,7 +396,7 @@ gimp_tools_clear (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list && success;
list = g_list_next (list))
{
......
......@@ -36,7 +36,6 @@
#include "core/gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "core/gimpundostack.h"
......@@ -2131,7 +2130,7 @@ gimp_text_tool_set_layer (GimpTextTool *text_tool,
display = NULL;
for (list = GIMP_LIST (tool->tool_info->gimp->displays)->list;
for (list = gimp_get_display_iter (tool->tool_info->gimp);
list;
list = g_list_next (list))
{
......
......@@ -1673,7 +1673,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
display = NULL;
for (list = GIMP_LIST (item->image->gimp->displays)->list;
for (list = gimp_get_display_iter (item->image->gimp);
list;
list = g_list_next (list))
{
......
......@@ -31,7 +31,6 @@
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "file/file-open.h"
......@@ -362,7 +361,7 @@ gimp_toolbox_size_allocate (GtkWidget *widget,
gtk_widget_size_request (tool_button, &button_requisition);
for (list = GIMP_LIST (gimp->tool_info_list)->list, n_tools = 0;
for (list = gimp_get_tool_info_iter (gimp), n_tools = 0;
list;
list = list->next)
{
......@@ -453,7 +452,7 @@ gimp_toolbox_style_set (GtkWidget *widget,
"button-relief", &relief,
NULL);
for (list = GIMP_LIST (gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (gimp);
list;
list = g_list_next (list))
{
......@@ -681,7 +680,7 @@ toolbox_create_tools (GimpToolbox *toolbox,
active_tool = gimp_context_get_tool (context);
for (list = GIMP_LIST (context->gimp->tool_info_list)->list;
for (list = gimp_get_tool_info_iter (context->gimp);
list;
list = g_list_next (list))
{
......
......@@ -65,7 +65,7 @@ HELP
%invoke = (
code => <<CODE
{
GList *list = GIMP_LIST (gimp->images)->list;
GList *list = gimp_get_image_iter (gimp);
num_images = g_list_length (list);
......@@ -2620,7 +2620,7 @@ CODE
"libgimpbase/gimpbase.h"
"base/temp-buf.h"
"core/gimp.h"
"core/gimplist.h"
"core/gimpcontainer.h"
"core/gimpprogress.h"
"core/gimpunit.h"
"gimppdberror.h"
......
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