Make (skip) annotation work everywhere
authorDan Winship <danw@gnome.org>
Sun, 22 Nov 2009 17:49:37 +0000 (12:49 -0500)
committerDan Winship <danw@gnome.org>
Mon, 23 Nov 2009 16:07:29 +0000 (11:07 -0500)
Previously it only worked for toplevel nodes. Now it works for any
node except <field>, since skipping a field would cause the
description of the struct layout to be wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=602652

giscanner/girwriter.py
tests/scanner/foo.c
tests/scanner/foo.h

index 76a77d8..78e34c9 100644 (file)
@@ -152,6 +152,8 @@ and/or use gtk-doc annotations. ''')
         self.write_tag('alias', attrs)
 
     def _write_callable(self, callable, tag_name, extra_attrs):
+        if callable.skip:
+            return
         attrs = [('name', callable.name)]
         attrs.extend(extra_attrs)
         if callable.doc:
@@ -304,6 +306,8 @@ and/or use gtk-doc annotations. ''')
                 self._write_member(member)
 
     def _write_member(self, member):
+        if member.skip:
+            return
         attrs = [('name', member.name),
                  ('value', str(member.value)),
                  ('c:identifier', member.symbol)]
@@ -376,6 +380,8 @@ and/or use gtk-doc annotations. ''')
                 self._write_method(method)
 
     def _write_property(self, prop):
+        if prop.skip:
+            return
         attrs = [('name', prop.name)]
         self._append_version(prop, attrs)
         self._append_deprecated(prop, attrs)
@@ -493,6 +499,8 @@ and/or use gtk-doc annotations. ''')
                 self._write_type(field.type)
 
     def _write_signal(self, signal):
+        if signal.skip:
+            return
         attrs = [('name', signal.name)]
         if signal.doc:
             attrs.append(('doc', signal.doc))
index e810b52..d2fb23b 100644 (file)
@@ -255,6 +255,17 @@ foo_object_read (FooObject *object, int offset, int length)
 
 }
 
+/**
+ * foo_object_skipped_method: (skip)
+ * @object: obj
+ *
+ * This is only useful from C.
+ */
+void
+foo_object_skipped_method (FooObject *object)
+{
+}
+
 G_DEFINE_ABSTRACT_TYPE (FooSubobject, foo_subobject, FOO_TYPE_OBJECT);
 
 static void
index 199d57a..b8f88a7 100644 (file)
@@ -125,6 +125,8 @@ void                  foo_object_read              (FooObject *object, int offse
 
 int                   foo_object_static_meth       (void);
 
+void                  foo_object_skipped_method    (FooObject *object);
+
 struct _FooSubobject
 {
   FooObject parent_instance;