iPXE
label.h
Go to the documentation of this file.
1 #ifndef _IPXE_LABEL_H
2 #define _IPXE_LABEL_H
3 
4 /** @file
5  *
6  * Text label widget
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <curses.h>
13 #include <ipxe/widget.h>
14 
15 /** A text label widget */
16 struct label {
17  /** Text widget */
18  struct widget widget;
19  /** Label text */
20  const char *text;
21 };
22 
24 
25 /**
26  * Initialise text label widget
27  *
28  * @v label Text label widget
29  * @v row Row
30  * @v col Starting column
31  * @v width Width
32  * @v text Label text
33  */
34 static inline __attribute__ (( always_inline )) void
35 init_label ( struct label *label, unsigned int row, unsigned int col,
36  unsigned int width, const char *text ) {
37 
38  init_widget ( &label->widget, &label_operations, row, col, width, 0 );
39  label->text = text;
40 }
41 
42 #endif /* _IPXE_LABEL_H */
MuCurses header file.
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
#define __attribute__(x)
Definition: compiler.h:10
A text label widget.
Definition: label.h:16
struct widget widget
Text widget.
Definition: label.h:18
static void init_label(struct label *label, unsigned int row, unsigned int col, unsigned int width, const char *text)
Initialise text label widget.
Definition: label.h:35
Text widget operations.
Definition: widget.h:38
Text widgets.
const char * text
Label text.
Definition: label.h:20
A text widget.
Definition: widget.h:15
struct widget_operations label_operations
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)