[evolution-data-server] Register EVCardAttribute as a boxed type
- From: Raul Gutierrez Segales <raulgs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Register EVCardAttribute as a boxed type
- Date: Mon, 16 May 2011 13:22:16 +0000 (UTC)
commit 3c1205d85adee9063252bd747dc7d554b9feeea9
Author: Raul Gutierrez Segales <raul gutierrez segales collabora co uk>
Date: Sat May 14 12:33:25 2011 +0100
Register EVCardAttribute as a boxed type
Without this EVCardAttribute can't be picked up by
g-ir-scanner when trying to generate the GIR file for
libebook.
Also, EVCardAttribute will need to be used by applications
trying to write back to libebook via an introspected binding.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=650169
addressbook/libebook/e-vcard.c | 19 +++++++++++++++++++
addressbook/libebook/e-vcard.h | 3 +++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index 346f3ee..b80d7f5 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -1078,6 +1078,25 @@ e_vcard_attribute_copy (EVCardAttribute *attr)
return a;
}
+GType
+e_vcard_attribute_get_type (void)
+{
+ static volatile gsize type_id__volatile = 0;
+
+ if (g_once_init_enter (&type_id__volatile)) {
+ GType type_id;
+
+ type_id = g_boxed_type_register_static ("EVCardAttribute",
+ (GBoxedCopyFunc) e_vcard_attribute_copy,
+ (GBoxedFreeFunc) e_vcard_attribute_free);
+
+ g_once_init_leave (&type_id__volatile, type_id);
+ }
+
+ return type_id__volatile;
+}
+
+
/**
* e_vcard_remove_attributes:
* @evc: vcard object
diff --git a/addressbook/libebook/e-vcard.h b/addressbook/libebook/e-vcard.h
index 4a41042..65d73ec 100644
--- a/addressbook/libebook/e-vcard.h
+++ b/addressbook/libebook/e-vcard.h
@@ -127,6 +127,8 @@ typedef enum {
#define E_IS_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_VCARD))
#define E_VCARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_VCARD, EVCardClass))
+#define E_TYPE_VCARD_ATTRIBUTE (e_vcard_attribute_get_type ())
+
typedef struct _EVCard EVCard;
typedef struct _EVCardClass EVCardClass;
typedef struct _EVCardPrivate EVCardPrivate;
@@ -162,6 +164,7 @@ gchar * e_vcard_to_string (EVCard *evc, EVCardFormat format
void e_vcard_dump_structure (EVCard *evc);
/* attributes */
+GType e_vcard_attribute_get_type (void);
EVCardAttribute *e_vcard_attribute_new (const gchar *attr_group, const gchar *attr_name);
void e_vcard_attribute_free (EVCardAttribute *attr);
EVCardAttribute *e_vcard_attribute_copy (EVCardAttribute *attr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]