iPXE
widget.h File Reference

Text widgets. More...

#include <curses.h>

Go to the source code of this file.

Data Structures

struct  widget
 A text widget. More...
struct  widget_operations
 Text widget operations. More...

Enumerations

enum  widget_flags { WIDGET_EDITABLE = 0x0001 , WIDGET_SECRET = 0x0002 }
 Text widget flags. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void init_widget (struct widget *widget, struct widget_operations *op, unsigned int row, unsigned int col, unsigned int width, unsigned int flags)
 Initialise text widget.
static void draw_widget (struct widget *widget)
 Draw text widget.
static int edit_widget (struct widget *widget, int key)
 Edit text widget.

Detailed Description

Text widgets.

Definition in file widget.h.

Enumeration Type Documentation

◆ widget_flags

Text widget flags.

Enumerator
WIDGET_EDITABLE 

Widget may have input focus.

WIDGET_SECRET 

Widget contains a secret.

Definition at line 31 of file widget.h.

31 {
32 /** Widget may have input focus */
33 WIDGET_EDITABLE = 0x0001,
34 /** Widget contains a secret */
35 WIDGET_SECRET = 0x0002,
36};
@ WIDGET_SECRET
Widget contains a secret.
Definition widget.h:35
@ WIDGET_EDITABLE
Widget may have input focus.
Definition widget.h:33

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ init_widget()

void init_widget ( struct widget * widget,
struct widget_operations * op,
unsigned int row,
unsigned int col,
unsigned int width,
unsigned int flags )
inlinestatic

Initialise text widget.

Parameters
widgetText widget
opText widget operations
rowRow
colStarting column
widthWidth

Definition at line 70 of file widget.h.

72 {
73
74 widget->op = op;
75 widget->row = row;
76 widget->col = col;
77 widget->width = width;
79}
uint8_t flags
Flags.
Definition ena.h:7
static uint16_t struct vmbus_xfer_pages_operations * op
Definition netvsc.h:327
A text widget.
Definition widget.h:16
struct widget_operations * op
Widget operations.
Definition widget.h:18
unsigned int col
Starting column.
Definition widget.h:23
unsigned int width
Width.
Definition widget.h:25
unsigned int flags
Flags.
Definition widget.h:27
unsigned int row
Row.
Definition widget.h:21

References widget::col, flags, widget::flags, op, widget::op, widget::row, and widget::width.

Referenced by init_editbox(), and init_label().

◆ draw_widget()

void draw_widget ( struct widget * widget)
inlinestatic

Draw text widget.

Parameters
widgetText widget

Definition at line 87 of file widget.h.

87 {
88
89 widget->op->draw ( widget );
90}
void(* draw)(struct widget *widget)
Draw widget.
Definition widget.h:45

References widget_operations::draw, and widget::op.

Referenced by draw_form(), form_loop(), and main_loop().

◆ edit_widget()

int edit_widget ( struct widget * widget,
int key )
inlinestatic

Edit text widget.

Parameters
widgetText widget
keyKey pressed by user
Return values
keyKey returned to application, or zero

This will not update the display: you must call draw_widget() to ensure that any changes to an editable widget are displayed to the user.

Definition at line 104 of file widget.h.

104 {
105
106 return widget->op->edit ( widget, key );
107}
union @162305117151260234136356364136041353210355154177 key
Sense key.
Definition scsi.h:3
int(* edit)(struct widget *widget, int key)
Edit widget.
Definition widget.h:57

References widget_operations::edit, key, and widget::op.

Referenced by edit_setting(), and form_loop().