[gtk-vnc] Add vapi bindings generation



commit 8f1d3d05416e0b46263e21a6fa7890f503dbe632
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Tue Oct 25 17:19:30 2011 +0200

    Add vapi bindings generation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662708

 Makefile.am      |    2 +-
 configure.ac     |   19 +++++++++++++++++++
 src/Makefile.am  |   15 ++++++---------
 src/gtk-vnc.h    |   31 +++++++++++++++++++++++++++++++
 src/gvnc.h       |   33 +++++++++++++++++++++++++++++++++
 vapi/Makefile.am |   32 ++++++++++++++++++++++++++++++++
 6 files changed, 122 insertions(+), 10 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a274aca..e67c84e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src tools examples plugin po
+SUBDIRS = src tools examples plugin po vapi
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
 
 pkgconfig_DATA = @PACKAGE -$(GTK_VNC_API_VERSION).pc gvnc-1.0.pc
diff --git a/configure.ac b/configure.ac
index 8d8eed9..d92feec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -402,6 +402,24 @@ fi
 AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
 AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"])
 
+AC_ARG_ENABLE([vala],
+              AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
+              [], [enable_vala=check])
+if test "x$enable_introspection" = "xyes" ; then
+        if test "x$enable_vala" != "xno" ; then
+                AC_PATH_PROG(VAPIGEN, vapigen, no)
+                if test "x$VAPIGEN" != "xno"; then
+                        if test "x$enable_vala" == "xcheck" ; then
+                                enable_vala=yes
+                                AC_SUBST(VAPIGEN)
+                        fi
+                else
+                        AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+                fi
+        fi
+fi
+AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
+
 AC_CONFIG_FILES(
   Makefile
   src/Makefile
@@ -409,6 +427,7 @@ AC_CONFIG_FILES(
   examples/Makefile
   plugin/Makefile
   po/Makefile.in
+  vapi/Makefile
   gvnc-1.0.pc
   gtk-vnc-1.0.pc
   gtk-vnc-2.0.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index 37f8444..8d0ccd7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -45,6 +45,7 @@ libgvnc_1_0_la_LDFLAGS = \
 
 gvnc_includedir = $(includedir)/gvnc-1.0/
 gvnc_include_HEADERS = \
+			gvnc.h \
 			vncpixelformat.h \
 			vncframebuffer.h \
 			vncbaseframebuffer.h \
@@ -92,6 +93,7 @@ gtk_vnc_CFLAGS = \
 
 gtk_vnc_includedir = $(includedir)/gtk-vnc-$(GTK_VNC_API_VERSION)/
 gtk_vnc_include_HEADERS = \
+			gtk-vnc.h \
 			vncdisplay.h \
 			vncdisplayenums.h \
 			vncgrabsequence.h \
@@ -309,14 +311,12 @@ GVnc-1.0.gir: libgvnc-1.0.la $(G_IR_SCANNER) Makefile.am
                 --add-include-path=$(top_srcdir) \
                 --add-include-path=$(srcdir) \
                 --add-include-path=$(builddir) \
+		--c-include="gvnc.h" \
                 --output $@ \
                 -I$(top_srcdir) \
                 -I$(srcdir) \
 		--verbose \
-                --pkg=glib-2.0 \
-                --pkg=gthread-2.0 \
-                --pkg=gdk-pixbuf-2.0 \
-                --pkg=gobject-2.0 \
+                --pkg=gvnc-1.0 \
                 $(GVNC_INTROSPECTION_SRCS)
 
 GtkVnc-$(GTK_VNC_API_VERSION).gir: GVnc-1.0.gir libgtk-vnc-$(GTK_VNC_API_VERSION).la $(G_IR_SCANNER) Makefile.am
@@ -331,15 +331,12 @@ GtkVnc-$(GTK_VNC_API_VERSION).gir: GVnc-1.0.gir libgtk-vnc-$(GTK_VNC_API_VERSION
                 --add-include-path=$(top_srcdir) \
                 --add-include-path=$(srcdir) \
                 --add-include-path=$(builddir) \
+		--c-include="gtk-vnc.h" \
                 --output $@ \
                 -I$(top_srcdir) \
                 -I$(srcdir) \
 		--verbose \
-                --pkg=glib-2.0 \
-                --pkg=gthread-2.0 \
-                --pkg=gdk-pixbuf-2.0 \
-                --pkg=gobject-2.0 \
-                --pkg=gtk+-$(GTK_API_VERSION) \
+                --pkg=gtk-vnc-$(GTK_VNC_API_VERSION) \
                 $(GTK_VNC_INTROSPECTION_SRCS)
 
 girdir = $(datadir)/gir-1.0
diff --git a/src/gtk-vnc.h b/src/gtk-vnc.h
new file mode 100644
index 0000000..844022b
--- /dev/null
+++ b/src/gtk-vnc.h
@@ -0,0 +1,31 @@
+/*
+ * GTK VNC Widget
+ *
+ * Copyright (C) 2009-2010 Daniel P. Berrange <dan berrange com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.0 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef GTK_VNC_H
+#define GTK_VNC_H
+
+#include <vncdisplayenums.h>
+#include <vncdisplay.h>
+#include <vncgrabsequence.h>
+#if !GTK_CHECK_VERSION(3,0,0)
+#include <vncimageframebuffer.h>
+#endif
+
+#endif
diff --git a/src/gvnc.h b/src/gvnc.h
new file mode 100644
index 0000000..a686fb6
--- /dev/null
+++ b/src/gvnc.h
@@ -0,0 +1,33 @@
+/*
+ * GTK VNC Widget
+ *
+ * Copyright (C) 2009-2010 Daniel P. Berrange <dan berrange com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.0 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef GVNC_H
+#define GVNC_H
+
+#include <vncbaseframebuffer.h>
+#include <vncconnectionenums.h>
+#include <vnccursor.h>
+#include <vncpixelformat.h>
+#include <vnccolormap.h>
+#include <vncconnection.h>
+#include <vncframebuffer.h>
+#include <vncutil.h>
+
+#endif
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
new file mode 100644
index 0000000..e21fa4c
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,32 @@
+NULL =
+
+if WITH_VALA
+vapidir = $(datadir)/vala/vapi
+vapi_DATA =					\
+	gtk-vnc-$(GTK_VNC_API_VERSION).deps	\
+	gtk-vnc-$(GTK_VNC_API_VERSION).vapi	\
+	gvnc-1.0.vapi				\
+	$(NULL)
+
+gvnc-1.0.vapi: $(top_builddir)/src/GVnc-1.0.gir
+	$(AM_V_GEN)$(VAPIGEN)			\
+		--library gvnc-1.0		\
+		$<
+
+gtk-vnc-$(GTK_VNC_API_VERSION).vapi: $(top_builddir)/src/GtkVnc-$(GTK_VNC_API_VERSION).gir gvnc-1.0.vapi
+	$(AM_V_GEN)$(VAPIGEN)					\
+		--vapidir=$(builddir)				\
+		--pkg gvnc-1.0					\
+		--pkg gtk+-$(GTK_API_VERSION)			\
+		--library gtk-vnc-$(GTK_VNC_API_VERSION)	\
+		$<
+
+gtk-vnc-$(GTK_VNC_API_VERSION).deps: gtk-vnc-$(GTK_VNC_API_VERSION).vapi
+	@echo "gvnc-1.0" > $@
+	@echo "gtk+-$(GTK_API_VERSION)" >> $@
+
+endif
+
+CLEANFILES = $(vapi_DATA)
+
+-include $(top_srcdir)/git.mk



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