]> err.no Git - libchamplain/commitdiff
libchamplain-gtk python bindings
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 15 Feb 2009 10:36:23 +0000 (12:36 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 1 Mar 2009 20:47:52 +0000 (22:47 +0200)
bindings/python/Makefile.am
bindings/python/champlain-gtk/Makefile.am [new file with mode: 0644]
bindings/python/champlain-gtk/pychamplaingtk.defs [new file with mode: 0644]
bindings/python/champlain-gtk/pychamplaingtk.override [new file with mode: 0644]

index 606c429d551397abd54b8173f61f10d4f4d83c0e..eefcaad2d5c8df3fe818fc66162c789cf8b00d72 100644 (file)
@@ -1 +1,5 @@
 SUBDIRS = champlain
+
+if ENABLE_GTK
+SUBDIRS += champlain-gtk
+endif
diff --git a/bindings/python/champlain-gtk/Makefile.am b/bindings/python/champlain-gtk/Makefile.am
new file mode 100644 (file)
index 0000000..e231aa2
--- /dev/null
@@ -0,0 +1,43 @@
+PYDEFS=`pkg-config --variable=defsdir pygtk-2.0`
+
+AM_CPPFLAGS =                                           \
+       -I.                                             \
+       -I$(top_srcdir)/champlain-gtk                   \
+       -I$(top_srcdir)/champlain                       \
+       -I$(top_srcdir)                                 \
+       -DDATADIR=\""$(datadir)"\"                      \
+       $(PYTHON_BINDING_CFLAGS)                        \
+       $(PYTHON_INCLUDES)                              \
+       $(WARN_CFLAGS)
+
+BUILT_SOURCES =                                        \
+       pychamplaingtk.c                                        
+
+pychamplaingtkdir = $(pyexecdir)
+pychamplaingtk_LTLIBRARIES = champlain-gtk.la
+
+champlain_gtk_la_SOURCES =                                     \
+       pychamplaingtk.c
+
+champlain_gtk_la_LIBADD =                                      \
+       $(PYTHON_BINDING_LIBS)                          \
+       $(top_builddir)/champlain/libchamplain-0.3.la   \
+       $(top_builddir)/champlain-gtk/libchamplain-gtk-0.3.la
+
+champlain_gtk_la_LDFLAGS =                                     \
+       -module -avoid-version
+
+pychamplaingtk.c: pychamplaingtk.override pychamplaingtk.defs
+       $(PYGOBJECTCODEGEN)                             \
+               --prefix champlain                      \
+               --register $(PYDEFS)/gdk-types.defs     \
+               --register $(PYDEFS)/gtk-types.defs     \
+               --override pychamplaingtk.override      \
+               pychamplaingtk.defs > $@
+
+EXTRA_DIST =                   \
+       pychamplaingtk.override                         \
+       pychamplaingtk.defs
+
+CLEANFILES = $(BUILT_SOURCES)
+
diff --git a/bindings/python/champlain-gtk/pychamplaingtk.defs b/bindings/python/champlain-gtk/pychamplaingtk.defs
new file mode 100644 (file)
index 0000000..da4500a
--- /dev/null
@@ -0,0 +1,33 @@
+;; -*- scheme -*-
+; object definitions ...
+;; Enumerations and flags ...
+
+
+;; From champlain-gtk.h
+
+
+
+;; From champlain-view-embed.h
+
+(define-function view_embed_get_type
+  (c-name "champlain_view_embed_get_type")
+  (return-type "GType")
+)
+
+(define-method embed_new
+  (of-object "ChamplainView")
+  (c-name "champlain_view_embed_new")
+  (return-type "GtkWidget*")
+)
+
+(define-method get_view
+  (of-object "ChamplainViewEmbed")
+  (c-name "champlain_view_embed_get_view")
+  (return-type "ChamplainView*")
+)
+
+
+
+;; From champlain-gtk-marshal.h
+
+
diff --git a/bindings/python/champlain-gtk/pychamplaingtk.override b/bindings/python/champlain-gtk/pychamplaingtk.override
new file mode 100644 (file)
index 0000000..fe20238
--- /dev/null
@@ -0,0 +1,13 @@
+%%
+headers
+#include <Python.h>
+#include <pygobject.h>
+#include <champlain/champlain.h>
+#include <clutter/clutter.h>
+
+%%
+modulename champlain
+%%
+import clutter.Actor as PyClutterActor_Type
+import clutter.Group as PyClutterGroup_Type
+%%