Commit 4c254ffe authored by Johan Dahlin's avatar Johan Dahlin

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
parent 9305a252
2004-03-09 Johan Dahlin <johan@gnome.org>
* 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 <johan@gnome.org>
* testsuite/element.py: Update to new api
......
......@@ -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
defs_DATA = \
gst.defs \
gst-types.defs
defsdir = $(pkgdatadir)/2.0/defs
CLEANFILES = gst.c
EXTRA_DIST = gst.defs gst-types.defs $(GST_OVERRIDES) arg-types.py
EXTRA_DIST = $(defs_DATA) $(GST_OVERRIDES) arg-types.py
.defs.c:
gst.c: $(srcdir)/gst.defs $(srcdir)/gst-types.defs $(GST_OVERRIDES)
(cd $(srcdir)\
&& $(PYGTK_CODEGEN) \
--load-types $(srcdir)/arg-types.py \
......
......@@ -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
......
......@@ -30,6 +30,7 @@ headers
#include "pygobject.h"
#include <gst/gst.h>
#include <gst/gsterror.h>
#include <gst/gstqueue.h>
#include <gst/gsttypefind.h>
......@@ -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));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment