Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/scanner/foo.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-28 00:02:48 (GMT)
committer Colin Walters <walters@verbum.org>2009-03-05 20:52:12 (GMT)
commitfdbe3cc3e1cfaa546648a76b1dca72beead0b65b (patch)
tree01156e22ec59d29c642d59ce7ad75f383d77466a /tests/scanner/foo.h
parentb8e3172424ba956a0d18eae8deb305310b2cab74 (diff)
Bug 557383 - Virtual method support
Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
Diffstat (limited to 'tests/scanner/foo.h')
-rw-r--r--tests/scanner/foo.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h
index da30df3..02f3cfe 100644
--- a/tests/scanner/foo.h
+++ b/tests/scanner/foo.h
@@ -48,15 +48,23 @@ struct _FooInterfaceIface
{
GTypeInterface parent_iface;
- void (*do_foo) (FooInterface *self);
+ void (*do_foo) (FooInterface *self, int x);
};
GType foo_interface_get_type (void) G_GNUC_CONST;
+void foo_interface_do_foo (FooInterface *iface, int x);
+
struct _FooSubInterfaceIface
{
GTypeInterface parent_iface;
+ /* signals */
+
+ void (*destroy_event) (FooSubInterface *self);
+
+ /* virtual table */
+
void (*do_bar) (FooSubInterface *self);
};
@@ -76,6 +84,9 @@ struct _FooObjectClass
GObjectClass parent_class;
gboolean (* virtual_method) (FooObject *object, int first_param);
+
+ /* Intended to match GFile */
+ void (*read_fn) (FooObject *object, int offset, int length);
};
gint foo_init (void);
@@ -105,6 +116,10 @@ char * foo_object_dup_name (FooObject *object);
void foo_object_handle_glyph (FooObject *object, UtilityGlyph glyph);
+gboolean foo_object_virtual_method (FooObject *object, int first_param);
+
+void foo_object_read (FooObject *object, int offset, int length);
+
int foo_object_static_meth ();
struct _FooSubobject