iPXE
Data Structures | Functions | Variables
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)
 
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. More...
 

Variables

struct edit_box __attribute__
 
struct widget_operations editbox_operations
 Text box widget operations. More...
 

Detailed Description

Editable text box widget.

Definition in file editbox.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ init_editbox()

static 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 39 of file editbox.h.

40  {
41 
42  init_widget ( &box->widget, &editbox_operations, row, col,
43  width, ( flags | WIDGET_EDITABLE ) );
44  init_editstring ( &box->string, buf );
45  if ( *buf )
46  box->string.cursor = strlen ( *buf );
47 }
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:69
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:100
Widget may have input focus.
Definition: widget.h:32
static __nonnull void init_editstring(struct edit_string *string, char **buf)
Initialise editable string.
Definition: editstring.h:46
uint8_t flags
Flags.
Definition: ena.h:18
size_t strlen(const char *src)
Get length of string.
Definition: string.c:243

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

Referenced by layout_form(), and select_setting_row().

Variable Documentation

◆ __attribute__

◆ editbox_operations

struct widget_operations editbox_operations

Text box widget operations.

Definition at line 100 of file editbox.c.

Referenced by init_editbox().