gobject-introspection r952 - trunk/tests/everything



Author: walters
Date: Wed Nov 19 22:38:47 2008
New Revision: 952
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=952&view=rev

Log:
Add TestObj with static methods

Static methods and ctors are a useful semi-corner case for bindings.

Modified:
   trunk/tests/everything/everything.c
   trunk/tests/everything/everything.h

Modified: trunk/tests/everything/everything.c
==============================================================================
--- trunk/tests/everything/everything.c	(original)
+++ trunk/tests/everything/everything.c	Wed Nov 19 22:38:47 2008
@@ -582,3 +582,26 @@
   return our_type;
 }
 
+G_DEFINE_TYPE(TestObj, test_obj, G_TYPE_OBJECT);
+
+static void
+test_obj_class_init (TestObjClass *klass)
+{
+}
+
+static void
+test_obj_init (TestObj *obj)
+{
+}
+
+TestObj *
+test_obj_new_from_file (const char *x, GError **error)
+{
+  return g_object_new (TEST_TYPE_OBJ, NULL);
+}
+
+double
+test_obj_static_method (int x)
+{
+  return x;
+}

Modified: trunk/tests/everything/everything.h
==============================================================================
--- trunk/tests/everything/everything.h	(original)
+++ trunk/tests/everything/everything.h	Wed Nov 19 22:38:47 2008
@@ -154,4 +154,24 @@
 gboolean   test_boxed_equals   (TestBoxed *boxed,
 				TestBoxed *other);
 
+#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))
+
+typedef struct _TestObj          TestObj;
+typedef struct _TestObjClass     TestObjClass;
+struct _TestObj
+{
+  GObject parent_instance;
+};
+
+struct _TestObjClass
+{
+  GObjectClass parent_class;
+};
+
+GType      test_obj_get_type (void);
+TestObj*   test_obj_new_from_file (const char *x, GError **error);
+double     test_obj_static_method (int x);
+
 #endif /* __GITESTTYPES_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]