From 3b602c14041622c48c5a92809a4a644e9aec6f5c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 10 Aug 2011 17:13:17 +0200 Subject: [PATCH] gst: Move PyGstMiniObject to public API. Allows it to be reused from 3rd party modules. https://bugzilla.gnome.org/show_bug.cgi?id=656289 --- gst/pygst.h | 12 ++++++++++++ gst/pygstminiobject.c | 2 ++ gst/pygstminiobject.h | 9 --------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gst/pygst.h b/gst/pygst.h index 01f7179..83b6849 100644 --- a/gst/pygst.h +++ b/gst/pygst.h @@ -25,6 +25,8 @@ #include #include +#include + #include "common.h" G_BEGIN_DECLS @@ -35,6 +37,16 @@ struct _PyGst_Functions { PyObject* (*miniobject_new) (GstMiniObject *obj); }; +#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj) +#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base)) + +typedef struct { + PyObject_HEAD + GstMiniObject *obj; + PyObject *inst_dict; /* the instance dictionary -- must be last */ + PyObject *weakreflist; /* list of weak references */ +} PyGstMiniObject; + #ifndef _INSIDE_PYGST_ #if defined(NO_IMPORT_PYGOBJECT) diff --git a/gst/pygstminiobject.c b/gst/pygstminiobject.c index daa029e..94f28fe 100644 --- a/gst/pygstminiobject.c +++ b/gst/pygstminiobject.c @@ -21,7 +21,9 @@ */ #define NO_IMPORT_PYGOBJECT +#define _INSIDE_PYGST_ #include "pygstminiobject.h" +#include "pygst.h" #include static const gchar pygstminiobject_class_id[] = "PyGstMiniObject::class"; diff --git a/gst/pygstminiobject.h b/gst/pygstminiobject.h index 80e6b7e..3eb3d4a 100644 --- a/gst/pygstminiobject.h +++ b/gst/pygstminiobject.h @@ -20,15 +20,6 @@ G_BEGIN_DECLS #define PYGIL_API_IS_BUGGY FALSE #endif -typedef struct { - PyObject_HEAD - GstMiniObject *obj; - PyObject *inst_dict; /* the instance dictionary -- must be last */ - PyObject *weakreflist; /* list of weak references */ -} PyGstMiniObject; - -#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj) -#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base)) void pygstminiobject_register_class(PyObject *dict, const gchar *type_name, -- 2.7.4