aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/saffron.h8
-rw-r--r--include/saffron_api.h4
-rw-r--r--include/saffron_theme.h25
-rw-r--r--include/saffron_widget.h2
4 files changed, 38 insertions, 1 deletions
diff --git a/include/saffron.h b/include/saffron.h
index 53f27fb..1178a51 100644
--- a/include/saffron.h
+++ b/include/saffron.h
@@ -4,11 +4,19 @@
#include <SDL3/SDL.h>
#include <SDL3_ttf/SDL_ttf.h>
+/* Dear LSP,
+ * I KNOW THESE ARE NOT USED
+ * PLEASE LEAVE ME ALONE
+ * Kind regards,
+ * Arslaan Pathan
+ * 2026-04-30
+*/
#include "saffron_api.h"
#include "saffron_button.h"
#include "saffron_text.h"
#include "saffron_widget.h"
#include "saffron_window.h"
#include "saffron_layout.h"
+#include "saffron_theme.h"
#endif
diff --git a/include/saffron_api.h b/include/saffron_api.h
index d64b480..8ad340c 100644
--- a/include/saffron_api.h
+++ b/include/saffron_api.h
@@ -28,10 +28,12 @@ SaffronWidget* saffron_widget_hit_test(SaffronWidget* widget, int x, int y);
SaffronBox* saffron_box_new(SaffronOrientation orientation, SaffronHorizontalAlignment halign, SaffronVerticalAlignment valign, int spacing, int padding, int margin, int width, int height);
void saffron_box_layout(SaffronBox* box);
-SaffronText* saffron_text_new(const char* text, TTF_Font* font, SDL_Color color);
+SaffronText* saffron_text_new(const char* text, TTF_Font* font);
void saffron_text_set_text(SaffronText* text, const char* new_text);
SaffronButton* saffron_button_new(bool enabled, void (*callback)(SaffronButton* self), int w, int h);
SaffronButton* saffron_button_new_with_text(SaffronText* text, bool enabled, void (*callback)(SaffronButton* self), int w, int h);
+void saffron_widget_set_theme(SaffronWidget* widget, SaffronTheme* theme);
+
#endif
diff --git a/include/saffron_theme.h b/include/saffron_theme.h
new file mode 100644
index 0000000..1425a5d
--- /dev/null
+++ b/include/saffron_theme.h
@@ -0,0 +1,25 @@
+#ifndef SAFFRON_THEME_H
+#define SAFFRON_THEME_H
+
+#include <SDL3/SDL.h>
+
+typedef struct {
+ int r;
+ int g;
+ int b;
+ int a;
+} SaffronColor;
+
+typedef struct {
+ SaffronColor bg;
+ SaffronColor fg;
+ SaffronColor primary;
+ SaffronColor secondary;
+ SaffronColor tertiary;
+} SaffronTheme;
+
+extern const SaffronTheme SAFFRON_DEFAULT_THEME;
+
+#define SF_MACRO_DEFAULT_THEME ((SaffronTheme*)&SAFFRON_DEFAULT_THEME)
+
+#endif
diff --git a/include/saffron_widget.h b/include/saffron_widget.h
index 8b9fc3c..8e7ad12 100644
--- a/include/saffron_widget.h
+++ b/include/saffron_widget.h
@@ -2,6 +2,7 @@
#define SAFFRON_WIDGET_H
#include <SDL3/SDL.h>
+#include "saffron_theme.h"
typedef enum {
SAFFRON_SIZE_FIXED, // keep normal size
@@ -28,6 +29,7 @@ typedef struct SaffronWidget {
bool pixel_perfect; // Do we scale dynamically (SaffronSizeMode, etc) or use raw x, y, w, h values? If this is true, the SaffronSizeModes from earlier will be ignored. this pretty much tells the engine NOT to layout your widgets, don't expect it to allocate size for it. get better
SaffronWidgetType type;
void (*free)(struct SaffronWidget* self);
+ SaffronTheme* theme;
} SaffronWidget;
#endif