1 /**
2  * @file lv_uefi_indev.h
3  *
4  */
5 
6 #ifndef __LV_UEFI_INDEV_H__
7 #define __LV_UEFI_INDEV_H__
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../../indev/lv_indev.h"
18 
19 #if LV_USE_UEFI
20 
21 #include "lv_uefi.h"
22 
23 /*********************
24  *      DEFINES
25  *********************/
26 
27 /**********************
28  *      TYPEDEFS
29  **********************/
30 
31 /**********************
32  * GLOBAL PROTOTYPES
33  **********************/
34 
35 /**
36  * @brief Create an indev object.
37  * @param display_res The resolution of the display in pixels, needed to scale the input.
38  * If NULL the resolution of the current default display will be used.
39  * @return The created LVGL indev object.
40 */
41 lv_indev_t * lv_uefi_simple_pointer_indev_create(lv_point_t * display_res);
42 
43 /**
44  * @brief Add an EFI_SIMPLE_POINTER_PROTOCOL interface to the indev.
45  * @param indev Indev that was created with lv_uefi_simple_pointer_indev_create.
46  * @param handle The handle on which an instance of the EFI_SIMPLE_POINTER_PROTOCOL protocol is installed.
47  * @return True if the interface was added.
48 */
49 bool lv_uefi_simple_pointer_indev_add_handle(lv_indev_t * indev, EFI_HANDLE handle);
50 
51 /**
52  * @brief Add all available EFI_SIMPLE_POINTER_PROTOCOL interfaces to the indev.
53  * @param indev Indev that was created with lv_uefi_simple_pointer_indev_create.
54 */
55 void lv_uefi_simple_pointer_indev_add_all(lv_indev_t * indev);
56 
57 /**
58  * @brief Create a LVGL indev object.
59  * @param display_res The resolution of the display in pixels, needed to scale the input.
60  * @return The created LVGL indev object.
61 */
62 lv_indev_t * lv_uefi_absolute_pointer_indev_create(lv_point_t * display_res);
63 
64 /**
65  * @brief Add an EFI_ABSOLUTE_POINTER_PROTOCOL interface to the indev.
66  * @param indev Indev that was created with lv_uefi_absolute_pointer_indev_create.
67  * @param handle The handle on which an instance of the EFI_ABSOLUTE_POINTER_PROTOCOL protocol is installed.
68  * @return True if the interface was added.
69 */
70 bool lv_uefi_absolute_pointer_indev_add_handle(lv_indev_t * indev, EFI_HANDLE handle);
71 
72 /**
73  * @brief Add all available EFI_ABSOLUTE_POINTER_PROTOCOL interfaces to the indev.
74  * @param indev Indev that was created with lv_uefi_absolute_pointer_indev_create.
75 */
76 void lv_uefi_absolute_pointer_indev_add_all(lv_indev_t * indev);
77 
78 /**
79  * @brief Create an indev object.
80  * @return The created LVGL indev object.
81 */
82 lv_indev_t * lv_uefi_simple_text_input_indev_create(void);
83 
84 /**
85  * @brief Add an EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL interface to the indev.
86  * @param indev Indev that was created with lv_uefi_simple_text_input_indev_create.
87  * @param handle The handle on which an instance of the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL protocol is installed.
88  * @return True if the interface was added.
89 */
90 bool lv_uefi_simple_text_input_indev_add_handle(lv_indev_t * indev, EFI_HANDLE handle);
91 
92 /**
93  * @brief Add all available EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL interfaces to the indev.
94  * @param indev Indev that was created with lv_uefi_simple_text_input_indev_create.
95 */
96 void lv_uefi_simple_text_input_indev_add_all(lv_indev_t * indev);
97 
98 /**********************
99  *      MACROS
100  **********************/
101 
102 #endif
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif //__LV_UEFI_INDEV_H__