app: make gimp_data_factory_data_foreach() public
...this time without additional shit.
This commit is contained in:
@ -64,11 +64,6 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
|
|
||||||
GimpData *data,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
|
|
||||||
struct _GimpDataFactoryPrivate
|
struct _GimpDataFactoryPrivate
|
||||||
{
|
{
|
||||||
Gimp *gimp;
|
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,
|
static void gimp_data_factory_path_notify (GObject *object,
|
||||||
const GParamSpec *pspec,
|
const GParamSpec *pspec,
|
||||||
GimpDataFactory *factory);
|
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,
|
static void gimp_data_factory_data_load (GimpDataFactory *factory,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
@ -879,6 +870,35 @@ gimp_data_factory_data_save_single (GimpDataFactory *factory,
|
|||||||
return TRUE;
|
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
|
GType
|
||||||
gimp_data_factory_get_data_type (GimpDataFactory *factory)
|
gimp_data_factory_get_data_type (GimpDataFactory *factory)
|
||||||
{
|
{
|
||||||
@ -980,30 +1000,6 @@ gimp_data_factory_path_notify (GObject *object,
|
|||||||
gimp_unset_busy (priv->gimp);
|
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
|
static void
|
||||||
gimp_data_factory_data_load (GimpDataFactory *factory,
|
gimp_data_factory_data_load (GimpDataFactory *factory,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
@ -25,13 +25,17 @@
|
|||||||
#include "gimpobject.h"
|
#include "gimpobject.h"
|
||||||
|
|
||||||
|
|
||||||
typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
|
typedef void (* GimpDataForeachFunc) (GimpDataFactory *factory,
|
||||||
const gchar *name);
|
GimpData *data,
|
||||||
typedef GList * (* GimpDataLoadFunc) (GimpContext *context,
|
gpointer user_data);
|
||||||
GFile *file,
|
|
||||||
GInputStream *input,
|
typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
|
||||||
GError **error);
|
const gchar *name);
|
||||||
typedef GimpData * (* GimpDataGetStandardFunc) (GimpContext *context);
|
typedef GList * (* GimpDataLoadFunc) (GimpContext *context,
|
||||||
|
GFile *file,
|
||||||
|
GInputStream *input,
|
||||||
|
GError **error);
|
||||||
|
typedef GimpData * (* GimpDataGetStandardFunc) (GimpContext *context);
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GimpDataFactoryLoaderEntry GimpDataFactoryLoaderEntry;
|
typedef struct _GimpDataFactoryLoaderEntry GimpDataFactoryLoaderEntry;
|
||||||
@ -123,6 +127,11 @@ gboolean gimp_data_factory_data_save_single (GimpDataFactory *factory,
|
|||||||
GimpData *data,
|
GimpData *data,
|
||||||
GError **error);
|
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);
|
GType gimp_data_factory_get_data_type (GimpDataFactory *factory);
|
||||||
GimpContainer * gimp_data_factory_get_container (GimpDataFactory *factory);
|
GimpContainer * gimp_data_factory_get_container (GimpDataFactory *factory);
|
||||||
GimpContainer * gimp_data_factory_get_container_obsolete
|
GimpContainer * gimp_data_factory_get_container_obsolete
|
||||||
|
Reference in New Issue
Block a user