2 typedef struct _E_Comp E_Comp;
3 typedef struct _E_Comp_Wl_Client_Data E_Comp_Client_Data;
4 typedef struct _E_Comp_Wl_Data E_Comp_Wl_Data;
5 typedef struct _E_Comp_Connected_Client_Info E_Comp_Connected_Client_Info;
7 # define E_COMP_TYPE (int) 0xE0b01003
9 # define E_LAYER_COUNT 24
10 # define E_CLIENT_LAYER_COUNT 16
14 E_LAYER_BOTTOM = -100,
15 E_LAYER_BG = -1, // zone bg stuff
16 E_LAYER_DESKTOP = 0, // desktop objects: fileman, gadgets, shelves
17 E_LAYER_DESKTOP_TOP = 10, // raised desktop objects: gadgets
18 E_LAYER_CLIENT_DESKTOP = 100, //shelves
19 E_LAYER_CLIENT_BELOW = 150,
20 E_LAYER_CLIENT_NORMAL = 200,
21 E_LAYER_CLIENT_ABOVE = 250,
22 E_LAYER_CLIENT_EDGE = 300,
23 E_LAYER_CLIENT_FULLSCREEN = 350,
24 E_LAYER_CLIENT_EDGE_FULLSCREEN = 400,
25 E_LAYER_CLIENT_POPUP = 450,
26 E_LAYER_CLIENT_TOP = 500,
27 E_LAYER_CLIENT_DRAG = 550,
28 E_LAYER_CLIENT_PRIO = 600,
29 E_LAYER_CLIENT_NOTIFICATION_LOW = 650,
30 E_LAYER_CLIENT_NOTIFICATION_NORMAL = 700,
31 E_LAYER_CLIENT_NOTIFICATION_HIGH = 750,
32 E_LAYER_CLIENT_NOTIFICATION_TOP = 800,
33 E_LAYER_CLIENT_ALERT = 850,
34 E_LAYER_POPUP = 999, // popups
35 E_LAYER_EFFECT = 1999,
36 E_LAYER_MENU = 5000, // menus
37 E_LAYER_DESKLOCK = 9999, // desklock
38 E_LAYER_MAX = 32767 // EVAS_LAYER_MAX
45 # include "e_comp_cfdata.h"
47 extern E_API int E_EVENT_COMPOSITOR_DISABLE;
48 extern E_API int E_EVENT_COMPOSITOR_ENABLE;
49 extern E_API int E_EVENT_COMPOSITOR_FPS_UPDATE;
51 typedef void (*E_Comp_Cb)(void);
53 typedef struct _E_Comp_Hook E_Comp_Hook;
55 typedef enum _E_Comp_Hook_Point
57 E_COMP_HOOK_PREPARE_PLANE,
61 typedef void (*E_Comp_Hook_Cb)(void *data, E_Comp *c);
66 E_Comp_Hook_Point hookpoint;
69 unsigned char delete_me : 1;
74 E_Object e_obj_inherit;
77 Ecore_Window win; // input overlay
83 Evas_Object *bg_blank_object;
87 unsigned int new_clients;
89 Eina_List *pre_render_cbs; /* E_Comp_Cb */
91 E_Comp_Wl_Data *wl_comp_data;
93 E_Pixmap_Type comp_type; //for determining X/Wayland/
95 Eina_Stringshare *name;
98 Eina_Inlist *clients; /* E_Client, bottom to top */
99 unsigned int clients_count;
100 } layers[E_LAYER_COUNT];
106 Ecore_Event_Handler *key_handler;
107 E_Comp_Object_Autoclose_Cb del_cb;
108 E_Comp_Object_Key_Cb key_cb;
112 Eina_List *debug_rects;
113 Eina_List *ignore_wins;
116 Eina_List *post_updates;
117 Ecore_Animator *render_animator;
118 Ecore_Job *shape_job;
119 Ecore_Job *update_job;
122 Ecore_Job *screen_job;
123 Ecore_Timer *nocomp_delay_timer;
124 Ecore_Timer *nocomp_override_timer;
125 Ecore_Timer *selcomp_delay_timer;
126 Ecore_Timer *selcomp_override_timer;
128 double frametimes[122];
132 int nocomp_override; //number of times nocomp override has been requested
133 Ecore_Window block_win;
134 int block_count; //number of times block window has been requested
136 Ecore_Window cm_selection; //FIXME: move to comp_x ?
139 int hwc_override; //number of times hwc override has been requested
143 unsigned int input_key_grabs;
144 unsigned int input_mouse_grabs;
147 E_Comp_Cb bindings_grab_cb;
148 E_Comp_Cb bindings_ungrab_cb;
151 Eina_Bool grabbed : 1;
152 Eina_Bool nocomp : 1;
153 Eina_Bool nocomp_want : 1;
154 Eina_Bool selcomp_want : 1;
156 Eina_Bool shape_queue_blocked : 1;
157 Eina_Bool calc_fps : 1;
159 Eina_Bool hwc_fs : 1; // active hwc policy
161 Eina_List *connected_clients;
162 Eina_List *launchscrns; // list of dummy clients for launchscreen image.
165 struct _E_Comp_Connected_Client_Info
175 E_COMP_ENGINE_NONE = 0,
176 E_COMP_ENGINE_SW = 1,
180 extern E_API E_Comp *e_comp;
181 extern E_API E_Comp_Wl_Data *e_comp_wl;
183 EINTERN Eina_Bool e_comp_init(void);
184 E_API E_Comp *e_comp_new(void);
185 E_API int e_comp_internal_save(void);
186 EINTERN int e_comp_shutdown(void);
187 E_API void e_comp_deferred_job(void);
188 E_API void e_comp_render_queue(void);
189 E_API void e_comp_client_post_update_add(E_Client *ec);
190 E_API void e_comp_shape_queue(void);
191 E_API void e_comp_shape_queue_block(Eina_Bool block);
192 E_API E_Comp_Config *e_comp_config_get(void);
193 E_API const Eina_List *e_comp_list(void);
194 E_API void e_comp_shadows_reset(void);
195 E_API Ecore_Window e_comp_top_window_at_xy_get(Evas_Coord x, Evas_Coord y);
196 E_API void e_comp_util_wins_print(void);
197 E_API void e_comp_ignore_win_add(E_Pixmap_Type type, Ecore_Window win);
198 E_API void e_comp_ignore_win_del(E_Pixmap_Type type, Ecore_Window win);
199 E_API Eina_Bool e_comp_ignore_win_find(Ecore_Window win);
200 E_API void e_comp_override_del(void);
201 E_API void e_comp_override_add(void);
202 E_API E_Comp *e_comp_find_by_window(Ecore_Window win);
203 E_API void e_comp_override_timed_pop(void);
204 E_API unsigned int e_comp_e_object_layer_get(const E_Object *obj);
205 E_API void e_comp_layer_name_get(unsigned int layer, char *buff, int buff_size);
206 E_API Eina_Bool e_comp_grab_input(Eina_Bool mouse, Eina_Bool kbd);
207 E_API void e_comp_ungrab_input(Eina_Bool mouse, Eina_Bool kbd);
208 E_API void e_comp_gl_set(Eina_Bool set);
209 E_API Eina_Bool e_comp_gl_get(void);
211 E_API void e_comp_button_bindings_grab_all(void);
212 E_API void e_comp_button_bindings_ungrab_all(void);
213 E_API void e_comp_client_redirect_toggle(E_Client *ec);
214 E_API Eina_Bool e_comp_util_object_is_above_nocomp(Evas_Object *obj);
216 E_API Eina_Bool e_comp_util_kbd_grabbed(void);
217 E_API Eina_Bool e_comp_util_mouse_grabbed(void);
219 E_API void e_comp_nocomp_end(const char *location);
221 static inline Eina_Bool
222 e_comp_util_client_is_fullscreen(const E_Client *ec)
224 if ((!ec->visible) || (ec->input_only))
226 return ((ec->client.x == 0) && (ec->client.y == 0) &&
227 ((ec->client.w) >= e_comp->w) &&
228 ((ec->client.h) >= e_comp->h) &&
229 (!ec->argb) && (!ec->shaped)
233 E_API void e_comp_post_update_add(E_Client *ec);
234 E_API void e_comp_post_update_purge(E_Client *ec);
236 E_API E_Comp_Hook *e_comp_hook_add(E_Comp_Hook_Point hookpoint, E_Comp_Hook_Cb func, const void *data);
237 E_API void e_comp_hook_del(E_Comp_Hook *ph);
238 EINTERN Eina_Bool e_comp_is_on_overlay(E_Client *ec);
239 E_API void e_comp_hwc_end(const char *location);