summaryrefslogtreecommitdiff
path: root/tests/scanner/gettype.h
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2012-03-06 11:57:01 -0300
committerJohan Dahlin <jdahlin@litl.com>2012-03-06 11:57:22 -0300
commitab8a6d9694ebd79b202b470c3742e8d521faf722 (patch)
tree8a7552e3b24cbf12d8e52e8758b3b79c7e8a5608 /tests/scanner/gettype.h
parentc2fc7cb45243aa9e0e1e5569cc742f69c76a671a (diff)
downloadgobject-introspection-ab8a6d9694ebd79b202b470c3742e8d521faf722.tar.gz
Fix matching of methods named *_get_type()
The code which heuristically turned functions into class methods would always ignore any function called *_get_type or *_get_gtype. However, the code which looked for GI metadata functions to execute them was much more comprehensive, checking not just the name, but also that it had no parameters and that it returned a GType. This change abstracts the more comprehensive check into the Function class, and uses the same check in both places. https://bugzilla.gnome.org/show_bug.cgi?id=671218
Diffstat (limited to 'tests/scanner/gettype.h')
-rw-r--r--tests/scanner/gettype.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/scanner/gettype.h b/tests/scanner/gettype.h
new file mode 100644
index 00000000..755f091c
--- /dev/null
+++ b/tests/scanner/gettype.h
@@ -0,0 +1,29 @@
+#ifndef __GETTYPE_OBJECT_H__
+#define __GETTYPE_OBJECT_H__
+
+#include <glib-object.h>
+
+#define GETTYPE_TYPE_OBJECT (gettype_object_get_type ())
+#define GETTYPE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GETTYPE_TYPE_OBJECT, GetTypeObject))
+#define GETTYPE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GETTYPE_TYPE_OBJECT))
+
+typedef struct _GetTypeObject GetTypeObject;
+typedef struct _GetTypeObjectClass GetTypeObjectClass;
+struct _GetTypeObject
+{
+ GObject parent_instance;
+};
+
+struct _GetTypeObjectClass
+{
+ GObjectClass parent_class;
+};
+
+GType gettype_object_get_type (void) G_GNUC_CONST;
+GetTypeObject* gettype_object_new (void);
+
+GType gettype_object_nonmeta1_get_type (GetTypeObject *obj);
+gboolean gettype_object_nonmeta2_get_type (void);
+gboolean gettype_object_nonmeta_get_gtype (void);
+
+#endif /* __GETTYPE_OBJECT_H__ */