summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-11-01 16:50:12 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-11-07 12:11:48 +0100
commite02598b55a352397a0e340062a111e6756128507 (patch)
treeb6b0a60f39b5970cf619cde5aeb9f8d687ca1e4d
parent28a5a407e796df8a26916d1db9e05d6d7bccbd7a (diff)
downloadvala-e02598b55a352397a0e340062a111e6756128507.tar.gz
girwriter: Add readable="0"/private="1" attribute to type-specific fields
-rw-r--r--codegen/valagirwriter.vala8
-rw-r--r--tests/girwriter/GirTest-1.0.gir-expected60
2 files changed, 34 insertions, 34 deletions
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 3406f8ee6..5df7133b0 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -427,7 +427,7 @@ public class Vala.GIRWriter : CodeVisitor {
}
write_indent ();
- buffer.append_printf ("<field name=\"parent_instance\">\n");
+ buffer.append_printf ("<field name=\"parent_instance\" readable=\"0\" private=\"1\">\n");
indent++;
write_indent ();
if (cl.base_class == null) {
@@ -451,7 +451,7 @@ public class Vala.GIRWriter : CodeVisitor {
}
write_indent ();
- buffer.append_printf ("<field name=\"priv\">\n");
+ buffer.append_printf ("<field name=\"priv\" readable=\"0\" private=\"1\">\n");
indent++;
write_indent ();
buffer.append_printf ("<type name=\"%sPrivate\" c:type=\"%sPrivate*\"/>\n", get_gir_name (cl), get_ccode_name (cl));
@@ -481,7 +481,7 @@ public class Vala.GIRWriter : CodeVisitor {
indent++;
write_indent ();
- buffer.append_printf ("<field name=\"parent_class\">\n");
+ buffer.append_printf ("<field name=\"parent_class\" readable=\"0\" private=\"1\">\n");
indent++;
write_indent ();
if (cl.base_class == null) {
@@ -657,7 +657,7 @@ public class Vala.GIRWriter : CodeVisitor {
indent++;
write_indent ();
- buffer.append_printf ("<field name=\"parent_iface\">\n");
+ buffer.append_printf ("<field name=\"parent_iface\" readable=\"0\" private=\"1\">\n");
indent++;
write_indent ();
buffer.append_printf ("<type name=\"%s\" c:type=\"%s\"/>\n", gi_type_name (gtypeinterface_type), get_ccode_name (gtypeinterface_type));
diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected
index a03f48fc6..c4020e580 100644
--- a/tests/girwriter/GirTest-1.0.gir-expected
+++ b/tests/girwriter/GirTest-1.0.gir-expected
@@ -32,13 +32,13 @@
<member name="fishy" c:identifier="GIR_TEST_ERROR_TEST_FISHY" value="23"/>
</enumeration>
<class name="TypeTest" c:type="GirTestTypeTest" glib:type-name="GirTestTypeTest" glib:get-type="gir_test_typetest_get_type" glib:type-struct="TypeTestClass" glib:fundamental="1" glib:ref-func="gir_test_typetest_ref" glib:unref-func="gir_test_typetest_unref" glib:set-value-func="gir_test_value_set_typetest" glib:get-value-func="gir_test_value_get_typetest">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
<field name="ref_count">
<type name="gint" c:type="volatile int"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="TypeTestPrivate" c:type="GirTestTypeTestPrivate*"/>
</field>
<constructor name="new" c:identifier="gir_test_typetest_new">
@@ -63,16 +63,16 @@
</method>
</class>
<record name="TypeTestClass" c:type="GirTestTypeTestClass" glib:is-gtype-struct-for="TypeTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.TypeClass" c:type="GTypeClass"/>
</field>
</record>
<record name="TypeTestPrivate" c:type="GirTestTypeTestPrivate" disguised="1"/>
<class name="SubTypeTest" c:type="GirTestSubTypeTest" glib:type-name="GirTestSubTypeTest" glib:get-type="gir_test_sub_type_test_get_type" glib:type-struct="SubTypeTestClass" parent="GirTest.TypeTest">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GirTest.TypeTest" c:type="GirTestTypeTest"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="SubTypeTestPrivate" c:type="GirTestSubTypeTestPrivate*"/>
</field>
<field name="array_field">
@@ -99,16 +99,16 @@
</constructor>
</class>
<record name="SubTypeTestClass" c:type="GirTestSubTypeTestClass" glib:is-gtype-struct-for="SubTypeTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GirTest.TypeTestClass" c:type="GirTestTypeTestClass"/>
</field>
</record>
<record name="SubTypeTestPrivate" c:type="GirTestSubTypeTestPrivate" disguised="1"/>
<class name="ObjectTest" c:type="GirTestObjectTest" glib:type-name="GirTestObjectTest" glib:get-type="gir_test_object_test_get_type" glib:type-struct="ObjectTestClass" parent="GObject.Object">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.Object" c:type="GObject"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="ObjectTestPrivate" c:type="GirTestObjectTestPrivate*"/>
</field>
<field name="field">
@@ -745,7 +745,7 @@
</glib:signal>
</class>
<record name="ObjectTestClass" c:type="GirTestObjectTestClass" glib:is-gtype-struct-for="ObjectTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<field name="method_with_default_impl">
@@ -862,10 +862,10 @@
</record>
<record name="ObjectTestPrivate" c:type="GirTestObjectTestPrivate" disguised="1"/>
<class name="AbstractObjectTest" c:type="GirTestAbstractObjectTest" glib:type-name="GirTestAbstractObjectTest" glib:get-type="gir_test_abstract_object_test_get_type" glib:type-struct="AbstractObjectTestClass" parent="GObject.Object" abstract="1">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.Object" c:type="GObject"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="AbstractObjectTestPrivate" c:type="GirTestAbstractObjectTestPrivate*"/>
</field>
<method name="method_int8_in" c:identifier="gir_test_abstract_object_test_method_int8_in">
@@ -940,7 +940,7 @@
</virtual-method>
</class>
<record name="AbstractObjectTestClass" c:type="GirTestAbstractObjectTestClass" glib:is-gtype-struct-for="AbstractObjectTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<field name="method_int8_in">
@@ -1004,10 +1004,10 @@
<record name="AbstractObjectTestPrivate" c:type="GirTestAbstractObjectTestPrivate" disguised="1"/>
<class name="ImplementionTest" c:type="GirTestImplementionTest" glib:type-name="GirTestImplementionTest" glib:get-type="gir_test_implemention_test_get_type" glib:type-struct="ImplementionTestClass" parent="GObject.Object">
<implements name="GirTest.InterfaceTest"/>
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.Object" c:type="GObject"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="ImplementionTestPrivate" c:type="GirTestImplementionTestPrivate*"/>
</field>
<constructor name="new" c:identifier="gir_test_implemention_test_new">
@@ -1017,7 +1017,7 @@
</constructor>
</class>
<record name="ImplementionTestClass" c:type="GirTestImplementionTestClass" glib:is-gtype-struct-for="ImplementionTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
</record>
@@ -1036,13 +1036,13 @@
</constructor>
</record>
<class name="SkippedClass" c:type="GirTestSkippedClass" glib:type-name="GirTestSkippedClass" glib:get-type="gir_test_skippedclass_get_type" glib:type-struct="SkippedClassClass" glib:fundamental="1" glib:ref-func="gir_test_skippedclass_ref" glib:unref-func="gir_test_skippedclass_unref" glib:set-value-func="gir_test_value_set_skippedclass" glib:get-value-func="gir_test_value_get_skippedclass" introspectable="0">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
<field name="ref_count">
<type name="gint" c:type="volatile int"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="SkippedClassPrivate" c:type="GirTestSkippedClassPrivate*"/>
</field>
<constructor name="new" c:identifier="gir_test_skippedclass_new">
@@ -1052,19 +1052,19 @@
</constructor>
</class>
<record name="SkippedClassClass" c:type="GirTestSkippedClassClass" glib:is-gtype-struct-for="SkippedClass">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.TypeClass" c:type="GTypeClass"/>
</field>
</record>
<record name="SkippedClassPrivate" c:type="GirTestSkippedClassPrivate" disguised="1"/>
<class name="DeprecatedClassTest" c:type="GirTestDeprecatedClassTest" glib:type-name="GirTestDeprecatedClassTest" glib:get-type="gir_test_deprecated_class_test_get_type" glib:type-struct="DeprecatedClassTestClass" glib:fundamental="1" glib:ref-func="gir_test_deprecated_class_test_ref" glib:unref-func="gir_test_deprecated_class_test_unref" glib:set-value-func="gir_test_value_set_deprecated_class_test" glib:get-value-func="gir_test_value_get_deprecated_class_test" deprecated="1" deprecated-version="0.1.2" version="0.1.0">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
<field name="ref_count">
<type name="gint" c:type="volatile int"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="DeprecatedClassTestPrivate" c:type="GirTestDeprecatedClassTestPrivate*"/>
</field>
<constructor name="new" c:identifier="gir_test_deprecated_class_test_new">
@@ -1074,19 +1074,19 @@
</constructor>
</class>
<record name="DeprecatedClassTestClass" c:type="GirTestDeprecatedClassTestClass" glib:is-gtype-struct-for="DeprecatedClassTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.TypeClass" c:type="GTypeClass"/>
</field>
</record>
<record name="DeprecatedClassTestPrivate" c:type="GirTestDeprecatedClassTestPrivate" disguised="1"/>
<class name="GenericsTest" c:type="GirTestGenericsTest" glib:type-name="GirTestGenericsTest" glib:get-type="gir_test_generics_test_get_type" glib:type-struct="GenericsTestClass" glib:fundamental="1" glib:ref-func="gir_test_generics_test_ref" glib:unref-func="gir_test_generics_test_unref" glib:set-value-func="gir_test_value_set_generics_test" glib:get-value-func="gir_test_value_get_generics_test">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
<field name="ref_count">
<type name="gint" c:type="volatile int"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="GenericsTestPrivate" c:type="GirTestGenericsTestPrivate*"/>
</field>
<constructor name="new" c:identifier="gir_test_generics_test_new">
@@ -1169,16 +1169,16 @@
</method>
</class>
<record name="GenericsTestClass" c:type="GirTestGenericsTestClass" glib:is-gtype-struct-for="GenericsTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.TypeClass" c:type="GTypeClass"/>
</field>
</record>
<record name="GenericsTestPrivate" c:type="GirTestGenericsTestPrivate" disguised="1"/>
<class name="GenericsObjectTest" c:type="GirTestGenericsObjectTest" glib:type-name="GirTestGenericsObjectTest" glib:get-type="gir_test_generics_object_test_get_type" glib:type-struct="GenericsObjectTestClass" parent="GObject.Object">
- <field name="parent_instance">
+ <field name="parent_instance" readable="0" private="1">
<type name="GObject.Object" c:type="GObject"/>
</field>
- <field name="priv">
+ <field name="priv" readable="0" private="1">
<type name="GenericsObjectTestPrivate" c:type="GirTestGenericsObjectTestPrivate*"/>
</field>
<property name="g-type" writable="1" construct-only="1">
@@ -1250,7 +1250,7 @@
</constructor>
</class>
<record name="GenericsObjectTestClass" c:type="GirTestGenericsObjectTestClass" glib:is-gtype-struct-for="GenericsObjectTest">
- <field name="parent_class">
+ <field name="parent_class" readable="0" private="1">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
</record>
@@ -1358,7 +1358,7 @@
</virtual-method>
</interface>
<record name="InterfaceTestIface" c:type="GirTestInterfaceTestIface" glib:is-gtype-struct-for="InterfaceTest">
- <field name="parent_iface">
+ <field name="parent_iface" readable="0" private="1">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
<field name="int8_in">
@@ -1440,7 +1440,7 @@
<interface name="SkippedInterface" c:type="GirTestSkippedInterface" glib:type-name="GirTestSkippedInterface" glib:get-type="gir_test_skipped_interface_get_type" glib:type-struct="SkippedInterfaceIface" introspectable="0">
</interface>
<record name="SkippedInterfaceIface" c:type="GirTestSkippedInterfaceIface" glib:is-gtype-struct-for="SkippedInterface">
- <field name="parent_iface">
+ <field name="parent_iface" readable="0" private="1">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
</record>
@@ -1448,7 +1448,7 @@
<prerequisite name="GirTest.InterfaceTest"/>
</interface>
<record name="PrerequisiteTestIface" c:type="GirTestPrerequisiteTestIface" glib:is-gtype-struct-for="PrerequisiteTest">
- <field name="parent_iface">
+ <field name="parent_iface" readable="0" private="1">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
</record>