+2008-08-13 Johan Dahlin <johan@gnome.org>
+
+ * giscanner/cgobject.py:
+ Register GInitiallyUnowned
+ * giscanner/girwriter.py:
+ * giscanner/glibtransformer.py:
+ Special case GObject/GInitially owned as they are a bit special to use.
+
2008-08-13 Colin Walters <walters@verbum.org>
* tests/scanner/Foo-expected.gir, tests/scanner/utility-expected.gir:
tag_name = 'interface'
if isinstance(node, (GLibObject, GLibInterface)):
attrs.append(('glib:type-name', node.type_name))
- attrs.append(('glib:get-type', node.get_type))
+ if node.get_type:
+ attrs.append(('glib:get-type', node.get_type))
with self.tagcontext(tag_name, attrs):
if isinstance(node, Class):
for method in node.constructors:
return True
def _parse_struct(self, struct):
+ # This is a hack, but GObject is a rather fundamental piece so.
+ if (self._namespace_name == 'GObject' and
+ struct.name in ["Object", 'InitiallyUnowned']):
+ self._create_gobject(struct)
+ return
node = self._output_ns.get(struct.name)
if node is None:
self._add_attribute(struct, replace=True)
self._add_attribute(node, replace=True)
self._register_internal_type(type_name, node)
+ def _create_gobject(self, node):
+ type_name = 'G' + node.name
+ if type_name == 'GObject':
+ parent_type_name = None
+ else:
+ print 'lookup', type_name
+ type_id = cgobject.type_from_name(type_name)
+ parent_type_name = cgobject.type_name(cgobject.type_parent(type_id))
+ print parent_type_name
+ node = GLibObject(node.name, parent_type_name, type_name, None)
+ type_id = cgobject.TYPE_OBJECT
+ self._introspect_properties(node, type_id)
+ self._introspect_signals(node, type_id)
+ self._add_attribute(node)
+ self._register_internal_type(type_name, node)
+
def _introspect_object(self, type_id, symbol):
type_name = cgobject.type_name(type_id)
parent_type_name = cgobject.type_name(cgobject.type_parent(type_id))