[gnome-contacts] Add custom wrapper of GnomeDesktopThumbnailFactory



commit 60d577fc5de8aca42e877408ceaa57ab6e3e5a2b
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Aug 31 15:16:59 2011 +0200

    Add custom wrapper of GnomeDesktopThumbnailFactory
    
    Seems gnome-desktop-3.0 doesn't have a vapi file yet.

 configure.ac     |    1 +
 src/Makefile.am  |    3 ++-
 vapi/Makefile.am |    6 ++----
 vapi/custom.vapi |   18 ++++++++++++++++++
 4 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a96e1b1..385054c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ AM_GNU_GETTEXT_VERSION([1.11])
 AM_GLIB_GNU_GETTEXT
 
 pkg_modules="gtk+-3.0
+	     gnome-desktop-3.0
 	     folks >= 0.6.1
 	     folks-telepathy
 	     libnotify
diff --git a/src/Makefile.am b/src/Makefile.am
index 0088bea..c2ac1f6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,10 +6,11 @@ AM_CPPFLAGS = \
 	-DLOCALEDIR=\""$(localedir)"\" \
 	-DPKGDATADIR=\""$(pkgdatadir)"\" \
 	-DPKGLIBDIR=\""$(pkglibdir)"\" \
+	-DGNOME_DESKTOP_USE_UNSTABLE_API \
 	$(NULL)
 
 AM_VALAFLAGS = \
-	--vapidir=$(srcdir)/../vapi --pkg config \
+	--vapidir=$(srcdir)/../vapi --pkg config --pkg custom \
 	@CONTACTS_PACKAGES@ \
 	$(NULL)
 
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 0eea6a4..bf0a8aa 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -1,5 +1,3 @@
-noinst_DATA = \
-config.vapi
+noinst_DATA = config.vapi custom.vapi
 
-EXTRA_DIST = \
-$(noinst_DATA)
+EXTRA_DIST = $(noinst_DATA)
diff --git a/vapi/custom.vapi b/vapi/custom.vapi
new file mode 100644
index 0000000..73f0a5f
--- /dev/null
+++ b/vapi/custom.vapi
@@ -0,0 +1,18 @@
+namespace Gnome {
+	[CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
+	public class DesktopThumbnailFactory : GLib.Object {
+		[CCode (has_construct_function = false)]
+		public DesktopThumbnailFactory (Gnome.ThumbnailSize size);
+		public bool can_thumbnail (string uri, string mime_type, ulong mtime);
+		public void create_failed_thumbnail (string uri, ulong mtime);
+		public unowned Gdk.Pixbuf generate_thumbnail (string uri, string mime_type);
+		public bool has_valid_failed_thumbnail (string uri, ulong mtime);
+		public unowned string lookup (string uri, ulong mtime);
+		public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, ulong original_mtime);
+	}
+	[CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_")]
+	public enum ThumbnailSize {
+		NORMAL,
+		LARGE
+	}
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]