1 #ifdef E_TYPEDEFS
2 
3 
4 
5 #else
6 #ifndef E_COMP_CANVAS_H
7 #define E_COMP_CANVAS_H
8 
9 extern E_API int E_EVENT_COMPOSITOR_UPDATE;
10 
11 E_API Eina_Bool e_comp_canvas_init(int w, int h);
12 EINTERN void e_comp_canvas_clear(void);
13 E_API void e_comp_canvas_resize(int w, int h);
14 E_API void e_comp_all_freeze(void);
15 E_API void e_comp_all_thaw(void);
16 E_API E_Zone * e_comp_zone_xy_get(Evas_Coord x, Evas_Coord y);
17 E_API E_Zone * e_comp_zone_number_get(int num);
18 E_API E_Zone * e_comp_zone_id_get(int id);
19 E_API E_Desk * e_comp_desk_window_profile_get(const char *profile);
20 E_API void e_comp_canvas_zone_restarted(E_Zone *zone);
21 E_API void e_comp_canvas_zone_update(E_Zone *zone);
22 E_API void e_comp_canvas_update(void);
23 E_API void e_comp_canvas_fake_layers_init(void);
24 E_API void e_comp_canvas_fps_toggle(void);
25 E_API E_Layer e_comp_canvas_layer_map_to(unsigned int layer);
26 E_API unsigned int e_comp_canvas_layer_map(E_Layer layer);
27 E_API unsigned int e_comp_canvas_client_layer_map(E_Layer layer);
28 E_API E_Layer e_comp_canvas_client_layer_map_nearest(int layer);
29 E_API void e_comp_canvas_keys_grab(void);
30 E_API void e_comp_canvas_keys_ungrab(void);
31 E_API void e_comp_canvas_feed_mouse_up(unsigned int activate_time);
32 E_API void e_comp_canvas_notidle(void);
33 E_API Evas_Object *e_comp_canvas_event_grabber_add(void);
34 EINTERN void e_comp_canvas_intercept(void);
35 
36 /* the following functions are used for adjusting root window coordinates
37  * to/from canvas coordinates.
38  * this ensures correct positioning when running E as a nested compositor
39  *
40  * - use the "adjust" functions to go root->canvas
41  * - use the "unadjust" functions to go canvas->root
42  */
43 static inline int
e_comp_canvas_x_root_unadjust(int x)44 e_comp_canvas_x_root_unadjust(int x)
45 {
46    int cx;
47 
48    ecore_evas_geometry_get(e_comp->ee, &cx, NULL, NULL, NULL);
49    return x + cx;
50 }
51 
52 static inline int
e_comp_canvas_y_root_unadjust(int y)53 e_comp_canvas_y_root_unadjust(int y)
54 {
55    int cy;
56 
57    ecore_evas_geometry_get(e_comp->ee, NULL, &cy, NULL, NULL);
58    return y + cy;
59 }
60 
61 static inline int
e_comp_canvas_x_root_adjust(int x)62 e_comp_canvas_x_root_adjust(int x)
63 {
64    int cx;
65 
66    ecore_evas_geometry_get(e_comp->ee, &cx, NULL, NULL, NULL);
67    return x - cx;
68 }
69 
70 static inline int
e_comp_canvas_y_root_adjust(int y)71 e_comp_canvas_y_root_adjust(int y)
72 {
73    int cy;
74 
75    ecore_evas_geometry_get(e_comp->ee, NULL, &cy, NULL, NULL);
76    return y - cy;
77 }
78 
79 #endif
80 #endif
81