summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_directfb/Ecore_DirectFB.h
blob: eace6595a17b8854162b170879e4ae39f945a03f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#ifndef _ECORE_DIRECTFB_H
#define _ECORE_DIRECTFB_H

#ifdef EAPI
#undef EAPI
#endif
#ifdef WIN32
# ifdef BUILDING_DLL
#  define EAPI __declspec(dllexport)
# else
#  define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

#include <Ecore_Data.h>
#include <directfb.h>


#ifdef __cplusplus
extern "C" {
#endif

EAPI extern int ECORE_DIRECTFB_EVENT_POSITION;
EAPI extern int ECORE_DIRECTFB_EVENT_SIZE;
EAPI extern int ECORE_DIRECTFB_EVENT_CLOSE;
EAPI extern int ECORE_DIRECTFB_EVENT_DESTROYED;
EAPI extern int ECORE_DIRECTFB_EVENT_GOT_FOCUS;
EAPI extern int ECORE_DIRECTFB_EVENT_LOST_FOCUS;
EAPI extern int ECORE_DIRECTFB_EVENT_KEY_DOWN;
EAPI extern int ECORE_DIRECTFB_EVENT_KEY_UP;
EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_DOWN;
EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_UP;
EAPI extern int ECORE_DIRECTFB_EVENT_MOTION;
EAPI extern int ECORE_DIRECTFB_EVENT_ENTER;
EAPI extern int ECORE_DIRECTFB_EVENT_LEAVE;
EAPI extern int ECORE_DIRECTFB_EVENT_WHEEL;

	

#ifndef _ECORE_DIRECTFB_WINDOW_PREDEF
typedef struct _Ecore_DirectFB_Window			Ecore_DirectFB_Window;
#endif
typedef struct _Ecore_DirectFB_Cursor			Ecore_DirectFB_Cursor;

typedef struct _Ecore_DirectFB_Event_Key_Down		Ecore_DirectFB_Event_Key_Down; 
typedef struct _Ecore_DirectFB_Event_Key_Up		Ecore_DirectFB_Event_Key_Up;
typedef struct _Ecore_DirectFB_Event_Button_Down	Ecore_DirectFB_Event_Button_Down;
typedef struct _Ecore_DirectFB_Event_Button_Up		Ecore_DirectFB_Event_Button_Up;
typedef struct _Ecore_DirectFB_Event_Motion		Ecore_DirectFB_Event_Motion;
typedef struct _Ecore_DirectFB_Event_Enter		Ecore_DirectFB_Event_Enter;
typedef struct _Ecore_DirectFB_Event_Leave		Ecore_DirectFB_Event_Leave;
typedef struct _Ecore_DirectFB_Event_Wheel		Ecore_DirectFB_Event_Wheel;
typedef struct _Ecore_DirectFB_Event_Got_Focus		Ecore_DirectFB_Event_Got_Focus;
typedef struct _Ecore_DirectFB_Event_Lost_Focus		Ecore_DirectFB_Event_Lost_Focus;


/* this struct is to keep windows data (id, window itself and surface) in memory as every call
 * to DirectFB for this values (e.g window->GetSurface(window,&surface)) will increment the
 * reference count, then we will have to release N times the data, so better we just ask for 
 them once */
struct _Ecore_DirectFB_Window
{
	DFBWindowID 		id;
	IDirectFBWindow		*window;
	IDirectFBSurface	*surface;
	Ecore_DirectFB_Cursor	*cursor;
	
};

struct _Ecore_DirectFB_Cursor
{
	IDirectFBSurface	*surface;
	int			hot_x;
	int			hot_y;

};

struct _Ecore_DirectFB_Event_Key_Down /** DirectFB Key Down event */
{
	char   *name; /**< The name of the key that was released */
   	char   *string; /**< The logical symbol of the key that was pressed */
	char   *key_compose; /**< The UTF-8 string conversion if any */
   	unsigned int time;
	DFBWindowID win;
};
   
struct _Ecore_DirectFB_Event_Key_Up /** DirectFB Key Up event */
{
	char   *name; /**< The name of the key that was released */
   	char   *string; /**< The logical symbol of the key that was pressed */
	char   *key_compose; /**< The UTF-8 string conversion if any */
   	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Button_Down
{
	int button;
	int modifiers;
	int x, y;
	unsigned int time;
	int double_click : 1;
	int triple_click : 1;
	DFBWindowID win;
};
struct _Ecore_DirectFB_Event_Button_Up
{
	int button;
	int modifiers;
	int x, y;
	unsigned int time;
	DFBWindowID win;
};
struct _Ecore_DirectFB_Event_Motion
{
	int modifiers;
	int x, y;
	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Enter
{
	int modifiers;
	int x, y;
	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Leave
{
	int modifiers;
	int x, y;
	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Wheel
{
	int direction;
	int z;
	int modifiers;
	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Got_Focus
{
	unsigned int time;
	DFBWindowID win;
};

struct _Ecore_DirectFB_Event_Lost_Focus
{
	unsigned int time;
	DFBWindowID win;
};

/* main functions */
EAPI int ecore_directfb_init(const char *name);
EAPI int ecore_directfb_shutdown(void);
EAPI IDirectFB * ecore_directfb_interface_get(void);
/* window operations */
EAPI Ecore_DirectFB_Window * ecore_directfb_window_new(int x, int y, int w, int h);
EAPI void ecore_directfb_window_del(Ecore_DirectFB_Window *window);
EAPI void ecore_directfb_window_move(Ecore_DirectFB_Window *window, int x, int y);
EAPI void ecore_directfb_window_resize(Ecore_DirectFB_Window *window, int w, int h);
EAPI void ecore_directfb_window_focus(Ecore_DirectFB_Window *window);
EAPI void ecore_directfb_window_show(Ecore_DirectFB_Window *window);
EAPI void ecore_directfb_window_hide(Ecore_DirectFB_Window *window);
EAPI void ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *window, int set);
EAPI void ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *window, int set);
EAPI void ecore_directfb_window_size_get(Ecore_DirectFB_Window *window, int *w, int *h);
EAPI void ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *window, int show);



#ifdef __cplusplus
}
#endif

#endif