iPXE
editbox.h File Reference

Editable text box widget. More...

#include <curses.h>
#include <ipxe/editstring.h>
#include <ipxe/widget.h>

Go to the source code of this file.

Data Structures

struct  edit_box
 An editable text box widget. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void init_editbox (struct edit_box *box, unsigned int row, unsigned int col, unsigned int width, unsigned int flags, char **buf)
 Initialise text box widget.

Variables

struct widget_operations editbox_operations
 Text box widget operations.

Detailed Description

Editable text box widget.

Definition in file editbox.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ init_editbox()

void init_editbox ( struct edit_box * box,
unsigned int row,
unsigned int col,
unsigned int width,
unsigned int flags,
char ** buf )
inlinestatic

Initialise text box widget.

Parameters
boxEditable text box widget
rowRow
colStarting column
widthWidth
flagsFlags
bufDynamically allocated string buffer

Definition at line 40 of file editbox.h.

41 {
42
43 init_widget ( &box->widget, &editbox_operations, row, col,
44 width, ( flags | WIDGET_EDITABLE ) );
45 init_editstring ( &box->string, buf );
46 if ( *buf )
47 box->string.cursor = strlen ( *buf );
48}
int box(WINDOW *win, chtype verch, chtype horch)
Draw borders from single-byte characters and renditions around a window.
Definition edging.c:22
struct widget_operations editbox_operations
Text box widget operations.
Definition editbox.c:101
static __nonnull void init_editstring(struct edit_string *string, char **buf)
Initialise editable string.
Definition editstring.h:47
uint8_t flags
Flags.
Definition ena.h:7
size_t strlen(const char *src)
Get length of string.
Definition string.c:244
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.
Definition widget.h:70
@ WIDGET_EDITABLE
Widget may have input focus.
Definition widget.h:33

References box(), editbox_operations, flags, init_editstring(), init_widget(), strlen(), and WIDGET_EDITABLE.

Referenced by layout_form(), and select_setting_row().

Variable Documentation

◆ editbox_operations

struct widget_operations editbox_operations
extern

Text box widget operations.

Definition at line 101 of file editbox.c.

101 {
102 .draw = draw_editbox,
103 .edit = edit_editbox,
104};
static void draw_editbox(struct widget *widget)
Draw text box widget.
Definition editbox.c:45
static int edit_editbox(struct widget *widget, int key)
Edit text box widget.
Definition editbox.c:94

Referenced by init_editbox().