aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-06-14 11:47:55 +0100
committerMichael Brown <mcb30@ipxe.org>2024-06-18 14:46:31 -0700
commitbb4a10696fb6541fdcfc2c057cf698de37fa5eba (patch)
treee568749785a510b8cbebfcbe714183dcfea1e2f3 /src/include
parente965f179e1654103eca33feed7a9cc4c51d91be6 (diff)
downloadipxe-bb4a10696fb6541fdcfc2c057cf698de37fa5eba.zip
ipxe-bb4a10696fb6541fdcfc2c057cf698de37fa5eba.tar.gz
ipxe-bb4a10696fb6541fdcfc2c057cf698de37fa5eba.tar.bz2
[hci] Draw all widgets on the standard screen
The curses concept of a window has been supported but never actively used in iPXE since the mucurses library was first implemented in 2006. Simplify the code by removing the ability to place a widget set in a specified window, and instead use the standard screen for all drawing operations. This simplification allows the widget set parameter to be omitted for the draw_widget() and edit_widget() operations, since the only reason for its inclusion was to provide access to the specified window. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/widget.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/include/ipxe/widget.h b/src/include/ipxe/widget.h
index fe93b9f..0d8af10 100644
--- a/src/include/ipxe/widget.h
+++ b/src/include/ipxe/widget.h
@@ -16,8 +16,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
struct widgets {
/** List of widgets (in tab order) */
struct list_head list;
- /** Containing window */
- WINDOW *win;
};
/** A text widget */
@@ -50,14 +48,12 @@ struct widget_operations {
/**
* Draw widget
*
- * @v widgets Text widget set
* @v widget Text widget
*/
- void ( * draw ) ( struct widgets *widgets, struct widget *widget );
+ void ( * draw ) ( struct widget *widget );
/**
* Edit widget
*
- * @v widgets Text widget set
* @v widget Text widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
@@ -66,21 +62,18 @@ struct widget_operations {
* method to ensure that any changes to an editable widget are
* displayed to the user.
*/
- int ( * edit ) ( struct widgets *widgets, struct widget *widget,
- int key );
+ int ( * edit ) ( struct widget *widget, int key );
};
/**
* Initialise text widget set
*
* @v widgets Text widget set
- * @v win Containing window
*/
static inline __attribute__ (( always_inline )) void
-init_widgets ( struct widgets *widgets, WINDOW *win ) {
+init_widgets ( struct widgets *widgets ) {
INIT_LIST_HEAD ( &widgets->list );
- widgets->win = ( win ? win : stdscr );
}
/**
@@ -119,19 +112,17 @@ add_widget ( struct widgets *widgets, struct widget *widget ) {
/**
* Draw text widget
*
- * @v widgets Text widget set
* @v widget Text widget
*/
static inline __attribute__ (( always_inline )) void
-draw_widget ( struct widgets *widgets, struct widget *widget ) {
+draw_widget ( struct widget *widget ) {
- widget->op->draw ( widgets, widget );
+ widget->op->draw ( widget );
}
/**
* Edit text widget
*
- * @v widgets Text widget set
* @v widget Text widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
@@ -141,9 +132,9 @@ draw_widget ( struct widgets *widgets, struct widget *widget ) {
* user.
*/
static inline __attribute__ (( always_inline )) int
-edit_widget ( struct widgets *widgets, struct widget *widget, int key ) {
+edit_widget ( struct widget *widget, int key ) {
- return widget->op->edit ( widgets, widget, key );
+ return widget->op->edit ( widget, key );
}
extern int widget_ui ( struct widgets *widgets );