Skip to content

Commit

Permalink
export code
Browse files Browse the repository at this point in the history
  • Loading branch information
kisvegabor committed Jan 8, 2025
1 parent af139b4 commit 8c44da0
Show file tree
Hide file tree
Showing 36 changed files with 2,268 additions and 6 deletions.
78 changes: 78 additions & 0 deletions examples/components/buttons/button_default_gen.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* @file button_default_gen.c
*
* @description Template source file for LVGL objects
*
*/

/*********************
* INCLUDES
*********************/
#include "button_default_gen.h"
#include "ui.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/***********************
* STATIC VARIABLES
**********************/

/***********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL FUNCTIONS
**********************/

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_inited = false;

if(!style_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_inited = true;
}

lv_obj_t * lv_obj = lv_button_create(parent);

lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_style(lv_obj, &style_pr, LV_PART_MAIN | LV_STATE_PRESSED);

lv_obj_t * h3_1 = h3_create(lv_obj, button_label);
lv_obj_set_align(h3_1, LV_ALIGN_CENTER);



LV_TRACE_OBJ_CREATE("finished");

return lv_obj;
}
/**********************
* STATIC FUNCTIONS
**********************/
45 changes: 45 additions & 0 deletions examples/components/buttons/button_default_gen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @file button_default_gen.h
*
*/

#ifndef BUTTON_DEFAULT_H
#define LV_TEMPL_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/**********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL PROTOTYPES
**********************/



lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label);
/**********************
* MACROS
**********************/

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LV_TEMPL_H*/
78 changes: 78 additions & 0 deletions examples/components/buttons/button_error_gen.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* @file button_error_gen.c
*
* @description Template source file for LVGL objects
*
*/

/*********************
* INCLUDES
*********************/
#include "button_error_gen.h"
#include "ui.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/***********************
* STATIC VARIABLES
**********************/

/***********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL FUNCTIONS
**********************/

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_inited = false;

if(!style_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_inited = true;
}

lv_obj_t * lv_obj = lv_button_create(parent);

lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_style(lv_obj, &style_pr, LV_PART_MAIN | LV_STATE_PRESSED);

lv_obj_t * h3_1 = h3_create(lv_obj, button_label);
lv_obj_set_align(h3_1, LV_ALIGN_CENTER);



LV_TRACE_OBJ_CREATE("finished");

return lv_obj;
}
/**********************
* STATIC FUNCTIONS
**********************/
45 changes: 45 additions & 0 deletions examples/components/buttons/button_error_gen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @file button_error_gen.h
*
*/

#ifndef BUTTON_ERROR_H
#define LV_TEMPL_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/**********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL PROTOTYPES
**********************/



lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label);
/**********************
* MACROS
**********************/

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LV_TEMPL_H*/
78 changes: 78 additions & 0 deletions examples/components/buttons/button_warning_gen.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* @file button_warning_gen.c
*
* @description Template source file for LVGL objects
*
*/

/*********************
* INCLUDES
*********************/
#include "button_warning_gen.h"
#include "ui.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/***********************
* STATIC VARIABLES
**********************/

/***********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL FUNCTIONS
**********************/

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_inited = false;

if(!style_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_inited = true;
}

lv_obj_t * lv_obj = lv_button_create(parent);

lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT);

lv_obj_t * h3_1 = h3_create(lv_obj, button_label);
lv_obj_set_align(h3_1, LV_ALIGN_CENTER);



LV_TRACE_OBJ_CREATE("finished");

return lv_obj;
}
/**********************
* STATIC FUNCTIONS
**********************/
45 changes: 45 additions & 0 deletions examples/components/buttons/button_warning_gen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @file button_warning_gen.h
*
*/

#ifndef BUTTON_WARNING_H
#define LV_TEMPL_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"

/*********************
* DEFINES
*********************/

/**********************
* TYPEDEFS
**********************/

/**********************
* STATIC PROTOTYPES
**********************/

/**********************
* GLOBAL PROTOTYPES
**********************/



lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label);
/**********************
* MACROS
**********************/

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LV_TEMPL_H*/
Loading

0 comments on commit 8c44da0

Please sign in to comment.