gtk: add and use DisplayOptions + DisplayGTK

Add QAPI DisplayType enum, DisplayOptions union and DisplayGTK struct.
Switch gtk configuration to use the qapi type.

Some bookkeeping (fullscreen for example) is done twice now, this is
temporary until more/all UIs are switched over to qapi configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-5-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2018-02-02 12:10:14 +01:00
parent be045e6bb8
commit 0c8d706532
4 changed files with 98 additions and 24 deletions

View file

@ -985,3 +985,61 @@
'data': { '*device': 'str',
'*head' : 'int',
'events' : [ 'InputEvent' ] } }
##
# @DisplayNoOpts:
#
# Empty struct for displays without config options.
#
# Since: 2.12
#
##
{ 'struct' : 'DisplayNoOpts',
'data' : { } }
##
# @DisplayGTK:
#
# GTK display options.
#
# @grab-on-hover: Grab keyboard input on mouse hover.
#
# Since: 2.12
#
##
{ 'struct' : 'DisplayGTK',
'data' : { '*grab-on-hover' : 'bool' } }
##
# @DisplayType:
#
# Display (user interface) type.
#
# Since: 2.12
#
##
{ 'enum' : 'DisplayType',
'data' : [ 'none', 'gtk' ] }
##
# @DisplayOptions:
#
# Display (user interface) options.
#
# @type: Which DisplayType qemu should use.
# @full-screen: Start user interface in fullscreen mode (default: off).
# @window-close: Allow to quit qemu with window close button (default: on).
# @gl: Enable OpenGL support (default: off).
#
# Since: 2.12
#
##
{ 'union' : 'DisplayOptions',
'base' : { 'type' : 'DisplayType',
'*full-screen' : 'bool',
'*window-close' : 'bool',
'*gl' : 'bool' },
'discriminator' : 'type',
'data' : { 'none' : 'DisplayNoOpts',
'gtk' : 'DisplayGTK' } }