mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-25 01:10:09 +01:00
scanner: handle the allow-null attribute for arguments
Currently unused but it's exposed, so yay...
This commit is contained in:
parent
267716a760
commit
87705ef97c
1 changed files with 9 additions and 0 deletions
|
|
@ -92,6 +92,10 @@ class Argument:
|
|||
For an argument referenced by another argument of type "new_id", this field
|
||||
points to the other argument that references this argument.
|
||||
"""
|
||||
allow_null: bool = attr.ib(default=False)
|
||||
"""
|
||||
For an argument of type string, specify if the argument may be NULL.
|
||||
"""
|
||||
|
||||
@property
|
||||
def signature(self) -> str:
|
||||
|
|
@ -137,6 +141,7 @@ class Argument:
|
|||
summary: str = "",
|
||||
enum: Optional["Enum"] = None,
|
||||
interface: Optional["Interface"] = None,
|
||||
allow_null: bool = False,
|
||||
) -> "Argument":
|
||||
return cls(
|
||||
name=name,
|
||||
|
|
@ -144,6 +149,7 @@ class Argument:
|
|||
summary=summary,
|
||||
enum=enum,
|
||||
interface=interface,
|
||||
allow_null=allow_null,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -709,12 +715,15 @@ class ProtocolParser(xml.sax.handler.ContentHandler):
|
|||
f"Failed to find enum '{intf.name}.{enum_name}'",
|
||||
self.location,
|
||||
)
|
||||
|
||||
allow_null = attrs.get("allow-null", "false") == "true"
|
||||
arg = Argument.create(
|
||||
name=name,
|
||||
protocol_type=proto_type,
|
||||
summary=summary,
|
||||
enum=enum,
|
||||
interface=interface,
|
||||
allow_null=allow_null,
|
||||
)
|
||||
self.current_message.add_argument(arg)
|
||||
if proto_type == "new_id":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue