diff options
-rw-r--r-- | contrib/python/Makefile.am | 23 | ||||
-rw-r--r-- | contrib/python/json-glib.override | 120 | ||||
-rw-r--r-- | contrib/python/jsonglib-module.c (renamed from contrib/python/json-glib-module.c) | 0 | ||||
-rw-r--r-- | contrib/python/jsonglib.defs (renamed from contrib/python/json-glib.defs) | 0 | ||||
-rw-r--r-- | contrib/python/jsonglib.override | 56 |
5 files changed, 68 insertions, 131 deletions
diff --git a/contrib/python/Makefile.am b/contrib/python/Makefile.am index 30fb7fd..37f3eba 100644 --- a/contrib/python/Makefile.am +++ b/contrib/python/Makefile.am @@ -1,26 +1,27 @@ -INCLUDES = $(PYTHON_INCLUDES) $(PYBEAGLE_CFLAGS) -I$(top_srcdir) +INCLUDES = $(PYTHON_INCLUDES) $(PYJSON_CFLAGS) -I$(top_srcdir) -libjson_glib_1_0_ladir = $(pyexecdir) -libjson_glib_1_0_la_LTLIBRARIES = libjson-glib-1.0.la -libjson_glib_1_0_la_LDFLAGS = -module -avoid-version -export-symbols-regex initjsonglib -libjson_glib_1_0_la_LIBADD = \ +libjson_glib_ladir = $(pyexecdir) +libjson_glib_la_LTLIBRARIES = libjson-glib.la +libjson_glib_la_LDFLAGS = -module -avoid-version -export-symbols-regex initjsonglib +libjson_glib_la_LIBADD = \ $(PYJSON_LIBS) \ $(JSON_LIBS) \ ../../json-glib/libjson-glib-1.0.la -libjson_glib_1_0_la_SOURCES = json-glib-module.c -nodist_libjson_glib_1_0_la_SOURCES = json-glib.c +libjson_glib_la_SOURCES = jsonglib-module.c +nodist_libjson_glib_la_SOURCES = jsonglib.c -CLEANFILES = json-glib.c +CLEANFILES = jsonglib.c EXTRA_DIST = \ - json-glib.defs \ - json-glib.override \ + jsonglib.defs \ + jsonglib.override \ gen-defs.sh -json-glib.c: json-glib.defs +jsonglib.c: jsonglib.defs .defs.c: (cd $(srcdir) \ && $(PYGTK_CODEGEN) \ + --py_ssize_t-clean \ --override $*.override \ --register $(PYGTK_DEFSDIR)/gtk-types.defs \ --register $(PYGTK_DEFSDIR)/gdk-types.defs \ diff --git a/contrib/python/json-glib.override b/contrib/python/json-glib.override deleted file mode 100644 index c29aa9e..0000000 --- a/contrib/python/json-glib.override +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- */ -%% -headers -#include <Python.h> -#include <stdio.h> - -#define NO_IMPORT_PYGOBJECT -#include "pygobject.h" - -#include <json-glib/json-glib.h> - -//#define JSON_TYPE_SERIALIZABLE (beagle_hit_get_gtype ()) -//#define BEAGLE_TYPE_PROPERTY (beagle_property_get_gtype ()) -#define JSON_TYPE_SERIALIZABLE (json_serializable_get_type ()) -#define JSON_SERIALIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_SERIALIZABLE, JsonSerializable)) -#define JSON_IS_SERIALIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_SERIALIZABLE)) -#define JSON_SERIALIZABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), JSON_TYPE_SERIALIZABLE, JsonSerializableIface)) -//#define BEAGLE_TYPE_TIMESTAMP (beagle_timestamp_get_gtype ()) -//#define BEAGLE_TYPE_QUERYABLE_STATUS (beagle_queryable_status_get_gtype ()) -//#define BEAGLE_TYPE_SCHEDULER_INFORMATION (beagle_scheduler_information_get_gtype ()) -//#define BEAGLE_TYPE_INDEXABLE (beagle_indexable_get_gtype ()) - -//GType -//beagle_hit_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleHit"); -// return our_type; -//} - -//GType -//beagle_timestamp_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleTimestamp"); -// return our_type; -//} - -//GType -//beagle_property_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleProperty"); -// return our_type; -//} - -//GType -//beagle_queryable_status_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleQueryableStatus"); -// return our_type; -//} - -//GType -//beagle_scheduler_information_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleSchedulerInformation"); -// return our_type; -//} - -//GType -//beagle_indexable_get_gtype (void) -//{ -// static GType our_type = 0; -// if (!our_type) -// our_type = g_pointer_type_register_static ("BeagleIndexable"); -// return our_type; -//} - -static PyObject * -_helper_wrap_pointer_gslist (GType type, GSList *list) -{ - GSList *tmp; - PyObject *py_list; - - if ((py_list = PyList_New(0)) == NULL) { - return NULL; - } - for (tmp = list; tmp != NULL; tmp = tmp->next) { - PyObject *obj = pyg_pointer_new (type, tmp->data); - PyList_Append(py_list, obj); - Py_DECREF(obj); - } - return py_list; -} - -static PyObject * -_helper_wrap_string_gslist (GSList *list) -{ - GSList *tmp; - PyObject *py_list; - - if ((py_list = PyList_New(0)) == NULL) { - return NULL; - } - for (tmp = list; tmp != NULL; tmp = tmp->next) { - PyObject *str_obj = PyString_FromString ((char*)tmp->data); - - if (str_obj == NULL) { - Py_DECREF(py_list); - return NULL; - } - PyList_Append(py_list, str_obj); - Py_DECREF(str_obj); - } - return py_list; -} -%% -modulename json_glib -%% -import gobject.GObject as PyGObject_Type - - diff --git a/contrib/python/json-glib-module.c b/contrib/python/jsonglib-module.c index 81109a2..81109a2 100644 --- a/contrib/python/json-glib-module.c +++ b/contrib/python/jsonglib-module.c diff --git a/contrib/python/json-glib.defs b/contrib/python/jsonglib.defs index df670a7..df670a7 100644 --- a/contrib/python/json-glib.defs +++ b/contrib/python/jsonglib.defs diff --git a/contrib/python/jsonglib.override b/contrib/python/jsonglib.override new file mode 100644 index 0000000..121ea5a --- /dev/null +++ b/contrib/python/jsonglib.override @@ -0,0 +1,56 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- */ +%% +headers +#include <Python.h> +#include <stdio.h> + +#define NO_IMPORT_PYGOBJECT +#include "pygobject.h" + +#include <json-glib/json-glib.h> +#include <json-glib/json-gobject.h> + +static PyObject * +_helper_wrap_pointer_gslist (GType type, GSList *list) +{ + GSList *tmp; + PyObject *py_list; + + if ((py_list = PyList_New(0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + PyObject *obj = pyg_pointer_new (type, tmp->data); + PyList_Append(py_list, obj); + Py_DECREF(obj); + } + return py_list; +} + +static PyObject * +_helper_wrap_string_gslist (GSList *list) +{ + GSList *tmp; + PyObject *py_list; + + if ((py_list = PyList_New(0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + PyObject *str_obj = PyString_FromString ((char*)tmp->data); + + if (str_obj == NULL) { + Py_DECREF(py_list); + return NULL; + } + PyList_Append(py_list, str_obj); + Py_DECREF(str_obj); + } + return py_list; +} +%% +modulename json_glib +%% +import gobject.GObject as PyGObject_Type + + |