summaryrefslogtreecommitdiff
path: root/desktop/plot_style.c
blob: 05954144af3795deb9f495fae01c0008c4bde3af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
 * Copyright 2009 Vincent Sanders <vince@kyllikki.org>
 *
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 *
 * NetSurf is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * NetSurf is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * \file
 * \brief Plotter global styles.
 *
 * These plot styles are globaly available and used in many places.
 */

#include "netsurf/plot_style.h"

static plot_style_t plot_style_fill_white_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = 0xffffff,
};
plot_style_t *plot_style_fill_white = &plot_style_fill_white_static;

static plot_style_t plot_style_fill_black_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = 0x0,
};
plot_style_t *plot_style_fill_black = &plot_style_fill_black_static;

static plot_style_t plot_style_fill_red_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = 0x000000ff,
};
plot_style_t *plot_style_fill_red = &plot_style_fill_red_static;

/* Box model debug outline styles for content, padding and margin edges */
static const plot_style_t plot_style_content_edge_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = 0x00ff0000,
	.stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_content_edge =
		&plot_style_content_edge_static;

static const plot_style_t plot_style_padding_edge_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = 0x000000ff,
	.stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_padding_edge =
		&plot_style_padding_edge_static;

static const plot_style_t plot_style_margin_edge_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = 0x0000ffff,
	.stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_margin_edge =
		&plot_style_margin_edge_static;

/* Broken object replacement styles */
static const plot_style_t plot_style_broken_object_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = 0x008888ff,
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = 0x000000ff,
	.stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_broken_object =
		&plot_style_broken_object_static;

static const plot_font_style_t plot_fstyle_broken_object_static = {
	.family = PLOT_FONT_FAMILY_SANS_SERIF,
	.size = 16 * PLOT_STYLE_SCALE,
	.weight = 400,
	.flags = FONTF_NONE,
	.background = 0x8888ff,
	.foreground = 0x000044,
};
plot_font_style_t const * const plot_fstyle_broken_object =
		&plot_fstyle_broken_object_static;

/* caret style used in html_redraw_caret */
static plot_style_t plot_style_caret_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = 0x0000ff,  /* todo - choose a proper colour */
};
plot_style_t *plot_style_caret = &plot_style_caret_static;



/* html redraw widget styles */

/** plot style for filled widget base colour. */
static plot_style_t plot_style_fill_wbasec_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = WIDGET_BASEC,
};
plot_style_t *plot_style_fill_wbasec = &plot_style_fill_wbasec_static;

/** plot style for dark filled widget base colour . */
static plot_style_t plot_style_fill_darkwbasec_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = double_darken_colour(WIDGET_BASEC),
};
plot_style_t *plot_style_fill_darkwbasec = &plot_style_fill_darkwbasec_static;

/** plot style for light filled widget base colour. */
static plot_style_t plot_style_fill_lightwbasec_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = double_lighten_colour(WIDGET_BASEC),
};
plot_style_t *plot_style_fill_lightwbasec = &plot_style_fill_lightwbasec_static;


/** plot style for widget background. */
static plot_style_t plot_style_fill_wblobc_static = {
	.fill_type = PLOT_OP_TYPE_SOLID,
	.fill_colour = WIDGET_BLOBC,
};
plot_style_t *plot_style_fill_wblobc = &plot_style_fill_wblobc_static;

/** plot style for checkbox cross. */
static plot_style_t plot_style_stroke_wblobc_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = WIDGET_BLOBC,
	.stroke_width = plot_style_int_to_fixed(2),
};
plot_style_t *plot_style_stroke_wblobc = &plot_style_stroke_wblobc_static;

/** stroke style for widget double dark colour. */
static plot_style_t plot_style_stroke_darkwbasec_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = double_darken_colour(WIDGET_BASEC),
};
plot_style_t *plot_style_stroke_darkwbasec = &plot_style_stroke_darkwbasec_static;

/** stroke style for widget double light colour. */
static plot_style_t plot_style_stroke_lightwbasec_static = {
	.stroke_type = PLOT_OP_TYPE_SOLID,
	.stroke_colour = double_lighten_colour(WIDGET_BASEC),
};
plot_style_t *plot_style_stroke_lightwbasec = &plot_style_stroke_lightwbasec_static;


/* Generic font style */
static const plot_font_style_t plot_style_font_static = {
	.family = PLOT_FONT_FAMILY_SANS_SERIF,
	.size = 8 * PLOT_STYLE_SCALE,
	.weight = 400,
	.flags = FONTF_NONE,
	.background = 0xffffff,
	.foreground = 0x000000,
};
plot_font_style_t const * const plot_style_font = &plot_style_font_static;