C-Menu
0.2.9
A User Interface Toolkit
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_theme.h
Go to the documentation of this file.
1
#
ifndef
UI_THEME_H
2
#
define
UI_THEME_H
1
3
4
/** @file ui_theme.h
5
@ingroup ui_backend
6
@brief UI theme definitions.
7
*/
8
#
include
"ui_backend.h"
9
10
/** @brief UI role definitions.
11
@ingroup ui_backend
12
These are used to identify the purpose of a UI element, and can be used to
13
apply different styles to different elements. The default theme will use these
14
roles to apply different colors and styles to different elements.
15
*/
16
typedef
enum
{
17
UI_ROLE_DEFAULT
= 0,
18
UI_ROLE_NORMAL
,
19
UI_ROLE_NORMAL_REVERSE
,
20
UI_ROLE_NORMAL_HIGHLIGHT
,
21
UI_ROLE_NORMAL_HIGHLIGHT_REVERSE
,
22
UI_ROLE_BOX
,
23
UI_ROLE_TITLE
,
24
UI_ROLE_LINENO
,
25
UI_ROLE_CMDLINE
,
26
UI_ROLE_BOLD
,
27
UI_ROLE_FILL
,
28
UI_ROLE_BRACKET
29
} UiRole;
30
31
/** @brief UI theme definition.
32
33
A UI theme is a collection of styles for different UI roles. The default theme
34
will use the default styles for each role, but custom themes can be created
35
by defining different styles for each role.
36
*/
37
typedef
struct
{
38
UiStyle
roles
[16];
39
} UiTheme;
40
41
/** @brief Get the style for a given UI role.
42
@ingroup ui_backend
43
@param theme The UI theme to get the style from.
44
@param role The UI role to get the style for.
45
@return The style for the given UI role.
46
*/
47
const
UiStyle *
ui_theme_style
(
const
UiTheme *theme, UiRole role);
48
49
#
endif
ui_theme_style
const UiStyle * ui_theme_style(const UiTheme *theme, UiRole role)
Get the style for a given UI role.
UI_ROLE_BOX
@ UI_ROLE_BOX
Definition
ui_theme.h:22
UI_ROLE_BRACKET
@ UI_ROLE_BRACKET
Definition
ui_theme.h:28
UI_ROLE_NORMAL_HIGHLIGHT
@ UI_ROLE_NORMAL_HIGHLIGHT
Definition
ui_theme.h:20
UI_ROLE_NORMAL_REVERSE
@ UI_ROLE_NORMAL_REVERSE
Definition
ui_theme.h:19
UI_ROLE_BOLD
@ UI_ROLE_BOLD
Definition
ui_theme.h:26
UI_ROLE_DEFAULT
@ UI_ROLE_DEFAULT
Definition
ui_theme.h:17
UI_ROLE_NORMAL
@ UI_ROLE_NORMAL
Definition
ui_theme.h:18
UI_ROLE_CMDLINE
@ UI_ROLE_CMDLINE
Definition
ui_theme.h:25
UI_ROLE_FILL
@ UI_ROLE_FILL
Definition
ui_theme.h:27
UI_ROLE_LINENO
@ UI_ROLE_LINENO
Definition
ui_theme.h:24
UI_ROLE_NORMAL_HIGHLIGHT_REVERSE
@ UI_ROLE_NORMAL_HIGHLIGHT_REVERSE
Definition
ui_theme.h:21
UI_ROLE_TITLE
@ UI_ROLE_TITLE
Definition
ui_theme.h:23
UiTheme::roles
UiStyle roles[16]
Definition
ui_theme.h:38
ui
ui_theme.h
Generated by
1.17.0