mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
libgimp: some object's header cleanup.
Using G_DECLARE_*() macros everywhere, aligning functions, including the parent class header…
This commit is contained in:
parent
b1736a6736
commit
87d89ba062
7 changed files with 55 additions and 74 deletions
|
@ -37,8 +37,9 @@ enum
|
|||
};
|
||||
|
||||
|
||||
struct _GimpDisplayPrivate
|
||||
struct _GimpDisplay
|
||||
{
|
||||
GObject parent_instance;
|
||||
gint id;
|
||||
};
|
||||
|
||||
|
@ -53,7 +54,7 @@ static void gimp_display_get_property (GObject *object,
|
|||
GParamSpec *pspec);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GimpDisplay, gimp_display, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GimpDisplay, gimp_display, G_TYPE_OBJECT)
|
||||
|
||||
#define parent_class gimp_display_parent_class
|
||||
|
||||
|
@ -82,7 +83,6 @@ gimp_display_class_init (GimpDisplayClass *klass)
|
|||
static void
|
||||
gimp_display_init (GimpDisplay *display)
|
||||
{
|
||||
display->priv = gimp_display_get_instance_private (display);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -96,7 +96,7 @@ gimp_display_set_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_ID:
|
||||
display->priv->id = g_value_get_int (value);
|
||||
display->id = g_value_get_int (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -116,7 +116,7 @@ gimp_display_get_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_ID:
|
||||
g_value_set_int (value, display->priv->id);
|
||||
g_value_set_int (value, display->id);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -139,7 +139,7 @@ gimp_display_get_property (GObject *object,
|
|||
gint32
|
||||
gimp_display_get_id (GimpDisplay *display)
|
||||
{
|
||||
return display ? display->priv->id : -1;
|
||||
return display ? display->id : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,42 +31,11 @@ G_BEGIN_DECLS
|
|||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#define GIMP_TYPE_DISPLAY (gimp_display_get_type ())
|
||||
#define GIMP_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DISPLAY, GimpDisplay))
|
||||
#define GIMP_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DISPLAY, GimpDisplayClass))
|
||||
#define GIMP_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DISPLAY))
|
||||
#define GIMP_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DISPLAY))
|
||||
#define GIMP_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DISPLAY, GimpDisplayClass))
|
||||
G_DECLARE_FINAL_TYPE (GimpDisplay, gimp_display, GIMP, DISPLAY, GObject)
|
||||
|
||||
|
||||
typedef struct _GimpDisplayClass GimpDisplayClass;
|
||||
typedef struct _GimpDisplayPrivate GimpDisplayPrivate;
|
||||
|
||||
struct _GimpDisplay
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GimpDisplayPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GimpDisplayClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gimp_reserved1) (void);
|
||||
void (*_gimp_reserved2) (void);
|
||||
void (*_gimp_reserved3) (void);
|
||||
void (*_gimp_reserved4) (void);
|
||||
void (*_gimp_reserved5) (void);
|
||||
void (*_gimp_reserved6) (void);
|
||||
void (*_gimp_reserved7) (void);
|
||||
void (*_gimp_reserved8) (void);
|
||||
};
|
||||
|
||||
|
||||
GType gimp_display_get_type (void) G_GNUC_CONST;
|
||||
|
||||
gint32 gimp_display_get_id (GimpDisplay *display);
|
||||
GimpDisplay * gimp_display_get_by_id (gint32 display_id);
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#include <libgimp/gimpdrawable.h>
|
||||
|
||||
|
||||
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
|
||||
G_DECLARE_DERIVABLE_TYPE (GimpLayer, gimp_layer, GIMP, LAYER, GimpDrawable)
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#include <libgimp/gimpchannel.h>
|
||||
|
||||
|
||||
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GimpLayerMask, gimp_layer_mask, GIMP, LAYER_MASK, GimpChannel)
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#include <libgimp/gimpchannel.h>
|
||||
|
||||
|
||||
#define GIMP_TYPE_SELECTION (gimp_selection_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GimpSelection, gimp_selection, GIMP, SELECTION, GimpChannel)
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#include <libgimp/gimplayer.h>
|
||||
|
||||
|
||||
#define GIMP_TYPE_TEXT_LAYER (gimp_text_layer_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GimpTextLayer, gimp_text_layer, GIMP, TEXT_LAYER, GimpLayer)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue