diff src/core/theme.h @ 115:3bd0d3a39e30

core: implement checkbox, closes #2486
author David Demelier <markand@malikania.fr>
date Sun, 12 Jul 2020 09:44:27 +0200
parents 4ac71ac10c9f
children
line wrap: on
line diff
--- a/src/core/theme.h	Thu Jul 09 22:38:48 2020 +0200
+++ b/src/core/theme.h	Sun Jul 12 09:44:27 2020 +0200
@@ -26,6 +26,7 @@
 
 #include <stdbool.h>
 
+struct checkbox;
 struct button;
 struct font;
 struct frame;
@@ -64,6 +65,11 @@
 	unsigned long colors[THEME_COLOR_LAST];
 
 	/**
+	 * (RW) Padding between GUI elements.
+	 */
+	unsigned int padding;
+
+	/**
 	 * Draw a frame.
 	 *
 	 * This function is used to draw a box usually as a container where UI
@@ -86,6 +92,13 @@
 	 * \see \ref theme_draw_button
 	 */
 	void (*draw_button)(struct theme *, const struct button *);
+
+	/**
+	 * Draw a checkbox.
+	 *
+	 * \see \ref theme_draw_button
+	 */
+	void (*draw_checkbox)(struct theme *t, const struct checkbox *);
 };
 
 /**
@@ -106,6 +119,15 @@
 theme_default(void);
 
 /**
+ * Get the desired padding between GUI elements.
+ *
+ * \param t the theme to use (may be NULL)
+ * \return the padding in pixels
+ */
+unsigned int
+theme_padding(const struct theme *t);
+
+/**
  * Draw a frame.
  *
  * \pre frame != NULL
@@ -136,6 +158,15 @@
 theme_draw_button(struct theme *t, const struct button *button);
 
 /**
+ * Draw a checkbox.
+ *
+ * \param t the theme to use (may be NULL)
+ * \param cb the checkbox
+ */
+void
+theme_draw_checkbox(struct theme *t, const struct checkbox *cb);
+
+/**
  * Close associated resources.
  */
 void