diff --git a/examples/components/buttons/button_default.xml b/examples/components/buttons/button_default.xml
index 96b683c..ffc6ad1 100644
--- a/examples/components/buttons/button_default.xml
+++ b/examples/components/buttons/button_default.xml
@@ -21,6 +21,6 @@
-
+
diff --git a/examples/components/buttons/button_default_gen.c b/examples/components/buttons/button_default_gen.c
new file mode 100644
index 0000000..d7c143a
--- /dev/null
+++ b/examples/components/buttons/button_default_gen.c
@@ -0,0 +1,56 @@
+
+#include "button_default_gen.h"
+#include "ui.h"
+
+lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+ static lv_style_t style_pr;
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0x222222));
+
+ lv_style_set_pad_hor(&style_main, 24);
+
+ lv_style_set_pad_ver(&style_main, 12);
+
+ lv_style_set_border_width(&style_main, 0);
+
+ lv_style_set_radius(&style_main, 12);
+
+ lv_style_set_shadow_width(&style_main, 0);
+
+
+ lv_style_init(&style_pr);
+ lv_style_set_bg_color(&style_pr, lv_color_hex(0x333333));
+
+ lv_style_set_shadow_width(&style_pr, 20);
+
+ lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000));
+
+ lv_style_set_shadow_opa(&style_pr, 40);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_button_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * h3 = h3_create(obj, "$button_label");
+ lv_obj_set_align(h3, LV_ALIGN_CENTER);
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/buttons/button_default_gen.h b/examples/components/buttons/button_default_gen.h
new file mode 100644
index 0000000..ad4a48b
--- /dev/null
+++ b/examples/components/buttons/button_default_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef BUTTON_DEFAULT_H
+#define BUTTON_DEFAULT_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label);
+
+#endif /*BUTTON_DEFAULT_H*/
\ No newline at end of file
diff --git a/examples/components/buttons/button_error.xml b/examples/components/buttons/button_error.xml
index fd79f02..95d7d30 100644
--- a/examples/components/buttons/button_error.xml
+++ b/examples/components/buttons/button_error.xml
@@ -22,6 +22,6 @@
-
+
diff --git a/examples/components/buttons/button_error_gen.c b/examples/components/buttons/button_error_gen.c
new file mode 100644
index 0000000..853b89e
--- /dev/null
+++ b/examples/components/buttons/button_error_gen.c
@@ -0,0 +1,56 @@
+
+#include "button_error_gen.h"
+#include "ui.h"
+
+lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+ static lv_style_t style_pr;
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0xf03c0f));
+
+ lv_style_set_pad_hor(&style_main, 24);
+
+ lv_style_set_pad_ver(&style_main, 12);
+
+ lv_style_set_border_width(&style_main, 0);
+
+ lv_style_set_radius(&style_main, 12);
+
+ lv_style_set_shadow_width(&style_main, 0);
+
+
+ lv_style_init(&style_pr);
+ lv_style_set_bg_color(&style_pr, lv_color_hex(0xfc5f38));
+
+ lv_style_set_shadow_width(&style_pr, 20);
+
+ lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000));
+
+ lv_style_set_shadow_opa(&style_pr, 40);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_button_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * h3 = h3_create(obj, "$button_label");
+ lv_obj_set_align(h3, LV_ALIGN_CENTER);
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/buttons/button_error_gen.h b/examples/components/buttons/button_error_gen.h
new file mode 100644
index 0000000..7b1b2b1
--- /dev/null
+++ b/examples/components/buttons/button_error_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef BUTTON_ERROR_H
+#define BUTTON_ERROR_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label);
+
+#endif /*BUTTON_ERROR_H*/
\ No newline at end of file
diff --git a/examples/components/buttons/button_warning.xml b/examples/components/buttons/button_warning.xml
index 1b4ea8b..c0fc578 100644
--- a/examples/components/buttons/button_warning.xml
+++ b/examples/components/buttons/button_warning.xml
@@ -23,6 +23,6 @@
-
+
diff --git a/examples/components/buttons/button_warning_gen.c b/examples/components/buttons/button_warning_gen.c
new file mode 100644
index 0000000..97b3b3d
--- /dev/null
+++ b/examples/components/buttons/button_warning_gen.c
@@ -0,0 +1,58 @@
+
+#include "button_warning_gen.h"
+#include "ui.h"
+
+lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+ static lv_style_t style_pr;
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0xf0b005));
+
+ lv_style_set_pad_hor(&style_main, 24);
+
+ lv_style_set_pad_ver(&style_main, 12);
+
+ lv_style_set_border_width(&style_main, 0);
+
+ lv_style_set_radius(&style_main, 12);
+
+ lv_style_set_shadow_width(&style_main, 0);
+
+ lv_style_set_text_color(&style_main, lv_color_hex(0x111111));
+
+
+ lv_style_init(&style_pr);
+ lv_style_set_bg_color(&style_pr, lv_color_hex(0xf9ca4e));
+
+ lv_style_set_shadow_width(&style_pr, 20);
+
+ lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000));
+
+ lv_style_set_shadow_opa(&style_pr, 40);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_button_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * h3 = h3_create(obj, "$button_label");
+ lv_obj_set_align(h3, LV_ALIGN_CENTER);
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/buttons/button_warning_gen.h b/examples/components/buttons/button_warning_gen.h
new file mode 100644
index 0000000..6d434b2
--- /dev/null
+++ b/examples/components/buttons/button_warning_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef BUTTON_WARNING_H
+#define BUTTON_WARNING_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label);
+
+#endif /*BUTTON_WARNING_H*/
\ No newline at end of file
diff --git a/examples/components/headings/h1.xml b/examples/components/headings/h1.xml
index 255790a..f6c82da 100644
--- a/examples/components/headings/h1.xml
+++ b/examples/components/headings/h1.xml
@@ -1,12 +1,12 @@
-
+
-
+
diff --git a/examples/components/headings/h1_gen.c b/examples/components/headings/h1_gen.c
new file mode 100644
index 0000000..50e2f70
--- /dev/null
+++ b/examples/components/headings/h1_gen.c
@@ -0,0 +1,35 @@
+
+#include "h1_gen.h"
+#include "ui.h"
+
+lv_obj_t * h1_create(lv_obj_t * parent, const char * text)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_text_font(&style_main, inter_xl);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_label_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_label_set_text(obj, "text");
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/headings/h1_gen.h b/examples/components/headings/h1_gen.h
new file mode 100644
index 0000000..84a6015
--- /dev/null
+++ b/examples/components/headings/h1_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef H1_H
+#define H1_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * h1_create(lv_obj_t * parent, const char * text);
+
+#endif /*H1_H*/
\ No newline at end of file
diff --git a/examples/components/headings/h2.xml b/examples/components/headings/h2.xml
index d5419ca..c26b2f5 100644
--- a/examples/components/headings/h2.xml
+++ b/examples/components/headings/h2.xml
@@ -1,12 +1,12 @@
-
+
-
+
diff --git a/examples/components/headings/h2_gen.c b/examples/components/headings/h2_gen.c
new file mode 100644
index 0000000..37595d7
--- /dev/null
+++ b/examples/components/headings/h2_gen.c
@@ -0,0 +1,35 @@
+
+#include "h2_gen.h"
+#include "ui.h"
+
+lv_obj_t * h2_create(lv_obj_t * parent, const char * text)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_text_font(&style_main, inter_md);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_label_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_label_set_text(obj, "text");
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/headings/h2_gen.h b/examples/components/headings/h2_gen.h
new file mode 100644
index 0000000..501b56e
--- /dev/null
+++ b/examples/components/headings/h2_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef H2_H
+#define H2_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * h2_create(lv_obj_t * parent, const char * text);
+
+#endif /*H2_H*/
\ No newline at end of file
diff --git a/examples/components/headings/h3.xml b/examples/components/headings/h3.xml
index 8dab2b1..ddc8db3 100644
--- a/examples/components/headings/h3.xml
+++ b/examples/components/headings/h3.xml
@@ -1,12 +1,12 @@
-
+
-
+
diff --git a/examples/components/headings/h3_gen.c b/examples/components/headings/h3_gen.c
new file mode 100644
index 0000000..2a6b946
--- /dev/null
+++ b/examples/components/headings/h3_gen.c
@@ -0,0 +1,35 @@
+
+#include "h3_gen.h"
+#include "ui.h"
+
+lv_obj_t * h3_create(lv_obj_t * parent, const char * text)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_text_font(&style_main, inter_sm);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_label_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_label_set_text(obj, "text");
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/headings/h3_gen.h b/examples/components/headings/h3_gen.h
new file mode 100644
index 0000000..ec1bd6c
--- /dev/null
+++ b/examples/components/headings/h3_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef H3_H
+#define H3_H
+
+#include "lvgl/lvgl.h"
+
+
+
+lv_obj_t * h3_create(lv_obj_t * parent, const char * text);
+
+#endif /*H3_H*/
\ No newline at end of file
diff --git a/examples/components/home_gen.c b/examples/components/home_gen.c
new file mode 100644
index 0000000..22ec492
--- /dev/null
+++ b/examples/components/home_gen.c
@@ -0,0 +1,115 @@
+
+#include "home_gen.h"
+#include "ui.h"
+
+lv_obj_t * home_create(lv_obj_t * parent)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+ static lv_style_t style_cont;
+static lv_style_t style_left_cont;
+static lv_style_t style_right_cont;
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+ lv_style_init(&style_main);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0x111111));
+
+ lv_style_set_radius(&style_main, 0);
+
+ lv_style_set_border_width(&style_main, 0);
+
+ lv_style_set_layout(&style_main, LV_LAYOUT_FLEX);
+
+ lv_style_set_flex_flow(&style_main, LV_FLEX_FLOW_ROW);
+
+ lv_style_set_width(&style_main, lv_pct(100));
+
+ lv_style_set_height(&style_main, lv_pct(100));
+
+ lv_style_set_pad_column(&style_main, 0);
+
+
+ lv_style_init(&style_cont);
+ lv_style_set_height(&style_cont, lv_pct(100));
+
+ lv_style_set_bg_color(&style_cont, lv_color_hex(0x333333));
+
+ lv_style_set_flex_flow(&style_cont, LV_FLEX_FLOW_COLUMN);
+
+ lv_style_set_layout(&style_cont, LV_LAYOUT_FLEX);
+
+ lv_style_set_radius(&style_cont, 0);
+
+ lv_style_set_pad_row(&style_cont, 16);
+
+
+ lv_style_init(&style_left_cont);
+ lv_style_set_width(&style_left_cont, LV_SIZE_CONTENT);
+
+ lv_style_set_border_width(&style_left_cont, 0);
+
+
+ lv_style_init(&style_right_cont);
+ lv_style_set_layout(&style_right_cont, LV_LAYOUT_FLEX);
+
+ lv_style_set_bg_opa(&style_right_cont, 0);
+
+ lv_style_set_border_width(&style_right_cont, 0);
+
+ lv_style_set_flex_flow(&style_right_cont, LV_FLEX_FLOW_COLUMN);
+
+ lv_style_set_flex_track_place(&style_right_cont, LV_FLEX_ALIGN_CENTER);
+
+ lv_style_set_flex_cross_place(&style_right_cont, LV_FLEX_ALIGN_CENTER);
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_obj_create(parent);
+
+ lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);
+ lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * lv_obj = lv_obj_create(obj);
+ lv_obj_add_style(lv_obj, &style_cont, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_add_style(lv_obj, &style_left_cont, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * slider_box = slider_box_create(lv_obj);
+ lv_obj_set_width(slider_box, 155);
+ slider_box_set_title(slider_box, "Room 1");
+ lv_obj_t * slider_box_2 = slider_box_create(lv_obj);
+ lv_obj_set_width(slider_box_2, 155);
+ slider_box_set_title(slider_box_2, "Room 2");
+ lv_obj_t * slider_box_3 = slider_box_create(lv_obj);
+ lv_obj_set_width(slider_box_3, 155);
+ slider_box_set_title(slider_box_3, "Room 3");
+ lv_obj_t * slider_box_4 = slider_box_create(lv_obj);
+ lv_obj_set_width(slider_box_4, 155);
+ slider_box_set_title(slider_box_4, "Room 4");
+ lv_obj_t * slider_box_5 = slider_box_create(lv_obj);
+ lv_obj_set_width(slider_box_5, 155);
+ slider_box_set_title(slider_box_5, "Room 5");
+ lv_obj_t * lv_obj_2 = lv_obj_create(obj);
+ lv_obj_add_style(lv_obj_2, &style_cont, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_add_style(lv_obj_2, &style_right_cont, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_t * button_default = button_default_create(lv_obj_2, "Ok");
+ lv_obj_t * button_default_2 = button_default_create(lv_obj_2, "Cancel");
+ lv_obj_t * dark_slider = dark_slider_create(lv_obj_2);
+ lv_obj_set_width(dark_slider, lv_pct(100));
+ dark_slider_set_color(dark_slider, lv_color_hex(0xf03c0f));
+ lv_obj_set_send_draw_task_events(dark_slider, true);
+ lv_obj_t * button_warning = button_warning_create(lv_obj_2, "Alert 1");
+ lv_obj_t * button_warning_2 = button_warning_create(lv_obj_2, "Alert 2");
+ lv_obj_t * button_error = button_error_create(lv_obj_2, "Error 1");
+ lv_obj_t * button_error_2 = button_error_create(lv_obj_2, "Error 2");
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/home_gen.h b/examples/components/home_gen.h
new file mode 100644
index 0000000..c991092
--- /dev/null
+++ b/examples/components/home_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef HOME_H
+#define HOME_H
+
+#include "lvgl/lvgl.h"
+
+#define HOME_SLIDER_BOX_WIDTH 155
+
+lv_obj_t * home_create(lv_obj_t * parent);
+
+#endif /*HOME_H*/
\ No newline at end of file
diff --git a/examples/components/scratchpad_gen.c b/examples/components/scratchpad_gen.c
new file mode 100644
index 0000000..2a90367
--- /dev/null
+++ b/examples/components/scratchpad_gen.c
@@ -0,0 +1,50 @@
+
+#include "scratchpad_gen.h"
+#include "ui.h"
+
+lv_obj_t * scratchpad_create(lv_obj_t * parent)
+{
+ LV_TRACE_OBJ_CREATE("begin");
+
+ static lv_style_t style_main;
+
+
+
+ static bool style_main_inited = false;
+
+ if(!style_main_inited) {
+
+
+
+ style_main_inited = true;
+ }
+
+ lv_obj_t * obj = lv_obj_create(parent);
+
+
+ lv_obj_set_width(obj, lv_pct(100));
+ lv_obj_set_height(obj, lv_pct(100));
+ lv_obj_t * button_default = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default, 250);
+ lv_obj_t * button_default_2 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_2, 250);
+ lv_obj_t * button_default_3 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_3, 250);
+ lv_obj_t * button_error = button_error_create(obj, "Button");
+ lv_obj_set_width(button_error, 250);
+ lv_obj_t * button_warning = button_warning_create(obj, "Button");
+ lv_obj_set_width(button_warning, 250);
+ lv_obj_t * button_default_4 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_4, 250);
+ lv_obj_t * button_default_5 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_5, 250);
+ lv_obj_t * button_default_6 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_6, 250);
+ lv_obj_t * button_default_7 = button_default_create(obj, "Button");
+ lv_obj_set_width(button_default_7, 250);
+
+
+ LV_TRACE_OBJ_CREATE("finished");
+
+ return obj;
+}
\ No newline at end of file
diff --git a/examples/components/scratchpad_gen.h b/examples/components/scratchpad_gen.h
new file mode 100644
index 0000000..3b193ba
--- /dev/null
+++ b/examples/components/scratchpad_gen.h
@@ -0,0 +1,11 @@
+
+#ifndef SCRATCHPAD_H
+#define SCRATCHPAD_H
+
+#include "lvgl/lvgl.h"
+
+#define SCRATCHPAD_LONG 250
+
+lv_obj_t * scratchpad_create(lv_obj_t * parent);
+
+#endif /*SCRATCHPAD_H*/
\ No newline at end of file
diff --git a/examples/example.c b/examples/example.c
index 775cbbf..34b9a84 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -6,6 +6,7 @@
/*********************
* INCLUDES
*********************/
+#include "example.h"
/*********************
* DEFINES
@@ -33,7 +34,7 @@
void example_init(void)
{
-
+ example_init_gen();
}
/**********************
diff --git a/examples/example.h b/examples/example.h
index fb7d671..0c1b8eb 100644
--- a/examples/example.h
+++ b/examples/example.h
@@ -13,10 +13,7 @@ extern "C" {
/*********************
* INCLUDES
*********************/
-
-/*Include all the widget and components of this library*/
-#include "dark_slider/dark_slider.h"
-#include "slider_box/slider_box.h"
+#include "example_gen.h"
/*********************
* DEFINES
diff --git a/examples/example_gen.c b/examples/example_gen.c
new file mode 100644
index 0000000..349297d
--- /dev/null
+++ b/examples/example_gen.c
@@ -0,0 +1,43 @@
+/**
+ * @file example_gen.c
+ *
+ */
+
+/*********************
+ * INCLUDES
+ *********************/
+
+/*********************
+ * DEFINES
+ *********************/
+
+/**********************
+ * TYPEDEFS
+ **********************/
+
+/**********************
+ * STATIC PROTOTYPES
+ **********************/
+
+/**********************
+ * STATIC VARIABLES
+ **********************/
+
+/**********************
+ * MACROS
+ **********************/
+
+/**********************
+ * GLOBAL FUNCTIONS
+ **********************/
+
+void example_init_gen(void)
+{
+ inter_sm = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 14);
+ inter_md = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 18);
+ inter_xl = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 22);
+}
+
+/**********************
+ * STATIC FUNCTIONS
+ **********************/
diff --git a/examples/example_gen.h b/examples/example_gen.h
new file mode 100644
index 0000000..a64c23a
--- /dev/null
+++ b/examples/example_gen.h
@@ -0,0 +1,58 @@
+/**
+ * @file example_gen.h
+ *
+ */
+
+#ifndef EXAMPLE_GEN_H
+#define EXAMPLE_GEN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*********************
+ * INCLUDES
+ *********************/
+
+/*Include all the widget and components of this library*/
+#include "dark_slider/dark_slider.h"
+#include "slider_box/slider_box.h"
+#include "components/headings/h1_gen.h"
+#include "components/headings/h2_gen.h"
+#include "components/headings/h3_gen.h"
+#include "components/buttons/button_default_gen.h"
+#include "components/buttons/button_error_gen.h"
+#include "components/buttons/button_warning_gen.h"
+#include "components/home_gen.h"
+#include "components/scratchpad_gen.h"
+
+/*********************
+ * DEFINES
+ *********************/
+
+/**********************
+ * TYPEDEFS
+ **********************/
+
+/**********************
+ * GLOBAL VARIABLES
+ **********************/
+
+/**********************
+ * GLOBAL PROTOTYPES
+ **********************/
+
+/**
+ * Initialize the component library
+ */
+void example_init_gen(void);
+
+/**********************
+ * MACROS
+ **********************/
+
+#ifdef __cplusplus
+} /*extern "C"*/
+#endif
+
+#endif /*EXAMPLE_GEN_H*/
diff --git a/examples/ui.c b/examples/ui.c
index 5a6e582..677fe13 100644
--- a/examples/ui.c
+++ b/examples/ui.c
@@ -23,9 +23,6 @@
/**********************
* STATIC VARIABLES
**********************/
-lv_font_t * inter_sm;
-lv_font_t * inter_md;
-lv_font_t * inter_xl;
/**********************
* MACROS
@@ -37,13 +34,6 @@ lv_font_t * inter_xl;
void ui_init(void)
{
- static bool inited = false;
- if(inited) return;
- inited = true;
-
- inter_sm = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 14);
- inter_md = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 18);
- inter_xl = lv_tiny_ttf_create_file("A:/fonts/Inter-SemiBold.ttf", 22);
example_init();
}
diff --git a/examples/ui.h b/examples/ui.h
index 9a3d6c4..570e972 100644
--- a/examples/ui.h
+++ b/examples/ui.h
@@ -29,9 +29,6 @@ extern "C" {
/**********************
* GLOBAL VARIABLES
**********************/
- extern lv_font_t * inter_sm;
- extern lv_font_t * inter_md;
- extern lv_font_t * inter_xl;
/**********************
* GLOBAL PROTOTYPES
diff --git a/examples/widgets/dark_slider/dark_slider_gen.c b/examples/widgets/dark_slider/dark_slider_gen.c
index c04e35a..00b05ef 100644
--- a/examples/widgets/dark_slider/dark_slider_gen.c
+++ b/examples/widgets/dark_slider/dark_slider_gen.c
@@ -73,32 +73,49 @@ static void dark_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
static lv_style_t style_main;
static lv_style_t style_light_knob;
- static lv_style_t style_blue_indicator;
+static lv_style_t style_blue_indicator;
static bool style_main_inited = false;
if(!style_main_inited) {
+
+
+
lv_style_init(&style_main);
- lv_style_set_bg_color(&style_main, lv_color_hex(0x333333));
- lv_style_set_bg_opa(&style_main, 255);
- lv_style_set_radius(&style_main, 10);
- lv_style_set_width(&style_main, 120);
- lv_style_set_height(&style_main, 10);
- lv_style_set_pad_all(&style_main, 0);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0x333333));
+
+ lv_style_set_bg_opa(&style_main, 255);
+
+ lv_style_set_radius(&style_main, 10);
+
+ lv_style_set_width(&style_main, 120);
+
+ lv_style_set_height(&style_main, 10);
+
+
lv_style_init(&style_light_knob);
- lv_style_set_bg_color(&style_light_knob, lv_color_hex(0xeeeeee));
- lv_style_set_bg_opa(&style_light_knob, 255);
- lv_style_set_shadow_width(&style_light_knob, 20);
- lv_style_set_shadow_opa(&style_light_knob, 120);
- lv_style_set_shadow_offset_y(&style_light_knob, 2);
- lv_style_set_pad_all(&style_light_knob, 5);
- lv_style_set_radius(&style_light_knob, 100);
+ lv_style_set_bg_color(&style_light_knob, lv_color_hex(0xeeeeee));
+
+ lv_style_set_bg_opa(&style_light_knob, 255);
+
+ lv_style_set_shadow_width(&style_light_knob, 20);
+
+ lv_style_set_shadow_opa(&style_light_knob, 120);
+
+ lv_style_set_shadow_offset_y(&style_light_knob, 2);
+
+ lv_style_set_radius(&style_light_knob, 100);
+
+
lv_style_init(&style_blue_indicator);
- lv_style_set_bg_color(&style_blue_indicator, lv_color_hex(0x0000ff));
- lv_style_set_bg_opa(&style_blue_indicator, 255);
- lv_style_set_radius(&style_blue_indicator, 100);
+ lv_style_set_bg_color(&style_blue_indicator, lv_color_hex(0x0000ff));
+
+ lv_style_set_bg_opa(&style_blue_indicator, 255);
+
+ lv_style_set_radius(&style_blue_indicator, 100);
+
style_main_inited = true;
}
@@ -106,8 +123,8 @@ static void dark_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_style(obj, &style_light_knob, LV_PART_KNOB | LV_STATE_DEFAULT);
lv_obj_add_style(obj, &style_blue_indicator, LV_PART_INDICATOR | LV_STATE_DEFAULT);
- lv_obj_add_flag(obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS);
- lv_slider_set_range(obj, 20, 40);
+
+
dark_slider_t * dark_slider = (dark_slider_t *)obj;
diff --git a/examples/widgets/dark_slider/dark_slider_gen.h b/examples/widgets/dark_slider/dark_slider_gen.h
index 7a05f30..d449dc3 100644
--- a/examples/widgets/dark_slider/dark_slider_gen.h
+++ b/examples/widgets/dark_slider/dark_slider_gen.h
@@ -36,9 +36,9 @@ lv_obj_t * dark_slider_create(lv_obj_t * parent);
/**
- * Set the undefined
+ * Set the color
* @param obj pointer to a dark_slider
- * @param color undefined
+ * @param color color
*/
void dark_slider_set_color(lv_obj_t * obj, lv_color_t color);
diff --git a/examples/widgets/slider_box/slider_box_gen.c b/examples/widgets/slider_box/slider_box_gen.c
index 5c68d7d..ee6902b 100644
--- a/examples/widgets/slider_box/slider_box_gen.c
+++ b/examples/widgets/slider_box/slider_box_gen.c
@@ -8,8 +8,7 @@
*********************/
#include "slider_box_private_gen.h"
#include "lvgl/src/core/lv_obj_class_private.h"
-#include "../../ui.h"
-
+#include "ui.h"
/*********************
* DEFINES
@@ -68,77 +67,97 @@ lv_obj_t * slider_box_create(lv_obj_t * parent)
static void slider_box_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
{
- ui_init();
LV_UNUSED(class_p);
LV_TRACE_OBJ_CREATE("begin");
static lv_style_t style_main;
+
static lv_style_t style_button;
static bool style_main_inited = false;
if(!style_main_inited) {
- lv_style_init(&style_main);
- lv_style_set_bg_color(&style_main, lv_color_hex(0x666666));
- lv_style_set_bg_opa(&style_main, 255);
- lv_style_set_radius(&style_main, 12);
- lv_style_set_width(&style_main, 180);
- lv_style_set_height(&style_main, LV_SIZE_CONTENT);
- lv_style_set_layout(&style_main, LV_LAYOUT_FLEX);
- lv_style_set_flex_flow(&style_main, LV_FLEX_FLOW_ROW_WRAP);
- lv_style_set_flex_cross_place(&style_main, LV_FLEX_ALIGN_CENTER);
- lv_style_set_flex_track_place(&style_main, LV_FLEX_ALIGN_CENTER);
- lv_style_set_pad_column(&style_main, 4);
- lv_style_set_pad_row(&style_main, 10);
- lv_style_set_pad_all(&style_main, 16);
- lv_style_set_text_color(&style_main, lv_color_hex(0xffffff));
- lv_style_set_text_font(&style_main, inter_sm);
-
- lv_style_init(&style_button);
- lv_style_set_radius(&style_button, 100);
- lv_style_set_text_font(&style_button, inter_xl);
- lv_style_set_bg_color(&style_button, lv_color_hex(0x222222));
- lv_style_set_shadow_width(&style_button, 0);
- style_main_inited = true;
+
+
+
+ lv_style_init(&style_main);
+ lv_style_set_bg_color(&style_main, lv_color_hex(0x666666));
+
+ lv_style_set_bg_opa(&style_main, 255);
+
+ lv_style_set_radius(&style_main, 12);
+
+ lv_style_set_width(&style_main, 180);
+
+ lv_style_set_height(&style_main, LV_SIZE_CONTENT);
+
+ lv_style_set_layout(&style_main, LV_LAYOUT_FLEX);
+
+ lv_style_set_flex_flow(&style_main, LV_FLEX_FLOW_ROW_WRAP);
+
+ lv_style_set_flex_cross_place(&style_main, LV_FLEX_ALIGN_CENTER);
+
+ lv_style_set_flex_track_place(&style_main, LV_FLEX_ALIGN_CENTER);
+
+ lv_style_set_pad_row(&style_main, 10);
+
+ lv_style_set_pad_column(&style_main, 4);
+
+ lv_style_set_text_font(&style_main, inter_sm);
+
+ lv_style_set_text_color(&style_main, lv_color_hex(0xffffff));
+
+
+
+ lv_style_init(&style_button);
+ lv_style_set_radius(&style_button, 100);
+
+ lv_style_set_text_font(&style_button, inter_xl);
+
+ lv_style_set_shadow_width(&style_button, 0);
+
+ lv_style_set_bg_color(&style_button, lv_color_hex(0x222222));
+
+
+ style_main_inited = true;
}
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
+
slider_box_t * slider_box = (slider_box_t *)obj;
-
+
slider_box->lv_button = lv_button_create(obj);
lv_obj_add_style(slider_box->lv_button, &style_button, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_width(slider_box->lv_button, 30);
lv_obj_set_height(slider_box->lv_button, 30);
- slider_box->lv_label2 = lv_label_create(slider_box->lv_button);
- lv_label_set_text(slider_box->lv_label2, "-");
- lv_obj_center(slider_box->lv_label2);
-
- slider_box->lv_label = lv_label_create(obj);
- lv_obj_set_align(slider_box->lv_label, LV_ALIGN_TOP_MID);
- lv_label_set_text(slider_box->lv_label, "Title");
- lv_obj_set_style_text_color(slider_box->lv_label, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
- lv_obj_set_flex_grow(slider_box->lv_label, 1);
- lv_label_set_long_mode(slider_box->lv_label, LV_LABEL_LONG_MODE_SCROLL);
- lv_obj_set_style_text_align(slider_box->lv_label, LV_TEXT_ALIGN_CENTER, 0);
- lv_obj_set_style_text_color(slider_box->lv_label, lv_color_hex(0xffffff), 0);
+ slider_box->lv_label = lv_label_create(slider_box->lv_button);
+ lv_label_set_text(slider_box->lv_label, "-");
+ lv_obj_set_align(slider_box->lv_label, LV_ALIGN_CENTER);
+ slider_box->lv_label2 = lv_label_create(obj);
+ lv_obj_set_align(slider_box->lv_label2, LV_ALIGN_TOP_MID);
+ lv_label_set_text(slider_box->lv_label2, "Title");
+ lv_obj_set_style_text_align(slider_box->lv_label2, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
+ lv_obj_set_width(slider_box->lv_label2, LV_SIZE_CONTENT);
+ lv_label_set_long_mode(slider_box->lv_label2, LV_LABEL_LONG_MODE_SCROLL);
slider_box->lv_button2 = lv_button_create(obj);
lv_obj_add_style(slider_box->lv_button2, &style_button, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_width(slider_box->lv_button2, 30);
lv_obj_set_height(slider_box->lv_button2, 30);
-
+
slider_box->lv_label3 = lv_label_create(slider_box->lv_button2);
lv_label_set_text(slider_box->lv_label3, "+");
- lv_obj_center(slider_box->lv_label3);
+ lv_obj_set_align(slider_box->lv_label3, LV_ALIGN_CENTER);
slider_box->dark_slider = dark_slider_create(obj);
lv_obj_set_width(slider_box->dark_slider, lv_pct(100));
- lv_obj_set_style_margin_hor(slider_box->dark_slider, 8, 0);
dark_slider_set_color(slider_box->dark_slider, lv_color_hex(0x44aaff));
-
+ lv_obj_set_style_margin_hor(slider_box->dark_slider, 10, LV_PART_MAIN | LV_STATE_DEFAULT);
+
+
slider_box_constructor_hook(obj);
LV_TRACE_OBJ_CREATE("finished");
@@ -162,5 +181,4 @@ static void slider_box_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(res != LV_RESULT_OK) return;
slider_box_event_hook(e);
-}
-
+}
\ No newline at end of file
diff --git a/examples/widgets/slider_box/slider_box_gen.h b/examples/widgets/slider_box/slider_box_gen.h
index d2050ea..a3a99ef 100644
--- a/examples/widgets/slider_box/slider_box_gen.h
+++ b/examples/widgets/slider_box/slider_box_gen.h
@@ -36,9 +36,9 @@ lv_obj_t * slider_box_create(lv_obj_t * parent);
/**
- * Set the undefined
+ * Set the title
* @param obj pointer to a slider_box
- * @param title undefined
+ * @param title title
*/
void slider_box_set_title(lv_obj_t * obj, const char * title);
diff --git a/examples/widgets/slider_box/slider_box_private_gen.h b/examples/widgets/slider_box/slider_box_private_gen.h
index a018d95..690fdbc 100644
--- a/examples/widgets/slider_box/slider_box_private_gen.h
+++ b/examples/widgets/slider_box/slider_box_private_gen.h
@@ -27,9 +27,8 @@ extern "C" {
typedef struct {
lv_obj_t obj; /* Base widget to extend */
const char * title;
- lv_obj_t * lv_label;
- lv_obj_t * lv_obj;
lv_obj_t * lv_button;
+ lv_obj_t * lv_label;
lv_obj_t * lv_label2;
lv_obj_t * lv_button2;
lv_obj_t * lv_label3;