537481758f3ea5c0db55c01338295e3e6a13c7a2
[framework/uifw/ecore.git] / src / lib / ecore_fb / Ecore_Fb.h
1 #ifndef _ECORE_FB_H
2 #define _ECORE_FB_H
3
4 #ifdef EAPI
5 #undef EAPI
6 #endif
7 #ifdef _MSC_VER
8 # ifdef BUILDING_DLL
9 #  define EAPI __declspec(dllexport)
10 # else
11 #  define EAPI __declspec(dllimport)
12 # endif
13 #else
14 # ifdef __GNUC__
15 #  if __GNUC__ >= 4
16 #   define EAPI __attribute__ ((visibility("default")))
17 #  else
18 #   define EAPI
19 #  endif
20 # else
21 #  define EAPI
22 # endif
23 #endif
24
25 /**
26  * @file
27  * @brief Ecore frame buffer system functions.
28  */
29
30 /* FIXME:
31  * maybe a new module?
32  * - code to get battery info
33  * - code to get thermal info
34  * ecore evas fb isnt good enough for weird things, like multiple fb's, same happens here.
35  * backlight support using new kernel interface
36  * absolute axis
37  * joystick
38  * ecore_fb_li_device_close_all ? or a shutdown of the subsystem?
39  *
40  */
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 typedef struct _Ecore_Fb_Input_Device Ecore_Fb_Input_Device; /* an input device handler */
47
48 /* device capabilities */
49 enum _Ecore_Fb_Input_Device_Cap
50 {
51    ECORE_FB_INPUT_DEVICE_CAP_NONE            = 0x00000000,
52      ECORE_FB_INPUT_DEVICE_CAP_RELATIVE        = 0x00000001,
53      ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE        = 0x00000002,
54      ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS = 0x00000004
55 };
56 typedef enum   _Ecore_Fb_Input_Device_Cap Ecore_Fb_Input_Device_Cap;
57
58 EAPI extern int ECORE_FB_EVENT_KEY_DOWN; /**< FB Key Down event */
59 EAPI extern int ECORE_FB_EVENT_KEY_UP; /**< FB Key Up event */
60 EAPI extern int ECORE_FB_EVENT_MOUSE_BUTTON_DOWN; /**< FB Mouse Down event */
61 EAPI extern int ECORE_FB_EVENT_MOUSE_BUTTON_UP; /**< FB Mouse Up event */
62 EAPI extern int ECORE_FB_EVENT_MOUSE_MOVE; /**< FB Mouse Move event */
63 EAPI extern int ECORE_FB_EVENT_MOUSE_WHEEL; /**< FB Mouse Wheel event */
64
65 typedef struct _Ecore_Fb_Event_Key_Down          Ecore_Fb_Event_Key_Down; /**< FB Key Down event */
66 typedef struct _Ecore_Fb_Event_Key_Up            Ecore_Fb_Event_Key_Up; /**< FB Key Up event */
67 typedef struct _Ecore_Fb_Event_Mouse_Button_Down Ecore_Fb_Event_Mouse_Button_Down; /**< FB Mouse Down event */
68 typedef struct _Ecore_Fb_Event_Mouse_Button_Up   Ecore_Fb_Event_Mouse_Button_Up; /**< FB Mouse Up event */
69 typedef struct _Ecore_Fb_Event_Mouse_Move        Ecore_Fb_Event_Mouse_Move; /**< FB Mouse Move event */
70 typedef struct _Ecore_Fb_Event_Mouse_Wheel       Ecore_Fb_Event_Mouse_Wheel; /**< FB Mouse Wheel event */
71
72 struct _Ecore_Fb_Event_Key_Down /** FB Key Down event */
73 {
74    Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
75    char   *keyname; /**< The name of the key that was pressed */
76    char   *keysymbol; /**< The logical symbol of the key that was pressed */
77    char   *key_compose; /**< The UTF-8 string conversion if any */
78 };
79    
80 struct _Ecore_Fb_Event_Key_Up /** FB Key Up event */
81 {
82    Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
83    char   *keyname; /**< The name of the key that was released */
84    char   *keysymbol; /**< The logical symbol of the key that was pressed */
85    char   *key_compose; /**< The UTF-8 string conversion if any */
86 };
87    
88 struct _Ecore_Fb_Event_Mouse_Button_Down /** FB Mouse Down event */
89 {
90    Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
91    int     button; /**< Mouse button that was pressed (1 - 32) */
92    int     x; /**< Mouse co-ordinates when mouse button was pressed */
93    int     y; /**< Mouse co-ordinates when mouse button was pressed */
94    int     double_click : 1; /**< Set if click was a double click */
95    int     triple_click : 1; /**< Set if click was a triple click  */
96 };
97    
98 struct _Ecore_Fb_Event_Mouse_Button_Up /** FB Mouse Up event */
99 {
100    Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
101    int     button; /**< Mouse button that was released (1 - 32) */
102    int     x; /**< Mouse co-ordinates when mouse button was raised */
103    int     y; /**< Mouse co-ordinates when mouse button was raised */
104 };
105    
106 struct _Ecore_Fb_Event_Mouse_Move /** FB Mouse Move event */ 
107 {
108    Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
109    int     x; /**< Mouse co-ordinates where the mouse cursor moved to */
110    int     y; /**< Mouse co-ordinates where the mouse cursor moved to */
111 };
112    
113 struct _Ecore_Fb_Event_Mouse_Wheel /** FB Mouse Wheel event */
114 {
115    Ecore_Fb_Input_Device *dev;
116    int x,y;
117    int direction; /* 0 = vertical, 1 = horizontal */
118    int wheel; /* value 1 (left/up), -1 (right/down) */
119 };
120
121 /* ecore_fb_vt.c */
122 EAPI void ecore_fb_callback_gain_set(void (*func) (void *data), void *data);
123 EAPI void ecore_fb_callback_lose_set(void (*func) (void *data), void *data);
124 /* ecore_fb_li.c */
125 EAPI Ecore_Fb_Input_Device           *ecore_fb_input_device_open(const char *dev);
126 EAPI void                             ecore_fb_input_device_close(Ecore_Fb_Input_Device *dev);
127 EAPI void                             ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, int listen);
128 EAPI const char                      *ecore_fb_input_device_name_get(Ecore_Fb_Input_Device *dev);
129 EAPI Ecore_Fb_Input_Device_Cap        ecore_fb_input_device_cap_get(Ecore_Fb_Input_Device *dev);
130 EAPI void                             ecore_fb_input_device_axis_size_set(Ecore_Fb_Input_Device *dev, int w, int h);
131 EAPI void                             ecore_fb_input_threshold_click_set(Ecore_Fb_Input_Device *dev, double threshold);
132 EAPI double                           ecore_fb_input_threshold_click_get(Ecore_Fb_Input_Device *dev);
133 /* ecore_fb.c */
134 EAPI int    ecore_fb_init(const char *name);
135 EAPI int    ecore_fb_shutdown(void);
136 EAPI void   ecore_fb_size_get(int *w, int *h);   
137
138 EAPI void   ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int ytrans, int xyswap);
139 EAPI void   ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int *ytrans, int *xyswap);
140    
141 #ifdef __cplusplus
142 }
143 #endif
144
145 #endif