Revert "app: make gimp_data_factory_data_foreach() public"

This reverts commit f521e92d35.
This commit is contained in:
Michael Natterer 2018-06-04 12:34:41 +02:00
parent f521e92d35
commit 6e19413d21
5 changed files with 49 additions and 50 deletions

View File

@ -155,8 +155,6 @@ libappcore_a_sources = \
gimpdata.h \
gimpdatafactory.c \
gimpdatafactory.h \
gimpdataloaderfactory.c \
gimpdataloaderfactory.h \
gimpdocumentlist.c \
gimpdocumentlist.h \
gimpdrawable.c \

View File

@ -131,7 +131,6 @@ typedef struct _GimpToolInfo GimpToolInfo;
/* data objects */
typedef struct _GimpDataFactory GimpDataFactory;
typedef struct _GimpDataLoaderFactory GimpDataLoaderFactory;
typedef struct _GimpData GimpData;
typedef struct _GimpBrush GimpBrush;
typedef struct _GimpBrushCache GimpBrushCache;

View File

@ -1385,10 +1385,17 @@ gimp_context_deserialize_property (GimpConfig *object,
object_name);
if (! deserialize_obj)
{
if (no_data)
{
g_free (*name_loc);
*name_loc = g_strdup (object_name);
}
else
{
deserialize_obj = current;
}
}
g_value_set_object (value, deserialize_obj);

View File

@ -64,6 +64,11 @@ enum
};
typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
GimpData *data,
gpointer user_data);
struct _GimpDataFactoryPrivate
{
Gimp *gimp;
@ -120,6 +125,10 @@ 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,
@ -870,35 +879,6 @@ 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)
{
@ -1000,6 +980,30 @@ 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,

View File

@ -25,10 +25,6 @@
#include "gimpobject.h"
typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
GimpData *data,
gpointer user_data);
typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
const gchar *name);
typedef GList * (* GimpDataLoadFunc) (GimpContext *context,
@ -127,11 +123,6 @@ 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