From 4c254ffe3f5553fd4870d74083884952fa152965 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Tue, 9 Mar 2004 14:54:57 +0000 Subject: [PATCH] gst/gst.override (_wrap_gst_g_error_tp_str) Original commit message from CVS: * gst/gst.override (_wrap_gst_g_error_tp_str) (_wrap_gst_g_error_tp_str): Impl. * gst/gst-types.defs (GError): Add * gst/Makefile.am (defs_DATA): Install defs * codegen/*: Resync --- ChangeLog | 11 +++++++++++ gst/Makefile.am | 11 ++++++++--- gst/gst-types.defs | 12 ++++++++++++ gst/gst.override | 18 ++++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f031608ce..052196a836 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-03-09 Johan Dahlin + + * gst/gst.override (_wrap_gst_g_error_tp_str) + (_wrap_gst_g_error_tp_str): Impl. + + * gst/gst-types.defs (GError): Add + + * gst/Makefile.am (defs_DATA): Install defs + + * codegen/*: Resync + 2004-03-05 Johan Dahlin * testsuite/element.py: Update to new api diff --git a/gst/Makefile.am b/gst/Makefile.am index 9ce1bc411e..c8530af398 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -23,10 +23,15 @@ _gstmodule_la_LIBADD = $(GST_LIBS) _gstmodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gst nodist__gstmodule_la_SOURCES = gst.c -CLEANFILES = gst.c -EXTRA_DIST = gst.defs gst-types.defs $(GST_OVERRIDES) arg-types.py +defs_DATA = \ + gst.defs \ + gst-types.defs +defsdir = $(pkgdatadir)/2.0/defs -.defs.c: +CLEANFILES = gst.c +EXTRA_DIST = $(defs_DATA) $(GST_OVERRIDES) arg-types.py + +gst.c: $(srcdir)/gst.defs $(srcdir)/gst-types.defs $(GST_OVERRIDES) (cd $(srcdir)\ && $(PYGTK_CODEGEN) \ --load-types $(srcdir)/arg-types.py \ diff --git a/gst/gst-types.defs b/gst/gst-types.defs index 08c2e3f1ca..f2b49aefa2 100644 --- a/gst/gst-types.defs +++ b/gst/gst-types.defs @@ -182,6 +182,18 @@ (release-func "gst_data_unref") ) +(define-boxed GError + (in-module "Gst") + (c-name "GError") + (gtype-id "GST_TYPE_G_ERROR") + (copy-func "g_error_copy") + (release-func "g_error_free") + (fields + '("GQuark" "domain") + '("gint" "code") + '("gchar*" "message")) +) + ;; ;; 0.7 Boxed types diff --git a/gst/gst.override b/gst/gst.override index be441c4cd4..241ff0d83d 100644 --- a/gst/gst.override +++ b/gst/gst.override @@ -30,6 +30,7 @@ headers #include "pygobject.h" #include +#include #include #include @@ -49,6 +50,7 @@ void iterate_bin_all (GstBin *bin); guint add_iterate_bin (GstBin *bin); void remove_iterate_bin (guint id); extern gboolean pygst_data_from_pyobject (PyObject *object, GstData **data); + %% include gstpad-handlers.override @@ -770,3 +772,19 @@ _wrap_gst_type_find_factory_get_caps(PyGObject *self) GstCaps *ret = (GstCaps*)gst_type_find_factory_get_caps(GST_TYPE_FIND_FACTORY(self->obj)); return pyg_boxed_new(GST_TYPE_CAPS, ret, TRUE, TRUE); } +%% +override-attr GError.domain +static PyObject * +_wrap_gst_g_error__get_domain(PyGObject *self, void *closure) +{ + return PyString_FromString(g_quark_to_string(((GError*)self->obj)->domain)); +} +%% +override-slot GError.tp_str +static PyObject * +_wrap_gst_g_error_tp_str(PyGObject *self) +{ + GError *error = (GError*)self->obj; + return PyString_FromString(gst_error_get_message (error->domain, + error->code)); +}