qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] ui: Switch "-display sdl" to use the QAPI parser


From: Markus Armbruster
Subject: Re: [PATCH 2/3] ui: Switch "-display sdl" to use the QAPI parser
Date: Tue, 17 May 2022 11:08:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Thomas Huth <thuth@redhat.com> writes:

> On 12/05/2022 14.16, Markus Armbruster wrote:

[...]

>>> This introduces the new "DisplaySDL" QAPI struct that is used to hold
>>> the parameters that are unique to the SDL display. The only specific
>>> parameter is currently "grab-mod" which is modeled as a string, so that
>>> it could be extended for other arbitrary modifiers later more easily.
>> 
>> Are the values of @grab-mod parsed in any way, or do we recognize a set
>> of fixed strings?
>> 
>> The former would be problematic.  We try hard to represent complex data
>> as JSON instead of inventing little ad hoc languages.
>> 
>> If it's the latter, use an enum.  Makes introspection more useful, and
>> adding enumeration values is no harder than adding string literals.
>
> It's currently only two strings that are used to replace the old behavior. 
> But in the long run, I think it would be nice to have more flexibility here, 
> so that a user could specify an arbitrary combination of modifier keys. I 
> don't think that an enum will really scale here, so I'd prefer to go with 
> the current approach and use the string for more flexibility.

"Arbitrary combination of modifier keys" sounds like set of enum to me.
We approximate sets with lists in QAPI.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]