mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
typelib: Fix field offsets for attributes
This fixes a bug where the decompiler could not recognize enums by their C identifiers because it could not correctly read attributes. Fixes #177.
This commit is contained in:
parent
d7097cad01
commit
3b6dcf072d
4 changed files with 20 additions and 3 deletions
|
@ -148,8 +148,8 @@ class Typelib:
|
|||
SIGNATURE_ARGUMENTS = Field(0x8, "offset")
|
||||
|
||||
ATTR_OFFSET = Field(0x0, "u32")
|
||||
ATTR_NAME = Field(0x0, "string")
|
||||
ATTR_VALUE = Field(0x0, "string")
|
||||
ATTR_NAME = Field(0x4, "string")
|
||||
ATTR_VALUE = Field(0x8, "string")
|
||||
|
||||
TYPE_BLOB_TAG = Field(0x0, "u8", 3, 5)
|
||||
TYPE_BLOB_INTERFACE = Field(0x2, "dir_entry")
|
||||
|
|
5
tests/samples/issue_177.blp
Normal file
5
tests/samples/issue_177.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Box {
|
||||
orientation: horizontal;
|
||||
}
|
12
tests/samples/issue_177.ui
Normal file
12
tests/samples/issue_177.ui
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT EDIT!
|
||||
This file was @generated by blueprint-compiler. Instead, edit the
|
||||
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||
-->
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
</object>
|
||||
</interface>
|
|
@ -207,7 +207,7 @@ class TestSamples(unittest.TestCase):
|
|||
]
|
||||
|
||||
# Decompiler-only tests
|
||||
SKIP_COMPILE = ["translator_comments"]
|
||||
SKIP_COMPILE = ["issue_177", "translator_comments"]
|
||||
|
||||
SKIP_DECOMPILE = [
|
||||
# Comments are not preserved in either direction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue