e_client: make fake mouse-out upon focus-out conditional
[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_NONE,
55    E_FOCUS_EXT_TOP_STACK,
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 // TODO: should be removed - yigl
108 typedef enum _E_Fullscreen
109 {
110    /* Resize window */
111    E_FULLSCREEN_RESIZE,
112    /* Change screen resolution and resize window */
113    E_FULLSCREEN_ZOOM
114 } E_Fullscreen;
115
116 typedef enum _E_Transient
117 {
118    E_TRANSIENT_ABOVE,
119    E_TRANSIENT_BELOW,
120 } E_Transient;
121
122 typedef enum _E_Window_Placement
123 {
124    E_WINDOW_PLACEMENT_SMART,
125    E_WINDOW_PLACEMENT_ANTIGADGET,
126    E_WINDOW_PLACEMENT_CURSOR,
127    E_WINDOW_PLACEMENT_MANUAL
128 } E_Window_Placement;
129
130 typedef enum E_Client_Property
131 {
132    E_CLIENT_PROPERTY_NONE = 0,
133    E_CLIENT_PROPERTY_SIZE = (1 << 0),
134    E_CLIENT_PROPERTY_POS = (1 << 1),
135    E_CLIENT_PROPERTY_TITLE = (1 << 2),
136    E_CLIENT_PROPERTY_ICON = (1 << 3),
137    E_CLIENT_PROPERTY_URGENCY = (1 << 4),
138    E_CLIENT_PROPERTY_GRAVITY = (1 << 5),
139    E_CLIENT_PROPERTY_NETWM_STATE = (1 << 6),
140    E_CLIENT_PROPERTY_STICKY = (1 << 7),
141    E_CLIENT_PROPERTY_CLIENT_TYPE = (1 << 8),
142 } E_Client_Property;
143
144 #ifdef _F_E_VIRTUAL_KEYBOARD_TYPE_
145 typedef enum _E_Virtual_Keyboard_Window_Type
146 {
147    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_NONE = 0,
148    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_KEYPAD = 1,
149    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_PREDICTION = 2,
150    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_MAGNIFIER = 3,
151    E_VIRTUAL_KEYBOARD_WINDOW_TYPE_POPUP = 4,
152 } E_Virtual_Keyboard_Window_Type;
153 #endif
154
155 #ifdef _F_ZONE_WINDOW_ROTATION_
156 typedef enum _E_Client_Rotation_Type
157 {
158    E_CLIENT_ROTATION_TYPE_NORMAL = 0,
159    E_CLIENT_ROTATION_TYPE_DEPENDENT = 1
160 } E_Client_Rotation_Type;
161 #endif
162
163 typedef enum _E_Visibility
164 {
165    E_VISIBILITY_UNKNOWN = -1,
166    E_VISIBILITY_UNOBSCURED = 0,
167    E_VISIBILITY_PARTIALLY_OBSCURED = 1,
168    E_VISIBILITY_FULLY_OBSCURED = 2,
169    E_VISIBILITY_PRE_UNOBSCURED = 3,
170 } E_Visibility;
171
172 typedef enum _E_Changable_Layer_Type
173 {
174    E_CHANGABLE_LAYER_TYPE_TRANSIENT = 0,
175    E_CHANGABLE_LAYER_TYPE_ABOVE_NOTIFICATION = 1,
176    E_CHANGABLE_LAYER_TYPE_MAX
177 } E_Changable_Layer_Type;
178
179 typedef enum _E_Indicator_Visible_Type
180 {
181    E_INDICATOR_VISIBLE_TYPE_HIDDEN = 0,
182    E_INDICATOR_VISIBLE_TYPE_SHOWN,
183 } E_Indicator_Visible_Type;
184
185 typedef enum _E_Indicator_State
186 {
187    E_INDICATOR_STATE_UNKNOWN = 0,
188    E_INDICATOR_STATE_OFF,
189    E_INDICATOR_STATE_ON
190 } E_Indicator_State;
191
192 typedef enum _E_Indicator_Opacity_Mode
193 {
194    E_INDICATOR_OPACITY_MODE_UNKNOWN = 0,
195    E_INDICATOR_OPACITY_MODE_OPAQUE,
196    E_INDICATOR_OPACITY_MODE_TRANSLUCENT,
197    E_INDICATOR_OPACITY_MODE_TRANSPARENT,
198    E_INDICATOR_OPACITY_MODE_BG_TRANSPARENT,
199 } E_Indicator_Opacity_Mode;
200
201 typedef struct E_Client E_Client;
202
203 typedef struct E_Event_Client E_Event_Client;
204 typedef struct _E_Event_Client_Property E_Event_Client_Property;
205 typedef struct _E_Client_Pending_Resize E_Client_Pending_Resize;
206 typedef struct _E_Client_Pending_Geometry E_Client_Pending_Geometry;
207 typedef struct E_Event_Client_Zone_Set E_Event_Client_Zone_Set;
208 typedef struct E_Event_Client_Desk_Set E_Event_Client_Desk_Set;
209 typedef struct _E_Client_Hook E_Client_Hook;
210 typedef struct _E_Client_Intercept_Hook E_Client_Intercept_Hook;
211
212 #ifdef _F_ZONE_WINDOW_ROTATION_
213 typedef struct E_Event_Client E_Event_Client_Rotation_Change_Begin;
214 typedef struct E_Event_Client E_Event_Client_Rotation_Change_Cancel;
215 typedef struct E_Event_Client E_Event_Client_Rotation_Change_End;
216 #endif
217
218 typedef enum _E_Client_Hook_Point
219 {
220    E_CLIENT_HOOK_EVAL_PRE_FETCH,
221    E_CLIENT_HOOK_EVAL_FETCH,
222    E_CLIENT_HOOK_EVAL_PRE_POST_FETCH,
223    E_CLIENT_HOOK_EVAL_POST_FETCH,
224    E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN,
225    E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN,
226    E_CLIENT_HOOK_EVAL_PRE_NEW_CLIENT,
227    E_CLIENT_HOOK_EVAL_POST_NEW_CLIENT,
228    E_CLIENT_HOOK_EVAL_END,
229    E_CLIENT_HOOK_FOCUS_SET,
230    E_CLIENT_HOOK_FOCUS_UNSET,
231    E_CLIENT_HOOK_NEW_CLIENT,
232    E_CLIENT_HOOK_DESK_SET,
233    E_CLIENT_HOOK_MOVE_BEGIN,
234    E_CLIENT_HOOK_MOVE_UPDATE,
235    E_CLIENT_HOOK_MOVE_END,
236    E_CLIENT_HOOK_RESIZE_BEGIN,
237    E_CLIENT_HOOK_RESIZE_UPDATE,
238    E_CLIENT_HOOK_RESIZE_END,
239    E_CLIENT_HOOK_FULLSCREEN_PRE,
240    E_CLIENT_HOOK_DEL,
241    E_CLIENT_HOOK_UNREDIRECT,
242    E_CLIENT_HOOK_REDIRECT,
243 #ifdef _F_E_CLIENT_NEW_CLIENT_POST_HOOK_
244    E_CLIENT_HOOK_NEW_CLIENT_POST,
245 #endif
246    E_CLIENT_HOOK_EVAL_VISIBILITY,
247    E_CLIENT_HOOK_ICONIFY,
248    E_CLIENT_HOOK_UNICONIFY,
249    E_CLIENT_HOOK_AUX_HINT_CHANGE,
250    E_CLIENT_HOOK_WINDOW_ROLE_CHANGE,
251    E_CLIENT_HOOK_CAL_VISIBILITY_DISPLAY_OFF,
252    E_CLIENT_HOOK_TRANSFORM_CHANGE,
253    E_CLIENT_HOOK_LAST,
254 } E_Client_Hook_Point;
255
256 typedef enum _E_Client_Intercept_Hook_Point
257 {
258    E_CLIENT_INTERCEPT_HOOK_FOCUS_REVERT,
259    E_CLIENT_INTERCEPT_HOOK_LAST,
260 } E_Client_Intercept_Hook_Point;
261
262 typedef void (*E_Client_Move_Intercept_Cb)(E_Client *, int x, int y);
263 typedef void (*E_Client_Hook_Cb)(void *data, E_Client *ec);
264 typedef Eina_Bool (*E_Client_Intercept_Hook_Cb)(void *data, E_Client *ec);
265 typedef void (*E_Client_Layout_Cb)(void);
266 #else
267
268 #define E_CLIENT_TYPE (int)0xE0b01002
269
270 struct E_Event_Client
271 {
272    E_Client *ec;
273 };
274
275 struct E_Event_Client_Desk_Set
276 {
277    E_Client *ec;
278    E_Desk *desk;
279 };
280
281 struct E_Event_Client_Zone_Set
282 {
283    E_Client *ec;
284    E_Zone *zone;
285 };
286
287 struct _E_Event_Client_Property
288 {
289    E_Client *ec;
290    unsigned int property;
291 };
292
293 struct _E_Client_Hook
294 {
295    EINA_INLIST;
296    E_Client_Hook_Point hookpoint;
297    E_Client_Hook_Cb func;
298    void               *data;
299    unsigned char       delete_me : 1;
300 };
301
302 struct _E_Client_Intercept_Hook
303 {
304    EINA_INLIST;
305    E_Client_Intercept_Hook_Point hookpoint;
306    E_Client_Intercept_Hook_Cb func;
307    void               *data;
308    unsigned char       delete_me : 1;
309 };
310
311 struct _E_Client_Pending_Resize
312 {
313    int           w, h;
314    unsigned int  serial;
315 };
316
317 typedef enum
318 {
319    E_GEOMETRY_NONE = 0,
320    E_GEOMETRY_POS  = (1 << 0),
321    E_GEOMETRY_SIZE = (1 << 1)
322 } E_Client_Demand_Geometry;
323
324 struct _E_Client_Pending_Geometry
325 {
326    E_Client_Demand_Geometry      mode;
327    int                           x, y, w, h;
328    unsigned int                  serial;
329 };
330
331 struct E_Client
332 {
333    E_Object e_obj_inherit;
334    EINA_INLIST;
335
336    E_Pixmap *pixmap;
337    int depth;
338    int x, y, w, h; //frame+client geom
339    struct {
340       int x, y, w, h; //frame+client geom before move or resize callback
341    } pre_cb;
342    Eina_Rectangle client; //client geom
343    Evas_Object *frame; //comp object
344    E_Zone *zone;
345    E_Desk *desk;
346
347    Ecore_Poller              *ping_poller;
348    Ecore_Timer               *kill_timer;
349
350    E_Client                  *modal;
351
352    E_Client                  *leader;
353    Eina_List                 *group;
354
355    E_Client                  *parent;
356    Eina_List                 *transients;
357
358    E_Layer                    layer;
359
360    Eina_Rectangle           *shape_rects;
361    unsigned int              shape_rects_num;
362
363    Eina_Rectangle           *shape_input_rects;
364    unsigned int              shape_input_rects_num;
365
366    Eina_Stringshare         *internal_icon;
367    Eina_Stringshare         *internal_icon_key;
368
369    E_Direction               shade_dir;
370
371    E_Comp_Client_Data       *comp_data;
372
373    E_Action                  *cur_mouse_action;
374
375    int               border_size; //size of client's border
376
377    struct
378    {
379       struct
380       {
381          int x, y, w, h;
382          int mx, my;
383       } current, last_down[3], last_up[3];
384       Eina_Bool in : 1;
385    } mouse;
386
387    struct
388    {
389       struct
390       {
391          int x, y, w, h;
392          int mx, my;
393          int button;
394       } down;
395    } moveinfo;
396
397    unsigned char      ignore_first_unmap;
398    E_Pointer_Mode     resize_mode;
399
400    struct
401    {
402       Eina_Bool mapping_change : 1;
403       Eina_Bool iconic_shading : 1;
404    } hacks;
405
406    struct
407    {
408       unsigned char changed : 1;
409       unsigned char user_selected : 1;
410       Eina_Stringshare *name;
411    } border;
412
413    struct
414    {
415       int          x, y, w, h;
416       E_Layer      layer;
417       int          zone;
418       E_Maximize   maximized;
419    } saved;
420
421    struct
422    {
423       unsigned char valid : 1;
424       int           x, y, w, h;
425       struct
426       {
427          int x, y, w, h;
428       } saved;
429    } pre_res_change;
430
431    unsigned char  shaped : 1;
432    unsigned char  argb : 1;
433
434    /* ICCCM */
435    struct
436    {
437       Eina_Stringshare        *title;
438       Eina_Stringshare        *name;
439       Eina_Stringshare        *class;
440       Eina_Stringshare        *icon_name;
441       Eina_Stringshare        *machine;
442       int                       min_w, min_h;
443       int                       max_w, max_h;
444       int                       base_w, base_h;
445       int                       step_w, step_h;
446       int                       start_x, start_y;
447       double                    min_aspect, max_aspect;
448       Ecore_Window            icon_window;
449       Ecore_Window            window_group;
450       Ecore_Window            transient_for;
451       Ecore_Window            client_leader;
452       Eina_Stringshare         *window_role;
453       unsigned char             take_focus : 1;
454       unsigned char             accepts_focus : 1;
455       unsigned char             urgent : 1;
456       unsigned char             delete_request : 1;
457       unsigned char             request_pos : 1;
458       struct
459       {
460          int    argc;
461          char **argv;
462       } command;
463       struct
464       {
465          unsigned char title : 1;
466          unsigned char name_class : 1;
467          unsigned char icon_name : 1;
468          unsigned char machine : 1;
469          unsigned char hints : 1;
470          unsigned char size_pos_hints : 1;
471          unsigned char protocol : 1;
472          unsigned char transient_for : 1;
473          unsigned char client_leader : 1;
474          unsigned char window_role : 1;
475          unsigned char state : 1;
476          unsigned char command : 1;
477       } fetch;
478    } icccm;
479
480    /* MWM */
481    struct
482    {
483       unsigned char          exists : 1;
484       unsigned char          borderless : 1;
485       struct
486       {
487          unsigned char hints : 1;
488       } fetch;
489    } mwm;
490
491    /* NetWM */
492    struct
493    {
494       pid_t         pid;
495       unsigned int  desktop;
496       Eina_Stringshare *name;
497       Eina_Stringshare *icon_name;
498
499       Ecore_X_Icon *icons;
500
501       int           num_icons;
502       unsigned int  user_time;
503       unsigned char opacity;
504       Eina_Bool     opacity_changed : 1; // prevent fetching opacity next prop change
505       struct
506       {
507          int left;
508          int right;
509          int top;
510          int bottom;
511          int left_start_y;
512          int left_end_y;
513          int right_start_y;
514          int right_end_y;
515          int top_start_x;
516          int top_end_x;
517          int bottom_start_x;
518          int bottom_end_x;
519       } strut;
520       unsigned char ping : 1;
521       struct
522       {
523          unsigned char        request : 1;
524          unsigned char        alarm : 1;
525          unsigned int         wait;
526          unsigned int         serial;
527          double               send_time;
528       } sync;
529
530       /* NetWM Window state */
531       struct
532       {
533          unsigned char modal : 1;
534          unsigned char sticky : 1;
535          unsigned char maximized_v : 1;
536          unsigned char maximized_h : 1;
537          unsigned char shaded : 1;
538          unsigned char skip_taskbar : 1;
539          unsigned char skip_pager : 1;
540          unsigned char hidden : 1;
541          unsigned char fullscreen : 1;
542          E_Stacking    stacking;
543       } state;
544
545       /* NetWM Window allowed actions */
546       struct
547       {
548          unsigned char move : 1;
549          unsigned char resize : 1;
550          unsigned char minimize : 1;
551          unsigned char shade : 1;
552          unsigned char stick : 1;
553          unsigned char maximized_h : 1;
554          unsigned char maximized_v : 1;
555          unsigned char fullscreen : 1;
556          unsigned char change_desktop : 1;
557          unsigned char close : 1;
558       } action;
559       E_Window_Type  type;
560       E_Window_Type *extra_types;
561       int                  extra_types_num;
562       int                  startup_id;
563
564       struct
565       {
566          unsigned char name : 1;
567          unsigned char icon_name : 1;
568          unsigned char icon : 1;
569          unsigned char user_time : 1;
570          unsigned char strut : 1;
571          unsigned char type : 1;
572          unsigned char state : 1;
573          unsigned char opacity : 1;
574          /* No, fetch on new_client, shouldn't be changed after map.
575             unsigned char pid : 1;
576           */
577          /* No, ignore this
578             unsigned char desktop : 1;
579           */
580       } fetch;
581
582       struct
583       {
584          unsigned char state : 1;
585       } update;
586    } netwm;
587
588    /* Extra e stuff */
589    struct
590    {
591       struct
592       {
593          struct
594          {
595             int           x, y;
596
597             unsigned char updated : 1;
598          } video_position;
599          Ecore_Window video_parent;
600          E_Client      *video_parent_client;
601          Eina_List     *video_child;
602          struct
603          {
604             Eina_Stringshare *name;
605             Eina_Stringshare **available_list;
606             Eina_Stringshare *set;
607             Eina_Stringshare *wait;
608             E_Desk           *wait_desk;
609             E_Object_Delfn   *wait_desk_delfn;
610             int               num;
611             unsigned char     wait_for_done : 1;
612             unsigned char     use : 1;
613          } profile;
614          unsigned char  centered : 1;
615          unsigned char  video : 1;
616 #ifdef _F_ZONE_WINDOW_ROTATION_
617          struct
618          {
619             E_Client_Rotation_Type type;
620             struct
621               {
622                  int prev, curr, next, reserve;
623               } ang;
624             struct
625               {
626                  int x, y, w, h;
627               } geom[4];
628             unsigned char support : 1;
629             unsigned char geom_hint: 1;
630             unsigned char pending_change_request : 1;
631             unsigned char pending_show : 1;  // newly created window that has to be rotated will be show after rotating done.
632                                              // so, it will be used pending e_border_show called at main eval time.
633             unsigned char wait_for_done: 1;
634             unsigned char app_set : 1;    // app wants to communicate with the window manager
635             int           rot;            // decided rotation by the window manager
636             int           preferred_rot;  // app specified rotation
637             int          *available_rots; // app specified available rotations
638             unsigned int  count;          // number of elements of available rotations
639             unsigned int  nopending_render : 1; // app wants to show rendering jobs before sending rotation_done
640                                                 // it is set by 'wm.policy.win.rot.render.nopending' aux hint
641          } rot;
642 #endif
643       } state;
644
645       struct
646       {
647 #ifdef _F_ZONE_WINDOW_ROTATION_
648          struct
649          {
650             unsigned char support : 1;
651             unsigned char geom_hint : 1;
652             unsigned char app_set : 1;        // app wants to communicate with the window manager
653             unsigned char preferred_rot : 1;  // app specified rotation
654             unsigned char available_rots : 1; // app specified available rotations
655             unsigned char need_rotation : 1;
656          } rot;
657 #endif
658          unsigned char state : 1;
659          unsigned char opaque : 1;
660          unsigned char video_parent : 1;
661          unsigned char video_position : 1;
662          unsigned char profile : 1;
663       } fetch;
664    } e;
665
666    struct
667    {
668       struct
669       {
670          unsigned char state : 1;
671          unsigned char vkbd : 1;
672       } fetch;
673       unsigned char                  have_property : 1;
674       unsigned char                  vkbd : 1;
675 #ifdef _F_E_VIRTUAL_KEYBOARD_TYPE_
676       E_Virtual_Keyboard_Window_Type win_type;
677 #endif
678       unsigned char                  floating : 1;
679    } vkbd;
680
681    struct
682    {
683       unsigned char visible : 1;
684       unsigned char pos : 1;
685       unsigned char size : 1;
686       unsigned char stack : 1;
687       unsigned char prop : 1;
688       unsigned char border : 1;
689       unsigned char reset_gravity : 1;
690       unsigned char shading : 1;
691       unsigned char shaded : 1;
692       unsigned char shape : 1;
693       unsigned char shape_input : 1;
694       unsigned char icon : 1;
695       Eina_Bool internal_state : 1;
696       Eina_Bool need_maximize : 1;
697       Eina_Bool need_unmaximize : 1;
698 #ifdef _F_ZONE_WINDOW_ROTATION_
699       Eina_Bool rotation : 1;
700 #endif
701       Eina_Bool accepts_focus : 1;
702       Eina_Bool tz_position : 1; /* true when new position is set using tizen_position interface */
703    } changes;
704
705    struct
706    {
707       int opaque;
708       int obscured;
709       unsigned char changed : 1;
710       Eina_Bool skip : 1;
711       Eina_Bool force_obscured : 1;
712       int last_sent_type;
713    } visibility;
714
715    struct
716    {
717       double zoom;
718       double angle;
719
720       Evas_Point center;
721       Evas_Point adjusted;
722
723       struct
724       {
725          double x, y, z;
726       } saved[4];
727    } transform;
728
729    unsigned int       visible : 1; // client is set to be visible by display server (never use this)
730    unsigned int       hidden : 1; // set when window has been hidden by api and should not be shown
731    unsigned int       moving : 1;
732    unsigned int       focused : 1;
733    unsigned int       new_client : 1;
734    unsigned int       re_manage : 1; // client is persisting from before E restart
735    unsigned int       placed : 1;
736    unsigned int       shading : 1;
737    unsigned int       shaded : 1;
738    unsigned int       iconic : 1;
739    unsigned int       deskshow : 1;
740    unsigned int       sticky : 1;
741    unsigned int       urgent : 1;
742    unsigned int       shaped_input : 1;
743    unsigned int       need_shape_merge : 1;
744    unsigned int       need_shape_export : 1;
745    unsigned int       fullscreen : 1;
746    unsigned int       need_fullscreen : 1;
747    unsigned int       skip_fullscreen : 1;
748    unsigned int       already_unparented : 1;
749    unsigned int       need_reparent : 1;
750    unsigned int       button_grabbed : 1;
751    unsigned int       delete_requested : 1;
752    unsigned int       ping_ok : 1;
753    unsigned int       hung : 1;
754    unsigned int       take_focus : 1;
755    unsigned int       want_focus : 1;
756    unsigned int       user_skip_winlist : 1;
757    E_Maximize         maximized;
758    E_Fullscreen       fullscreen_policy; // TODO: should be removed - yigl
759    E_Transient        transient_policy;
760    unsigned int       borderless : 1;
761    unsigned char      offer_resistance : 1;
762    Eina_Stringshare  *bordername;
763
764    unsigned int       lock_user_location : 1; /*DONE*/
765    unsigned int       lock_client_location : 1; /*DONE*/
766    unsigned int       lock_user_size : 1; /*DONE*/
767    unsigned int       lock_client_size : 1; /*DONE*/
768    unsigned int       lock_user_stacking : 1; /*DONE*/
769    unsigned int       lock_client_stacking : 1; /*DONE*/
770    unsigned int       lock_user_iconify : 1; /*DONE*/
771    unsigned int       lock_client_iconify : 1; /*DONE*/
772    unsigned int       lock_user_desk : 1;
773    unsigned int       lock_client_desk : 1;
774    unsigned int       lock_user_sticky : 1; /*DONE*/
775    unsigned int       lock_client_sticky : 1; /*DONE*/
776    unsigned int       lock_user_shade : 1; /*DONE*/
777    unsigned int       lock_client_shade : 1; /*DONE*/
778    unsigned int       lock_user_maximize : 1; /*DONE*/
779    unsigned int       lock_client_maximize : 1; /*DONE*/
780    unsigned int       lock_user_fullscreen : 1; /*DONE*/
781    unsigned int       lock_client_fullscreen : 1; /*DONE*/
782    unsigned int       lock_border : 1; /*DONE*/
783    unsigned int       lock_close : 1; /*DONE*/
784    unsigned int       lock_focus_in : 1; /*DONE*/
785    unsigned int       lock_focus_out : 1; /*DONE*/
786    unsigned int       lock_life : 1; /*DONE*/
787
788    unsigned int       stolen : 1;
789
790    unsigned int       internal : 1;
791    unsigned int       internal_no_remember : 1; /* TODO: should be removed */
792    unsigned int       internal_no_reopen : 1;
793    Eina_Bool          dead : 1;
794
795    Evas_Object       *internal_elm_win;
796
797    double             ping;
798
799    unsigned char      changed : 1;
800
801    unsigned char      icon_preference;
802
803    struct
804    {
805       int x, y;
806       int modified;
807    } shelf_fix;
808
809    Eina_List       *stick_desks;
810    Evas_Object     *color_editor;
811    E_Dialog        *border_prop_dialog;
812    Eina_List       *pending_resize;
813
814    struct
815    {
816       unsigned char start : 1;
817       int           x, y;
818    } drag;
819
820    E_Client_Move_Intercept_Cb move_intercept_cb;
821    void                      *remember; /* TODO: should be removed */
822
823    unsigned char              comp_hidden   : 1;
824
825    unsigned char              post_move   : 1;
826    unsigned char              post_resize : 1;
827    unsigned char              post_show : 1;
828    unsigned char              during_lost : 1;
829
830    Ecore_Idle_Enterer        *post_job;
831
832    E_Focus_Policy             focus_policy_override;
833
834    Eina_Bool override : 1;
835    Eina_Bool input_only : 1;
836    Eina_Bool dialog : 1;
837    Eina_Bool tooltip : 1;
838    Eina_Bool redirected : 1;
839    Eina_Bool unredirected_single : 1; //window has been selectively unredirected
840    Eina_Bool shape_changed : 1;
841    Eina_Bool layer_block : 1; // client is doing crazy stuff and should not be relayered in protocol
842    Eina_Bool layer_pending : 1; // change inlist stack but postpone evas stack
843    Eina_Bool ignored : 1; // client is comp-ignored
844    Eina_Bool no_shape_cut : 1; // client shape should not be cut
845    Eina_Bool maximize_override : 1; // client is doing crazy stuff and should "just do it" when moving/resizing
846    Eina_Bool transformed : 1;
847    Eina_Bool keyboard_resizing : 1;
848    Eina_Bool gesture_disable : 1;
849    Eina_Bool floating : 1; //client is set as floating mode
850    Eina_Bool first_mapped : 1;
851    Eina_Bool post_raise : 1;
852    Eina_Bool post_lower : 1;
853    Eina_Bool animatable : 1; //client is animatable (can apply animation)
854
855    Eina_Bool on_post_updates : 1; // client is on the post update list
856    uuid_t uuid;
857
858    int client_type; //e_client_type
859
860    struct
861    {
862       unsigned char by_client : 1;
863       unsigned char not_raise : 1;
864       unsigned char skip_iconify : 1;
865       unsigned char skip_by_remote : 1;    // skip iconify by remote surface client
866       unsigned char deiconify_update : 1;  // wait client render if deiconify_update is 1
867       unsigned char buffer_flush : 1;      // 0: no flush, 1: flush buffer when iconify
868    } exp_iconify;
869
870    struct
871    {
872       Eina_Bool set;
873       Eina_Bool saved;
874       E_Layer   saved_layer; // original layer
875    } changable_layer[E_CHANGABLE_LAYER_TYPE_MAX];
876
877    struct
878    {
879       Eina_List *transform_list;
880       Eina_Bool  background;
881       Eina_Bool  changed;
882
883       struct
884       {
885          int client_x, client_y, client_w, client_h;
886          int frame_w, frame_h;
887       } backup;
888
889       struct
890       {
891          Eina_Bool                    enable;
892          E_Util_Transform_Matrix      matrix;
893          E_Util_Transform_Matrix      inv_matrix;
894          E_Util_Transform_Rect_Vertex vertices;
895          E_Util_Transform             transform;
896
897          struct
898          {
899             E_Util_Transform_Rect_Vertex vertices;
900             int x, y, w, h;
901          } boundary;
902
903       } result;
904
905       struct
906       {
907          Eina_Bool               enable;
908          E_Util_Transform_Matrix matrix;
909       } parent;
910    } transform_core;
911
912    struct
913    {
914       unsigned char            resizable : 1;  // or scalable
915       unsigned char            splited : 1;
916       int                      s_id;           // split(slot) id
917    } layout;
918
919    Ecore_Timer *map_timer;
920    Eina_Bool pointer_enter_sent;
921
922    Eina_Bool launching : 1;
923    Eina_Bool extra_animating : 1;
924    Eina_Bool bg_state : 1;
925
926    struct
927    {
928       E_Indicator_State        state;
929       E_Indicator_Opacity_Mode opacity_mode;
930       E_Indicator_Visible_Type visible_type;
931    } indicator;
932
933    E_Plane_Renderer_Client *renderer_client;
934
935    struct
936    {
937       Eina_Bool provider : 1;
938       Eina_Bool consumer : 1;
939       int       bind_ref;
940    } remote_surface;
941
942    Eina_Bool is_cursor : 1; // The client is a cursor client
943
944    int effect_type;
945    Eina_Bool use_splash : 1;
946    Eina_Bool saved_img : 1; // indicates that window has been saved as the image file even once
947    Eina_Bool skip_save_img: 1; // indicates that window doesn't want to save its image file
948
949    E_Hwc_Window *hwc_window; // hwc window for the tdm_hwc.
950    int comp_override;
951
952    struct
953    {
954       Eina_Bool    wait_commit : 1;
955       unsigned int serial;
956       Eina_List   *pending_geometry; // E_Client_Pending_Geometry
957    } surface_sync;
958
959    Eina_Bool on_render_list : 1; // client is on the render list
960 };
961
962 #define e_client_focus_policy_click(ec) \
963   ((ec->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK))
964
965 /* macro for finding misuse of changed flag */
966 #if 0
967 # define EC_CHANGED(EC) \
968   do { \
969      if (e_object_is_del(E_OBJECT(EC))) \
970        EINA_LOG_CRIT("CHANGED SET ON DELETED CLIENT!"); \
971      EC->changed = 1; \
972      INF("%s:%d - EC CHANGED: %p", __FILE__, __LINE__, EC); \
973   } while (0)
974 #else
975 # define EC_CHANGED(EC) EC->changed = 1
976 #endif
977
978 #define E_CLIENT_FOREACH(EC) \
979   for (EC = e_client_bottom_get(); EC; EC = e_client_above_get(EC))
980
981 #define E_CLIENT_REVERSE_FOREACH(EC) \
982   for (EC = e_client_top_get(); EC; EC = e_client_below_get(EC))
983
984
985 E_API extern int E_EVENT_CLIENT_ADD;
986 E_API extern int E_EVENT_CLIENT_REMOVE;
987 E_API extern int E_EVENT_CLIENT_ZONE_SET;
988 E_API extern int E_EVENT_CLIENT_DESK_SET;
989 E_API extern int E_EVENT_CLIENT_RESIZE;
990 E_API extern int E_EVENT_CLIENT_MOVE;
991 E_API extern int E_EVENT_CLIENT_SHOW;
992 E_API extern int E_EVENT_CLIENT_HIDE;
993 E_API extern int E_EVENT_CLIENT_ICONIFY;
994 E_API extern int E_EVENT_CLIENT_UNICONIFY;
995 E_API extern int E_EVENT_CLIENT_STACK;
996 E_API extern int E_EVENT_CLIENT_FOCUS_IN;
997 E_API extern int E_EVENT_CLIENT_FOCUS_OUT;
998 E_API extern int E_EVENT_CLIENT_PROPERTY;
999 E_API extern int E_EVENT_CLIENT_FULLSCREEN;
1000 E_API extern int E_EVENT_CLIENT_UNFULLSCREEN;
1001 #ifdef _F_ZONE_WINDOW_ROTATION_
1002 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN;
1003 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL;
1004 E_API extern int E_EVENT_CLIENT_ROTATION_CHANGE_END;
1005 #endif
1006 E_API extern int E_EVENT_CLIENT_VISIBILITY_CHANGE;
1007 E_API extern int E_EVENT_CLIENT_BUFFER_CHANGE;
1008
1009 EINTERN void e_client_idler_before(void);
1010 EINTERN Eina_Bool e_client_init(void);
1011 EINTERN void e_client_shutdown(void);
1012 E_API E_Client *e_client_new(E_Pixmap *cp, int first_map, int internal);
1013 E_API void e_client_unignore(E_Client *ec);
1014 E_API void e_client_desk_set(E_Client *ec, E_Desk *desk);
1015 E_API Eina_Bool e_client_comp_grabbed_get(void);
1016 E_API E_Client *e_client_action_get(void);
1017 E_API E_Client *e_client_warping_get(void);
1018 E_API Eina_List *e_clients_immortal_list(void);
1019 E_API void e_client_mouse_in(E_Client *ec, int x, int y);
1020 E_API void e_client_mouse_out(E_Client *ec, int x, int y);
1021 E_API void e_client_mouse_wheel(E_Client *ec, Evas_Point *output, E_Binding_Event_Wheel *ev);
1022 E_API void e_client_mouse_down(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev);
1023 E_API void e_client_mouse_up(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button* ev);
1024 E_API void e_client_mouse_move(E_Client *ec, Evas_Point *output);
1025 E_API void e_client_res_change_geometry_save(E_Client *bd);
1026 E_API void e_client_res_change_geometry_restore(E_Client *ec);
1027 E_API void e_client_zone_set(E_Client *ec, E_Zone *zone);
1028 E_API void e_client_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
1029 E_API E_Client *e_client_above_get(const E_Client *ec);
1030 E_API E_Client *e_client_below_get(const E_Client *ec);
1031 E_API E_Client *e_client_bottom_get(void);
1032 E_API E_Client *e_client_top_get(void);
1033 E_API unsigned int e_clients_count(void);
1034 E_API void e_client_move_intercept_cb_set(E_Client *ec, E_Client_Move_Intercept_Cb cb);
1035 E_API E_Client_Hook *e_client_hook_add(E_Client_Hook_Point hookpoint, E_Client_Hook_Cb func, const void *data);
1036 E_API void e_client_hook_del(E_Client_Hook *ch);
1037 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);
1038 E_API void e_client_intercept_hook_del(E_Client_Intercept_Hook *ch);
1039 EINTERN void e_client_focus_stack_lower(E_Client *ec);
1040 E_API void e_client_focus_latest_set(E_Client *ec);
1041 E_API void e_client_focus_defer_set(E_Client *ec);
1042 E_API void e_client_focus_defer_unset(E_Client *ec);
1043 E_API Eina_Bool e_client_focus_track_enabled(void);
1044 E_API void e_client_focus_track_freeze(void);
1045 E_API void e_client_focus_track_thaw(void);
1046 E_API void e_client_refocus(void);
1047 E_API void e_client_focus_set_with_pointer(E_Client *ec);
1048 E_API void e_client_activate(E_Client *ec, Eina_Bool just_do_it);
1049 E_API E_Client *e_client_focused_get(void);
1050 E_API Eina_List *e_client_focus_stack_get(void);
1051 E_API Eina_List *e_client_lost_windows_get(E_Zone *zone);
1052 E_API void e_client_shade(E_Client *ec, E_Direction dir);
1053 E_API void e_client_unshade(E_Client *ec, E_Direction dir);
1054 E_API void e_client_maximize(E_Client *ec, E_Maximize max);
1055 E_API void e_client_unmaximize(E_Client *ec, E_Maximize max);
1056 E_API void e_client_fullscreen(E_Client *ec, E_Fullscreen policy);
1057 E_API void e_client_unfullscreen(E_Client *ec);
1058 E_API void e_client_iconify(E_Client *ec);
1059 E_API void e_client_uniconify(E_Client *ec);
1060 E_API void e_client_urgent_set(E_Client *ec, Eina_Bool urgent);
1061 E_API void e_client_stick(E_Client *ec);
1062 E_API void e_client_unstick(E_Client *ec);
1063 E_API void e_client_pinned_set(E_Client *ec, Eina_Bool set);
1064 E_API void e_client_comp_hidden_set(E_Client *ec, Eina_Bool hidden);
1065 E_API Eina_Bool e_client_border_set(E_Client *ec, const char *name);
1066 E_API void e_client_act_move_keyboard(E_Client *ec);
1067 E_API void e_client_act_resize_keyboard(E_Client *ec);
1068 E_API void e_client_act_move_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev);
1069 E_API void e_client_act_move_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
1070 E_API void e_client_act_resize_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, E_Pointer_Mode resize_mode);
1071 E_API void e_client_act_resize_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
1072 E_API void e_client_act_menu_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, int key);
1073 E_API void e_client_act_close_begin(E_Client *ec);
1074 E_API void e_client_act_kill_begin(E_Client *ec);
1075 E_API Evas_Object *e_client_icon_add(E_Client *ec, Evas *evas);
1076 E_API void e_client_ping(E_Client *cw);
1077 E_API void e_client_move_cancel(void);
1078 E_API void e_client_resize_cancel(void);
1079 E_API Eina_Bool e_client_resize_begin(E_Client *ec);
1080 E_API void e_client_frame_recalc(E_Client *ec);
1081 E_API void e_client_signal_move_begin(E_Client *ec, const char *sig, const char *src EINA_UNUSED);
1082 E_API void e_client_signal_move_end(E_Client *ec, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
1083 E_API void e_client_signal_resize_begin(E_Client *ec, const char *dir, const char *sig, const char *src EINA_UNUSED);
1084 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);
1085 E_API void e_client_resize_limit(E_Client *ec, int *w, int *h);
1086 E_API E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude);
1087 E_API E_Client *e_client_under_position_get(E_Desk *desk, int x, int y, E_Client *exclude);
1088 E_API int e_client_pointer_warp_to_center_now(E_Client *ec);
1089 E_API int e_client_pointer_warp_to_center(E_Client *ec);
1090 E_API void e_client_redirected_set(E_Client *ec, Eina_Bool set);
1091 E_API Eina_Bool e_client_is_stacking(const E_Client *ec);
1092 E_API Eina_Bool e_client_has_xwindow(const E_Client *ec);
1093 E_API Eina_Bool e_client_desk_window_profile_available_check(E_Client *ec, const char *profile);
1094 E_API void      e_client_desk_window_profile_wait_desk_set(E_Client *ec, E_Desk *desk);
1095 E_API void      e_client_layout_cb_set(E_Client_Layout_Cb cb);
1096 E_API E_Client *e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus);
1097 E_API void      e_client_visibility_calculate(void);
1098 E_API void      e_client_visibility_skip_set(E_Client *ec, Eina_Bool skip);
1099 E_API void      e_client_post_raise_lower_set(E_Client *ec, Eina_Bool raise_set, Eina_Bool lower_set);
1100 E_API Eina_Bool e_client_first_mapped_get(E_Client *ec);
1101
1102 E_API void e_client_transform_update(E_Client *ec);
1103 E_API void e_client_transform_apply(E_Client *ec, double degree, double zoom, int cx, int cy);
1104 E_API void e_client_transform_clear(E_Client *ec);
1105 E_API void e_client_cursor_map_apply(E_Client *ec, int rotation, int x, int y);
1106
1107 YOLO E_API void e_client_focus_stack_set(Eina_List *l);
1108
1109 E_API Eina_Bool         e_client_transform_core_enable_get(E_Client *ec);
1110 E_API void              e_client_transform_core_add(E_Client *ec, E_Util_Transform *transform);
1111 E_API void              e_client_transform_core_remove(E_Client *ec, E_Util_Transform *transform);
1112 E_API void              e_client_transform_core_update(E_Client *ec);
1113 E_API int               e_client_transform_core_transform_count_get(E_Client *ec);
1114 E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int index);
1115 E_API void              e_client_transform_core_input_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1116 E_API void              e_client_transform_core_input_inv_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1117 E_API void              e_client_transform_core_input_inv_rect_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
1118
1119 E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
1120 E_API void e_client_window_role_set(E_Client *ec, const char *role);
1121
1122 E_API Eina_Bool e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, unsigned int time);
1123 E_API Eina_Bool e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time);
1124 E_API Eina_Bool e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time);
1125 E_API Eina_Bool e_client_touch_cancel_send(E_Client *ec);
1126 E_API Eina_Bool e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, unsigned int time);
1127 E_API Eina_Bool e_client_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time);
1128 E_API Eina_Bool e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, unsigned int time);
1129 E_API Eina_Bool e_client_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time);
1130 E_API Eina_Bool e_client_mouse_out_send(E_Client *ec, Evas_Device *dev, unsigned int time);
1131
1132 E_API Eina_Bool e_client_video_client_has(E_Client *ec);
1133 E_API Eina_Bool e_client_normal_client_has(E_Client *ec);
1134
1135 E_API Eina_Bool e_client_cursor_hide(E_Client *ec);
1136
1137 E_API void e_client_visibility_force_obscured_set(E_Client *ec, Eina_Bool set);
1138
1139 E_API void e_client_stay_within_canvas_margin(E_Client *ec);
1140
1141 EINTERN void e_client_revert_focus(E_Client *ec);
1142 EINTERN Eina_Bool e_client_check_above_focused(E_Client *ec);
1143
1144 EINTERN void      e_client_pending_geometry_flush(E_Client *ec);
1145 EINTERN Eina_Bool e_client_pending_geometry_has(E_Client *ec);
1146
1147 /**
1148  * Move window to coordinates that do not account client decorations yet.
1149  *
1150  * This call will consider given position does not account client
1151  * decoration, so these values (e_comp_object_frame) will be
1152  * accounted automatically. This is specially useful when it is a new
1153  * client and has not be evaluated yet, in this case
1154  * the frame will be zeroed and no information is known. It
1155  * will mark pending requests so client will be accounted on
1156  * evalutation phase.
1157  *
1158  * @parm x horizontal position to place window.
1159  * @parm y vertical position to place window.
1160  *
1161  * @see e_client_move()
1162  */
1163 static inline void
1164 e_client_util_move_without_frame(E_Client *ec, int x, int y)
1165 {
1166    if (!ec) return;
1167    e_comp_object_frame_xy_adjust(ec->frame, x, y, &x, &y);
1168    evas_object_move(ec->frame, x, y);
1169 }
1170
1171 /**
1172  * Resize window to values that do not account client decorations yet.
1173  *
1174  * This call will consider given size and does not for account client
1175  * decoration, so these values (e_comp_object_frame) will be
1176  * accounted for automatically. This is specially useful when it is a new
1177  * client and has not been evaluated yet, in this case
1178  * e_comp_object_frame will be zeroed and no information is known. It
1179  * will mark pending requests so the client will be accounted for on
1180  * evalutation phase.
1181  *
1182  * @parm w horizontal window size.
1183  * @parm h vertical window size.
1184  *
1185  * @see e_client_resize()
1186  */
1187 static inline void
1188 e_client_util_resize_without_frame(E_Client *ec, int w, int h)
1189 {
1190    if (!ec) return;
1191    e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h);
1192    evas_object_resize(ec->frame, w, h);
1193    e_client_stay_within_canvas_margin(ec);
1194 }
1195
1196 /**
1197  * Move and resize window to values that do not account for client decorations yet.
1198  *
1199  * This call will consider given values already accounts client
1200  * decorations, so it will not be considered later. This will just
1201  * work properly with clients that have being evaluated and client
1202  * decorations are known (e_comp_object_frame).
1203  *
1204  * @parm x horizontal position to place window.
1205  * @parm y vertical position to place window.
1206  * @parm w horizontal window size.
1207  * @parm h vertical window size.
1208  *
1209  * @see e_client_move_resize()
1210  */
1211 static inline void
1212 e_client_util_move_resize_without_frame(E_Client *ec, int x, int y, int w, int h)
1213 {
1214    e_client_util_move_without_frame(ec, x, y);
1215    e_client_util_resize_without_frame(ec, w, h);
1216 }
1217
1218 static inline Eina_Bool
1219 e_client_util_ignored_get(const E_Client *ec)
1220 {
1221    if (!ec) return EINA_TRUE;
1222    return ec->override || ec->input_only || ec->ignored;
1223 }
1224
1225 static inline Eina_Bool
1226 e_client_util_desk_visible(const E_Client *ec, const E_Desk *desk)
1227 {
1228    if (!ec) return EINA_FALSE;
1229    return !ec->desk || ec->sticky || (ec->desk == desk);
1230 }
1231
1232 static inline Ecore_Window
1233 e_client_util_pwin_get(const E_Client *ec)
1234 {
1235    if (!ec) return 0;
1236    if (!ec->pixmap) return 0;
1237    return e_pixmap_parent_window_get(ec->pixmap);
1238 }
1239
1240 static inline Ecore_Window
1241 e_client_util_win_get(const E_Client *ec)
1242 {
1243    if (!ec) return 0;
1244    if (!ec->pixmap) return 0;
1245    return e_pixmap_window_get(ec->pixmap);
1246 }
1247
1248 static inline Eina_Bool
1249 e_client_util_resizing_get(const E_Client *ec)
1250 {
1251    if (!ec) return EINA_FALSE;
1252    return (ec->resize_mode != E_POINTER_RESIZE_NONE);
1253 }
1254
1255 static inline Eina_Bool
1256 e_client_util_borderless(const E_Client *ec)
1257 {
1258    if (!ec) return EINA_FALSE;
1259    return (ec->borderless || ec->mwm.borderless || (!ec->border.name) || (!strcmp(ec->border.name, "borderless")));
1260 }
1261
1262 static inline Eina_Bool
1263 e_client_util_shadow_state_get(const E_Client *ec)
1264 {
1265    Eina_Bool on;
1266    if (!ec) return EINA_FALSE;
1267    if (ec->shaped) return EINA_FALSE;
1268    if (ec->argb)
1269      {
1270         return (!ec->borderless) && (ec->bordername || (ec->border.name && strcmp(ec->border.name, "borderless")));
1271      }
1272    on = !ec->e.state.video;
1273    if (on)
1274      on = !ec->fullscreen;
1275    return on;
1276 }
1277
1278 static inline Eina_Stringshare *
1279 e_client_util_name_get(const E_Client *ec)
1280 {
1281    if (!ec) return NULL;
1282    if (ec->netwm.name)
1283      return ec->netwm.name;
1284    else if (ec->icccm.title)
1285      return ec->icccm.title;
1286    return NULL;
1287 }
1288
1289 static inline Eina_Bool
1290 e_client_util_is_popup(const E_Client *ec)
1291 {
1292    if (!ec) return EINA_FALSE;
1293    switch (ec->netwm.type)
1294      {
1295         case E_WINDOW_TYPE_MENU:
1296         case E_WINDOW_TYPE_SPLASH:
1297         case E_WINDOW_TYPE_DROPDOWN_MENU:
1298         case E_WINDOW_TYPE_POPUP_MENU:
1299         case E_WINDOW_TYPE_TOOLTIP:
1300         case E_WINDOW_TYPE_NOTIFICATION:
1301         case E_WINDOW_TYPE_COMBO:
1302         case E_WINDOW_TYPE_DND:
1303           return EINA_TRUE;
1304         default: break;
1305      }
1306   return EINA_FALSE;
1307 }
1308
1309 #endif