Mercurial > molko
comparison libcore/core/theme.c @ 146:7d7ea7a9cf50
core: add theme_shallow function
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 14 Oct 2020 18:20:58 +0200 |
parents | 7f1af54bb35a |
children |
comparison
equal
deleted
inserted
replaced
145:7f1af54bb35a | 146:7d7ea7a9cf50 |
---|---|
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 */ | 17 */ |
18 | 18 |
19 #include <assert.h> | 19 #include <assert.h> |
20 #include <stddef.h> | 20 #include <stddef.h> |
21 #include <string.h> | |
21 | 22 |
22 #include "button.h" | 23 #include "button.h" |
23 #include "checkbox.h" | 24 #include "checkbox.h" |
24 #include "font.h" | 25 #include "font.h" |
25 #include "frame.h" | 26 #include "frame.h" |
256 { | 257 { |
257 return THEME(t)->padding; | 258 return THEME(t)->padding; |
258 } | 259 } |
259 | 260 |
260 void | 261 void |
262 theme_shallow(struct theme *dst, const struct theme *src) | |
263 { | |
264 assert(dst); | |
265 | |
266 memcpy(dst, src ? src : &default_theme, sizeof (*src)); | |
267 } | |
268 | |
269 void | |
261 theme_draw_frame(struct theme *t, const struct frame *frame) | 270 theme_draw_frame(struct theme *t, const struct frame *frame) |
262 { | 271 { |
263 assert(frame); | 272 assert(frame); |
264 | 273 |
265 THEME(t)->draw_frame(THEME(t), frame); | 274 THEME(t)->draw_frame(THEME(t), frame); |