Update to 2.28 for TINF-96
[profile/ivi/pygobject2.git] / gobject / pygobject-private.h
index 2a09eed..6f3a25e 100644 (file)
@@ -32,12 +32,18 @@ extern struct _PyGObject_Functions pygobject_api_functions;
 
 #define pyg_threads_enabled (pygobject_api_functions.threads_enabled)
 
+#ifdef DISABLE_THREADING
+#define pyg_gil_state_ensure() 0
+#define pyg_gil_state_release(state) G_STMT_START {     \
+    } G_STMT_END
 
+#else
 #define pyg_gil_state_ensure() (pygobject_api_functions.threads_enabled? (PyGILState_Ensure()) : 0)
 #define pyg_gil_state_release(state) G_STMT_START {     \
     if (pygobject_api_functions.threads_enabled)        \
         PyGILState_Release(state);                      \
     } G_STMT_END
+#endif
 
 #define pyg_begin_allow_threads                         \
     G_STMT_START {                                      \
@@ -98,6 +104,7 @@ gboolean pyg_gerror_exception_check(GError **error);
 extern PyTypeObject PyGTypeWrapper_Type;
 
 PyObject *pyg_type_wrapper_new (GType type);
+GType     pyg_type_from_object_strict (PyObject *obj, gboolean strict);
 GType     pyg_type_from_object (PyObject *obj);
 
 gint pyg_enum_get_value  (GType enum_type, PyObject *obj, gint *val);
@@ -113,10 +120,10 @@ void      pyg_register_gtype_custom(GType gtype,
 int       pyg_value_from_pyobject(GValue *value, PyObject *obj);
 PyObject *pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed);
 int       pyg_param_gvalue_from_pyobject(GValue* value,
-                                         PyObject* py_obj, 
+                                         PyObject* py_obj,
                                          const GParamSpec* pspec);
 PyObject *pyg_param_gvalue_as_pyobject(const GValue* gvalue,
-                                       gboolean copy_boxed, 
+                                       gboolean copy_boxed,
                                        const GParamSpec* pspec);
 
 GClosure *pyg_closure_new(PyObject *callback, PyObject *extra_args, PyObject *swap_data);
@@ -149,6 +156,7 @@ void          pygobject_register_class   (PyObject *dict,
 void          pygobject_register_wrapper (PyObject *self);
 PyObject *    pygobject_new              (GObject *obj);
 PyObject *    pygobject_new_full         (GObject *obj, gboolean sink, gpointer g_class);
+PyObject *    pygobject_new_sunk         (GObject *obj);
 void          pygobject_sink             (GObject *obj);
 PyTypeObject *pygobject_lookup_class     (GType gtype);
 void          pygobject_watch_closure    (PyObject *self, GClosure *closure);
@@ -175,14 +183,14 @@ const gchar * pyg_constant_strip_prefix(const gchar *name, const gchar *strip_pr
 
 /* pygflags */
 typedef struct {
-    _PyLongObject parent;
+       PYGLIB_PyLongObject parent;
     GType gtype;
 } PyGFlags;
 
 extern PyTypeObject PyGFlags_Type;
 
 #define PyGFlags_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_FLAGS))
-                          
+
 extern PyObject * pyg_flags_add        (PyObject *   module,
                                        const char * type_name,
                                        const char * strip_prefix,
@@ -194,7 +202,7 @@ extern PyObject * pyg_flags_from_gtype (GType        gtype,
 #define PyGEnum_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_ENUM))
 
 typedef struct {
-    _PyLongObject parent;
+       PYGLIB_PyLongObject parent;
     GType gtype;
 } PyGEnum;
 
@@ -221,9 +229,14 @@ extern PyTypeObject PyGObjectWeakRef_Type;
 static inline PyGObjectData *
 pyg_object_peek_inst_data(GObject *obj)
 {
-    return ((PyGObjectData *) 
+    return ((PyGObjectData *)
             g_object_get_qdata(obj, pygobject_instance_data_key));
 }
 
+gboolean        pygobject_prepare_construct_properties  (GObjectClass *class,
+                                                         PyObject *kwargs,
+                                                         guint *n_params,
+                                                         GParameter **params);
+
 
 #endif