Debian Codegraph @

gi/pygobject-object.h

raw
1 #ifndef __PYGOBJECT_OBJECT_H__
2 #define __PYGOBJECT_OBJECT_H__
3
4 #include <pythoncapi_compat.h>
5
6 #include "pygobject-types.h"
7
8 /* Data that belongs to the GObject instance, not the Python wrapper */
9 struct _PyGObjectData {
10 PyTypeObject *type; /* wrapper type for this instance */
11 PyObject *inst_dict;
12 gboolean call_do_dispose;
13 GSList *closures;
14 };
15
16 extern GType PY_TYPE_OBJECT;
17 extern GQuark pygobject_custom_key;
18 extern GQuark pygobject_wrapper_key;
19 extern GQuark pygobject_class_key;
20 extern GQuark pygobject_class_init_key;
21 extern GQuark pygobject_instance_data_key;
22
23 extern PyTypeObject PyGObjectWeakRef_Type;
24 extern PyTypeObject PyGObject_Type;
25 extern PyTypeObject *PyGObject_MetaType;
26
27 void pygobject_register_class (PyObject *dict, const gchar *type_name,
28 GType gtype, PyTypeObject *type,
29 PyObject *bases);
30 void pygobject_register_wrapper (PyObject *self);
31 PyObject *pygobject_new (GObject *obj);
32 PyObject *pygobject_new_full (GObject *obj, gboolean steal, gpointer g_class);
33 PyTypeObject *pygobject_lookup_class (GType gtype);
34 void pygobject_watch_closure (PyObject *self, GClosure *closure);
35 int pyg_object_register_types (PyObject *d);
36 PyObject *pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs);
37
38 /* from pygobject-class.c */
39 void pygobject_init_wrapper_set (PyObject *wrapper);
40
41 void pygobject__g_instance_init (GTypeInstance *instance, gpointer g_class);
42 void pygobject__g_class_init (GObjectClass *class, PyObject *py_class);
43
44 static inline PyGObjectData *
45 pyg_object_peek_inst_data (GObject *obj)
46 {
47 if (!obj) return NULL;
48 return ((PyGObjectData *)g_object_get_qdata (obj,
49 pygobject_instance_data_key));
50 }
51
52 #endif /*__PYGOBJECT_OBJECT_H__*/