[gimp] app: make gimp_data_factory_data_foreach() public
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: make gimp_data_factory_data_foreach() public
- Date: Mon, 4 Jun 2018 10:46:43 +0000 (UTC)
commit 0b4677ec586f3bdb57be6f969a79f82029f31adb
Author: Michael Natterer <mitch gimp org>
Date: Mon Jun 4 12:44:50 2018 +0200
app: make gimp_data_factory_data_foreach() public
...this time without additional shit.
app/core/gimpdatafactory.c | 62 ++++++++++++++++++++++------------------------
app/core/gimpdatafactory.h | 23 +++++++++++------
2 files changed, 45 insertions(+), 40 deletions(-)
---
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index 3f6900188e..900c4a900e 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -64,11 +64,6 @@ enum
};
-typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
- GimpData *data,
- gpointer user_data);
-
-
struct _GimpDataFactoryPrivate
{
Gimp *gimp;
@@ -125,10 +120,6 @@ static gboolean gimp_data_factory_real_data_delete (GimpDataFactory *fa
static void gimp_data_factory_path_notify (GObject *object,
const GParamSpec *pspec,
GimpDataFactory *factory);
-static void gimp_data_factory_data_foreach (GimpDataFactory *factory,
- gboolean skip_internal,
- GimpDataForeachFunc callback,
- gpointer user_data);
static void gimp_data_factory_data_load (GimpDataFactory *factory,
GimpContext *context,
@@ -879,6 +870,35 @@ gimp_data_factory_data_save_single (GimpDataFactory *factory,
return TRUE;
}
+void
+gimp_data_factory_data_foreach (GimpDataFactory *factory,
+ gboolean skip_internal,
+ GimpDataForeachFunc callback,
+ gpointer user_data)
+{
+ GList *list;
+
+ g_return_if_fail (GIMP_IS_DATA_FACTORY (factory));
+ g_return_if_fail (callback != NULL);
+
+ list = GIMP_LIST (factory->priv->container)->queue->head;
+
+ if (skip_internal)
+ {
+ while (list && gimp_data_is_internal (GIMP_DATA (list->data)))
+ list = g_list_next (list);
+ }
+
+ while (list)
+ {
+ GList *next = g_list_next (list);
+
+ callback (factory, list->data, user_data);
+
+ list = next;
+ }
+}
+
GType
gimp_data_factory_get_data_type (GimpDataFactory *factory)
{
@@ -980,30 +1000,6 @@ gimp_data_factory_path_notify (GObject *object,
gimp_unset_busy (priv->gimp);
}
-static void
-gimp_data_factory_data_foreach (GimpDataFactory *factory,
- gboolean skip_internal,
- GimpDataForeachFunc callback,
- gpointer user_data)
-{
- GList *list = GIMP_LIST (factory->priv->container)->queue->head;
-
- if (skip_internal)
- {
- while (list && gimp_data_is_internal (GIMP_DATA (list->data)))
- list = g_list_next (list);
- }
-
- while (list)
- {
- GList *next = g_list_next (list);
-
- callback (factory, list->data, user_data);
-
- list = next;
- }
-}
-
static void
gimp_data_factory_data_load (GimpDataFactory *factory,
GimpContext *context,
diff --git a/app/core/gimpdatafactory.h b/app/core/gimpdatafactory.h
index 2af6e42b87..4f3f0036ff 100644
--- a/app/core/gimpdatafactory.h
+++ b/app/core/gimpdatafactory.h
@@ -25,13 +25,17 @@
#include "gimpobject.h"
-typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
- const gchar *name);
-typedef GList * (* GimpDataLoadFunc) (GimpContext *context,
- GFile *file,
- GInputStream *input,
- GError **error);
-typedef GimpData * (* GimpDataGetStandardFunc) (GimpContext *context);
+typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
+ GimpData *data,
+ gpointer user_data);
+
+typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
+ const gchar *name);
+typedef GList * (* GimpDataLoadFunc) (GimpContext *context,
+ GFile *file,
+ GInputStream *input,
+ GError **error);
+typedef GimpData * (* GimpDataGetStandardFunc) (GimpContext *context);
typedef struct _GimpDataFactoryLoaderEntry GimpDataFactoryLoaderEntry;
@@ -123,6 +127,11 @@ gboolean gimp_data_factory_data_save_single (GimpDataFactory *factory,
GimpData *data,
GError **error);
+void gimp_data_factory_data_foreach (GimpDataFactory *factory,
+ gboolean skip_internal,
+ GimpDataForeachFunc callback,
+ gpointer user_data);
+
GType gimp_data_factory_get_data_type (GimpDataFactory *factory);
GimpContainer * gimp_data_factory_get_container (GimpDataFactory *factory);
GimpContainer * gimp_data_factory_get_container_obsolete
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]