diff options
author | James Henstridge <james@daa.com.au> | 2000-10-26 12:48:17 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2000-10-26 12:48:17 +0000 |
commit | 03cf5b7534de8da2af941cf0a11b92ae078cf19d (patch) | |
tree | b3cd29440f7f6b9b6e291effde333406c7d23e5f /pygobject.h | |
parent | e951bb46a26cee1abcf4540a9de79642158c0fda (diff) | |
download | pygtk-03cf5b7534de8da2af941cf0a11b92ae078cf19d.tar.gz |
new function for registering functions to marshal boxed GValues to/from
2000-10-26 James Henstridge <james@daa.com.au>
* gobjectmodule.c (pyg_boxed_register): new function for
registering functions to marshal boxed GValues to/from their
python wrappers.
(pyg_value_from_pyobject): add boxed support.
(pyg_value_as_pyobject): add boxed support.
(pyg_closure_new): new function to create a python GClosure.
(pyg_closure_destroy): cleanup function for a PyGClosure.
(pyg_closure_marshal): marshaler for PyGClosure.
(pyg_value_as_pyobject): add const to GValue argument.
* pygobject.h: export a pyg_boxed_register function to register
new boxed types for use with pyg_value_from_pyobject and
pyg_value_as_pyobject.
Diffstat (limited to 'pygobject.h')
-rw-r--r-- | pygobject.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/pygobject.h b/pygobject.h index 62b1922b..88235144 100644 --- a/pygobject.h +++ b/pygobject.h @@ -19,15 +19,18 @@ typedef struct { #define pygobject_check(v,base) (ExtensionClassSubclassInstance_Check(v,base)) struct _PyGObject_Functions { - void (* register_class)(PyObject *dict, const gchar *class_name, - PyExtensionClass *ec, PyExtensionClass *parent); - void (* register_wrapper)(PyObject *self); - PyExtensionClass *(* lookup_class)(GType type); - PyObject *(* new)(GObject *obj); - gint (* enum_get_value)(GType enum_type, PyObject *obj, gint *val); - gint (* flags_get_value)(GType flag_type, PyObject *obj, gint *val); - int (* value_from_pyobject)(GValue *value, PyObject *obj); - PyObject *(* value_as_pyobject)(GValue *value); + void (* register_class)(PyObject *dict, const gchar *class_name, + PyExtensionClass *ec, PyExtensionClass *parent); + void (* register_wrapper)(PyObject *self); + PyExtensionClass *(* lookup_class)(GType type); + PyObject *(* new)(GObject *obj); + gint (* enum_get_value)(GType enum_type, PyObject *obj, gint *val); + gint (* flags_get_value)(GType flag_type, PyObject *obj, gint *val); + void (* boxed_register)(GType boxed_type, + PyObject *(* from_func)(const GValue *value), + int (* to_func)(GValue *value, PyObject *obj)); + int (* value_from_pyobject)(GValue *value, PyObject *obj); + PyObject *(* value_as_pyobject)(const GValue *value); }; #ifndef _INSIDE_PYGOBJECT_ @@ -44,6 +47,7 @@ struct _PyGObject_Functions *_PyGObject_API; #define pygobject_new (_PyGObject_API->new) #define pyg_enum_get_value (_PyGObject_API->enum_get_value) #define pyg_flags_get_value (_PyGObject_API->flags_get_value) +#define pyg_boxed_register (_PyGObject_API->boxed_register) #define pyg_value_from_pyobject (_PyGObject_API->value_from_pyobject) #define pyg_value_as_pyobject (_PyGObject_API->value_as_pyobject) |