From nobody Sat Apr 11 13:56:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1775849315; cv=none; d=zohomail.com; s=zohoarc; b=K6riLrhfOkZGVySkN7FJSIr46fOPEC6O9HcitxsCQXjj+1ohaN1W19ei6Zk3ZqDfDqb0dTVMCi1Rxj7WhTbzQKL+g4dWAScgrCtR1uYurp6C2Pe9HMO1QKRYyaqYNPh7MrTZA0x8A1J0tTSVuTC76XiAFlj19KxZpBa2TDryA6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775849315; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gi6lAlNnlbIZcDiuiqDaVlawki8cAOl1cfYmhR6nZ90=; b=Z+UvLmlvD1uOOtbGUV/CTEXKHQ+Dje0QBJPvZ9lpnsh5MALu9g7vM0sTuHEE+lNUncPyXOAHoWfACCMYlnKviTuDWHDnHAgBNuObavCTMDwwJfibW0tHV7YIbNdJyqtvCQ2QOBsir4bhBsEPsL4gawNnbIIqg+kXpoDEp2PC5sM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775849315302427.1323917685586; Fri, 10 Apr 2026 12:28:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHTt-0007jr-B0; Fri, 10 Apr 2026 15:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wBHTk-0007VY-Ja for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:25:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wBHTh-000349-JY for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:25:19 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-pSlA6PRhNdi2f6zGO4edNQ-1; Fri, 10 Apr 2026 15:25:13 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 589491956094; Fri, 10 Apr 2026 19:25:12 +0000 (UTC) Received: from localhost (unknown [10.44.22.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D68E61800357; Fri, 10 Apr 2026 19:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775849116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gi6lAlNnlbIZcDiuiqDaVlawki8cAOl1cfYmhR6nZ90=; b=FFZILIJ+QTYxjK0RjiyS3nh6FlJRcZmUi2FdTjeT9k7qMFQQG8Cu0AcotfyjzWeTwMgjZj mpJi72W+/R8X4xDHd9tJ1hMfM2FikCY4736ntD6tfLtGZagvOk+EE7C7jyKLxJXOszLzwY YF4hGnIjaS+A0l+m9ypSvwRSMknkXFQ= X-MC-Unique: pSlA6PRhNdi2f6zGO4edNQ-1 X-Mimecast-MFC-AGG-ID: pSlA6PRhNdi2f6zGO4edNQ_1775849112 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 10 Apr 2026 23:19:25 +0400 Subject: [PATCH v2 63/67] ui: extract common sources into a static library MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260410-qemu-vnc-v2-63-231416f76dc3@redhat.com> References: <20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com> In-Reply-To: <20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com> To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4428; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=rWym6d5xAr+8hbLq1UtEkGuKDuN4vQzF9UwSMIl3IIU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBp2U0XcTzAeaVVckiudqsLO94pYGgLHT7ElSkMU sGsRjZMKPmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCadlNFwAKCRDa6OEJdZac 5ffHD/wKpNb4WTsLXGqXHg/Uy67+7gXKbur/rAY9XANpG+JTW184qxeMT1zLOE4vknNU/NWQJIJ P05TMxtxbs32Y19rDdl1sEhSdheaTi8s83o36HpBaziuAYwHl1XPo/+vXcI+JeWShV/p6b3sunm gy6B1m8OHfkUi/9zUIDAhzzGNj9TlkWeJJL5/on78jCVzhGrcTiqA5yeGMp/5xZa9BemIcniKJ0 QSb08lEVHfo5CDktIODASgC0dYNXJHqHHkELTPCGXWxKUvDppvBLoLXJHDDZro5B/+XZvFAthGZ eul5sDQXBUsbfQWRqjzN3aePMAcHWmbG3OEktuq8yg3jrpSWakC2sAu0mdLRDNQOmykj2XAPlLp svAk4iXDMeMzMeJJERfWdGfPwIvdZQ7gdootnVbVXv7QMppNwCeEL8xdhNVNUzOHVQGZ82J20Mb eu0hCAg9avOD1zE+JhJb1Yv9gmNTYXt8/2f+VTADn2CvHSRFOyPKHe3FYe/IV4aOYLbicIBTvmq kXshxO0DnPLUUeZg2CxPHvov1h48mrCLDH0pko6cDQSdb14UaaYg45BZQc9mFkTSHtj37mgAfcD wZe3ngBFlaB13sHshzqV+uWi4MpPuEQYtUnuHX2yjXpE6KCSAgWejRomDbeR8bax8OtDFUSjCu4 vsqNS03yA3Gt97g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1775849315555158500 Move clipboard, cursor, display-surface, input-keymap, kbd-state, keymaps, vt100, and qemu-pixman into a separate static library 'qemuui'. This allows these common UI sources to be linked by targets outside of the system emulator build, such as standalone VNC or D-Bus display binaries. keymaps generation has to be moved earlier, so that header dependency are resolved first. The library objects are re-exported via a dependency so existing system_ss consumers are unaffected. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/meson.build | 103 ++++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 55 insertions(+), 48 deletions(-) diff --git a/ui/meson.build b/ui/meson.build index f959f8972b5..c3f4d03eaf8 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -1,25 +1,67 @@ -system_ss.add(pixman) +keymaps =3D [ + ['atset1', 'qcode'], + ['linux', 'qcode'], + ['qcode', 'atset1'], + ['qcode', 'atset2'], + ['qcode', 'atset3'], + ['qcode', 'linux'], + ['qcode', 'qnum'], + ['qcode', 'sun'], + ['qnum', 'qcode'], + ['usb', 'qcode'], + ['win32', 'qcode'], + ['x11', 'qcode'], + ['xorgevdev', 'qcode'], + ['xorgkbd', 'qcode'], + ['xorgxquartz', 'qcode'], + ['xorgxwin', 'qcode'], + ['osx', 'qcode'], +] + +if have_system or xkbcommon.found() + keycodemapdb_proj =3D subproject('keycodemapdb', required: true) + foreach e : keymaps + output =3D 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1]) + genh +=3D custom_target(output, + output: output, + capture: true, + input: keycodemapdb_proj.get_variable('keymaps_csv'), + command: [python, keycodemapdb_proj.get_variable('keymap= _gen').full_path(), + 'code-map', '--lang', 'glib2', + '--varname', 'qemu_input_map_@0@_to_@1@'.forma= t(e[0], e[1]), + '@INPUT0@', e[0], e[1]]) + endforeach +endif + +libui_sources =3D files( + 'clipboard.c', + 'console.c', + 'cursor.c', + 'dmabuf.c', + 'display-surface.c', + 'input-keymap.c', + 'kbd-state.c', + 'keymaps.c', + 'qemu-pixman.c', + 'vgafont.c', + ) +if pixman.found() + libui_sources +=3D files('cp437.c', 'vt100.c') +endif +libui =3D static_library('qemuui', libui_sources + genh, + dependencies: [pixman], + build_by_default: false) +ui =3D declare_dependency(objects: libui.extract_all_objects(recursive: fa= lse), dependencies: [pixman]) system_ss.add(png) system_ss.add(files( - 'clipboard.c', - 'console.c', - 'cp437.c', - 'cursor.c', - 'display-surface.c', - 'dmabuf.c', - 'input-keymap.c', 'input-legacy.c', 'input-barrier.c', 'input.c', - 'kbd-state.c', - 'keymaps.c', - 'qemu-pixman.c', 'ui-hmp-cmds.c', 'ui-qmp-cmds.c', 'util.c', - 'vgafont.c', - 'vt100.c', )) +system_ss.add(ui) system_ss.add(when: pixman, if_true: files('console-vc.c'), if_false: file= s('console-vc-stubs.c')) if dbus_display system_ss.add(files('dbus-module.c')) @@ -151,41 +193,6 @@ if spice.found() endif endif =20 -keymaps =3D [ - ['atset1', 'qcode'], - ['linux', 'qcode'], - ['qcode', 'atset1'], - ['qcode', 'atset2'], - ['qcode', 'atset3'], - ['qcode', 'linux'], - ['qcode', 'qnum'], - ['qcode', 'sun'], - ['qnum', 'qcode'], - ['usb', 'qcode'], - ['win32', 'qcode'], - ['x11', 'qcode'], - ['xorgevdev', 'qcode'], - ['xorgkbd', 'qcode'], - ['xorgxquartz', 'qcode'], - ['xorgxwin', 'qcode'], - ['osx', 'qcode'], -] - -if have_system or xkbcommon.found() - keycodemapdb_proj =3D subproject('keycodemapdb', required: true) - foreach e : keymaps - output =3D 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1]) - genh +=3D custom_target(output, - output: output, - capture: true, - input: keycodemapdb_proj.get_variable('keymaps_csv'), - command: [python, keycodemapdb_proj.get_variable('keymap= _gen').full_path(), - 'code-map', '--lang', 'glib2', - '--varname', 'qemu_input_map_@0@_to_@1@'.forma= t(e[0], e[1]), - '@INPUT0@', e[0], e[1]]) - endforeach -endif - subdir('shader') =20 if have_system --=20 2.53.0