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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12#include <curses.h>
13#include <ipxe/widget.h>
14
15/** A text label widget */
16struct 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 */
34static inline __attribute__ (( always_inline )) void
35init_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.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define __attribute__(x)
Definition compiler.h:10
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
struct widget_operations label_operations
A text label widget.
Definition label.h:16
struct widget widget
Text widget.
Definition label.h:18
const char * text
Label text.
Definition label.h:20
Text widget operations.
Definition widget.h:39
Text widgets.
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