wlmaker
Toggle main menu visibility
Loading...
Searching...
No Matches
include
toolkit
style.h
Go to the documentation of this file.
1
/* ========================================================================= */
21
#ifndef __WLMTK_STYLE_H__
22
#define __WLMTK_STYLE_H__
23
24
#include <cairo.h>
25
#include <inttypes.h>
26
#include <libbase/libbase.h>
27
#include <libbase/plist.h>
28
#include <stdbool.h>
29
30
#ifdef __cplusplus
31
extern
"C"
{
32
#endif
// __cplusplus
33
35
typedef
enum
{
37
WLMTK_STYLE_COLOR_SOLID
,
39
WLMTK_STYLE_COLOR_HGRADIENT
,
41
WLMTK_STYLE_COLOR_VGRADIENT
,
49
WLMTK_STYLE_COLOR_DGRADIENT
,
59
WLMTK_STYLE_COLOR_ADGRADIENT
,
60
}
wlmtk_style_fill_type_t
;
61
63
typedef
struct
{
65
uint32_t
color
;
66
}
wlmtk_style_color_solid_data_t
;
67
69
typedef
struct
{
71
uint32_t
from
;
73
uint32_t
to
;
74
}
wlmtk_style_color_gradient_data_t
;
75
77
typedef
struct
{
79
wlmtk_style_fill_type_t
type
;
81
union
{
83
wlmtk_style_color_solid_data_t
solid
;
85
wlmtk_style_color_gradient_data_t
hgradient
;
87
wlmtk_style_color_gradient_data_t
vgradient
;
89
wlmtk_style_color_gradient_data_t
dgradient
;
91
wlmtk_style_color_gradient_data_t
adgradient
;
92
} param;
93
}
wlmtk_style_fill_t
;
94
96
#define WLMTK_STYLE_FONT_FACE_LENGTH 128
97
99
typedef
enum
{
100
WLMTK_FONT_WEIGHT_NORMAL,
101
WLMTK_FONT_WEIGHT_BOLD,
102
}
wlmtk_style_font_weight_t
;
103
105
typedef
struct
{
107
char
face
[
WLMTK_STYLE_FONT_FACE_LENGTH
];
109
wlmtk_style_font_weight_t
weight
;
111
uint64_t
size
;
112
}
wlmtk_style_font_t
;
113
114
116
struct
wlmtk_margin_style
{
118
uint64_t
width
;
120
uint32_t
color
;
121
};
122
124
struct
wlmtk_titlebar_style
{
126
wlmtk_style_fill_t
focussed_fill
;
128
wlmtk_style_fill_t
blurred_fill
;
130
uint32_t
focussed_text_color
;
132
uint32_t
blurred_text_color
;
134
uint64_t
height
;
136
uint64_t
bezel_width
;
138
struct
wlmtk_margin_style
margin
;
140
wlmtk_style_font_t
font
;
141
};
142
144
cairo_font_weight_t
wlmtk_style_font_weight_cairo_from_wlmtk
(
145
wlmtk_style_font_weight_t
weight);
146
156
bool
wlmtk_style_decode_fill
(
157
bspl_object_t *object_ptr,
158
const
union
bspl_desc_value *desc_value_ptr,
159
void
*value_ptr);
160
162
extern
const
bspl_desc_t
wlmtk_style_margin_desc
[];
163
165
extern
const
bspl_desc_t
wlmtk_style_font_desc
[];
166
168
extern
const
bs_test_set_t
wlmtk_style_test_set
;
169
170
#ifdef __cplusplus
171
}
// extern "C"
172
#endif
// __cplusplus
173
174
#endif
/* __WLMTK_STYLE_H__ */
175
/* == End of style.h ================================================== */
wlmtk_margin_style
Definition
style.h:116
wlmtk_margin_style::width
uint64_t width
Definition
style.h:118
wlmtk_margin_style::color
uint32_t color
Definition
style.h:120
wlmtk_style_color_gradient_data_t
Definition
style.h:69
wlmtk_style_color_gradient_data_t::from
uint32_t from
Definition
style.h:71
wlmtk_style_color_gradient_data_t::to
uint32_t to
Definition
style.h:73
wlmtk_style_color_solid_data_t
Definition
style.h:63
wlmtk_style_color_solid_data_t::color
uint32_t color
Definition
style.h:65
wlmtk_style_fill_t
Definition
style.h:77
wlmtk_style_fill_t::hgradient
wlmtk_style_color_gradient_data_t hgradient
Definition
style.h:85
wlmtk_style_fill_t::solid
wlmtk_style_color_solid_data_t solid
Definition
style.h:83
wlmtk_style_fill_t::vgradient
wlmtk_style_color_gradient_data_t vgradient
Definition
style.h:87
wlmtk_style_fill_t::type
wlmtk_style_fill_type_t type
Definition
style.h:79
wlmtk_style_fill_t::dgradient
wlmtk_style_color_gradient_data_t dgradient
Definition
style.h:89
wlmtk_style_fill_t::adgradient
wlmtk_style_color_gradient_data_t adgradient
Definition
style.h:91
wlmtk_style_font_t
Definition
style.h:105
wlmtk_style_font_t::face
char face[WLMTK_STYLE_FONT_FACE_LENGTH]
Definition
style.h:107
wlmtk_style_font_t::size
uint64_t size
Definition
style.h:111
wlmtk_style_font_t::weight
wlmtk_style_font_weight_t weight
Definition
style.h:109
wlmtk_titlebar_style
Definition
style.h:124
wlmtk_titlebar_style::focussed_text_color
uint32_t focussed_text_color
Definition
style.h:130
wlmtk_titlebar_style::height
uint64_t height
Definition
style.h:134
wlmtk_titlebar_style::bezel_width
uint64_t bezel_width
Definition
style.h:136
wlmtk_titlebar_style::blurred_fill
wlmtk_style_fill_t blurred_fill
Definition
style.h:128
wlmtk_titlebar_style::margin
struct wlmtk_margin_style margin
Definition
style.h:138
wlmtk_titlebar_style::focussed_fill
wlmtk_style_fill_t focussed_fill
Definition
style.h:126
wlmtk_titlebar_style::blurred_text_color
uint32_t blurred_text_color
Definition
style.h:132
wlmtk_titlebar_style::font
wlmtk_style_font_t font
Definition
style.h:140
wlmtk_style_font_desc
const bspl_desc_t wlmtk_style_font_desc[]
Definition
style.c:44
wlmtk_style_margin_desc
const bspl_desc_t wlmtk_style_margin_desc[]
Definition
style.c:29
wlmtk_style_font_weight_cairo_from_wlmtk
cairo_font_weight_t wlmtk_style_font_weight_cairo_from_wlmtk(wlmtk_style_font_weight_t weight)
Definition
style.c:93
wlmtk_style_decode_fill
bool wlmtk_style_decode_fill(bspl_object_t *object_ptr, const union bspl_desc_value *desc_value_ptr, void *value_ptr)
Definition
style.c:107
wlmtk_style_font_weight_t
wlmtk_style_font_weight_t
Definition
style.h:99
wlmtk_style_fill_type_t
wlmtk_style_fill_type_t
Definition
style.h:35
WLMTK_STYLE_COLOR_VGRADIENT
@ WLMTK_STYLE_COLOR_VGRADIENT
Definition
style.h:41
WLMTK_STYLE_COLOR_SOLID
@ WLMTK_STYLE_COLOR_SOLID
Definition
style.h:37
WLMTK_STYLE_COLOR_ADGRADIENT
@ WLMTK_STYLE_COLOR_ADGRADIENT
Definition
style.h:59
WLMTK_STYLE_COLOR_HGRADIENT
@ WLMTK_STYLE_COLOR_HGRADIENT
Definition
style.h:39
WLMTK_STYLE_COLOR_DGRADIENT
@ WLMTK_STYLE_COLOR_DGRADIENT
Definition
style.h:49
WLMTK_STYLE_FONT_FACE_LENGTH
#define WLMTK_STYLE_FONT_FACE_LENGTH
Definition
style.h:96
wlmtk_style_test_set
const bs_test_set_t wlmtk_style_test_set
Definition
style.c:168
Generated by
1.17.0