Fix flag values

Enums/bitfields have a C identifier, a GLib nick, and a GIR name. The
last two are usually the same except the nick uses '-' and the GIR name
uses '_'. It is confusing.

Blueprint tries to use GIR names for everything, but GTK requires a C
identifier or GLib nick for enum and bitfield values. Blueprint was
sometimes passing the GIR name through instead of finding one of the
other names. Fixed by always emitting the C identifier for enums and
bitfields where the GIR type is known.
This commit is contained in:
James Westman 2022-06-10 13:20:44 -05:00
parent fac311d3c3
commit fd55a5abf2
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
8 changed files with 27 additions and 18 deletions

View file

@ -5,7 +5,7 @@
<accessibility>
<property name="label" translatable="true">Hello, world!</property>
<relation name="labelled-by">my_label</relation>
<state name="checked">true</state>
<state name="checked">GTK_ACCESSIBLE_TRISTATE_TRUE</state>
</accessibility>
</object>
<object class="GtkLabel" id="my_label"></object>

View file

@ -2,6 +2,6 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkScrolledWindow">
<property name="window-placement">top-left</property>
<property name="window-placement">GTK_CORNER_TOP_LEFT</property>
</object>
</interface>

View file

@ -6,5 +6,5 @@ Gio.Application {
}
EventControllerScroll {
flags: vertical;
flags: both_axes;
}

View file

@ -2,9 +2,9 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GApplication">
<property name="flags">is_service|handles_open</property>
<property name="flags">G_APPLICATION_IS_SERVICE|G_APPLICATION_HANDLES_OPEN</property>
</object>
<object class="GtkEventControllerScroll">
<property name="flags">vertical</property>
<property name="flags">GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES</property>
</object>
</interface>

View file

@ -2,6 +2,6 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="orientation">GTK_ORIENTATION_VERTICAL</property>
</object>
</interface>

View file

@ -2,7 +2,7 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<property name="mode">GTK_SIZE_GROUP_HORIZONTAL</property>
<widgets>
<widget name="label"/>
<widget name="button"/>