Tizen 2.1 release
[platform/core/uifw/e17.git] / src / bin / e_zone.h
1 #ifdef E_TYPEDEFS
2
3 typedef enum _E_Zone_Edge
4 {
5    E_ZONE_EDGE_NONE,
6    E_ZONE_EDGE_LEFT,
7    E_ZONE_EDGE_RIGHT,
8    E_ZONE_EDGE_TOP,
9    E_ZONE_EDGE_BOTTOM,
10    E_ZONE_EDGE_TOP_LEFT,
11    E_ZONE_EDGE_TOP_RIGHT,
12    E_ZONE_EDGE_BOTTOM_RIGHT,
13    E_ZONE_EDGE_BOTTOM_LEFT
14 } E_Zone_Edge;
15
16 typedef struct _E_Zone                      E_Zone;
17
18 typedef struct _E_Event_Zone_Desk_Count_Set E_Event_Zone_Desk_Count_Set;
19 typedef struct _E_Event_Zone_Move_Resize    E_Event_Zone_Move_Resize;
20 typedef struct _E_Event_Zone_Add            E_Event_Zone_Add;
21 typedef struct _E_Event_Zone_Del            E_Event_Zone_Del;
22 /* TODO: Move this to a general place? */
23 typedef struct _E_Event_Pointer_Warp        E_Event_Pointer_Warp;
24 typedef struct _E_Event_Zone_Edge           E_Event_Zone_Edge;
25 #ifdef _F_ZONE_WINDOW_ROTATION_
26 typedef struct _E_Event_Zone_Rotation_Change E_Event_Zone_Rotation_Change;
27 #endif
28
29 #else
30 #ifndef E_ZONE_H
31 #define E_ZONE_H
32
33 #define E_ZONE_TYPE (int)0xE0b0100d
34
35 struct _E_Zone
36 {
37    E_Object     e_obj_inherit;
38
39    int          x, y, w, h;
40    const char  *name;
41    /* num matches the id of the xinerama screen
42     * this zone belongs to. */
43    unsigned int num;
44    E_Container *container;
45    int          fullscreen;
46
47    Evas_Object *bg_object;
48    Evas_Object *bg_event_object;
49    Evas_Object *bg_clip_object;
50    Evas_Object *prev_bg_object;
51    Evas_Object *transition_object;
52
53    int          desk_x_count, desk_y_count;
54    int          desk_x_current, desk_y_current;
55    E_Desk     **desks;
56
57    Eina_List   *handlers;
58
59    struct
60    {
61       unsigned char      switching : 1;
62       E_Shelf           *es;
63       E_Event_Zone_Edge *ev;
64       E_Binding_Edge    *bind;
65    } flip;
66
67    struct
68    {
69       Ecore_X_Window top, right, bottom, left;
70    } edge;
71    struct
72    {
73       Ecore_X_Window left_top, top_left, top_right, right_top,
74                      right_bottom, bottom_right, bottom_left, left_bottom;
75    } corner;
76
77    E_Action      *cur_mouse_action;
78    Eina_List     *popups;
79
80    Ecore_Evas    *black_ecore_evas;
81    Evas          *black_evas;
82    Ecore_X_Window black_win;
83    int            black_need;
84    int            id;
85
86    struct
87    {
88       int       x, y, w, h;
89       Eina_Bool dirty : 1;
90    } useful_geometry;
91 #ifdef _F_ZONE_WINDOW_ROTATION_
92    struct
93    {
94       int       prev, curr, next;
95       Eina_Bool wait_for_done : 1;
96       Eina_Bool pending : 1;
97    } rot;
98 #endif
99 };
100
101 struct _E_Event_Zone_Desk_Count_Set
102 {
103    E_Zone *zone;
104 };
105
106 struct _E_Event_Zone_Move_Resize
107 {
108    E_Zone *zone;
109 };
110
111 struct _E_Event_Zone_Add
112 {
113    E_Zone *zone;
114 };
115
116 struct _E_Event_Zone_Del
117 {
118    E_Zone *zone;
119 };
120
121 struct _E_Event_Pointer_Warp
122 {
123    struct
124    {
125       int x, y;
126    } prev;
127    struct
128    {
129       int x, y;
130    } curr;
131 };
132
133 struct _E_Event_Zone_Edge
134 {
135    E_Zone     *zone;
136    E_Zone_Edge edge;
137    int         x, y;
138    int         modifiers;
139    int         button;
140 };
141
142 #ifdef _F_ZONE_WINDOW_ROTATION_
143 struct _E_Event_Zone_Rotation_Change
144 {
145    E_Zone     *zone;
146 };
147 #endif
148
149 EINTERN int    e_zone_init(void);
150 EINTERN int    e_zone_shutdown(void);
151 EAPI E_Zone   *e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h);
152 EAPI void      e_zone_name_set(E_Zone *zone, const char *name);
153 EAPI void      e_zone_move(E_Zone *zone, int x, int y);
154 EAPI void      e_zone_resize(E_Zone *zone, int w, int h);
155 EAPI void      e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h);
156 EAPI void      e_zone_fullscreen_set(E_Zone *zone, int on);
157 EAPI E_Zone   *e_zone_current_get(E_Container *con);
158 EAPI void      e_zone_bg_reconfigure(E_Zone *zone);
159 EAPI void      e_zone_flip_coords_handle(E_Zone *zone, int x, int y);
160 EAPI void      e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count);
161 EAPI void      e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count);
162 EAPI void      e_zone_desk_flip_by(E_Zone *zone, int dx, int dy);
163 EAPI void      e_zone_desk_flip_to(E_Zone *zone, int x, int y);
164 EAPI void      e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
165 EAPI void      e_zone_desk_linear_flip_to(E_Zone *zone, int x);
166 EAPI void      e_zone_edge_flip_eval(E_Zone *zone);
167 EAPI void      e_zone_edge_new(E_Zone_Edge edge);
168 EAPI void      e_zone_edge_free(E_Zone_Edge edge);
169 EAPI void      e_zone_edge_enable(void);
170 EAPI void      e_zone_edge_disable(void);
171 EAPI void      e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b);
172 EAPI Eina_Bool e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge);
173 EAPI void      e_zone_edge_win_layer_set(E_Zone *zone, int layer);
174
175 EAPI void      e_zone_useful_geometry_dirty(E_Zone *zone);
176 EAPI void      e_zone_useful_geometry_get(E_Zone *zone, int *x, int *y, int *w, int *h);
177
178 #ifdef _F_ZONE_WINDOW_ROTATION_
179 EAPI void      e_zone_rotation_set(E_Zone *zone, int rot);
180 EAPI int       e_zone_rotation_get(E_Zone *zone);
181 EAPI void      e_zone_rotation_update_done(E_Zone *zone);
182 EAPI void      e_zone_rotation_update_cancel(E_Zone *zone);
183 #endif
184
185 extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
186 extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;
187 extern EAPI int E_EVENT_ZONE_ADD;
188 extern EAPI int E_EVENT_ZONE_DEL;
189 extern EAPI int E_EVENT_POINTER_WARP;
190 extern EAPI int E_EVENT_ZONE_EDGE_IN;
191 extern EAPI int E_EVENT_ZONE_EDGE_OUT;
192 extern EAPI int E_EVENT_ZONE_EDGE_MOVE;
193 #ifdef _F_ZONE_WINDOW_ROTATION_
194 extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE;
195 #endif
196
197 #endif
198 #endif