Skip to content

Commit

Permalink
add the prototypes of the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kisvegabor committed Feb 19, 2021
1 parent fe20d47 commit ca4f11e
Show file tree
Hide file tree
Showing 18 changed files with 168 additions and 26 deletions.
1 change: 1 addition & 0 deletions examples/examples.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name \*.c)
12 changes: 9 additions & 3 deletions examples/layouts/flex/lv_example_flex.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
*/

#ifndef LV_EX_FLEX_H
#define LV_EX_FLEX_H
#ifndef LV_EXAMPLE_FLEX_H
#define LV_EXAMPLE_FLEX_H

#ifdef __cplusplus
extern "C" {
Expand All @@ -25,6 +25,12 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_example_flex_1(void);
void lv_example_flex_2(void);
void lv_example_flex_3(void);
void lv_example_flex_4(void);
void lv_example_flex_5(void);
void lv_example_flex_6(void);

/**********************
* MACROS
Expand All @@ -34,4 +40,4 @@ extern "C" {
} /* extern "C" */
#endif

#endif /*LV_EX_FLEX_H*/
#endif /*LV_EXAMPLE_FLEX_H*/
12 changes: 9 additions & 3 deletions examples/layouts/grid/lv_example_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
*/

#ifndef LV_EX_GRID_H
#define LV_EX_GRID_H
#ifndef LV_EXAMPLE_GRID_H
#define LV_EXAMPLE_GRID_H

#ifdef __cplusplus
extern "C" {
Expand All @@ -25,6 +25,12 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_example_grid_1(void);
void lv_example_grid_2(void);
void lv_example_grid_3(void);
void lv_example_grid_4(void);
void lv_example_grid_5(void);
void lv_example_grid_6(void);

/**********************
* MACROS
Expand All @@ -34,4 +40,4 @@ extern "C" {
} /* extern "C" */
#endif

#endif /*LV_EX_GRID_H*/
#endif /*LV_EXAMPLE_GRID_H*/
39 changes: 39 additions & 0 deletions examples/layouts/lv_example_layout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* @file lv_example_layout.h
*
*/

#ifndef LV_EXAMPLE_LAYOUT_H
#define LV_EXAMPLE_LAYOUT_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
* INCLUDES
*********************/
#include "flex/lv_example_flex.h"
#include "grid/lv_example_grid.h"

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

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

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

/**********************
* MACROS
**********************/

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

#endif /*LV_EXAMPLE_LAYOUT_H*/
41 changes: 41 additions & 0 deletions examples/lv_examples.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @file lv_examples.h
*
*/

#ifndef LV_EXAMPLES_H
#define LV_EXAMPLES_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
* INCLUDES
*********************/
#include "styles/lv_example_style.h"
#include "get_started/lv_example_get_started.h"
#include "widgets/lv_example_widgets.h"
#include "layouts/lv_example_layout.h"

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

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

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

/**********************
* MACROS
**********************/

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

#endif /*LV_EXAMPLES_H*/
1 change: 1 addition & 0 deletions examples/styles/lv_example_style_10.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
typedef int _keep_pedantic_happy;
//#include "../../lv_examples.h"
//
///**
Expand Down
1 change: 1 addition & 0 deletions examples/styles/lv_example_style_6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typedef int _keep_pedantic_happy;
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/widgets/btnmatrix/lv_example_btnmatrix_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES


void event_cb(lv_obj_t * obj, lv_event_t e)
static void event_cb(lv_obj_t * obj, lv_event_t e)
{
if(e == LV_EVENT_DRAW_PART_BEGIN) {
lv_obj_draw_hook_dsc_t * dsc = lv_event_get_param();
Expand Down
3 changes: 1 addition & 2 deletions examples/widgets/img/lv_example_img_1.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#include "../../../lvgl.h"
#if LV_USE_IMG && LV_BUILD_EXAMPLES

/* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */
LV_IMG_DECLARE(img_cogwheel_argb);

void lv_example_img_1(void)
{
LV_IMG_DECLARE(img_cogwheel_argb);
lv_obj_t * img1 = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img1, &img_cogwheel_argb);
lv_obj_align(img1, NULL, LV_ALIGN_CENTER, 0, -20);
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/img/lv_example_img_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void lv_example_img_2(void)
lv_obj_align(intense_slider, blue_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0);

/* Now create the actual image */
LV_IMG_DECLARE(img_cogwheel_argb);
LV_IMG_DECLARE(img_cogwheel_argb)
img1 = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img1, &img_cogwheel_argb);
lv_obj_align(img1, NULL, LV_ALIGN_IN_RIGHT_MID, -20, 0);
Expand Down
3 changes: 2 additions & 1 deletion examples/widgets/img/lv_example_img_3.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "../../../lvgl.h"
#if LV_USE_IMG && LV_BUILD_EXAMPLES

LV_IMG_DECLARE(img_cogwheel_argb);

/**
* Show transformations (zoom and rotation) using a pivot point.
*/
void lv_example_img_3(void)
{
LV_IMG_DECLARE(img_cogwheel_argb);

/* Now create the actual image */
lv_obj_t * img = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img, &img_cogwheel_argb);
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/img/lv_example_img_4.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "../../../lvgl.h"
#if LV_USE_IMG && LV_BUILD_EXAMPLES

LV_IMG_DECLARE(img_skew_strip);

/**
* Image styling and offset
*/
void lv_example_img_4(void)
{
LV_IMG_DECLARE(img_skew_strip);

static lv_style_t style;
lv_style_init(&style);
lv_style_set_bg_color(&style, LV_COLOR_YELLOW);
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/keyboard/lv_example_keyboard_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
}
}

void lv_keyboard_example_1(void)
void lv_example_keyboard_1(void)
{
/*Create a keyboard to use it with an of the text areas*/
lv_obj_t *kb = lv_keyboard_create(lv_scr_act());
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/list/lv_example_list_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
LV_LOG_USER("Clicked: %s\n", lv_list_get_btn_text(obj));
}
}
void lv_list_example_1(void)
void lv_example_list_1(void)
{
/*Create a list*/
lv_obj_t * list1 = lv_list_create(lv_scr_act());
Expand Down
67 changes: 57 additions & 10 deletions examples/widgets/lv_example_widgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,92 @@ extern "C" {
**********************/
void lv_example_arc_1(void);
void lv_example_arc_2(void);

void lv_example_bar_1(void);
void lv_example_bar_2(void);
void lv_example_bar_3(void);
void lv_example_bar_4(void);
void lv_example_bar_5(void);
void lv_example_bar_6(void);

void lv_example_btn_1(void);
void lv_example_btn_2(void);
void lv_example_btn_3(void);

void lv_example_btnmatrix_1(void);
void lv_example_btnmatrix_2(void);
void lv_example_btnmatrix_3(void);

void lv_example_calendar_1(void);

void lv_example_canvas_1(void);
void lv_example_canvas_2(void);
void lv_example_checkbox_1(void);

void lv_example_chart_1(void);
void lv_example_chart_2(void);
void lv_example_chart_3(void);
void lv_example_chart_4(void);

void lv_example_checkbox_1(void);

void lv_example_colorwheel_1(void);

void lv_example_dropdown_1(void);
void lv_example_dropdown_2(void);
void lv_example_gauge_1(void);
void lv_example_gauge_2(void);
void lv_example_dropdown_3(void);

void lv_example_img_1(void);
void lv_example_img_2(void);
void lv_example_img_3(void);
void lv_example_img_4(void);

void lv_example_imgbtn_1(void);

void lv_example_keyboard_1(void);

void lv_example_label_1(void);
void lv_example_label_2(void);
void lv_example_label_3(void);

void lv_example_led_1(void);

void lv_example_line_1(void);

void lv_example_list_1(void);
void lv_example_linemeter_1(void);

void lv_example_meter_1(void);
void lv_example_meter_2(void);
void lv_example_meter_3(void);
void lv_example_meter_4(void);

void lv_example_msgbox_1(void);
void lv_example_msgbox_2(void);

void lv_example_obj_1(void);
void lv_example_spinner_1(void);

void lv_example_roller_1(void);
void lv_example_roller_2(void);

void lv_example_slider_1(void);
void lv_example_slider_2(void);
void lv_example_slider_3(void);

void lv_example_spinbox_1(void);

void lv_example_spinner_1(void);

void lv_example_switch_1(void);
void lv_example_textarea_1(void);
void lv_example_objmask_1(void);
void lv_example_objmask_2(void);

void lv_example_table_1(void);

void lv_example_tabview_1(void);

void lv_example_textarea_1(void);
void lv_example_textarea_2(void);
void lv_example_textarea_3(void);

void lv_example_tileview_1(void);

void lv_example_win_1(void);

/**********************
* MACROS
**********************/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "../../../lvgl.h"
#if LV_USE_ROLLER && LV_BUILD_EXAMPLES
#if LV_USE_ROLLER && LV_FONT_MONTSERRAT_22 && LV_BUILD_EXAMPLES

static void event_handler(lv_obj_t * obj, lv_event_t event)
{
Expand Down

0 comments on commit ca4f11e

Please sign in to comment.