From patchwork Fri Feb 24 11:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656250 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp833294wrb; Fri, 24 Feb 2023 03:03:00 -0800 (PST) X-Google-Smtp-Source: AK7set9o/th12jLv0Nl1sJPi+hzZool7VQJdFUzRB53HxDin4/hEH2FbpG4EK7rj6/2c3EIo2pyX X-Received: by 2002:a05:622a:138e:b0:3b9:bc8c:c20f with SMTP id o14-20020a05622a138e00b003b9bc8cc20fmr27743971qtk.26.1677236579923; Fri, 24 Feb 2023 03:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677236579; cv=none; d=google.com; s=arc-20160816; b=wsIyr+XUtww/aiPQUw2m+plPpI1opgxq09IlDIFODalxiJgMwsRGbFV6ARsBYpu9rf B8RjdDGZPrO3NYVOQrAY6oICv6+8Q0W0cDy77ZBU1WrlI/UVioPATnJP27drf91XxvNN 0s3t5GwCOQmpZXAYzGT93M/00jVWcdihbDRYSTLnOp3AusaxF9MYyVJEiHgtIextx3ni kP7AU9sWahLJNYuh76eK7kL7q7XBcMADSKk88P9p9pLltRbxdvj+9XW7Pjz1gmm2l4j/ scqLKWK2rSsRgbYfxozmd/S0Dr16sXTCwY+YPw4rWcFg2ys6NGQaUk3M//yaUaGv1dT5 xWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mtI7oTW1zRiQGzcik8ROjOPNokpondLOeXtarHwD0c0=; b=pFnanF3by3os8TkkvNv8rSwx/y0KmUIf1xOPiMGHN6ctIVnvBK0N/aC/yPZ8vclHDV SZiCzrtzrBkZ8KyNrdfQgMbgbhpxnPfrWUHHtVQcJL1ioLgyI0DpR/qKgrIlVyLpg0GX yuLbfg392RR38J8TiSNaiOqkpXMx6vpVK+DjXpAPTTDf35IdqysmgXeIcEJPaLCXg/Mi 5crw3STaz9wlhqMLe3sL33QDBJtUQx/EIDQ80QFAd84BWtnzeXVE/l4bPAcZ6Dq/jzSj deBK6PfMtOProTTUrLzj873G30GD297gNTkfScGCE2LPUqwyRmtTa7WdEA8POVSnmg6K DbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xdce7Yd8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 207-20020a370ad8000000b00742703b0200si1595014qkk.349.2023.02.24.03.02.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Feb 2023 03:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xdce7Yd8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVVq4-0006dF-Rw; Fri, 24 Feb 2023 06:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVVq1-0006cT-Io for qemu-devel@nongnu.org; Fri, 24 Feb 2023 06:02:07 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVVpz-0000qM-3r for qemu-devel@nongnu.org; Fri, 24 Feb 2023 06:02:05 -0500 Received: by mail-wm1-x329.google.com with SMTP id j3so9175276wms.2 for ; Fri, 24 Feb 2023 03:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mtI7oTW1zRiQGzcik8ROjOPNokpondLOeXtarHwD0c0=; b=xdce7Yd8ZFsI1npxNSMfl4d3z5YHQTwMBvZd3WrKeIv2clUzgFb8qeAmHcEZc723q6 5E9hWSvYlraVS4pOBRh+6Ex70uLg2AiGglrfHvr6YQNc+CO7BXEwG+QUsBeWjTPV3VBD 8KVTZl+5ppiSa538usE+9PeryGvFDIYgQUnv/TNO7h+/hpZwBeNWp2MSjsoY45fzzRB+ S+TB8C5hIMorump5jTGvg726HuU35yrKIuuqgRnOgg5YEq2dm5RLhdhCCqWu9QAwrLjg FgCOy0pohBoRLpPgjYyG/6PfGX2XD3wFiugt5SQz+RzDYvFcA6MxAHv2OJoua0Z6H1Xi nc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mtI7oTW1zRiQGzcik8ROjOPNokpondLOeXtarHwD0c0=; b=H0kC8+jIm4bAwqHSjHAUu+Ko8kIeZTIh+hq7XqQjjwzH9sS0LzOC0I+zoungq4g4Dz k9LB84GIGg5Ert/VIRWFfeomgUHY17jkaESuc5bXuewMe4JpY5gmhXH5Bs6fKWslsPWm 3Pg7EHuHwfBKOq/MbuN+o2lvUJaxV9VmY7DlSI8kGzGYkBgMr1tlx0XkxZd5fn5M8d9Z HTSh9ieiuxb92YxLTHBTHXHEpmB4LaupuUl1EiBUNQPI5OT/hRv+vLmgL63kWY20QmbB 10BJ5JFyy6xK9ps6TVY9Ofu0Jy8b4Uvk8eq9zIU3Bq0LkvXuWP27tnT0BX6ayV0CR1A6 cKCw== X-Gm-Message-State: AO0yUKW8psp4SshEKJlleQJmGeom2FMzmW3TSlKxhKRqvA/TE70fmLZa eMTZtHxd9tcfqKniCyFflyw4caJlhd4FvB/b X-Received: by 2002:a05:600c:c8:b0:3d2:392e:905f with SMTP id u8-20020a05600c00c800b003d2392e905fmr11373170wmm.24.1677236521196; Fri, 24 Feb 2023 03:02:01 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n1-20020a05600c4f8100b003eb20d4d4a8sm1273121wmq.44.2023.02.24.03.02.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Feb 2023 03:02:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Eric Blake , Markus Armbruster , Akihiko Odaki , Peter Maydell Subject: [PATCH 1/2] ui/kbd-state: Rename QKbdModifier enum definitions Date: Fri, 24 Feb 2023 12:01:52 +0100 Message-Id: <20230224110153.8559-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224110153.8559-1-philmd@linaro.org> References: <20230224110153.8559-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In order to QAPI'fy QKbdModifier in the next commit, rename its definitions to a QAPI-ready format. Mechanical change doing: $ sed -i -e s/QKBD_MOD_/Q_KBD_MODIFIER_/g $(git grep -l QKBD_MOD_) Signed-off-by: Philippe Mathieu-Daudé --- include/ui/kbd-state.h | 16 ++++++++-------- ui/cocoa.m | 2 +- ui/kbd-state.c | 14 +++++++------- ui/keymaps.c | 6 +++--- ui/sdl2-input.c | 2 +- ui/vnc.c | 16 ++++++++-------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/ui/kbd-state.h b/include/ui/kbd-state.h index eb9067dd53..14ee2c59e4 100644 --- a/include/ui/kbd-state.h +++ b/include/ui/kbd-state.h @@ -12,17 +12,17 @@ typedef enum QKbdModifier QKbdModifier; enum QKbdModifier { - QKBD_MOD_NONE = 0, + Q_KBD_MODIFIER_NONE = 0, - QKBD_MOD_SHIFT, - QKBD_MOD_CTRL, - QKBD_MOD_ALT, - QKBD_MOD_ALTGR, + Q_KBD_MODIFIER_SHIFT, + Q_KBD_MODIFIER_CTRL, + Q_KBD_MODIFIER_ALT, + Q_KBD_MODIFIER_ALTGR, - QKBD_MOD_NUMLOCK, - QKBD_MOD_CAPSLOCK, + Q_KBD_MODIFIER_NUMLOCK, + Q_KBD_MODIFIER_CAPSLOCK, - QKBD_MOD__MAX + Q_KBD_MODIFIER__MAX }; typedef struct QKbdState QKbdState; diff --git a/ui/cocoa.m b/ui/cocoa.m index e915c344a8..2c12fc58ea 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -840,7 +840,7 @@ - (bool) handleEventLocked:(NSEvent *)event * this implementation usable enough. */ if (!!(modifiers & NSEventModifierFlagCapsLock) != - qkbd_state_modifier_get(kbd, QKBD_MOD_CAPSLOCK)) { + qkbd_state_modifier_get(kbd, Q_KBD_MODIFIER_CAPSLOCK)) { qkbd_state_key_event(kbd, Q_KEY_CODE_CAPS_LOCK, true); qkbd_state_key_event(kbd, Q_KEY_CODE_CAPS_LOCK, false); } diff --git a/ui/kbd-state.c b/ui/kbd-state.c index 62d42a7a22..cc53b5e135 100644 --- a/ui/kbd-state.c +++ b/ui/kbd-state.c @@ -13,7 +13,7 @@ struct QKbdState { QemuConsole *con; int key_delay_ms; DECLARE_BITMAP(keys, Q_KEY_CODE__MAX); - DECLARE_BITMAP(mods, QKBD_MOD__MAX); + DECLARE_BITMAP(mods, Q_KBD_MODIFIER__MAX); }; static void qkbd_state_modifier_update(QKbdState *kbd, @@ -67,29 +67,29 @@ void qkbd_state_key_event(QKbdState *kbd, QKeyCode qcode, bool down) case Q_KEY_CODE_SHIFT: case Q_KEY_CODE_SHIFT_R: qkbd_state_modifier_update(kbd, Q_KEY_CODE_SHIFT, Q_KEY_CODE_SHIFT_R, - QKBD_MOD_SHIFT); + Q_KBD_MODIFIER_SHIFT); break; case Q_KEY_CODE_CTRL: case Q_KEY_CODE_CTRL_R: qkbd_state_modifier_update(kbd, Q_KEY_CODE_CTRL, Q_KEY_CODE_CTRL_R, - QKBD_MOD_CTRL); + Q_KBD_MODIFIER_CTRL); break; case Q_KEY_CODE_ALT: qkbd_state_modifier_update(kbd, Q_KEY_CODE_ALT, Q_KEY_CODE_ALT, - QKBD_MOD_ALT); + Q_KBD_MODIFIER_ALT); break; case Q_KEY_CODE_ALT_R: qkbd_state_modifier_update(kbd, Q_KEY_CODE_ALT_R, Q_KEY_CODE_ALT_R, - QKBD_MOD_ALTGR); + Q_KBD_MODIFIER_ALTGR); break; case Q_KEY_CODE_CAPS_LOCK: if (down) { - change_bit(QKBD_MOD_CAPSLOCK, kbd->mods); + change_bit(Q_KBD_MODIFIER_CAPSLOCK, kbd->mods); } break; case Q_KEY_CODE_NUM_LOCK: if (down) { - change_bit(QKBD_MOD_NUMLOCK, kbd->mods); + change_bit(Q_KBD_MODIFIER_NUMLOCK, kbd->mods); } break; default: diff --git a/ui/keymaps.c b/ui/keymaps.c index 6ceaa97085..c8b99eaf4a 100644 --- a/ui/keymaps.c +++ b/ui/keymaps.c @@ -222,13 +222,13 @@ int keysym2scancode(kbd_layout_t *k, int keysym, * interface modifier state. If so, prefer that one. */ mods = 0; - if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_SHIFT)) { + if (kbd && qkbd_state_modifier_get(kbd, Q_KBD_MODIFIER_SHIFT)) { mods |= SCANCODE_SHIFT; } - if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_ALTGR)) { + if (kbd && qkbd_state_modifier_get(kbd, Q_KBD_MODIFIER_ALTGR)) { mods |= SCANCODE_ALTGR; } - if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_CTRL)) { + if (kbd && qkbd_state_modifier_get(kbd, Q_KBD_MODIFIER_CTRL)) { mods |= SCANCODE_CTRL; } diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c index f068382209..24c920e3af 100644 --- a/ui/sdl2-input.c +++ b/ui/sdl2-input.c @@ -44,7 +44,7 @@ void sdl2_process_key(struct sdl2_console *scon, qkbd_state_key_event(scon->kbd, qcode, ev->type == SDL_KEYDOWN); if (!qemu_console_is_graphic(con)) { - bool ctrl = qkbd_state_modifier_get(scon->kbd, QKBD_MOD_CTRL); + bool ctrl = qkbd_state_modifier_get(scon->kbd, Q_KBD_MODIFIER_CTRL); if (ev->type == SDL_KEYDOWN) { switch (qcode) { case Q_KEY_CODE_RET: diff --git a/ui/vnc.c b/ui/vnc.c index d9eacad759..a10d0b7b20 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1877,8 +1877,8 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) switch (qcode) { case Q_KEY_CODE_1 ... Q_KEY_CODE_9: /* '1' to '9' keys */ if (vs->vd->dcl.con == NULL && down && - qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CTRL) && - qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_ALT)) { + qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_CTRL) && + qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_ALT)) { /* Reset the modifiers sent to the current console */ qkbd_state_lift_all_keys(vs->vd->kbd); console_select(qcode - Q_KEY_CODE_1); @@ -1899,12 +1899,12 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) toggles numlock away from the VNC window. */ if (keysym_is_numlock(vs->vd->kbd_layout, sym & 0xFFFF)) { - if (!qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK)) { + if (!qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_NUMLOCK)) { trace_vnc_key_sync_numlock(true); press_key(vs, Q_KEY_CODE_NUM_LOCK); } } else { - if (qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK)) { + if (qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_NUMLOCK)) { trace_vnc_key_sync_numlock(false); press_key(vs, Q_KEY_CODE_NUM_LOCK); } @@ -1919,8 +1919,8 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) toggles capslock away from the VNC window. */ int uppercase = !!(sym >= 'A' && sym <= 'Z'); - bool shift = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_SHIFT); - bool capslock = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CAPSLOCK); + bool shift = qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_SHIFT); + bool capslock = qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_CAPSLOCK); if (capslock) { if (uppercase == shift) { trace_vnc_key_sync_capslock(false); @@ -1936,8 +1936,8 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) qkbd_state_key_event(vs->vd->kbd, qcode, down); if (!qemu_console_is_graphic(NULL)) { - bool numlock = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK); - bool control = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CTRL); + bool numlock = qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_NUMLOCK); + bool control = qkbd_state_modifier_get(vs->vd->kbd, Q_KBD_MODIFIER_CTRL); /* QEMU console emulation */ if (down) { switch (keycode) { From patchwork Fri Feb 24 11:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656249 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp833293wrb; Fri, 24 Feb 2023 03:03:00 -0800 (PST) X-Google-Smtp-Source: AK7set+5tIxAiuB3iZtYujmg5qq6WQ+AcOPadOpr4u6htqJoXlVrxrAUzOxDVAwl6Woa8d4GCW4+ X-Received: by 2002:ac8:5c0c:0:b0:3b6:2f3f:2713 with SMTP id i12-20020ac85c0c000000b003b62f3f2713mr27246452qti.25.1677236579904; Fri, 24 Feb 2023 03:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677236579; cv=none; d=google.com; s=arc-20160816; b=fQ+HYm2TK2mYPdTjWuKKYy2gWdSphncnAzSsygEd/B4JvjXzm0WIoQAy6mM3xwYu17 FTP6PQ8aGugwdJN+uELiyXK0uBB9NPtaptEZuvkjQ2rwwq/lAxtusPkCOmwIfExmpdq+ UzxMj0Wa8/V8TRqH6hxuGRi/owDMJQ/dluHba1ZIhLrUwLZeW0mP6uIcN03pB7sEh/lG sFXeNL3+lU9NK+EFwdOwSVSS/A8oWGOur4K/40iS4fDyoRTTr4/HC+GcFg8HJTVNJpt5 WUBbMk008BcDJVUQnu14dtMRhZevQrmyFqR4shZLV4W23ZLf8yc+OV/AM1qhbdAHQqcf Cl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UL9cbfanvKJdm70LAtZ1fItowiCtEfLbfU50/G893cY=; b=Z05naDm6sE26MFrlHoiyLFC93r6UFRLFqbYYTcgjQYsws85g/xen6AJREenmHcMGoH 6BbE0SS8H3/HVkFw1ZiUpOP7DGDHlrRMcLp/OMHWgih2AbZnTfsCtGbB/EmEhkAn2qcW OVEXYsD1ZBT4oCPoi3VYMaIF53r5sOLgDRt69aDvUkJj45/Isq1x7BViEhYQ5GagBqq+ BafJoEcNtW1MB/eP5AfM+gKz00HCUvSioRMjiMkYu9TngWAi+XYdfIZFcL5flAoqEQtP tJTXwf7U5BdBhR1dvJYRoc0axjtVugCQmAHvMwhII/C3owgwMgjp0Pw7S7EDVdPgyhXS RpPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d7ib19uK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x17-20020ac87011000000b003b9b3a0df86si7159523qtm.535.2023.02.24.03.02.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Feb 2023 03:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d7ib19uK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVVqA-0006eO-NT; Fri, 24 Feb 2023 06:02:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVVq6-0006dX-3i for qemu-devel@nongnu.org; Fri, 24 Feb 2023 06:02:10 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVVq4-0000ry-FC for qemu-devel@nongnu.org; Fri, 24 Feb 2023 06:02:09 -0500 Received: by mail-wr1-x432.google.com with SMTP id bt28so6836901wrb.8 for ; Fri, 24 Feb 2023 03:02:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UL9cbfanvKJdm70LAtZ1fItowiCtEfLbfU50/G893cY=; b=d7ib19uK/TVtr/noqBXWaPS34Iz4TgGUOGaXRFFVNQqi1Mqxy8O/1o2v2CZjPUZnoS 3e6O9IY94II0qBcSuoc/V085MziEozyDfnvDHj54d6M9S1pZnTxmxw5lgjJoS4u2je1U HfGN8r2PWAKjBB1QZypqVRKzcMWLEooLsz1WeYDHn6fsOAhlgziNtjWVJtPcY/jqIvlI x+nzwQyutzLUHmL5f+VpQeMfwYdDlggNU5Z3IhKHGUfdBC7Gg2LBqU4ZhleKv7JE5wo3 9DQFSsOccmecYSPMvfOBlDL0Jjn3Eue2w0uY6y7kEgCLOS7QPUvC6oW+srpO1h6dO3ud 4F6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UL9cbfanvKJdm70LAtZ1fItowiCtEfLbfU50/G893cY=; b=NtrsnhMOw/Rff8PQKyrJGLV8h955jWiDOGEuQDa0D3aCNiAWDsfI2OP23DTfsmSYyr VIXyC38K/fNNuzBplXDA9kvsig52st++JjOzKbFQl3xb7WFsXOz9j9VM92bKQCRKq0mX UKTnVsW35hHEhU/sqyNMiR7So/HqDkDfPn8RYSMfG9MNCSL/PYqUPmGL54sikWzF1zJb Idr/5IzEI+kO9hyg+enBJ5e0RUOo7OM2k3mOTLnSpQRdOLOV7i2SRN1W1dukE/oR/d0I YT3/ZnINgrk0LCbCThENeR99AMf34Tbr9c887J8po2Xg70QsT0IldL56qg5hqwHtQg+o jz9g== X-Gm-Message-State: AO0yUKVzsm4NJFUPdB1nFo7nnfDC166AloZCWYVWSlo5LlbVVi+ghwk9 K6xcqYMsbYnzMMXioXhhX+/R1C/VaTVm0wHO X-Received: by 2002:adf:d08f:0:b0:2c6:8e3a:f6fe with SMTP id y15-20020adfd08f000000b002c68e3af6femr12813656wrh.51.1677236526306; Fri, 24 Feb 2023 03:02:06 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r26-20020a05600c2f1a00b003eae73ee4a1sm2498311wmn.17.2023.02.24.03.02.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Feb 2023 03:02:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Eric Blake , Markus Armbruster , Akihiko Odaki , Peter Maydell Subject: [PATCH 2/2] ui/kbd-state: QAPI'fy QKbdModifier Date: Fri, 24 Feb 2023 12:01:53 +0100 Message-Id: <20230224110153.8559-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224110153.8559-1-philmd@linaro.org> References: <20230224110153.8559-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Let QAPI maintain the QKbdModifier enum values. Signed-off-by: Philippe Mathieu-Daudé --- include/ui/kbd-state.h | 16 ---------------- qapi/ui.json | 10 ++++++++++ 2 files changed, 10 insertions(+), 16 deletions(-) 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: #