From c0732ff863477928736b74c6d2a08b6e573bd646 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sun, 13 Jul 2008 21:53:30 +0000 Subject: [PATCH] Implemented stlye slots on AdgFontStyle --- adg/adg-font-style.c | 18 ++++++++++++++++++ adg/adg-font-style.h | 2 ++ adg/adg-line-style.c | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/adg/adg-font-style.c b/adg/adg-font-style.c index 1fc30b15..c83315bc 100644 --- a/adg/adg-font-style.c +++ b/adg/adg-font-style.c @@ -244,6 +244,24 @@ set_property (GObject *object, /** + * adg_font_style_get_slot: + * + * Gets the slot id for this style class. + * + * Return value: the slot + **/ +AdgStyleSlot +adg_font_style_get_slot (void) +{ + static AdgStyleSlot slot = -1; + + if G_UNLIKELY (slot < 0) + slot = adg_context_get_slot (ADG_TYPE_FONT_STYLE); + + return slot; +} + +/** * adg_font_style_new: * * Constructs a new font style initialized with default params. diff --git a/adg/adg-font-style.h b/adg/adg-font-style.h index 8f1339db..5c3a1e12 100644 --- a/adg/adg-font-style.h +++ b/adg/adg-font-style.h @@ -29,6 +29,7 @@ G_BEGIN_DECLS #define ADG_TYPE_FONT_STYLE (adg_font_style_get_type ()) +#define ADG_SLOT_FONT_STYLE (adg_font_style_get_slot ()) #define ADG_FONT_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADG_TYPE_FONT_STYLE, AdgFontStyle)) #define ADG_FONT_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADG_TYPE_FONT_STYLE, AdgFontStyleClass)) #define ADG_IS_FONT_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADG_TYPE_FONT_STYLE)) @@ -54,6 +55,7 @@ struct _AdgFontStyleClass GType adg_font_style_get_type (void) G_GNUC_CONST; +AdgStyleSlot adg_font_style_get_slot (void) G_GNUC_CONST; AdgStyle * adg_font_style_new (void); const gchar * adg_font_style_get_family (AdgFontStyle *font_style); diff --git a/adg/adg-line-style.c b/adg/adg-line-style.c index aa4f3082..ecd5baf6 100644 --- a/adg/adg-line-style.c +++ b/adg/adg-line-style.c @@ -209,6 +209,13 @@ set_property (GObject *object, } +/** + * adg_line_style_get_slot: + * + * Gets the slot id for this style class. + * + * Return value: the slot + **/ AdgStyleSlot adg_line_style_get_slot (void) { -- 2.11.4.GIT