summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2022-07-13 12:45:57 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2023-01-08 21:48:45 +0000
commit8d44bd13940649a708c8a2186cd3ba58ce6fc503 (patch)
tree390c0457dc2939502a7c7a1e15e8b933fc1145d7 /giscanner/girwriter.py
parent9ffbdd3738b02a0220c8d9156babf20e0c5ff7d4 (diff)
downloadgobject-introspection-8d44bd13940649a708c8a2186cd3ba58ce6fc503.tar.gz
Split disguised attribute into two
The disguised attribute started off as a way to indicate a typedef to a structure pointer, e.g. typedef struct Foo* FooPtr; Over the years, though, it started to include opaque structure types, e.g. typedef struct _FooObject FooObject; typedef struct _FooObjectClass FooObjectClass; This has led to issues in language bindings, code generators, and documentation generators, which now have issues when dealing with both pointer aliases and opaque types. An initial attempt at fixing this mess in commit f606183a ended up breaking Vala, and had to be reverted. To avoid breaking existing users we can follow a similar approach to the allow-none/nullable/optional solution: 1. introduce a new pair of attributes: "pointer" and "opaque" 2. deprecate the "disguised" attribute The "pointer" attribute covers the case of pointer types. The "opaque" attribute covers the case of opaque structured types. See also: https://gitlab.gnome.org/GNOME/vala/-/issues/735 Fixes: #101
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 810acad6..db4dccb4 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -587,6 +587,10 @@ class GIRWriter(XMLWriter):
attrs.append(('c:type', record.ctype))
if record.disguised:
attrs.append(('disguised', '1'))
+ if record.opaque:
+ attrs.append(('opaque', '1'))
+ if record.pointer:
+ attrs.append(('pointer', '1'))
if record.foreign:
attrs.append(('foreign', '1'))
if record.is_gtype_struct_for is not None: