e_client: remove the post_show/resize/move variables
[platform/upstream/enlightenment.git] / src / bin / e_client.h
1 #ifdef E_TYPEDEFS
2 typedef enum _E_Client_Screen_Limit
3 {
4     E_CLIENT_OFFSCREEN_LIMIT_ALLOW_PARTIAL = 0,
5     E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL = 1,
6     E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE = 2
7 } E_Client_Screen_Limit;
8
9 typedef enum _E_Icon_Preference
10 {
11    E_ICON_PREF_E_DEFAULT,
12    E_ICON_PREF_NETWM,
13    E_ICON_PREF_USER
14 } E_Icon_Preference;
15
16 typedef enum _E_Direction
17 {
18    E_DIRECTION_UP,
19    E_DIRECTION_DOWN,
20    E_DIRECTION_LEFT,
21    E_DIRECTION_RIGHT
22 } E_Direction;
23
24 typedef enum _E_Transition
25 {
26    E_TRANSITION_LINEAR = 0,
27    E_TRANSITION_SINUSOIDAL = 1,
28    E_TRANSITION_ACCELERATE = 2,
29    E_TRANSITION_DECELERATE = 3,
30    E_TRANSITION_ACCELERATE_LOTS = 4,
31    E_TRANSITION_DECELERATE_LOTS = 5,
32    E_TRANSITION_SINUSOIDAL_LOTS = 6,
33    E_TRANSITION_BOUNCE = 7,
34    E_TRANSITION_BOUNCE_LOTS = 8
35 } E_Transition;
36
37 typedef enum _E_Stacking
38 {
39    E_STACKING_NONE,
40    E_STACKING_ABOVE,
41    E_STACKING_BELOW
42 } E_Stacking;
43
44 typedef enum _E_Focus_Policy
45 {
46    E_FOCUS_CLICK,
47    E_FOCUS_MOUSE,
48    E_FOCUS_SLOPPY,
49    E_FOCUS_LAST,
50 } E_Focus_Policy;
51
52 typedef enum _E_Focus_Policy_Ext
53 {
54    E_FOCUS_EXT_TOP_STACK,
55    E_FOCUS_EXT_HISTORY,
56 } E_Focus_Policy_Ext;
57
58 typedef enum
59 {
60    /* same as ecore-x types */
61    E_WINDOW_TYPE_UNKNOWN = 0,
62    E_WINDOW_TYPE_DESKTOP,
63    E_WINDOW_TYPE_DOCK,
64    E_WINDOW_TYPE_TOOLBAR,
65    E_WINDOW_TYPE_MENU,
66    E_WINDOW_TYPE_UTILITY,
67    E_WINDOW_TYPE_SPLASH,
68    E_WINDOW_TYPE_DIALOG,
69    E_WINDOW_TYPE_NORMAL,
70    E_WINDOW_TYPE_DROPDOWN_MENU,
71    E_WINDOW_TYPE_POPUP_MENU,
72    E_WINDOW_TYPE_TOOLTIP,
73    E_WINDOW_TYPE_NOTIFICATION,
74    E_WINDOW_TYPE_COMBO,
75    E_WINDOW_TYPE_DND,
76    /* since UNKNOWN was used improperly in comp matching,
77     * this value is a placeholder to indicate that we want
78     * only type UNKNOWN windows
79     */
80    E_WINDOW_TYPE_REAL_UNKNOWN = 999
81 } E_Window_Type;
82
83 typedef enum _E_Focus_Setting
84 {
85    E_FOCUS_NONE,
86    E_FOCUS_NEW_WINDOW,
87    E_FOCUS_NEW_DIALOG,
88    E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED
89 } E_Focus_Setting;
90
91 typedef enum _E_Maximize
92 {
93    E_MAXIMIZE_NONE = 0x00000000,
94    E_MAXIMIZE_FULLSCREEN = 0x00000001,
95    E_MAXIMIZE_SMART = 0x00000002,
96    E_MAXIMIZE_EXPAND = 0x00000003,
97    E_MAXIMIZE_FILL = 0x00000004,
98    E_MAXIMIZE_TYPE = 0x0000000f,
99    E_MAXIMIZE_VERTICAL = 0x00000010,
100    E_MAXIMIZE_HORIZONTAL = 0x00000020,
101    E_MAXIMIZE_BOTH = 0x00000030,
102    E_MAXIMIZE_LEFT = 0x00000070,
103    E_MAXIMIZE_RIGHT = 0x000000b0,
104    E_MAXIMIZE_DIRECTION = 0x000000f0
105 } E_Maximize;
106
107 typedef enum _E_Maximize_Direction
108 {
109    E_MAXIMIZE_DIRECTION_NONE,
110    E_MAXIMIZE_DIRECTION_ALL,
111    E_MAXIMIZE_DIRECTION_LEFT,
112    E_MAXIMIZE_DIRECTION_RIGHT,
113 } E_Maximize_Direction;
114
115 // TODO: should be removed - yigl
116 typedef enum _E_Fullscreen
117 {
118    /* Resize window */
119    E_FULLSCREEN_RESIZE,
120    /* Change screen resolution and resize window */
121    E_FULLSCREEN_ZOOM
122 } E_Fullscreen;
123
124 typedef enum _E_Transient
125 {
126    E_TRANSIENT_ABOVE,
127    E_TRANSIENT_BELOW,
128 } E_Transient;
129
130 typedef enum _E_Window_Placement
131 {
132    E_WINDOW_PLACEMENT_SMART,
133    E_WINDOW_PLACEMENT_ANTIGADGET,
134    E_WINDOW_PLACEMENT_CURSOR,
135    E_WINDOW_PLACEMENT_MANUAL
136 } E_Window_Placement;
137
138 typedef enum E_Client_Property
139 {
140    E_CLIENT_PROPERTY_NONE = 0,
141    E_CLIENT_PROPERTY_SIZE = (1 << 0),
142    E_CLIENT_PROPERTY_POS = (1 << 1),
143    E_CLIENT_PROPERTY_TITLE = (1 << 2),
144    E_CLIENT_PROPERTY_ICON = (1 << 3),
145    E_CLIENT_PROPERTY_URGENCY = (1 << 4),
146    E_CLIENT_PROPERTY_GRAVITY = (1 << 5),
147    E_CLIENT_PROPERTY_NETWM_STATE = (1 << 6),
148    E_CLIENT_PROPERTY_STICKY = (1 << 7),
149    E_CLIENT_PROPERTY_CLIENT_TYPE = (1 << 8),
150 } E_Client_Property;
151
152 #ifdef _F_E_VIRTUAL_KEYBOARD_TYPE_
153 typedef enum _E_Virtual_Keyboard_Window_Type
154 {
155    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_NONE = 0,
156    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_KEYPAD = 1,
157    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_PREDICTION = 2,
158    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_MAGNIFIER = 3,
159    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_POPUP = 4,
160 } E_Virtual_Keyboard_Window_Type;
161 #endif
162
163 #ifdef _F_ZONE_WINDOW_ROTATION_
164 typedef enum _E_Client_Rotation_Type
165 {
166    E_CLIENT_ROTATION_TYPE_NORMAL = 0,
167    E_CLIENT_ROTATION_TYPE_DEPENDENT = 1
168 } E_Client_Rotation_Type;
169 #endif
170
171 typedef enum _E_Visibility
172 {
173    E_VISIBILITY_UNKNOWN = -1,
174    E_VISIBILITY_UNOBSCURED = 0,
175    E_VISIBILITY_PARTIALLY_OBSCURED = 1,
176    E_VISIBILITY_FULLY_OBSCURED = 2,
177    E_VISIBILITY_PRE_UNOBSCURED = 3,
178 } E_Visibility;
179
180 typedef enum _E_Changable_Layer_Type
181 {
182    E_CHANGABLE_LAYER_TYPE_TRANSIENT = 0,
183    E_CHANGABLE_LAYER_TYPE_ABOVE_NOTIFICATION = 1,
184    E_CHANGABLE_LAYER_TYPE_MAX
185 } E_Changable_Layer_Type;
186
187 typedef enum _E_Indicator_Visible_Type
188 {
189    E_INDICATOR_VISIBLE_TYPE_HIDDEN = 0,
190    E_INDICATOR_VISIBLE_TYPE_SHOWN,
191 } E_Indicator_Visible_Type;
192
193 typedef enum _E_Indicator_State
194 {
195    E_INDICATOR_STATE_UNKNOWN = 0,
196    E_INDICATOR_STATE_OFF,
197    E_INDICATOR_STATE_ON
198 } E_Indicator_State;
199
200 typedef enum _E_Indicator_Opacity_Mode
201 {
202    E_INDICATOR_OPACITY_MODE_UNKNOWN = 0,
203    E_INDICATOR_OPACITY_MODE_OPAQUE,
204    E_INDICATOR_OPACITY_MODE_TRANSLUCENT,
205    E_INDICATOR_OPACITY_MODE_TRANSPARENT,
206    E_INDICATOR_OPACITY_MODE_BG_TRANSPARENT,
207 } E_Indicator_Opacity_Mode;
208
209 typedef enum _E_Iconified_Type
210 {
211    E_ICONIFIED_TYPE_NONE              = 0, // not iconified
212    E_ICONIFIED_TYPE_VISIBILITY        = 1, // iconified by visibility
213    E_ICONIFIED_TYPE_ICONIFY_BY_CLIENT = 2, // iconified by iconify request
214    E_ICONIFIED_TYPE_DESK_ICONIFY_BY_CLIENT = 3, // iconified by iconify all windows in the desk request
215 } E_Iconified_Type;
216
217 typedef struct E_Client E_Client;
218
219 typedef struct E_Event_Client E_Event_Client;
220 typedef struct _E_Event_Client_Property E_Event_Client_Property;
221 typedef struct _E_Event_Client_Focus_Skip E_Event_Client_Focus_Skip_Set;
222 typedef struct _E_Event_Client_Focus_Skip E_Event_Client_Focus_Skip_Unset;
223 typedef struct _E_Client_Pending_Resize E_Client_Pending_Resize;
224 typedef struct _E_Client_Pending_Geometry E_Client_Pending_Geometry;
225 typedef struct E_Event_Client_Zone_Set E_Event_Client_Zone_Set;
226 typedef struct E_Event_Client_Desk_Set E_Event_Client_Desk_Set;
227 typedef struct _E_Client_Hook E_Client_Hook;
228 typedef struct _E_Client_Intercept_Hook E_Client_Intercept_Hook;
229
230 #ifdef _F_ZONE_WINDOW_ROTATION_
231 typedef struct E_Event_Client E_Event_Client_Rotation_Change_Begin;
232 typedef struct E_Event_Client E_Event_Client_Rotation_Change_Cancel;
233 typedef struct E_Event_Client E_Event_Client_Rotation_Change_End;
234 typedef struct _E_Event_Client_Rotation_Geometry_Set E_Event_Client_Rotation_Geometry_Set;
235 #endif
236
237 typedef enum _E_Client_Hook_Point
238 {
239    E_CLIENT_HOOK_EVAL_PRE_FETCH,
240    E_CLIENT_HOOK_EVAL_FETCH,
241    E_CLIENT_HOOK_EVAL_PRE_POST_FETCH,
242    E_CLIENT_HOOK_EVAL_POST_FETCH,
243    E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN,
244    E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN,
245    E_CLIENT_HOOK_EVAL_PRE_NEW_CLIENT,
246    E_CLIENT_HOOK_EVAL_POST_NEW_CLIENT,
247    E_CLIENT_HOOK_EVAL_END,
248    E_CLIENT_HOOK_FOCUS_SET,
249    E_CLIENT_HOOK_FOCUS_UNSET,
250    E_CLIENT_HOOK_NEW_CLIENT,
251    E_CLIENT_HOOK_DESK_SET,
252    E_CLIENT_HOOK_MOVE_BEGIN,
253    E_CLIENT_HOOK_MOVE_UPDATE,
254    E_CLIENT_HOOK_MOVE_END,
255    E_CLIENT_HOOK_RESIZE_BEGIN,
256    E_CLIENT_HOOK_RESIZE_UPDATE,
257    E_CLIENT_HOOK_RESIZE_END,
258    E_CLIENT_HOOK_FULLSCREEN_PRE,
259    E_CLIENT_HOOK_DEL,
260    E_CLIENT_HOOK_UNREDIRECT,
261    E_CLIENT_HOOK_REDIRECT,
262 #ifdef _F_E_CLIENT_NEW_CLIENT_POST_HOOK_
263    E_CLIENT_HOOK_NEW_CLIENT_POST,
264 #endif
265    E_CLIENT_HOOK_EVAL_VISIBILITY,
266    E_CLIENT_HOOK_ICONIFY,
267    E_CLIENT_HOOK_UNICONIFY,
268    E_CLIENT_HOOK_AUX_HINT_CHANGE,
269    E_CLIENT_HOOK_WINDOW_ROLE_CHANGE,
270    E_CLIENT_HOOK_CAL_VISIBILITY_DISPLAY_OFF,
271    E_CLIENT_HOOK_TRANSFORM_CHANGE,
272    E_CLIENT_HOOK_ACTIVATE_DONE,
273    E_CLIENT_HOOK_EVAL_VISIBILITY_END,
274    E_CLIENT_HOOK_LAST,
275 } E_Client_Hook_Point;
276
277 typedef enum _E_Client_Intercept_Hook_Point
278 {
279    E_CLIENT_INTERCEPT_HOOK_FOCUS_REVERT,
280    E_CLIENT_INTERCEPT_HOOK_AUTO_PLACEMENT,
281    E_CLIENT_INTERCEPT_HOOK_LAST,
282 } E_Client_Intercept_Hook_Point;
283
284 typedef void (*E_Client_Move_Intercept_Cb)(E_Client *, int x, int y);
285 typedef void (*E_Client_Hook_Cb)(void *data, E_Client *ec);
286 typedef Eina_Bool (*E_Client_Intercept_Hook_Cb)(void *data, E_Client *ec);
287 typedef void (*E_Client_Layout_Cb)(void);
288 typedef Eina_Bool (*E_Client_Surface_Tree_Foreach)(void *data, E_Client *ec);
289 typedef Evas_Object* (*E_Client_Resize_Object_Create_Cb)(E_Client *ec);
290 #else
291
292 #define E_CLIENT_TYPE (int)0xE0b01002
293
294 struct E_Event_Client
295 {
296    E_Client *ec;
297 };
298
299 struct E_Event_Client_Desk_Set
300 {
301    E_Client *ec;
302    E_Desk *desk;
303 };
304
305 struct E_Event_Client_Zone_Set
306 {
307    E_Client *ec;
308    E_Zone *zone;
309 };
310
311 struct _E_Event_Client_Property
312 {
313    E_Client *ec;
314    unsigned int property;
315 };
316
317 struct _E_Event_Client_Focus_Skip
318 {
319    E_Client  *ec;
320    Eina_Bool  by_client;
321 };
322
323 struct _E_Client_Hook
324 {
325    EINA_INLIST;
326    E_Client_Hook_Point hookpoint;
327    E_Client_Hook_Cb func;
328    void               *data;
329    unsigned char       delete_me : 1;
330 };
331
332 struct _E_Client_Intercept_Hook
333 {
334    EINA_INLIST;
335    E_Client_Intercept_Hook_Point hookpoint;
336    E_Client_Intercept_Hook_Cb func;
337    void               *data;
338    unsigned char       delete_me : 1;
339 };
340
341 struct _E_Client_Pending_Resize
342 {
343    int           w, h;
344    unsigned int  serial;
345 };
346
347 struct _E_Event_Client_Rotation_Geometry_Set
348 {
349    E_Client *ec;
350    unsigned int angle; /* 0, 90, 180, 270 */
351    int x, y, w, h;
352 };
353
354 struct _E_Client_Pending_Geometry
355 {
356    int                           x, y, w, h;
357    unsigned int                  serial;
358 };
359
360 struct E_Client
361 {
362    E_Object e_obj_inherit;
363    EINA_INLIST;
364
365    E_Pixmap *pixmap;
366    int depth;
367    int x, y, w, h; //frame+client geom
368    struct {
369       int x, y, w, h; //frame+client geom before move or resize callback
370    } pre_cb;
371    Eina_Rectangle client; //client geom
372    Evas_Object *frame; //comp object
373    E_Zone *zone;
374    E_Desk *desk;
375
376    Ecore_Poller              *ping_poller;
377    Ecore_Timer               *kill_timer;
378
379    E_Client                  *parent;
380    Eina_List                 *transients;
381
382    E_Layer                    layer;
383
384    Eina_Rectangle           *shape_rects;
385    unsigned int              shape_rects_num;
386
387    Eina_Rectangle           *shape_input_rects;
388    unsigned int              shape_input_rects_num;
389
390    Eina_Stringshare         *internal_icon;
391    Eina_Stringshare         *internal_icon_key;
392
393    E_Direction               shade_dir;
394
395    E_Comp_Wl_Client_Data    *comp_data;
396
397    E_Action                  *cur_mouse_action;
398
399    int               border_size; //size of client's border
400
401    struct
402    {
403       struct
404       {
405          int x, y, w, h;
406          int mx, my;
407       } current, last_down[3], last_up[3];
408       Eina_Bool in : 1;
409    } mouse;
410
411    struct
412    {
413       struct
414       {
415          int x, y, w, h;
416          int mx, my;
417          int button;
418       } down;
419    } moveinfo;
420
421    unsigned char      ignore_first_unmap;
422    E_Pointer_Mode     resize_mode;
423
424    struct
425    {
426       Eina_Bool mapping_change : 1;
427       Eina_Bool iconic_shading : 1;
428    } hacks;
429
430    struct
431    {
432       unsigned char changed : 1;
433       unsigned char user_selected : 1;
434       Eina_Stringshare *name;
435    } border;
436
437    struct
438    {
439       int          x, y, w, h;
440       E_Layer      layer;
441       int          zone;
442       E_Maximize   maximized;
443    } saved;
444
445    struct
446    {
447       unsigned char valid : 1;
448       int           x, y, w, h;
449       struct
450       {
451          int x, y, w, h;
452       } saved;
453    } pre_res_change;
454
455    unsigned char  shaped : 1;
456    unsigned char  argb : 1;
457
458    /* ICCCM */
459    struct
460    {
461       Eina_Stringshare        *title;
462       Eina_Stringshare        *name;
463 #if defined(__cplusplus) || defined(c_plusplus)
464       Eina_Stringshare        *cpp_class; /* for C++ TODO: change the implementation for this */
465 #else
466       Eina_Stringshare        *class;
467 #endif
468       Eina_Stringshare        *icon_name;
469       Eina_Stringshare        *machine;
470       int                       min_w, min_h;
471       int                       max_w, max_h;
472       int                       base_w, base_h;
473       int                       step_w, step_h;
474       int                       start_x, start_y;
475       double                    min_aspect, max_aspect;
476       Ecore_Window            icon_window;
477       Ecore_Window            window_group;
478       Ecore_Window            transient_for;
479       Ecore_Window            client_leader;
480       Eina_Stringshare         *window_role;
481       unsigned char             take_focus : 1;
482       unsigned char             accepts_focus : 1;
483       unsigned char             urgent : 1;
484       unsigned char             delete_request : 1;
485       unsigned char             request_pos : 1;
486       struct
487       {
488          int    argc;
489          char **argv;
490       } command;
491       struct
492       {
493          unsigned char title : 1;
494          unsigned char name_class : 1;
495          unsigned char icon_name : 1;
496          unsigned char machine : 1;
497          unsigned char hints : 1;
498          unsigned char size_pos_hints : 1;
499          unsigned char protocol : 1;
500          unsigned char transient_for : 1;
501          unsigned char client_leader : 1;
502          unsigned char window_role : 1;
503          unsigned char state : 1;
504          unsigned char command : 1;
505       } fetch;
506    } icccm;
507
508    /* MWM */
509    struct
510    {
511       unsigned char          exists : 1;
512       unsigned char          borderless : 1;
513       struct
514       {
515          unsigned char hints : 1;
516       } fetch;
517    } mwm;
518
519    /* NetWM */
520    struct
521    {
522       pid_t         pid;
523       unsigned int  desktop;
524       Eina_Stringshare *name;
525       Eina_Stringshare *icon_name;
526
527       Ecore_X_Icon *icons;
528
529       int           num_icons;
530       unsigned int  user_time;
531       unsigned char opacity;
532       Eina_Bool     opacity_changed : 1; // prevent fetching opacity next prop change
533       struct
534       {
535          int left;
536          int right;
537          int top;
538          int bottom;
539          int left_start_y;
540          int left_end_y;
541          int right_start_y;
542          int right_end_y;
543          int top_start_x;
544          int top_end_x;
545          int bottom_start_x;
546          int bottom_end_x;
547       } strut;
548       unsigned char ping : 1;
549       struct
550       {
551          unsigned char        request : 1;
552          unsigned char        alarm : 1;
553          unsigned int         wait;
554          unsigned int         serial;
555          double               send_time;
556       } sync;
557
558       /* NetWM Window state */
559       struct
560       {
561          unsigned char modal : 1;
562          unsigned char sticky : 1;
563          unsigned char maximized_v : 1;
564          unsigned char maximized_h : 1;
565          unsigned char shaded : 1;
566          unsigned char skip_taskbar : 1;
567          unsigned char skip_pager : 1;
568          unsigned char hidden : 1;
569          unsigned char fullscreen : 1;
570          E_Stacking    stacking;
571       } state;
572
573       /* NetWM Window allowed actions */
574       struct
575       {
576          unsigned char move : 1;
577          unsigned char resize : 1;
578          unsigned char minimize : 1;
579          unsigned char shade : 1;
580          unsigned char stick : 1;
581          unsigned char maximized_h : 1;
582          unsigned char maximized_v : 1;
583          unsigned char fullscreen : 1;
584          unsigned char change_desktop : 1;
585          unsigned char close : 1;
586       } action;
587       E_Window_Type  type;
588       E_Window_Type *extra_types;
589       int                  extra_types_num;
590       int                  startup_id;
591
592       struct
593       {
594          unsigned char name : 1;
595          unsigned char icon_name : 1;
596          unsigned char icon : 1;
597          unsigned char user_time : 1;
598          unsigned char strut : 1;
599          unsigned char type : 1;
600          unsigned char state : 1;
601          unsigned char opacity : 1;
602          /* No, fetch on new_client, shouldn't be changed after map.
603             unsigned char pid : 1;
604           */
605          /* No, ignore this
606             unsigned char desktop : 1;
607           */
608       } fetch;
609
610       struct
611       {
612          unsigned char state : 1;
613       } update;
614    } netwm;
615
616    /* Extra e stuff */
617    struct
618    {
619       struct
620       {
621          struct
622          {
623             int           x, y;
624
625             unsigned char updated : 1;
626          } video_position;
627          Ecore_Window video_parent;
628          E_Client      *video_parent_client;
629          Eina_List     *video_child;
630          struct
631          {
632             Eina_Stringshare *name;
633             Eina_Stringshare **available_list;
634             Eina_Stringshare *set;
635             Eina_Stringshare *wait;
636             E_Desk           *wait_desk;
637             E_Object_Delfn   *wait_desk_delfn;
638             int               num;
639             unsigned char     wait_for_done : 1;
640             unsigned char     use : 1;
641          } profile;
642          unsigned char  centered : 1;
643          unsigned char  video : 1;
644 #ifdef _F_ZONE_WINDOW_ROTATION_
645          struct
646          {
647             E_Client_Rotation_Type type;
648             struct
649               {
650                  int prev, curr, next, reserve;
651               } ang;
652             struct
653               {
654                  int x, y, w, h;
655               } geom[4];
656             unsigned char support : 1;
657             unsigned char geom_hint: 1;
658             unsigned char pending_change_request : 1;
659             unsigned char pending_show : 1;  // newly created window that has to be rotated will be show after rotating done.
660                                              // so, it will be used pending e_border_show called at main eval time.
661             unsigned char wait_for_done: 1;
662             unsigned char app_set : 1;    // app wants to communicate with the window manager
663             int           rot;            // decided rotation by the window manager
664             int           preferred_rot;  // app specified rotation
665             int          *available_rots; // app specified available rotations
666             unsigned int  count;          // number of elements of available rotations
667             unsigned int  nopending_render : 1; // app wants to show rendering jobs before sending rotation_done
668                                                 // it is set by 'wm.policy.win.rot.render.nopending' aux hint
669          } rot;
670 #endif
671       } state;
672
673       struct
674       {
675 #ifdef _F_ZONE_WINDOW_ROTATION_
676          struct
677          {
678             unsigned char support : 1;
679             unsigned char geom_hint : 1;
680             unsigned char app_set : 1;        // app wants to communicate with the window manager
681             unsigned char preferred_rot : 1;  // app specified rotation
682             unsigned char available_rots : 1; // app specified available rotations
683             unsigned char need_rotation : 1;
684          } rot;
685 #endif
686          unsigned char state : 1;
687          unsigned char opaque : 1;
688          unsigned char video_parent : 1;
689          unsigned char video_position : 1;
690          unsigned char profile : 1;
691       } fetch;
692    } e;
693
694    struct
695    {
696       struct
697       {
698          unsigned char state : 1;
699          unsigned char vkbd : 1;
700       } fetch;
701       unsigned char                  have_property : 1;
702       unsigned char                  vkbd : 1;
703 #ifdef _F_E_VIRTUAL_KEYBOARD_TYPE_
704       E_Virtual_Keyboard_Window_Type win_type;
705 #endif
706       unsigned char                  floating : 1;
707    } vkbd;
708
709    struct
710    {
711       unsigned char visible : 1;
712       unsigned char pos : 1;
713       unsigned char size : 1;
714       unsigned char stack : 1;
715       unsigned char prop : 1;
716       unsigned char border : 1;
717       unsigned char reset_gravity : 1;
718       unsigned char shading : 1;
719       unsigned char shaded : 1;
720       unsigned char shape : 1;
721       unsigned char shape_input : 1;
722       unsigned char icon : 1;
723       Eina_Bool internal_state : 1;
724       Eina_Bool need_maximize : 1;
725       Eina_Bool need_unmaximize : 1;
726 #ifdef _F_ZONE_WINDOW_ROTATION_
727       Eina_Bool rotation : 1;
728 #endif
729       Eina_Bool accepts_focus : 1;
730       Eina_Bool tz_position : 1; /* true when new position is set using tizen_position interface */
731       unsigned char title : 1;
732       unsigned char buf_size : 1;
733    } changes;
734
735    struct
736    {
737       int opaque;
738       int obscured;
739       unsigned char changed : 1;
740       Eina_Bool skip : 1;
741       Eina_Bool force_obscured : 1;
742       int last_sent_type;
743       Eina_Bool ignore_geometry : 1;
744    } visibility;
745
746    struct
747    {
748       double zoom;
749       double angle;
750
751       Evas_Point center;
752       Evas_Point adjusted;
753
754       struct
755       {
756          double x, y, z;
757       } saved[4];
758    } transform;
759
760    unsigned int       visible : 1; // client is set to be visible by display server (never use this)
761    unsigned int       hidden : 1; // set when window has been hidden by api and should not be shown
762    unsigned int       moving : 1;
763    unsigned int       focused : 1;
764    unsigned int       new_client : 1;
765    unsigned int       re_manage : 1; // client is persisting from before E restart
766    unsigned int       placed : 1;
767    unsigned int       shading : 1;
768    unsigned int       shaded : 1;
769    unsigned int       iconic : 1;
770    unsigned int       deskshow : 1;
771    unsigned int       sticky : 1;
772    unsigned int       urgent : 1;
773    unsigned int       shaped_input : 1;
774    unsigned int       need_shape_merge : 1;
775    unsigned int       need_shape_export : 1;
776    unsigned int       fullscreen : 1;
777    unsigned int       need_fullscreen : 1;
778    unsigned int       skip_fullscreen : 1;
779    unsigned int       already_unparented : 1;
780    unsigned int       need_reparent : 1;
781    unsigned int       button_grabbed : 1;
782    unsigned int       delete_requested : 1;
783    unsigned int       ping_ok : 1;
784    unsigned int       hung : 1;
785    unsigned int       take_focus : 1;
786    unsigned int       want_focus : 1;
787    unsigned int       user_skip_winlist : 1;
788    E_Maximize         maximized;
789    E_Fullscreen       fullscreen_policy; // TODO: should be removed - yigl
790    E_Transient        transient_policy;
791    unsigned int       borderless : 1;
792    unsigned char      offer_resistance : 1;
793    Eina_Stringshare  *bordername;
794
795    unsigned int       lock_user_location : 1; /*DONE*/
796    unsigned int       lock_client_location : 1; /*DONE*/
797    unsigned int       lock_user_size : 1; /*DONE*/
798    unsigned int       lock_client_size : 1; /*DONE*/
799    unsigned int       lock_user_stacking : 1; /*DONE*/
800    unsigned int       lock_client_stacking : 1; /*DONE*/
801    unsigned int       lock_user_iconify : 1; /*DONE*/
802    unsigned int       lock_client_iconify : 1; /*DONE*/
803    unsigned int       lock_user_desk : 1;
804    unsigned int       lock_client_desk : 1;
805    unsigned int       lock_user_sticky : 1; /*DONE*/
806    unsigned int       lock_client_sticky : 1; /*DONE*/
807    unsigned int       lock_user_shade : 1; /*DONE*/
808    unsigned int       lock_client_shade : 1; /*DONE*/
809    unsigned int       lock_user_maximize : 1; /*DONE*/
810    unsigned int       lock_client_maximize : 1; /*DONE*/
811    unsigned int       lock_user_fullscreen : 1; /*DONE*/
812    unsigned int       lock_client_fullscreen : 1; /*DONE*/
813    unsigned int       lock_border : 1; /*DONE*/
814    unsigned int       lock_close : 1; /*DONE*/
815    unsigned int       lock_focus_in : 1; /*DONE*/
816    unsigned int       lock_focus_out : 1; /*DONE*/
817    unsigned int       lock_life : 1; /*DONE*/
818
819    unsigned int       stolen : 1;
820
821    unsigned int       internal : 1;
822    unsigned int       internal_no_remember : 1; /* TODO: should be removed */
823    unsigned int       internal_no_reopen : 1;
824    Eina_Bool          dead : 1;
825
826    double             ping;
827
828    unsigned char      changed : 1;
829
830    unsigned char      icon_preference;
831
832    struct
833    {
834       int x, y;
835       int modified;
836    } shelf_fix;
837
838    Eina_List       *stick_desks;
839    Evas_Object     *color_editor;
840    Eina_List       *pending_resize;
841
842    struct
843    {
844       unsigned char start : 1;
845       int           x, y;
846    } drag;
847
848    E_Client_Move_Intercept_Cb move_intercept_cb;
849    void                      *remember; /* TODO: should be removed */
850
851    unsigned char              comp_hidden   : 1;
852
853    unsigned char              during_lost : 1;
854
855    E_Focus_Policy             focus_policy_override;
856
857    Eina_Bool override : 1;
858    Eina_Bool input_only : 1;
859    Eina_Bool dialog : 1;
860    Eina_Bool tooltip : 1;
861    Eina_Bool redirected : 1;
862    Eina_Bool unredirected_single : 1; //window has been selectively unredirected
863    Eina_Bool shape_changed : 1;
864    Eina_Bool layer_block : 1; // client is doing crazy stuff and should not be relayered in protocol
865    Eina_Bool layer_pending : 1; // change inlist stack but postpone evas stack
866    Eina_Bool ignored : 1; // client is comp-ignored
867    Eina_Bool no_shape_cut : 1; // client shape should not be cut
868    Eina_Bool maximize_override : 1; // client is doing crazy stuff and should "just do it" when moving/resizing
869    Eina_Bool transformed : 1;
870    Eina_Bool keyboard_resizing : 1;
871    Eina_Bool gesture_disable : 1;
872    Eina_Bool floating : 1; //client is set as floating mode
873    Eina_Bool first_mapped : 1;
874    Eina_Bool post_raise : 1;
875    Eina_Bool post_lower : 1;
876    Eina_Bool animatable : 1; //client is animatable (can apply animation)
877
878    Eina_Bool on_post_updates : 1; // client is on the post update list
879    uuid_t uuid;
880
881    int client_type; //e_client_type
882
883    struct
884    {
885       unsigned char by_client : 1; // will be deprecated
886       unsigned char not_raise : 1;
887       unsigned char skip_iconify : 1;
888       unsigned char skip_by_remote : 1;    // skip iconify by remote surface client
889       unsigned char deiconify_update : 1;  // wait client render if deiconify_update is 1
890       unsigned char buffer_flush : 1;      // 0: no flush, 1: flush buffer when iconify
891       unsigned char last_sent_iconic : 1;  // 0: uniconify, 1: iconify
892       E_Iconified_Type type;
893    } exp_iconify;
894
895    struct
896    {
897       Eina_Bool set;
898       Eina_Bool saved;
899       E_Layer   saved_layer; // original layer
900    } changable_layer[E_CHANGABLE_LAYER_TYPE_MAX];
901
902    struct
903    {
904       Eina_List *transform_list;
905       Eina_Bool  background;
906       Eina_Bool  changed;
907
908       struct
909       {
910          int client_x, client_y, client_w, client_h;
911          int frame_w, frame_h;
912          unsigned char argb : 1;
913       } backup;
914
915       struct
916       {
917          Eina_Bool                    enable;
918          E_Util_Transform_Matrix      matrix;
919          E_Util_Transform_Matrix      inv_matrix;
920          E_Util_Transform_Rect_Vertex vertices;
921          E_Util_Transform             transform;
922
923          struct
924          {
925             E_Util_Transform_Rect_Vertex vertices;
926             int x, y, w, h;
927          } boundary;
928
929       } result;
930
931       struct
932       {
933          Eina_Bool               enable;
934          E_Util_Transform_Matrix matrix;
935          E_Util_Transform_Zoom   zoom;
936       } parent;
937
938       Eina_Bool direct_render;
939    } transform_core;
940
941    Ecore_Timer *map_timer;
942    Eina_Bool pointer_enter_sent;
943    Eina_Bool has_cursor_unset : 1; // The client has set cursor null to hide cursor image
944
945    Eina_Bool launching : 1;
946    Eina_Bool extra_animating : 1;
947    Eina_Bool bg_state : 1;
948
949    struct
950    {
951       E_Indicator_State        state;
952       E_Indicator_Opacity_Mode opacity_mode;
953       E_Indicator_Visible_Type visible_type;
954    } indicator;
955
956    E_Plane_Renderer_Client *renderer_client;
957
958    struct
959    {
960       Eina_Bool provider : 1;
961       Eina_Bool consumer : 1;
962       int       bind_ref;
963    } remote_surface;
964
965    Eina_Bool is_cursor : 1; // The client is a cursor client
966
967    int effect_type;
968    Eina_Bool use_splash : 1;
969    Eina_Bool saved_img : 1; // indicates that window has been saved as the image file even once
970    Eina_Bool skip_save_img: 1; // indicates that window doesn't want to save its image file
971
972    E_Hwc_Window *hwc_window; // hwc window for the tdm_hwc.
973    E_Explicit_Sync_Surface *explicit_sync_surface;
974    int comp_override;
975
976    struct
977    {
978       Eina_Bool    wait_commit : 1;
979       unsigned int serial;
980       Eina_List   *pending_geometry; // E_Client_Pending_Geometry
981    } surface_sync;
982
983    Eina_Bool on_render_list : 1; // client is on the render list
984
985    // flag to check event pairing
986    struct
987    {
988       Eina_Bool add  : 1; // ADD / REMOVE
989       Eina_Bool show : 1; // SHOW / HIDE
990    } reg_ev;
991
992    Evas_Object *magnifier_proxy;   // The proxy object used by magnifier
993    Eina_Bool    is_magnifier : 1;  // The client is a magnifier client
994
995    struct
996    {
997       Eina_Bool    use : 1; // use the base output resolution
998       int          w;
999       int          h;
1000       E_Util_Transform *transform;
1001       E_Comp_Wl_Hook *hook_subsurf_create;
1002    } base_output_resolution;
1003
1004    Eina_Bool hwc_visible_skip : 1;
1005
1006    struct
1007    {
1008       Eina_Bool     enable;
1009       E_Desk_Area *desk_area;
1010       E_Desk_Area_Client_Layer edgc_layer; // used by desk_area mode
1011       E_Layer       layer_backup; // original layer (used by no desk_area mode)
1012       E_Util_Transform *transform;
1013    } desk_area;
1014
1015    Eina_Bool transient_for_always_on_top;
1016    Eina_Bool belong_to_parent;
1017    struct
1018    {
1019       int count;
1020       Eina_Bool running;
1021    } show_pending;
1022
1023    E_Layer floating_saved_layer;
1024
1025    struct
1026    {
1027       int x, y, w, h;
1028       Eina_Bool enable_aspect_ratio;
1029       Evas_Object *resize_obj;
1030       float aw, ah;
1031       int header_h, footer_h;
1032       unsigned int unit_size;
1033       struct
1034       {
1035          int t, b, l, r;
1036       } shadow;
1037    } manage_resize;
1038
1039    Eina_Bool move_after_resize;
1040
1041    struct
1042    {
1043       int x, y, w, h;
1044    } maximized_info;
1045
1046    struct
1047    {
1048       Eina_Bool enable;
1049       E_Util_Transform *transform;
1050       E_Comp_Wl_Hook *hook_subsurf_create;
1051    } desk_zoom;
1052
1053    E_Maximize_Direction maximize_dir;
1054    Eina_Bool apply_layout;
1055
1056    struct
1057    {
1058       Eina_Bool            enabled;
1059       double               fps;
1060       double               old_fps;
1061       double               frametimes[122];
1062       double               time;
1063       double               lapse;
1064       int                  cframes;
1065       int                  flapse;
1066    } fps;
1067 };
1068
1069 #define e_client_focus_policy_click(ec) \
1070   ((ec->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK))
1071
1072 /* macro for finding misuse of changed flag */
1073 #if 0
1074 # define EC_CHANGED(EC) \
1075   do { \
1076      if (e_object_is_del(E_OBJECT(EC))) \
1077        EINA_LOG_CRIT("CHANGED SET ON DELETED CLIENT!"); \
1078      EC->changed = 1; \
1079      INF("%s:%d - EC CHANGED: %p", __FILE__, __LINE__, EC); \
1080   } while (0)
1081 #else
1082 # define EC_CHANGED(EC) EC->changed = 1
1083 #endif
1084
1085 #define E_CLIENT_FOREACH(EC) \
1086   for (EC = e_client_bottom_get(); EC; EC = e_client_above_get(EC))
1087
1088 #define E_CLIENT_REVERSE_FOREACH(EC) \
1089   for (EC = e_client_top_get(); EC; EC = e_client_below_get(EC))
1090
1091
1092 E_API extern int E_EVENT_CLIENT_ADD;
1093 E_API extern int E_EVENT_CLIENT_REMOVE;
1094 E_API extern int E_EVENT_CLIENT_ZONE_SET;
1095 E_API extern int E_EVENT_CLIENT_DESK_SET;
1096 E_API extern int E_EVENT_CLIENT_RESIZE;
1097 E_API extern int E_EVENT_CLIENT_MOVE;
1098 E_API extern int E_EVENT_CLIENT_SHOW;
1099 E_API extern int E_EVENT_CLIENT_HIDE;
1100 E_API extern int E_EVENT_CLIENT_ICONIFY;
1101 E_API extern int E_EVENT_CLIENT_UNICONIFY;
1102 E_API extern int E_EVENT_CLIENT_STACK;
1103 E_API extern int E_EVENT_CLIENT_FOCUS_IN;
1104 E_API extern int E_EVENT_CLIENT_FOCUS_OUT;
1105 E_API extern int E_EVENT_CLIENT_PROPERTY;
1106 E_API extern int E_EVENT_CLIENT_FULLSCREEN;
1107 E_API extern int E_EVENT_CLIENT_UNFULLSCREEN;
1108 #ifdef _F_ZONE_WINDOW_ROTATION_
1109 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN;
1110 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL;
1111 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_END;
1112 E_API extern int E_EVENT_CLIENT_ROTATION_GEOMETRY_SET;
1113 #endif
1114 E_API extern int E_EVENT_CLIENT_VISIBILITY_CHANGE;
1115 E_API extern int E_EVENT_CLIENT_BUFFER_CHANGE;
1116 E_API extern int E_EVENT_CLIENT_FOCUS_SKIP_SET;
1117 E_API extern int E_EVENT_CLIENT_FOCUS_SKIP_UNSET;
1118
1119 EINTERN void e_client_idler_before(void);
1120 EINTERN Eina_Bool e_client_init(void);
1121 EINTERN void e_client_shutdown(void);
1122 E_API E_Client *e_client_from_surface_resource(struct wl_resource *surface_resource);
1123 E_API E_Client *e_client_new(E_Pixmap *cp, int first_map, int internal);
1124 E_API Eina_Bool e_client_is_internal(E_Client *ec);
1125 E_API void e_client_unignore(E_Client *ec);
1126 E_API void e_client_desk_set(E_Client *ec, E_Desk *desk);
1127 E_API void e_client_desk_iconify_skip_set(E_Client *ec, Eina_Bool skip);
1128 E_API Eina_Bool e_client_desk_iconify_skip_get(E_Client *ec);
1129 E_API Eina_Bool e_client_comp_grabbed_get(void);
1130 E_API E_Client *e_client_action_get(void);
1131 E_API E_Client *e_client_warping_get(void);
1132 E_API void e_client_mouse_in(E_Client *ec, int x, int y);
1133 E_API void e_client_mouse_out(E_Client *ec, int x, int y);
1134 E_API void e_client_mouse_wheel(E_Client *ec, Evas_Point *output, E_Binding_Event_Wheel *ev);
1135 E_API void e_client_mouse_down(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev);
1136 E_API void e_client_mouse_up(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button* ev);
1137 E_API void e_client_mouse_move(E_Client *ec, Evas_Point *output);
1138 E_API void e_client_res_change_geometry_save(E_Client *bd);
1139 E_API void e_client_res_change_geometry_restore(E_Client *ec);
1140 E_API void e_client_zone_set(E_Client *ec, E_Zone *zone);
1141 E_API void e_client_pos_set(E_Client *ec, int x, int y);
1142 E_API void e_client_pos_get(E_Client *ec, int *x, int *y);
1143 E_API void e_client_size_set(E_Client *ec, int w, int h);
1144 E_API void e_client_size_get(E_Client *ec, int *w, int *h);
1145 E_API void e_client_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
1146 E_API E_Client *e_client_above_get(const E_Client *ec);
1147 E_API E_Client *e_client_below_get(const E_Client *ec);
1148 E_API E_Client *e_client_bottom_get(void);
1149 E_API E_Client *e_client_top_get(void);
1150 E_API unsigned int e_clients_count(void);
1151 E_API void e_client_move_intercept_cb_set(E_Client *ec, E_Client_Move_Intercept_Cb cb);
1152 E_API E_Client_Hook *e_client_hook_add(E_Client_Hook_Point hookpoint, E_Client_Hook_Cb func, const void *data);
1153 E_API void e_client_hook_del(E_Client_Hook *ch);
1154 E_API E_Client_Intercept_Hook *e_client_intercept_hook_add(E_Client_Intercept_Hook_Point hookpoint, E_Client_Intercept_Hook_Cb func, const void *data);
1155 E_API void e_client_intercept_hook_del(E_Client_Intercept_Hook *ch);
1156 EINTERN Eina_Bool e_client_focus_can_take(E_Client *ec);
1157 EINTERN void e_client_focus_stack_lower(E_Client *ec);
1158 E_API void e_client_focus_latest_set(E_Client *ec);
1159 EINTERN void e_client_focus_stack_append_current_focused(E_Client *ec);
1160 E_API void e_client_focus_defer_set(E_Client *ec);
1161 E_API void e_client_focus_defer_unset(E_Client *ec);
1162 EINTERN void e_client_focus_defer_clear(void);
1163 E_API Eina_Bool e_client_focus_track_enabled(void);
1164 E_API void e_client_focus_track_freeze(void);
1165 E_API void e_client_focus_track_thaw(void);
1166 E_API void e_client_refocus(void);
1167 E_API void e_client_focus_set_with_pointer(E_Client *ec);
1168 E_API void e_client_activate(E_Client *ec, Eina_Bool just_do_it);
1169 E_API E_Client *e_client_focused_get(void);
1170 E_API Eina_List *e_client_focus_stack_get(void);
1171 EINTERN void e_client_focus_stack_clear(void);
1172 E_API Eina_List *e_client_lost_windows_get(E_Zone *zone);
1173 E_API void e_client_shade(E_Client *ec, E_Direction dir);
1174 E_API void e_client_unshade(E_Client *ec, E_Direction dir);
1175 EINTERN void e_client_maximized_geometry_set(E_Client *ec, int x, int y, int w, int h);
1176 EINTERN void e_client_maximized_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
1177 EINTERN void e_client_maximize_update(E_Client *ec);
1178 E_API void e_client_maximize(E_Client *ec, E_Maximize max);
1179 E_API void e_client_unmaximize(E_Client *ec, E_Maximize max);
1180 E_API void e_client_fullscreen(E_Client *ec, E_Fullscreen policy);
1181 E_API void e_client_unfullscreen(E_Client *ec);
1182 E_API void e_client_iconify(E_Client *ec);
1183 E_API void e_client_uniconify(E_Client *ec);
1184 E_API void e_client_iconified_type_set(E_Client *ec, E_Iconified_Type type);
1185 E_API E_Iconified_Type e_client_iconified_type_get(E_Client *ec);
1186 E_API Eina_Bool e_client_is_iconified_by_client(E_Client *ec);
1187 E_API void e_client_urgent_set(E_Client *ec, Eina_Bool urgent);
1188 E_API void e_client_stick(E_Client *ec);
1189 E_API void e_client_unstick(E_Client *ec);
1190 E_API void e_client_pinned_set(E_Client *ec, Eina_Bool set);
1191 E_API void e_client_comp_hidden_set(E_Client *ec, Eina_Bool hidden);
1192 E_API Eina_Bool e_client_border_set(E_Client *ec, const char *name);
1193 E_API void e_client_act_move_keyboard(E_Client *ec);
1194 E_API void e_client_act_resize_keyboard(E_Client *ec);
1195 E_API void e_client_act_move_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev);
1196 E_API void e_client_act_move_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
1197 E_API void e_client_act_resize_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, E_Pointer_Mode resize_mode);
1198 E_API void e_client_act_resize_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
1199 E_API void e_client_act_menu_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, int key);
1200 E_API void e_client_act_close_begin(E_Client *ec);
1201 E_API void e_client_act_kill_begin(E_Client *ec);
1202 E_API Evas_Object *e_client_icon_add(E_Client *ec, Evas *evas);
1203 E_API void e_client_ping(E_Client *cw);
1204 E_API void e_client_move_cancel(void);
1205 E_API void e_client_resize_cancel(void);
1206 E_API Eina_Bool e_client_resize_begin(E_Client *ec);
1207 E_API void e_client_frame_recalc(E_Client *ec);
1208 E_API void e_client_signal_move_begin(E_Client *ec, const char *sig, const char *src EINA_UNUSED);
1209 E_API void e_client_signal_move_end(E_Client *ec, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
1210 E_API void e_client_signal_resize_begin(E_Client *ec, const char *dir, const char *sig, const char *src EINA_UNUSED);
1211 E_API void e_client_signal_resize_end(E_Client *ec, const char *dir EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
1212 E_API void e_client_resize_limit(E_Client *ec, int *w, int *h);
1213 E_API E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude);
1214 E_API E_Client *e_client_under_position_get(E_Desk *desk, int x, int y, E_Client *exclude);
1215 EINTERN E_Client *e_client_input_rect_under_pointer_get(E_Desk *desk, E_Client *exclude);
1216 E_API int e_client_pointer_warp_to_center_now(E_Client *ec);
1217 E_API int e_client_pointer_warp_to_center(E_Client *ec);
1218 E_API void e_client_redirected_set(E_Client *ec, Eina_Bool set);
1219 E_API Eina_Bool e_client_is_stacking(const E_Client *ec);
1220 E_API Eina_Bool e_client_desk_window_profile_available_check(E_Client *ec, const char *profile);
1221 E_API void      e_client_desk_window_profile_wait_desk_set(E_Client *ec, E_Desk *desk);
1222 E_API void      e_client_layout_cb_set(E_Client_Layout_Cb cb);
1223 E_API E_Client *e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus);
1224 E_API void      e_client_visibility_calculate(void);
1225 E_API void      e_client_visibility_skip_set(E_Client *ec, Eina_Bool skip);
1226 E_API void      e_client_post_raise_lower_set(E_Client *ec, Eina_Bool raise_set, Eina_Bool lower_set);
1227 E_API Eina_Bool e_client_first_mapped_get(E_Client *ec);
1228 EINTERN Eina_Bool e_client_mapped_get(E_Client *ec);
1229 EINTERN void      e_client_mapped_set(E_Client *ec, Eina_Bool set);
1230
1231 E_API void e_client_transform_update(E_Client *ec);
1232 E_API void e_client_transform_apply(E_Client *ec, double degree, double zoom, int cx, int cy);
1233 E_API void e_client_transform_clear(E_Client *ec);
1234 E_API void e_client_cursor_map_apply(E_Client *ec, int rotation, int x, int y);
1235
1236 YOLO E_API void e_client_focus_stack_set(Eina_List *l);
1237
1238 E_API Eina_Bool         e_client_transform_core_enable_get(E_Client *ec);
1239 E_API void              e_client_transform_core_add(E_Client *ec, E_Util_Transform *transform);
1240 E_API void              e_client_transform_core_remove(E_Client *ec, E_Util_Transform *transform);
1241 E_API void              e_client_transform_core_update(E_Client *ec);
1242 E_API int               e_client_transform_core_transform_count_get(E_Client *ec);
1243 E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int index);
1244 E_API void              e_client_transform_core_input_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1245 E_API void              e_client_transform_core_input_inv_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1246 E_API void              e_client_transform_core_input_inv_rect_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1247 E_API void              e_client_transform_core_direct_render_set(E_Client *ec, Eina_Bool set);
1248
1249 E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
1250 E_API void e_client_window_role_set(E_Client *ec, const char *role);
1251
1252 E_API Eina_Bool e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, unsigned int time);
1253 E_API Eina_Bool e_client_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, unsigned int time);
1254 E_API Eina_Bool e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time);
1255 E_API Eina_Bool e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time);
1256 E_API Eina_Bool e_client_touch_cancel_send(E_Client *ec);
1257 E_API Eina_Bool e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, unsigned int time);
1258 E_API Eina_Bool e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time);
1259 E_API Eina_Bool e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, unsigned int time);
1260 E_API Eina_Bool e_client_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time);
1261 E_API Eina_Bool e_client_mouse_out_send(E_Client *ec, Ecore_Device *dev, unsigned int time);
1262
1263 E_API Eina_Bool e_client_video_client_has(E_Client *ec);
1264 E_API Eina_Bool e_client_normal_client_has(E_Client *ec);
1265
1266 E_API Eina_Bool e_client_cursor_hide(E_Client *ec);
1267
1268 E_API void e_client_visibility_force_obscured_set(E_Client *ec, Eina_Bool set);
1269
1270 E_API void e_client_stay_within_canvas_margin(E_Client *ec);
1271
1272 E_API E_Capture_Save_State e_client_image_save(E_Client *ec, const char *dir, const char *name, E_Capture_Client_Save_End_Cb func_end, void *data, Eina_Bool skip_child);
1273
1274 E_API void      e_client_base_output_resolution_transform_adjust(E_Client *ec);
1275 E_API Eina_Bool e_client_base_output_resolution_update(E_Client *ec);
1276 E_API Eina_Bool e_client_base_output_resolution_useful_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
1277 EINTERN Eina_Bool e_client_base_output_resolution_rsm_update(E_Client *bind_ec, E_Client *provider_ec);
1278
1279 E_API void e_client_focus_skip_set(E_Client *ec, Eina_Bool skip, Eina_Bool by_client);
1280 EINTERN void e_client_revert_focus(E_Client *ec);
1281 EINTERN Eina_Bool e_client_check_above_focused(E_Client *ec);
1282
1283 EINTERN void      e_client_pending_geometry_flush(E_Client *ec);
1284 EINTERN Eina_Bool e_client_pending_geometry_has(E_Client *ec);
1285 EINTERN void      e_client_pending_geometry_last_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
1286
1287 E_API void e_client_frame_focus_set(E_Client *ec, Eina_Bool focus);
1288 E_API void e_client_frame_geometry_set(E_Client *ec, int x, int y, int w, int h);
1289
1290 E_API Eina_Bool e_client_layer_set(E_Client *ec, E_Layer layer);
1291 /* client layer shall be placed on range between E_LAYER_CLIENT_DESKTOP and E_LAYER_CLIENT_CURSOR
1292  * if it is in unexpected layer return E_LAYER_BOTTOM otherwise
1293  */
1294 E_API E_Layer   e_client_layer_get(E_Client *ec);
1295
1296 EINTERN Eina_Bool e_client_layer_set_by_desk_area(E_Client *ec, E_Layer layer);
1297 EINTERN void e_client_desk_area_original_layer_restore(E_Client *ec);
1298 EINTERN E_Layer e_client_desk_area_original_layer_get(E_Client *ec);
1299 EINTERN Eina_Bool e_client_desk_area_client_layer_set(E_Client *ec, E_Desk_Area_Client_Layer edgc_layer);
1300 EINTERN E_Desk_Area_Client_Layer e_client_desk_area_client_layer_get(E_Client *ec);
1301 EINTERN Eina_Bool e_client_desk_area_enable_set(E_Client *ec, Eina_Bool enable);
1302
1303 E_API Eina_Bool e_client_desk_area_set(E_Client *ec, E_Desk_Area *eda);
1304
1305 E_API void      e_client_raise(E_Client *ec);
1306 E_API void      e_client_lower(E_Client *ec);
1307 // ec is placed on the above
1308 E_API void      e_client_stack_above(E_Client *ec, E_Client *above);
1309 // ec is placed under the below
1310 E_API void      e_client_stack_below(E_Client *ec, E_Client *below);
1311
1312 E_API int       e_client_show_pending_set(E_Client *ec);
1313 E_API int       e_client_show_pending_unset(E_Client *ec);
1314
1315 EINTERN void    e_client_surface_tree_foreach(E_Client *ec, E_Client_Surface_Tree_Foreach func, void *data);
1316
1317 // get a comp_data from a ec
1318 EINTERN E_Comp_Wl_Client_Data   *e_client_cdata_new(E_Client *ec);
1319 EINTERN void                     e_client_cdata_free(E_Client *ec);
1320 EINTERN E_Comp_Wl_Client_Data   *e_client_cdata_get(E_Client *ec);
1321
1322 E_API Eina_Bool        e_client_map_set(E_Client *ec, E_Map *em);
1323 // get E_Map from e_client. it must be freed after used.
1324 E_API E_Map           *e_client_map_get(const E_Client *ec);
1325 E_API Eina_Bool        e_client_map_enable_set(E_Client *ec, Eina_Bool enabled);
1326
1327 EINTERN void e_client_belong_to_parent_set(E_Client *ec, Eina_Bool set);
1328 E_API Eina_Bool e_client_is_belong_to_parent(E_Client *ec);
1329
1330 E_API void e_client_transient_policy_set(E_Client *ec, E_Transient policy);
1331 E_API E_Transient e_client_transient_policy_get(E_Client *ec);
1332
1333 E_API void e_client_resize_object_create_cb_set(E_Client_Resize_Object_Create_Cb cb);
1334 E_API void e_client_resize_unit_size_set(E_Client *ec, unsigned int unit_size);
1335
1336 EINTERN void e_client_desk_zoom_enable_set(E_Client *ec, Eina_Bool enable);
1337 EINTERN Eina_Bool e_client_desk_zoom_enable_get(E_Client *ec);
1338
1339 EINTERN void e_client_layout_apply(E_Client *ec, Eina_Bool apply);
1340 E_API Eina_Bool e_client_is_layout_apply(E_Client *ec);
1341
1342 EINTERN Eina_Bool e_client_fps_get(E_Client *ec, double *fps);
1343 EINTERN void e_client_fps_update(E_Client *ec);
1344 EINTERN void e_client_fps_enable(E_Client *ec, Eina_Bool enable);
1345 /**
1346  * Move window to coordinates that do not account client decorations yet.
1347  *
1348  * This call will consider given position does not account client
1349  * decoration, so these values (e_comp_object_frame) will be
1350  * accounted automatically. This is specially useful when it is a new
1351  * client and has not be evaluated yet, in this case
1352  * the frame will be zeroed and no information is known. It
1353  * will mark pending requests so client will be accounted on
1354  * evalutation phase.
1355  *
1356  * @parm x horizontal position to place window.
1357  * @parm y vertical position to place window.
1358  *
1359  * @see e_client_move()
1360  */
1361 static inline void
1362 e_client_util_move_without_frame(E_Client *ec, int x, int y)
1363 {
1364    if (!ec) return;
1365    e_comp_object_frame_xy_adjust(ec->frame, x, y, &x, &y);
1366    evas_object_move(ec->frame, x, y);
1367 }
1368
1369 /**
1370  * Resize window to values that do not account client decorations yet.
1371  *
1372  * This call will consider given size and does not for account client
1373  * decoration, so these values (e_comp_object_frame) will be
1374  * accounted for automatically. This is specially useful when it is a new
1375  * client and has not been evaluated yet, in this case
1376  * e_comp_object_frame will be zeroed and no information is known. It
1377  * will mark pending requests so the client will be accounted for on
1378  * evalutation phase.
1379  *
1380  * @parm w horizontal window size.
1381  * @parm h vertical window size.
1382  *
1383  * @see e_client_resize()
1384  */
1385 static inline void
1386 e_client_util_resize_without_frame(E_Client *ec, int w, int h)
1387 {
1388    if (!ec) return;
1389    e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h);
1390    evas_object_resize(ec->frame, w, h);
1391    e_client_stay_within_canvas_margin(ec);
1392 }
1393
1394 /**
1395  * Move and resize window to values that do not account for client decorations yet.
1396  *
1397  * This call will consider given values already accounts client
1398  * decorations, so it will not be considered later. This will just
1399  * work properly with clients that have being evaluated and client
1400  * decorations are known (e_comp_object_frame).
1401  *
1402  * @parm x horizontal position to place window.
1403  * @parm y vertical position to place window.
1404  * @parm w horizontal window size.
1405  * @parm h vertical window size.
1406  *
1407  * @see e_client_move_resize()
1408  */
1409 E_API void e_client_util_move_resize_without_frame(E_Client *ec, int x, int y, int w, int h);
1410
1411 static inline Eina_Bool
1412 e_client_util_ignored_get(const E_Client *ec)
1413 {
1414    if (!ec) return EINA_TRUE;
1415    return ec->override || ec->input_only || ec->ignored;
1416 }
1417
1418 static inline Eina_Bool
1419 e_client_util_desk_visible(const E_Client *ec, const E_Desk *desk)
1420 {
1421    if (!ec) return EINA_FALSE;
1422    return !ec->desk || ec->sticky || (ec->desk == desk);
1423 }
1424
1425 static inline Ecore_Window
1426 e_client_util_pwin_get(const E_Client *ec)
1427 {
1428    if (!ec) return 0;
1429    if (!ec->pixmap) return 0;
1430    return e_pixmap_parent_window_get(ec->pixmap);
1431 }
1432
1433 static inline Ecore_Window
1434 e_client_util_win_get(const E_Client *ec)
1435 {
1436    if (!ec) return 0;
1437    if (!ec->pixmap) return 0;
1438    return e_pixmap_window_get(ec->pixmap);
1439 }
1440
1441 static inline Eina_Bool
1442 e_client_util_moving_get(const E_Client *ec)
1443 {
1444    if (!ec) return EINA_FALSE;
1445    return ec->moving;
1446 }
1447
1448 static inline Eina_Bool
1449 e_client_util_resizing_get(const E_Client *ec)
1450 {
1451    if (!ec) return EINA_FALSE;
1452    return (ec->resize_mode != E_POINTER_RESIZE_NONE);
1453 }
1454
1455 static inline Eina_Bool
1456 e_client_util_borderless(const E_Client *ec)
1457 {
1458    if (!ec) return EINA_FALSE;
1459    return (ec->borderless || ec->mwm.borderless || (!ec->border.name) || (!strcmp(ec->border.name, "borderless")));
1460 }
1461
1462 static inline Eina_Bool
1463 e_client_util_shadow_state_get(const E_Client *ec)
1464 {
1465    Eina_Bool on;
1466    if (!ec) return EINA_FALSE;
1467    if (ec->shaped) return EINA_FALSE;
1468    if (ec->argb)
1469      {
1470         return (!ec->borderless) && (ec->bordername || (ec->border.name && strcmp(ec->border.name, "borderless")));
1471      }
1472    on = !ec->e.state.video;
1473    if (on)
1474      on = !ec->fullscreen;
1475    return on;
1476 }
1477
1478 static inline Eina_Stringshare *
1479 e_client_util_name_get(const E_Client *ec)
1480 {
1481    if (!ec) return NULL;
1482    if (ec->netwm.name)
1483      return ec->netwm.name;
1484    else if (ec->icccm.title)
1485      return ec->icccm.title;
1486    return NULL;
1487 }
1488
1489 static inline Eina_Bool
1490 e_client_util_is_popup(const E_Client *ec)
1491 {
1492    if (!ec) return EINA_FALSE;
1493    switch (ec->netwm.type)
1494      {
1495         case E_WINDOW_TYPE_MENU:
1496         case E_WINDOW_TYPE_SPLASH:
1497         case E_WINDOW_TYPE_DROPDOWN_MENU:
1498         case E_WINDOW_TYPE_POPUP_MENU:
1499         case E_WINDOW_TYPE_TOOLTIP:
1500         case E_WINDOW_TYPE_NOTIFICATION:
1501         case E_WINDOW_TYPE_COMBO:
1502         case E_WINDOW_TYPE_DND:
1503           return EINA_TRUE;
1504         default: break;
1505      }
1506   return EINA_FALSE;
1507 }
1508
1509 #endif