From 814877cc77189120ace952e658066d483736145c Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sun, 13 Jul 2008 09:48:27 +0000 Subject: [PATCH] Used AdgStyleId instead of gint --- adg/adg-style.c | 16 ++++++++-------- adg/adg-style.h | 7 ++++--- docs/adg-sections.txt | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/adg/adg-style.c b/adg/adg-style.c index 9fb1d863..0f84748d 100644 --- a/adg/adg-style.c +++ b/adg/adg-style.c @@ -139,15 +139,15 @@ set_property (GObject *object, /** - * adg_style_register: + * adg_style_register_id: * @style: an #AdgStyle derived instance * * Registers a new style in the internal register. * * Return value: the new id associated to this style or %0 on errors **/ -gint -adg_style_register (AdgStyle *style) +AdgStyleId +adg_style_register_id (AdgStyle *style) { GPtrArray *pool; @@ -163,7 +163,7 @@ adg_style_register (AdgStyle *style) /** * adg_style_from_id: - * @style: the style type id + * @type: the style type id * @id: the id to get * * Gets the preregistered style identified by @id of @style family. @@ -171,17 +171,17 @@ adg_style_register (AdgStyle *style) * Return value: the requested style or %NULL on errors **/ AdgStyle * -adg_style_from_id (GType style, - gint id) +adg_style_from_id (GType type, + AdgStyleId id) { AdgStyleClass *klass; GPtrArray *pool; - klass = g_type_class_ref (style); + klass = g_type_class_ref (type); g_return_val_if_fail (ADG_IS_STYLE_CLASS (klass), NULL); pool = klass->get_pool (); - /* If @style is valid, @klass will be referenced by the pool items */ + /* If @type is valid, @klass will be referenced by the pool items */ g_type_class_unref (klass); if (id > pool->len) diff --git a/adg/adg-style.h b/adg/adg-style.h index cc8651f9..616533d7 100644 --- a/adg/adg-style.h +++ b/adg/adg-style.h @@ -37,6 +37,7 @@ G_BEGIN_DECLS typedef struct _AdgStyle AdgStyle; typedef struct _AdgStyleClass AdgStyleClass; typedef struct _AdgStylePrivate AdgStylePrivate; +typedef gint AdgStyleId; struct _AdgStyle { @@ -57,9 +58,9 @@ struct _AdgStyleClass }; GType adg_style_get_type (void) G_GNUC_CONST; -gint adg_style_register (AdgStyle *style); -AdgStyle * adg_style_from_id (GType style, - gint id); +AdgStyleId adg_style_register_id (AdgStyle *style); +AdgStyle * adg_style_from_id (GType type, + AdgStyleId id); void adg_style_apply (AdgStyle *style, cairo_t *cr); diff --git a/docs/adg-sections.txt b/docs/adg-sections.txt index dd2ff4fc..f5ea1797 100644 --- a/docs/adg-sections.txt +++ b/docs/adg-sections.txt @@ -57,7 +57,7 @@ ADG_CONTEXT_GET_CLASS AdgStyle -adg_style_register +adg_style_register_id adg_style_from_id adg_style_apply -- 2.11.4.GIT