Commit 78dc75a3 authored by Benjamin Otte's avatar Benjamin Otte

styleproperty: Make this an object

parent 3e24b5db
...@@ -55,6 +55,31 @@ static GHashTable *print_funcs = NULL; ...@@ -55,6 +55,31 @@ static GHashTable *print_funcs = NULL;
static GHashTable *properties = NULL; static GHashTable *properties = NULL;
static GPtrArray *__style_property_array = NULL; static GPtrArray *__style_property_array = NULL;
G_DEFINE_TYPE (GtkStyleProperty, _gtk_style_property, G_TYPE_OBJECT)
static void
gtk_style_property_finalize (GObject *object)
{
GtkStyleProperty *property = GTK_STYLE_PROPERTY (object);
g_warning ("finalizing %s `%s', how could this happen?", G_OBJECT_TYPE_NAME (object), property->pspec->name);
G_OBJECT_CLASS (_gtk_style_property_parent_class)->finalize (object);
}
static void
_gtk_style_property_class_init (GtkStylePropertyClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_style_property_finalize;
}
static void
_gtk_style_property_init (GtkStyleProperty *property)
{
}
static void static void
register_conversion_function (GType type, register_conversion_function (GType type,
GtkStyleParseFunc parse, GtkStyleParseFunc parse,
...@@ -3228,7 +3253,7 @@ _gtk_style_property_register (GParamSpec *pspec, ...@@ -3228,7 +3253,7 @@ _gtk_style_property_register (GParamSpec *pspec,
return; return;
} }
node = g_slice_new0 (GtkStyleProperty); node = g_object_new (GTK_TYPE_STYLE_PROPERTY, NULL);
node->flags = flags; node->flags = flags;
node->pspec = pspec; node->pspec = pspec;
node->property_parse_func = property_parse_func; node->property_parse_func = property_parse_func;
......
...@@ -25,7 +25,16 @@ ...@@ -25,7 +25,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GtkStyleProperty GtkStyleProperty; #define GTK_TYPE_STYLE_PROPERTY (_gtk_style_property_get_type ())
#define GTK_STYLE_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_STYLE_PROPERTY, GtkStyleProperty))
#define GTK_STYLE_PROPERTY_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_STYLE_PROPERTY, GtkStylePropertyClass))
#define GTK_IS_STYLE_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_STYLE_PROPERTY))
#define GTK_IS_STYLE_PROPERTY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_STYLE_PROPERTY))
#define GTK_STYLE_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE_PROPERTY, GtkStylePropertyClass))
typedef struct _GtkStyleProperty GtkStyleProperty;
typedef struct _GtkStylePropertyClass GtkStylePropertyClass;
typedef enum { typedef enum {
GTK_STYLE_PROPERTY_INHERIT = (1 << 0) GTK_STYLE_PROPERTY_INHERIT = (1 << 0)
} GtkStylePropertyFlags; } GtkStylePropertyFlags;
...@@ -44,9 +53,10 @@ typedef void (* GtkStylePrintFunc) (const GValue ...@@ -44,9 +53,10 @@ typedef void (* GtkStylePrintFunc) (const GValue
typedef void (* GtkStyleUnsetFunc) (GtkStyleProperties *props, typedef void (* GtkStyleUnsetFunc) (GtkStyleProperties *props,
GtkStateFlags state); GtkStateFlags state);
struct _GtkStyleProperty struct _GtkStyleProperty
{ {
GObject parent;
GParamSpec *pspec; GParamSpec *pspec;
GtkStylePropertyFlags flags; GtkStylePropertyFlags flags;
guint id; guint id;
...@@ -60,6 +70,13 @@ struct _GtkStyleProperty ...@@ -60,6 +70,13 @@ struct _GtkStyleProperty
GtkStyleUnsetFunc unset_func; GtkStyleUnsetFunc unset_func;
}; };
struct _GtkStylePropertyClass
{
GObjectClass parent_class;
};
GType _gtk_style_property_get_type (void) G_GNUC_CONST;
guint _gtk_style_property_get_count (void); guint _gtk_style_property_get_count (void);
const GtkStyleProperty * _gtk_style_property_get (guint id); const GtkStyleProperty * _gtk_style_property_get (guint id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment