From 12fb8e70c79fb262a06431bfbd0e4ce97380d2a8 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Tue, 21 Apr 2026 15:28:04 +1200 Subject: Add foundations for layout --- src/saffron_layout.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/saffron_layout.c (limited to 'src/saffron_layout.c') diff --git a/src/saffron_layout.c b/src/saffron_layout.c new file mode 100644 index 0000000..cc91246 --- /dev/null +++ b/src/saffron_layout.c @@ -0,0 +1,26 @@ +#include "saffron_layout.h" +#include "saffron_api.h" +#include +#include +#include +#include +#include +#include + +SaffronBox* saffron_box_new(SaffronOrientation orientation, SaffronHorizontalAlignment halign, SaffronVerticalAlignment valign, int spacing, int padding, int margin) { + SaffronBox* box = malloc(sizeof(SaffronBox)); + if (!box) return NULL; + + saffron_widget_init((SaffronWidget*)box); + + box->orientation = orientation; + box->halign = halign; + box->valign = valign; + box->spacing = spacing; + box->padding = padding; + box->margin = margin; + + return box; +} + + -- cgit v1.2.3