libgimp: add instance-private struct to all new objects

Just in case we need it later.
This commit is contained in:
Michael Natterer 2019-08-27 16:47:17 +02:00
parent 96c1f754ba
commit f57725a96a
18 changed files with 120 additions and 54 deletions

View File

@ -23,10 +23,17 @@
#include "gimp.h"
G_DEFINE_TYPE (GimpChannel, gimp_channel, GIMP_TYPE_DRAWABLE)
struct _GimpChannelPrivate
{
gpointer unused;
};
G_DEFINE_TYPE_WITH_PRIVATE (GimpChannel, gimp_channel, GIMP_TYPE_DRAWABLE)
#define parent_class gimp_drawable_parent_class
static void
gimp_channel_class_init (GimpChannelClass *klass)
{
@ -35,6 +42,7 @@ gimp_channel_class_init (GimpChannelClass *klass)
static void
gimp_channel_init (GimpChannel *channel)
{
channel->priv = gimp_channel_get_instance_private (channel);
}
/**

View File

@ -31,6 +31,7 @@ G_BEGIN_DECLS
#include <libgimp/gimpdrawable.h>
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
#define GIMP_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass))
@ -40,10 +41,13 @@ G_BEGIN_DECLS
typedef struct _GimpChannelClass GimpChannelClass;
typedef struct _GimpChannelPrivate GimpChannelPrivate;
struct _GimpChannel
{
GimpDrawable parent_instance;
GimpDrawable parent_instance;
GimpChannelPrivate *priv;
};
struct _GimpChannelClass
@ -59,7 +63,6 @@ struct _GimpChannelClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
@ -72,6 +75,7 @@ GimpChannel * gimp_channel_new (GimpImage *image,
gdouble opacity,
const GimpRGB *color);
G_END_DECLS
#endif /* __GIMP_CHANNEL_H__ */

View File

@ -43,14 +43,14 @@ struct _GimpDisplayPrivate
};
static void gimp_display_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_display_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_display_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_display_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE_WITH_PRIVATE (GimpDisplay, gimp_display, G_TYPE_OBJECT)

View File

@ -28,6 +28,7 @@
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_DISPLAY (gimp_display_get_type ())
@ -43,7 +44,7 @@ typedef struct _GimpDisplayPrivate GimpDisplayPrivate;
struct _GimpDisplay
{
GObject parent_instance;
GObject parent_instance;
GimpDisplayPrivate *priv;
};
@ -61,9 +62,9 @@ struct _GimpDisplayClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_display_get_type (void) G_GNUC_CONST;
gint32 gimp_display_get_id (GimpDisplay *display);

View File

@ -26,10 +26,17 @@
#include "gimptilebackendplugin.h"
G_DEFINE_ABSTRACT_TYPE (GimpDrawable, gimp_drawable, GIMP_TYPE_ITEM)
struct _GimpDrawablePrivate
{
gpointer unused;
};
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GimpDrawable, gimp_drawable, GIMP_TYPE_ITEM)
#define parent_class gimp_drawable_parent_class
static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
@ -38,6 +45,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->priv = gimp_drawable_get_instance_private (drawable);
}

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#include <libgimp/gimpitem.h>
#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ())
@ -40,10 +41,13 @@ G_BEGIN_DECLS
typedef struct _GimpDrawableClass GimpDrawableClass;
typedef struct _GimpDrawablePrivate GimpDrawablePrivate;
struct _GimpDrawable
{
GimpItem parent_instance;
GimpItem parent_instance;
GimpDrawablePrivate *priv;
};
struct _GimpDrawableClass
@ -62,6 +66,7 @@ struct _GimpDrawableClass
void (*_gimp_reserved9) (void);
};
GType gimp_drawable_get_type (void) G_GNUC_CONST;
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API

View File

@ -43,14 +43,14 @@ struct _GimpImagePrivate
};
static void gimp_image_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_image_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_image_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_image_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE_WITH_PRIVATE (GimpImage, gimp_image, G_TYPE_OBJECT)

View File

@ -27,6 +27,7 @@
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
@ -60,9 +61,9 @@ struct _GimpImageClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_image_get_type (void) G_GNUC_CONST;
gint32 gimp_image_get_id (GimpImage *image);

View File

@ -43,14 +43,14 @@ struct _GimpItemPrivate
};
static void gimp_item_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_item_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_item_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_item_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GimpItem, gimp_item, G_TYPE_OBJECT)

View File

@ -30,6 +30,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_ITEM (gimp_item_get_type ())
#define GIMP_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_ITEM, GimpItem))
#define GIMP_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_ITEM, GimpItemClass))
@ -61,13 +62,13 @@ struct _GimpItemClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_item_get_type (void) G_GNUC_CONST;
gint32 gimp_item_get_id (GimpItem *item);
GimpItem * gimp_item_get_by_id (gint32 item_id);
gint32 gimp_item_get_id (GimpItem *item);
GimpItem * gimp_item_get_by_id (gint32 item_id);
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
@ -81,7 +82,6 @@ GList * gimp_item_list_children (GimpItem *item);
#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
gint * gimp_item_get_children_deprecated (gint32 item_id,
gint *num_children);

View File

