gobject-introspection r381 - in trunk: . giscanner



Author: walters
Date: Fri Aug 15 05:03:16 2008
New Revision: 381
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=381&view=rev

Log:
2008-08-15  Colin Walters  <walters verbum org>

	* giscanner/cgobject.py: Define yet more argument
	prototypes; fix prototype for g_type_fundamental.




Modified:
   trunk/ChangeLog
   trunk/giscanner/cgobject.py

Modified: trunk/giscanner/cgobject.py
==============================================================================
--- trunk/giscanner/cgobject.py	(original)
+++ trunk/giscanner/cgobject.py	Fri Aug 15 05:03:16 2008
@@ -130,13 +130,6 @@
 _gobj = ctypes.cdll.LoadLibrary(_library_path)
 _gobj.g_type_init()
 
-# Workaround this error:
-#   GLib-GObject-CRITICAL **: g_param_spec_pool_list:
-#   assertion `pool != NULL' failed
-# which happens when trying to introspect an interface before instantiating
-# a GObject.
-_gobj.g_object_new(TYPE_OBJECT, None)
-_gobj.g_initially_unowned_get_type()
 
 # Functions
 
@@ -151,6 +144,21 @@
     return _deco
 
 
+ _gwrap('g_object_new', ctypes.c_void_p, GType)
+def object_new(type_id):
+    return _gobj.g_object_new(type_id, None)
+
+
+# Workaround this error:
+#   GLib-GObject-CRITICAL **: g_param_spec_pool_list:
+#   assertion `pool != NULL' failed
+# which happens when trying to introspect an interface before instantiating
+# a GObject.
+
+object_new(TYPE_OBJECT)
+_gobj.g_initially_unowned_get_type()
+
+
 @_gwrap('g_type_name', ctypes.c_char_p, GType)
 def type_name(type_id):
     return _gobj.g_type_name(type_id)
@@ -161,7 +169,7 @@
     return _gobj.g_type_from_name(name)
 
 
- _gwrap('g_type_fundamental', GType)
+ _gwrap('g_type_fundamental', GType, GType)
 def type_fundamental(type_id):
     return _gobj.g_type_fundamental(type_id)
 
@@ -197,11 +205,16 @@
         yield ctypes.cast(pspecs[i], ctypes.POINTER(GParamSpec)).contents
 
 
+ _gwrap('g_type_default_interface_ref', ctypes.c_void_p, GType)
+def type_default_interface_ref(type_id):
+    return _gobj.g_type_default_interface_ref(type_id)
+
+
 @_gwrap('g_object_interface_list_properties',
        ctypes.POINTER(ctypes.POINTER(GParamSpec)),
        ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint))
 def object_interface_list_properties(type_id):
-    iface = _gobj.g_type_default_interface_ref(type_id)
+    iface = type_default_interface_ref(type_id)
     n = ctypes.c_uint()
     pspecs = _gobj.g_object_interface_list_properties(iface, ctypes.byref(n))
     for i in range(n.value):
@@ -226,6 +239,11 @@
         yield type_ids[i]
 
 
+ _gwrap('g_signal_query', None, ctypes.c_uint, ctypes.POINTER(GSignalInfo))
+def signal_query(sigid, qptr):
+    _gobj.g_signal_query(sigid, qptr)
+
+
 @_gwrap('g_signal_list_ids', ctypes.POINTER(ctypes.c_uint),
        GType, ctypes.POINTER(ctypes.c_uint))
 def signal_list(type_id):
@@ -233,5 +251,5 @@
     signal_ids = _gobj.g_signal_list_ids(type_id, ctypes.byref(n))
     for i in range(n.value):
         info = GSignalInfo()
-        _gobj.g_signal_query(signal_ids[i], ctypes.byref(info))
+        signal_query(signal_ids[i], ctypes.byref(info))
         yield info



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]