The video cursor is always enabled at present, but it is only used for
expo. Put it behind an option, to reduce code size for platforms which
do use video but don't want a cursor.
Move the existing set_cursor_visible() method behind this option, for
the normal console. For the truetype console, the fonts and extra
rendering dwarf the code-size saving, so include the cursor there
always.
Once the cursor is enabled for the CLI, this will produce code-size
savings.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some strings in this file are quite long and it is a pain to look at
them within an 80-column editor. Split them.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
The ifeq/else/endif conditional for capsule_esl_file generation was
incorrectly placed inside the recipe, causing malformed Makefile syntax
that prevented proper dependency resolution. This resulted in build
failures when CONFIG_EFI_CAPSULE_AUTHENTICATE was enabled because the
capsule_esl_file target could not be created from the certificate file.
Move the conditional to properly wrap the rule definitions, allowing
Make to correctly parse and execute the capsule ESL generation rules.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Claude <noreply@anthropic.com>
All of these helper functions check the wrong member. Fix them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 9e55d09596 ("video: Allow obtaining the nominal size of a...")
Fixes: 9899eef2cb ("video: Allow saving and restoring text-entry...")
When using a debugger it is common to single step through functions. If
one of those functions happens to be called from a cyclic function, then
a warning messages is shown. When debugging the console itself, this can
mess up the session.
Add a Kconfig to control whether the message is shown. Disable it by
default if CONFIG_CC_OPTIMIZE_FOR_DEBUG is enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
Check the behaviour of non-popup menus with a mouse.
Series-to: concept
Series-cc: heinrich
Cover-letter:
expo: Support interactions with a mouse or touchpad
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.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:34
Add a test which checks the various expected features of a cedit when
used with a mouse. This includes clicking on menu items and textlines.
For now, textedit is not supported.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a way to click on an object and check that the expected action
resulted. Put it in a common file so it can be used by cedit and expo
tests.
Tidy up the include-order in both cedit and expo.
Signed-off-by: Simon Glass <sjg@chromium.org>
When creating a new bootflow menu or cedit, enable the mouse, so the
user can interact with the expo more easily.
Signed-off-by: Simon Glass <sjg@chromium.org>
In preparation for supporting mouse clicks, split the key-handling part
of this function into a separate poll_keys() function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Implement clicking on an expo, which simply passes it onto the scene.
For now, there are no callers for this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Implement clicking on an object in the scene. For now only menus and
textlines respond to this. For menus the behaviour is different for
popups than for normal menus.
Signed-off-by: Simon Glass <sjg@chromium.org>
Clicking on a menu can result in selecting an item. If it is a popup
menu then the item should be closed. Add support for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Popup menus have particular behaviour which needs to be modelled in
the expoact_type enum:
- clicking on a menu item should select it and close the menu
- clicking on a menu should highlight it and open the menu
- clicking on a menu while another menu is open should select the item,
close the menu, then open the other menu
Add actions associated with each of these. These are modelled as
combined actions for simplicity.
Implement the actions in cedit. The general expo support will come
later.
Signed-off-by: Simon Glass <sjg@chromium.org>
For a textline it is possible to click into the edit field. Provide a
function to check whether a position is within this field.
Signed-off-by: Simon Glass <sjg@chromium.org>
To implement mouse clicks we need a way to figure out what the user has
clicked on. As a starting point, create a scene_menu_within() function
which returns the item containing an x, y coordinate.
Provide a helper function in scene.c for use with this. Add a simple
for completeness.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
In preparation for adding more tests which use a common expo, move the
creation code out of expo_render_image() and into a new function.
Signed-off-by: Simon Glass <sjg@chromium.org>
The bootflow menu creates an image at position -4, expecting that it
will be relative to the right side of the display.
With the recently added alignment feature, this is not supported. Update
the implementation to calculation the correct position instead. Update
the tests to match.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases it is useful to use expo with a mouse (or touchpad). Add
a way to tell expo to find and record a mouse device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fix up send_key_obj() to mention a missing argument. Add a bit more
detail in scene_send_key() to explain what 'processing' means.
Signed-off-by: Simon Glass <sjg@chromium.org>
The video tests run past too quickly to see what is going on. Update
them to introduce a delay after each check of the screen contents, when
LOG_DEBUG is enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present boxes are not supported in the expo_build format. Also, it is
now possible to draw filled boxes, a recently added feature to the video
API.
Expand the box feature slightly to resolve these two items.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
If there is no console (e.g. in a test) this function segfaults. Add
the console as a parameter so it is clear that it is needed. Check for
it in the caller.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present only an outline boxes is supported, albeit with a thickness
parameter. Provide a way to draw a filled rectangle.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
These fonts look quite nice and are freely available. Bring in the bold
and light variants so that they can be selected as needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Enable the mouse when running on QEMU, for ARM and x86.
This requires 'usb start' on x86. For ARM, the mouse does not work,
perhaps related to the fact that the display does not work either.
Series-to: concept
Series-cc: heinrich
Cover-letter:
mouse: Provide some support for using a mouse
This series resurects some old code that was never submitted, related to
using Nuklear with U-Boot.
It includes:
- a very simple mouse uclass
- sandbox mouse driver
- USB mouse driver, useful on x86
- EFI mouse driver, useful when running as an EFI app
- script updates to use the above with build-qemu and build-efi
It also includes a few small patches for sandbox, tests and membuf
Not everything is fully working at present:
- Mouse works on x86 QEMU (after 'usb start') but not ARM
- Mouse works on real hardware with EFI, but not with build-efi script
- Mouse times out with 'usb start', even though it does actually work
More work will be needed to tidy up these remaining issues.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:33
Series-version: 2
In some cases the device may have a touchpad or mouse, so it is useful
to be able to use this in U-Boot. Add a simple driver for a mouse that
uses the EFI simple-pointer protocol.
Series-changes: 2
- Add missed Claude credit
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
A mouse click is defined as pressing the mouse and then releasing it
over a given spot. Add a function the tracks the mouse state and
returns the most recent mouse click, if any.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a basic mouse driver for USB mice. It only handles very basic mice so
assumes that the reports are in the basic format described by the USB HID
specification 1.11.
Change-Id: I74dbe55eb065be1782737c8b2b86558e53e0292a
Signed-off-by: Simon Glass <sjg@chromium.org>
This reads mouse input and shows it on the terminal. It is useful for
testing mice.
Change-Id: Ifebe6452f38904689e3e2142fc08a623131ed0de
Signed-off-by: Simon Glass <sjg@chromium.org>
When running a simple GUI it is useful to support a mouse. This is
similar to what is provided in UEFI's boot menu. Add a simple uclass and
a way to read the mouse position.
For sandbox add a driver that reads the position from SDL. Disable input
for the tools-only build, since it is of no use there and causes build
failures.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a new option to set the window title for U-Boot sandbox. This is
helpful when different sandbox instances are used for different purposes
at the same time.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a way to set up a membuf with some pre-loaded data, so it is
possible to read it out using membuf_readline(), etc.
Signed-off-by: Simon Glass <sjg@chromium.org>