From patchwork Mon Sep 15 12:28:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 27 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939358; bh=pbaLQHNCEhXieOtfzpKBiFE2RqJ9eEkpw6N7x40xYeQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=YqMj1wl7UMkvIGMTh213BOsAjaSdscg42aIGcPKAXtUlWxQc48YTFA3DLSHE1RUhI HT2tqj39YzDYNFvF1a6hi4uD2BrMKD+DAoC2FLuYE/e0J3D9/DlyZex7el4Zl9mHMD F2qVyGMLzf0oy+qwwoIiI2rJwhhEMECyCQuuvGcOvTk6IcwKT0Sz7ich4Tek2JtWkB KTEKWXg1NvQEU/No+r8GtdvYkBePOtQBOE6oCyQAzpda2ijf7dpu3gNpZjQsk089nC DuMHt4adLpHWMQv9Mvv9stHemGQkaffXsHFnQMB00VHkaTtMA2ywgtQlAjJAzVAFLb EmrBdNdupt0dw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BAB6367BAC for ; Mon, 15 Sep 2025 06:29:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IdkjwKNwtcL2 for ; Mon, 15 Sep 2025 06:29:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939358; bh=pbaLQHNCEhXieOtfzpKBiFE2RqJ9eEkpw6N7x40xYeQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=YqMj1wl7UMkvIGMTh213BOsAjaSdscg42aIGcPKAXtUlWxQc48YTFA3DLSHE1RUhI HT2tqj39YzDYNFvF1a6hi4uD2BrMKD+DAoC2FLuYE/e0J3D9/DlyZex7el4Zl9mHMD F2qVyGMLzf0oy+qwwoIiI2rJwhhEMECyCQuuvGcOvTk6IcwKT0Sz7ich4Tek2JtWkB KTEKWXg1NvQEU/No+r8GtdvYkBePOtQBOE6oCyQAzpda2ijf7dpu3gNpZjQsk089nC DuMHt4adLpHWMQv9Mvv9stHemGQkaffXsHFnQMB00VHkaTtMA2ywgtQlAjJAzVAFLb EmrBdNdupt0dw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 85F8E67BC8 for ; Mon, 15 Sep 2025 06:29:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939356; bh=dwhy6EAKTroCRVsKIEMPcvp5W0/k9qVheaeSFGZKkAk=; h=From:To:Cc:Subject:Date:From; b=A8iLUzSBH8e08ffmZhjF4qRkAsZoJLf3o09N9Ee3MPTVLP2UXeFD6kqshxBNbAJum u7q1oACQjGOOo2SrFVyz4MLgMpR+i8ptH6ZQ3kCHCSxliBB1GxvIrAawYdwVSAFi3x +jd2ZWAHG8sqJOEhVvYmfeDduHxje5typn1yCrp8NINmXu+SqijgR2IOkm25CK5Yzm u6uZFosWGLXhjY2oZD+NhS6P5wAyNTAOiqWfSaoto0QwJp4fsI5h8+EK87KNpUKUzZ 7wt3XzxGPGIgR+NlfSmKG1WgsZxzvl/Qb00apowbu7UREXmXbuSVeMSF110gGfNpdo cjzUqEm+j5kPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 209F867BAC; Mon, 15 Sep 2025 06:29:16 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 8aOb5iq2xFxA; Mon, 15 Sep 2025 06:29:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939355; bh=0mNlqcSBj1Eq6Gj5jiKtF27kTvTPkbk1XsJp+mgsRhk=; h=From:To:Cc:Subject:Date:From; b=ZZzBgQuLqqRCv4lejFTtfYJ0gp7AnupJK5n2gLT2PsTqV6cd56qR9YycpaoZjtUel BGPwCaZL5MGKa34jvD7OOX9qdQKAJg0LltDgrPr2iHCuQqvMPUd9PwXTg5PoO5Nh0z nNvWNwqGKVrJyFKbrcQw3BsAnIunuIj/wsUKRa65dwcPAMBO828UtpEYWXDzaK3iu3 /EJGYLFvZl0Xi2UetusL0wIFvujmT8q545Nzq31NAuU/CkexC8ppluszFcH5Y1nO25 OBPbZ52/ctAm3WIPjMyZ1VVftaeCfE51OQ6LU5icn2QQc439U4BoFg8V+CBIWI0Ux4 Ult3ywnu+5nAA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 678B667B34; Mon, 15 Sep 2025 06:29:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 06:28:33 -0600 Message-ID: <20250915122905.1217249-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: 7QGFGKUYBU5SMB7B2TVIC7GTK66Q5Z47 X-Message-ID-Hash: 7QGFGKUYBU5SMB7B2TVIC7GTK66Q5Z47 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/23] expo: Support interactions with a mouse or touchpad List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass So far expo only supports user interaction with a keyboard. This is the common case, but for PC devices it is typical to have a mouse or touchpad available as well. Particularly for the configuration editor, these devices are often more convenient for selecting options than moving up and down with with the keyboard. This series adds mouse support to expo, providing a function to process a click similar to processing of a keypress. The core of this is a new expo_send_click() function. Within scenes, the logic to search for objects by and x and y position is provided. As with keypresses, expo provides clear separation between the processing of a click (which may or may not produce an action) and the handling of that action. This allows expo to be used within an existing event loop. Expo uses a mouse by default if available. This series also includes a few other minor improvements, including some code tidy-ups and support for filled boxes. Simon Glass (23): video: Provide a few Ubuntu fonts video: Support drawing filled boxes expo: Guard against a crash in scene_textline_calc_dims() expo: Support boxes fully test: video: Provide an easy way to watch video tests expo: Tidy up a few key-related comments expo: Add comments for enum bootmenu_id_t expo: Provide a way to enable the mouse expo: Tidy up image position with the menu expo: test: Move expo creation into a separate function expo: Provide a way to check if a position is within a menu expo: Allow checking if a position is within a textline expo: Tidy up comments for enum expoact_type expo: Add three new actions for mouse events expo: Support sending a click to a menu expo: Support sending a click to a scene expo: Support sending a click to an expo expo: Refactor expo_poll() to separate out key handling expo: Check the mouse when polling expo: Enable the mouse when available expo: Add a test helper for clicking on objects expo: Provide a test of cedit mouse behaviour expo: Provide a test of expo mouse behaviour arch/sandbox/dts/cedit.dtsi | 13 ++ boot/bootflow_internal.h | 14 +- boot/bootflow_menu.c | 4 +- boot/cedit.c | 23 +++ boot/expo.c | 85 ++++++++- boot/expo_build.c | 30 ++++ boot/scene.c | 248 ++++++++++++++++++++++++++- boot/scene_internal.h | 80 ++++++++- boot/scene_menu.c | 77 ++++++++- boot/scene_textline.c | 13 +- doc/develop/expo.rst | 16 ++ drivers/video/console_truetype.c | 8 + drivers/video/fonts/Kconfig | 32 +++- drivers/video/fonts/Makefile | 2 + drivers/video/fonts/ubuntu_bold.ttf | Bin 0 -> 270164 bytes drivers/video/fonts/ubuntu_light.ttf | Bin 0 -> 362552 bytes drivers/video/video-uclass.c | 27 +-- include/expo.h | 60 ++++++- include/test/cedit-test.h | 5 +- include/video.h | 3 +- test/boot/Makefile | 4 +- test/boot/cedit.c | 108 +++++++++++- test/boot/expo.c | 240 ++++++++++++++++++++++++-- test/boot/expo_common.c | 24 +++ test/boot/expo_common.h | 33 ++++ test/dm/video.c | 22 ++- 26 files changed, 1109 insertions(+), 62 deletions(-) create mode 100644 drivers/video/fonts/ubuntu_bold.ttf create mode 100644 drivers/video/fonts/ubuntu_light.ttf create mode 100644 test/boot/expo_common.c create mode 100644 test/boot/expo_common.h