Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | /* SPDX-License-Identifier: GPL-2.0+ */ /* * Bootctl display * * Copyright 2025 Canonical Ltd * Written by Simon Glass <simon.glass@canonical.com> */ #ifndef __bootctl_display_h #define __bootctl_display_h #include <stdbool.h> #include <abuf.h> struct expo; struct logic_priv; struct osinfo; struct oslist_iter; struct scene; struct udevice; /** * struct bc_ui_priv - Common uclass private data for UI devices * * @expo: Expo containing the menu * @scn: Current scene being shown * @lpriv: Private data of logic device * @console: vidconsole device in use * @autoboot_template: template string to use for autoboot * @autoboot_str: current string displayed for autoboot timeout * @logo: logo in bitmap format, NULL to use default * @logo_size: size of the logo in bytes */ struct bc_ui_priv { struct expo *expo; struct scene *scn; struct logic_priv *lpriv; struct udevice *console; struct abuf autoboot_template; struct abuf *autoboot_str; const void *logo; int logo_size; }; /** * struct bc_ui_ops - Operations for displays */ struct bc_ui_ops { /** * print() - Show a string on the display * * @dev: Display device * @msg: Message to show * Return 0 if OK, -ve on error */ int (*print)(struct udevice *dev, const char *msg); /** * show() - Show the display, ready to accept boot options * * @dev: Display device * Return 0 if OK, -ve on error */ int (*show)(struct udevice *dev); /** * add() - Add an OS to the display, so the user can select it * * @dev: Display device * @info: Information about the OS to display * Return 0 if OK, -ve on error */ int (*add)(struct udevice *dev, struct osinfo *info); /** * render() - Render any updates to the display * * @dev: Display device * Return 0 if OK, -ve on error */ int (*render)(struct udevice *dev); /** * poll() - Check for user activity * * @dev: Display device * @seqp: Returns the sequence number of the osinfo that is currently * pointed to/highlighted, or -1 if nothing * @selectedp: Returns true if the user selected an item, else false * Return: 0 if OK, -EPIPE if the user tried to quit the menu, other * -ve on error */ int (*poll)(struct udevice *dev, int *seqp, bool *selectedp); /** * switch_layout() - Switch between different UI layout modes * * @dev: Display device * Return 0 if OK, -ve on error */ int (*switch_layout)(struct udevice *dev); }; #define bc_ui_get_ops(dev) ((struct bc_ui_ops *)(dev)->driver->ops) /** * bc_ui_show() - Show the display, ready to accept boot options * * @dev: Display device * Return 0 if OK, -ve on error */ int bc_ui_show(struct udevice *dev); /** * bc_ui_add() - Add an OS to the display, so the user can select it * * @dev: Display device * @info: Information about the OS to display * Return 0 if OK, -ve on error */ int bc_ui_add(struct udevice *dev, struct osinfo *info); /** * bc_ui_render() - Render any updates to the display * * @dev: Display device * Return 0 if OK, -ve on error */ int bc_ui_render(struct udevice *dev); /** * bc_ui_poll() - Check for user activity * * @dev: Display device * @seqp: Returns the sequence number of the osinfo that is currently * pointed to/highlighted, or -1 if nothing * @selectedp: Returns true if the user selected an item, else false * Return: 0 if OK, -EPIPE if the user tried to quit the menu, other * -ve on error */ int bc_ui_poll(struct udevice *dev, int *seqp, bool *selectedp); /** * bc_ui_switch_layout() - Switch between different UI layout modes * * @dev: Display device * Return 0 if OK, -ve on error */ int bc_ui_switch_layout(struct udevice *dev); #endif |