1 /**
2  * @file lv_x11.h
3  *
4  */
5 
6 #ifndef LV_X11_H
7 #define LV_X11_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../../display/lv_display.h"
18 #include "../../indev/lv_indev.h"
19 #include "../../draw/lv_image_dsc.h"
20 
21 #if LV_USE_X11
22 
23 /*********************
24  *      DEFINES
25  *********************/
26 
27 /** Header of private display driver user data - for internal use only */
28 typedef struct {
29     struct _XDisplay   *  display;  /**< X11 display object     */
30     struct _x11_inp_data * inp_data; /**< input user data object */
31 } _x11_user_hdr_t;
32 
33 /** optional window close callback function type
34  *  @see lv_x11_window_set_close_cb
35 */
36 typedef void(*lv_x11_close_cb)(void * user_data);
37 
38 /**********************
39  * GLOBAL PROTOTYPES
40  **********************/
41 
42 /**
43  * create and add keyboard, mouse and scrollwheel objects and connect them to x11 display.
44  *
45  * This is a convenience method handling the typical input initialisation of an X11 window:
46  * - create keyboard (lv_x11_keyboard_create)
47  * - create mouse (with scrollwheel, lv_x11_mouse_create lv_x11_mousewheel_create)
48  *
49  * @param[in] disp      the created X11 display object from @ref lv_x11_window_create
50  * @param[in] mouse_img optional image description for the mouse cursor (NULL for no/invisible mouse cursor)
51  */
52 void lv_x11_inputs_create(lv_display_t * disp, lv_image_dsc_t const * mouse_img);
53 
54 /**
55  * create the X11 display
56  *
57  * The minimal initialisation for initializing the X11 display driver with keyboard/mouse support:
58  * @code
59  * lv_display_t* disp = lv_x11_window_create("My Window Title", window_width, window_width);
60  * lv_x11_inputs_create(disp, NULL);
61  * @endcode
62  * or with mouse cursor icon:
63  * @code
64  * lv_image_dsc_t mouse_symbol = {.....};
65  * lv_display_t* disp = lv_x11_window_create("My Window Title", window_width, window_width);
66  * lv_x11_inputs_create(disp, &mouse_symbol);
67  * @endcode
68  *
69  * @param[in] title    title of the created X11 window
70  * @param[in] hor_res  horizontal resolution (=width) of the X11 window
71  * @param[in] ver_res  vertical resolution (=height) of the X11 window
72  * @return             pointer to the display object
73  */
74 lv_display_t * lv_x11_window_create(char const * title, int32_t hor_res, int32_t ver_res);
75 
76 #endif /* LV_USE_X11 */
77 
78 #ifdef __cplusplus
79 } /* extern "C" */
80 #endif
81 
82 #endif /* LV_X11_H */
83