2016-06-08 07:25:08 +02:00
|
|
|
/**
|
|
|
|
* @file lv_page.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_PAGE_H
|
|
|
|
#define LV_PAGE_H
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2016-06-10 15:00:56 +02:00
|
|
|
#include "lv_conf.h"
|
2016-06-08 07:25:08 +02:00
|
|
|
#if USE_LV_PAGE != 0
|
|
|
|
|
|
|
|
#include "../lv_obj/lv_obj.h"
|
|
|
|
#include "lv_rect.h"
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
LV_PAGE_SB_MODE_OFF,
|
|
|
|
LV_PAGE_SB_MODE_ON,
|
|
|
|
LV_PAGE_SB_MODE_AUTO,
|
|
|
|
}lv_page_sb_mode_t;
|
|
|
|
|
2016-12-19 11:58:11 +01:00
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
/*Style of page*/
|
2016-06-08 07:25:08 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-10-04 09:45:39 +02:00
|
|
|
lv_rects_t bg_rects; /*Style of ancestor*/
|
|
|
|
/*New style element for this type */
|
2017-01-01 22:56:09 +01:00
|
|
|
lv_rects_t scrl_rects;
|
2016-06-08 07:25:08 +02:00
|
|
|
lv_rects_t sb_rects;
|
|
|
|
cord_t sb_width;
|
|
|
|
lv_page_sb_mode_t sb_mode;
|
|
|
|
uint8_t sb_opa;
|
|
|
|
}lv_pages_t;
|
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
/*Built-in styles of page*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
LV_PAGES_DEF,
|
2017-01-01 22:56:09 +01:00
|
|
|
LV_PAGES_SIMPLE,
|
2016-10-07 11:15:46 +02:00
|
|
|
LV_PAGES_TRANSP,
|
|
|
|
}lv_pages_builtin_t;
|
2016-06-08 07:25:08 +02:00
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
/*Data of page*/
|
2016-06-08 07:25:08 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-10-04 09:45:39 +02:00
|
|
|
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
|
|
|
|
/*New data for this type */
|
2017-01-01 22:56:09 +01:00
|
|
|
lv_obj_t * scrl; /*The scrollable object on the background*/
|
2016-12-18 22:07:03 +01:00
|
|
|
lv_action_t rel_action;
|
|
|
|
lv_action_t pr_action;
|
2016-10-04 09:45:39 +02:00
|
|
|
area_t sbh; /*Horizontal scrollbar*/
|
|
|
|
area_t sbv; /*Vertical scrollbar*/
|
|
|
|
uint8_t sbh_draw :1; /*1: horizontal scrollbar is visible now*/
|
|
|
|
uint8_t sbv_draw :1; /*1: vertical scrollbar is visible now*/
|
2016-06-15 09:38:20 +02:00
|
|
|
}lv_page_ext_t;
|
2016-06-08 07:25:08 +02:00
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
/*Create function*/
|
2016-10-07 11:15:46 +02:00
|
|
|
lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy);
|
|
|
|
lv_pages_t * lv_pages_get(lv_pages_builtin_t style, lv_pages_t * copy);
|
2016-12-15 10:31:30 +01:00
|
|
|
bool lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param);
|
2016-06-08 07:25:08 +02:00
|
|
|
|
2016-12-18 22:07:03 +01:00
|
|
|
void lv_page_set_rel_action(lv_obj_t * page, lv_action_t rel_action);
|
|
|
|
void lv_page_set_pr_action(lv_obj_t * page, lv_action_t pr_action);
|
2016-12-17 21:22:16 +01:00
|
|
|
void lv_page_glue_obj(lv_obj_t * page, bool glue);
|
|
|
|
void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, bool anim_en);
|
2017-01-01 22:56:09 +01:00
|
|
|
lv_obj_t * lv_page_get_scrl(lv_obj_t * page);
|
2016-12-17 10:50:28 +01:00
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|