Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/everything/everything.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/everything/everything.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/everything/everything.h')
-rw-r--r--tests/everything/everything.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/everything/everything.h b/tests/everything/everything.h
index dbb7995..2474566 100644
--- a/tests/everything/everything.h
+++ b/tests/everything/everything.h
@@ -178,6 +178,7 @@ gboolean test_boxed_equals (TestBoxed *boxed,
#define TEST_TYPE_OBJ (test_obj_get_type ())
#define TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_OBJ, TestObj))
#define TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_OBJ))
+#define TEST_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_OBJ, TestObjClass))
typedef struct _TestObj TestObj;
typedef struct _TestObjClass TestObjClass;
@@ -197,6 +198,8 @@ struct _TestObjClass
{
GObjectClass parent_class;
+ int (*matrix) (TestObj *obj, const char *somestr);
+
guint test_signal;
};
@@ -205,6 +208,9 @@ TestObj* test_obj_new_from_file (const char *x, GError **error);
void test_obj_set_bare (TestObj *obj, GObject *bare);
double test_obj_static_method (int x);
+/* virtual */
+int test_obj_do_matrix (TestObj *obj, const char *somestr);
+
/* callback */
typedef int (*TestCallback) ();
typedef int (*TestCallbackUserData) (gpointer user_data);