diff mbox series

[2/2] ui/kbd-state: QAPI'fy QKbdModifier

Message ID 20230224110153.8559-3-philmd@linaro.org
State New
Headers show
Series ui/kbd-state: QAPI'fy QKbdModifier | expand

Commit Message

Philippe Mathieu-Daudé Feb. 24, 2023, 11:01 a.m. UTC
Let QAPI maintain the QKbdModifier enum values.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/ui/kbd-state.h | 16 ----------------
 qapi/ui.json           | 10 ++++++++++
 2 files changed, 10 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/include/ui/kbd-state.h b/include/ui/kbd-state.h
index 14ee2c59e4..83e869bc09 100644
--- a/include/ui/kbd-state.h
+++ b/include/ui/kbd-state.h
@@ -9,22 +9,6 @@ 
 
 #include "qapi/qapi-types-ui.h"
 
-typedef enum QKbdModifier QKbdModifier;
-
-enum QKbdModifier {
-    Q_KBD_MODIFIER_NONE = 0,
-
-    Q_KBD_MODIFIER_SHIFT,
-    Q_KBD_MODIFIER_CTRL,
-    Q_KBD_MODIFIER_ALT,
-    Q_KBD_MODIFIER_ALTGR,
-
-    Q_KBD_MODIFIER_NUMLOCK,
-    Q_KBD_MODIFIER_CAPSLOCK,
-
-    Q_KBD_MODIFIER__MAX
-};
-
 typedef struct QKbdState QKbdState;
 
 /**
diff --git a/qapi/ui.json b/qapi/ui.json
index 0abba3e930..d3230a6bc7 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -920,6 +920,16 @@ 
             'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks',
             'lang1', 'lang2' ] }
 
+##
+# @QKbdModifier:
+#
+# An enumeration of keyboard modifier name.
+#
+# Since: 8.0
+##
+{ 'enum': 'QKbdModifier',
+  'data': [ 'none', 'shift', 'ctrl', 'alt', 'altgr', 'numlock', 'capslock' ] }
+
 ##
 # @KeyValueKind:
 #