@ -25,7 +25,13 @@
#include "gimp.h"
G_DEFINE_TYPE (GimpLayer, gimp_layer, GIMP_TYPE_DRAWABLE)
struct _GimpLayerPrivate
{
gpointer unused;
};
G_DEFINE_TYPE_WITH_PRIVATE (GimpLayer, gimp_layer, GIMP_TYPE_DRAWABLE)
#define parent_class gimp_layer_parent_class
@ -38,12 +44,12 @@ gimp_layer_class_init (GimpLayerClass *klass)
static void
gimp_layer_init (GimpLayer *layer)
{
layer->priv = gimp_layer_get_instance_private (layer);
}
/* Public API. */
/**
* gimp_layer_new:
* @image: The image to which to add the layer.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
@ -43,6 +44,8 @@ typedef struct _GimpLayerPrivate GimpLayerPrivate;
struct _GimpLayer
{
GimpDrawable parent_instance;
GimpLayerPrivate *priv;
};
struct _GimpLayerClass
@ -58,7 +61,6 @@ struct _GimpLayerClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
@ -97,7 +99,6 @@ GimpLayer * gimp_layer_copy (GimpLayer *layer);
#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
gint32 gimp_layer_new_deprecated (gint32 image_id,
const gchar *name,
gint width,

View File

@ -24,10 +24,17 @@
#include "gimp.h"
G_DEFINE_TYPE (GimpLayerMask, gimp_layer_mask, GIMP_TYPE_CHANNEL)
struct _GimpLayerMaskPrivate
{
gpointer unused;
};
G_DEFINE_TYPE_WITH_PRIVATE (GimpLayerMask, gimp_layer_mask, GIMP_TYPE_CHANNEL)
#define parent_class gimp_layer_mask_parent_class
static void
gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
{
@ -36,4 +43,5 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
static void
gimp_layer_mask_init (GimpLayerMask *layer_mask)
{
layer_mask->priv = gimp_layer_mask_get_instance_private (layer_mask);
}

View File

@ -30,6 +30,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())
#define GIMP_LAYER_MASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask))
#define GIMP_LAYER_MASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass))
@ -43,7 +44,9 @@ typedef struct _GimpLayerMaskPrivate GimpLayerMaskPrivate;
struct _GimpLayerMask
{
GimpChannel parent_instance;
GimpChannel parent_instance;
GimpLayerMaskPrivate *priv;
};
struct _GimpLayerMaskClass
@ -59,10 +62,9 @@ struct _GimpLayerMaskClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_layer_mask_get_type (void) G_GNUC_CONST;
GType gimp_layer_mask_get_type (void) G_GNUC_CONST;
G_END_DECLS

View File

@ -23,10 +23,17 @@
#include "gimp.h"
G_DEFINE_TYPE (GimpSelection, gimp_selection, GIMP_TYPE_CHANNEL)
struct _GimpSelectionPrivate
{
gpointer unused;
};
G_DEFINE_TYPE_WITH_PRIVATE (GimpSelection, gimp_selection, GIMP_TYPE_CHANNEL)
#define parent_class gimp_selection_parent_class
static void
gimp_selection_class_init (GimpSelectionClass *klass)
{
@ -35,14 +42,15 @@ gimp_selection_class_init (GimpSelectionClass *klass)
static void
gimp_selection_init (GimpSelection *selection)
{
selection->priv = gimp_selection_get_instance_private (selection);
}
/**
* gimp_selection_float:
* @image: ignored
* @image: ignored
* @drawable: The drawable from which to float selection.
* @offx: x offset for translation.
* @offy: y offset for translation.
* @offx: x offset for translation.
* @offy: y offset for translation.
*
* Float the selection from the specified drawable with initial offsets
* as specified.
@ -53,7 +61,7 @@ gimp_selection_init (GimpSelection *selection)
* instantiated as a floating selection. The offsets allow initial
* positioning of the new floating selection.
*
* Returns: (transfer full): The floated layer.
* Returns: (transfer none): The floated layer.
*/
GimpLayer *
gimp_selection_float (GimpImage *image,

View File

@ -39,10 +39,13 @@ G_BEGIN_DECLS
typedef struct _GimpSelectionClass GimpSelectionClass;
typedef struct _GimpSelectionPrivate GimpSelectionPrivate;
struct _GimpSelection
{
GimpChannel parent_instance;
GimpChannel parent_instance;
GimpSelectionPrivate *priv;
};
struct _GimpSelectionClass
@ -58,7 +61,6 @@ struct _GimpSelectionClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};

View File

@ -24,10 +24,17 @@
#include "gimp.h"
G_DEFINE_TYPE (GimpVectors, gimp_vectors, GIMP_TYPE_ITEM)
struct _GimpVectorsPrivate
{
gpointer unused;
};
G_DEFINE_TYPE_WITH_PRIVATE (GimpVectors, gimp_vectors, GIMP_TYPE_ITEM)
#define parent_class gimp_vectors_parent_class
static void
gimp_vectors_class_init (GimpVectorsClass *klass)
{
@ -36,4 +43,5 @@ gimp_vectors_class_init (GimpVectorsClass *klass)
static void
gimp_vectors_init (GimpVectors *vectors)
{
vectors->priv = gimp_vectors_get_instance_private (vectors);
}

View File

@ -30,6 +30,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_VECTORS (gimp_vectors_get_type ())
#define GIMP_VECTORS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS, GimpVectors))
#define GIMP_VECTORS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS, GimpVectorsClass))
@ -43,7 +44,9 @@ typedef struct _GimpVectorsPrivate GimpVectorsPrivate;
struct _GimpVectors
{
GimpItem parent_instance;
GimpItem parent_instance;
GimpVectorsPrivate *priv;
};
struct _GimpVectorsClass
@ -59,11 +62,12 @@ struct _GimpVectorsClass
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_vectors_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GIMP_VECTORS_H__ */