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

115 lines
2.9 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
* @param disp pointer to display which active screen should be get. (NULL to use the default screen)
* @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);
/**
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top layer)
* @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);
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
*/
static inline lv_obj_t * lv_top_layer(void)
{
return lv_disp_get_layer_top(lv_disp_get_default());
}
/**
* Get the active screen of the deafult display
* @return pointer to the sys layer
*/
static inline lv_obj_t * lv_sys_layer(void)
{
return lv_disp_get_layer_sys(lv_disp_get_default());
}
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
*------------------------------------------------*/
#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*/