[evolution-data-server/openismus-work] ebook: make EContactGeo usable in Vala
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work] ebook: make EContactGeo usable in Vala
- Date: Mon, 18 Feb 2013 10:15:54 +0000 (UTC)
commit 0c8685819e68c927b6d1bc2a64fd5f0ca4a6c773
Author: Patrick Ohly <patrick ohly intel com>
Date: Thu Feb 14 17:33:56 2013 +0100
ebook: make EContactGeo usable in Vala
"new E.ContactGeo()" in Vala fails because the struct has no
constructor. Introducing e_contact_geo_new() fixes that problem.
This extends the API instead of changing it. It is still valid
to allocated EContactGeo instances via some other means.
addressbook/libebook-contacts/e-contact.c | 19 +++++++++++++++++++
addressbook/libebook-contacts/e-contact.h | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/libebook-contacts/e-contact.c b/addressbook/libebook-contacts/e-contact.c
index cb277b0..47a7497 100644
--- a/addressbook/libebook-contacts/e-contact.c
+++ b/addressbook/libebook-contacts/e-contact.c
@@ -2478,6 +2478,25 @@ e_contact_inline_local_photos (EContact *contact,
E_CONTACT_DEFINE_BOXED_TYPE (e_contact_photo, "EContactPhoto")
/**
+ * e_contact_geo_new:
+ *
+ * Creates an #EContactGeo struct with all coordinates set to 0.
+ *
+ * Returns: (transfer full): A new #EContactGeo struct.
+ *
+ * Since: 3.7
+ **/
+EContactGeo *
+e_contact_geo_new ()
+{
+ EContactGeo *geo;
+ geo = g_malloc (sizeof(EContactGeo));
+ geo->latitude =
+ geo->longitude = 0;
+ return geo;
+}
+
+/**
* e_contact_geo_free:
* @geo: an #EContactGeo
*
diff --git a/addressbook/libebook-contacts/e-contact.h b/addressbook/libebook-contacts/e-contact.h
index 6c31be7..3dc744c 100644
--- a/addressbook/libebook-contacts/e-contact.h
+++ b/addressbook/libebook-contacts/e-contact.h
@@ -359,6 +359,7 @@ void e_contact_photo_set_uri (EContactPhoto *photo, con
gboolean e_contact_inline_local_photos (EContact *contact,
GError **error);
+EContactGeo * e_contact_geo_new (void);
GType e_contact_geo_get_type (void);
void e_contact_geo_free (EContactGeo *geo);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]