diff 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
line wrap: on
line diff
--- a/libcore/core/theme.c	Wed Oct 14 18:11:38 2020 +0200
+++ b/libcore/core/theme.c	Wed Oct 14 18:20:58 2020 +0200
@@ -18,6 +18,7 @@
 
 #include <assert.h>
 #include <stddef.h>
+#include <string.h>
 
 #include "button.h"
 #include "checkbox.h"
@@ -258,6 +259,14 @@
 }
 
 void
+theme_shallow(struct theme *dst, const struct theme *src)
+{
+	assert(dst);
+
+	memcpy(dst, src ? src : &default_theme, sizeof (*src));
+}
+
+void
 theme_draw_frame(struct theme *t, const struct frame *frame)
 {
 	assert(frame);