1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/src/lv_core/lv_disp.h

142 lines
3.7 KiB
C
Raw Normal View History

2019-02-07 19:17:10 +01:00
/**
* @file lv_disp.h
*
*/
#ifndef LV_DISP_H
#define LV_DISP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
2019-02-10 11:06:47 +01:00
#include "../lv_hal/lv_hal.h"
2019-02-12 16:20:59 +01:00
#include "lv_obj.h"
2019-02-07 19:17:10 +01:00
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
2019-02-20 23:58:13 +01:00
* Return with a pointer to the active screen
2019-04-04 07:15:40 +02:00
* @param disp pointer to display which active screen should be get. (NULL to use the default
* screen)
2019-02-20 23:58:13 +01:00
* @return pointer to the active screen object (loaded by 'lv_scr_load()')
*/
lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp);
/**
* Make a screen active
* @param scr pointer to a screen
*/
2019-02-20 23:58:13 +01:00
void lv_disp_set_scr_act(lv_obj_t * scr);
/**
2019-02-20 23:58:13 +01:00
* Return with the top layer. (Same on every screen and it is above the normal screen layer)
* @param disp pointer to display which top layer should be get. (NULL to use the default screen)
* @return pointer to the top layer object (transparent screen sized lv_obj)
*/
2019-02-20 23:58:13 +01:00
lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp);
/**
2019-04-04 07:15:40 +02:00
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top
* layer)
2019-02-20 23:58:13 +01:00
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
* @return pointer to the sys layer object (transparent screen sized lv_obj)
*/
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
/**
* Assign a screen to a display.
* @param disp pointer to a display where to assign the screen
* @param scr pointer to a screen object to assign
*/
void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr);
/**
* Get a pointer to the screen refresher task to
* modify its parameters with `lv_task_...` functions.
* @param disp pointer to a display
* @return pointer to the display refresher task. (NULL on error)
*/
2019-04-04 07:15:40 +02:00
lv_task_t * lv_disp_get_refr_task(lv_disp_t * disp);
/**
* Get elapsed time since last user activity on a display (e.g. click)
* @param disp pointer to an display (NULL to get the overall smallest inactivity)
* @return elapsed ticks (milliseconds) since the last activity
*/
uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp);
/**
* Manually trigger an activity on a display
* @param disp pointer to an display (NULL to use the default display)
*/
2019-04-04 07:10:34 +02:00
void lv_disp_trig_activity(lv_disp_t * disp);
2019-02-25 06:50:20 +01:00
/*------------------------------------------------
* To improve backward compatibility
* Recommended only if you have one display
*------------------------------------------------*/
/**
* Get the active screen of the default display
* @return pointer to the active screen
*/
static inline lv_obj_t * lv_scr_act(void)
{
return lv_disp_get_scr_act(lv_disp_get_default());
}
/**
* Get the top layer of the default display
* @return pointer to the top layer
*/
2019-02-27 10:25:21 +01:00
static inline lv_obj_t * lv_layer_top(void)
2019-02-25 06:50:20 +01:00
{
return lv_disp_get_layer_top(lv_disp_get_default());
}
/**
* Get the active screen of the deafult display
* @return pointer to the sys layer
*/
2019-02-27 10:25:21 +01:00
static inline lv_obj_t * lv_layer_sys(void)
2019-02-25 06:50:20 +01:00
{
return lv_disp_get_layer_sys(lv_disp_get_default());
}
2019-02-27 10:25:21 +01:00
static inline void lv_scr_load(lv_obj_t * scr)
{
lv_disp_set_scr_act(scr);
}
2019-02-07 19:17:10 +01:00
/**********************
* MACROS
**********************/
2019-02-25 06:50:20 +01:00
/*------------------------------------------------
* To improve backward compatibility
* Recommended only if you have one display
*------------------------------------------------*/
2019-02-27 10:25:21 +01:00
#define LV_HOR_RES lv_disp_get_hor_res(lv_disp_get_default())
#define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default())
2019-02-07 19:17:10 +01:00
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/