Add an instance method to TestObj.
Add a TestObj subclass in Everything, with another constructor, an
additional instance method and an overridden instance method.
</parameter>
</parameters>
</method>
+ <method name="instance_method" c:identifier="test_obj_instance_method">
+ <return-value transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </return-value>
+ </method>
<method name="do_matrix"
c:identifier="test_obj_do_matrix"
doc="This method is virtual. Notably its name differs from the virtual
<type name="GObject.Object" c:type="GObject*"/>
</field>
</record>
+ <class name="TestSubObj"
+ c:type="TestSubObj"
+ parent="TestObj"
+ glib:type-name="TestSubObj"
+ glib:get-type="test_sub_obj_get_type"
+ glib:type-struct="TestSubObjClass">
+ <constructor name="new" c:identifier="test_sub_obj_new">
+ <return-value transfer-ownership="full">
+ <type name="TestSubObj" c:type="TestSubObj*"/>
+ </return-value>
+ </constructor>
+ <method name="unset_bare" c:identifier="test_sub_obj_unset_bare">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ </method>
+ <method name="instance_method"
+ c:identifier="test_sub_obj_instance_method">
+ <return-value transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </return-value>
+ </method>
+ <field name="parent_instance">
+ <type name="TestObj" c:type="TestObj"/>
+ </field>
+ </class>
+ <record name="TestSubObjClass"
+ c:type="TestSubObjClass"
+ glib:is-gtype-struct-for="TestSubObj">
+ <field name="parent_class">
+ <type name="TestObjClass" c:type="TestObjClass"/>
+ </field>
+ </record>
<class name="TestWi8021x"
c:type="TestWi8021x"
parent="GObject.Object"
g_object_ref (obj->bare);
}
+int
+test_obj_instance_method (TestObj *obj)
+{
+ return -1;
+}
+
double
test_obj_static_method (int x)
{
};
+G_DEFINE_TYPE(TestSubObj, test_sub_obj, TEST_TYPE_OBJ);
+
+static void
+test_sub_obj_class_init (TestSubObjClass *klass)
+{
+}
+
+static void
+test_sub_obj_init (TestSubObj *obj)
+{
+}
+
+TestSubObj*
+test_sub_obj_new ()
+{
+ return g_object_new (TEST_TYPE_SUB_OBJ, NULL);
+}
+
+int
+test_sub_obj_instance_method (TestSubObj *obj)
+{
+ return 0;
+}
+
+void
+test_sub_obj_unset_bare (TestSubObj *obj)
+{
+ test_obj_set_bare(TEST_OBJECT(obj), NULL);
+}
+
+
/**
* test_callback:
* @callback: (scope call):
GType test_obj_get_type (void);
TestObj* test_obj_new_from_file (const char *x, GError **error);
void test_obj_set_bare (TestObj *obj, GObject *bare);
+int test_obj_instance_method (TestObj *obj);
double test_obj_static_method (int x);
/* virtual */
int test_obj_do_matrix (TestObj *obj, const char *somestr);
+/* inheritance */
+#define TEST_TYPE_SUB_OBJ (test_sub_obj_get_type ())
+#define TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_SUB_OBJ, TestSubObj))
+#define TEST_IS_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_SUB_OBJ))
+#define TEST_SUB_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_SUB_OBJ, TestSubObjClass))
+
+typedef struct _TestSubObj TestSubObj;
+typedef struct _TestSubObjClass TestSubObjClass;
+
+struct _TestSubObj
+{
+ TestObj parent_instance;
+};
+
+struct _TestSubObjClass
+{
+ TestObjClass parent_class;
+};
+
+GType test_sub_obj_get_type (void);
+TestSubObj* test_sub_obj_new (void);
+void test_sub_obj_unset_bare (TestSubObj *obj);
+int test_sub_obj_instance_method (TestSubObj *obj);
+
/* callback */
typedef int (*TestCallback) ();
typedef int (*TestCallbackUserData) (gpointer user_data);