e client: added E_CLIENT_HOOK_EVAL_VISIBILITY, E_Visibility enumeration for visibility 41/53741/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 9 Dec 2015 05:35:35 +0000 (14:35 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 9 Dec 2015 05:35:35 +0000 (14:35 +0900)
Change-Id: Ia44b07a93538a49abe1b1c4059fcc25be5137f57

src/bin/e_client.c
src/bin/e_client.h

index b65e0e9..e37f6cd 100644 (file)
@@ -92,6 +92,7 @@ static Eina_Inlist *_e_client_hooks[] =
 #ifdef _F_E_CLIENT_NEW_CLIENT_POST_HOOK_
    [E_CLIENT_HOOK_NEW_CLIENT_POST] = NULL,
 #endif
+   [E_CLIENT_HOOK_EVAL_VISIBILITY] = NULL,
 };
 
 ///////////////////////////////////////////
@@ -2786,10 +2787,11 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
         if (ec_vis)
           {
              /* unobscured case */
-             if (ec->visibility.obscured != 0)
+             if (ec->visibility.obscured != E_VISIBILITY_UNOBSCURED)
                {
                   /* previous state is obscured: -1 or 1 */
-                  ec->visibility.obscured = 0;
+                  ec->visibility.obscured = E_VISIBILITY_UNOBSCURED;
+                  ec->visibility.changed = 1;
                   changed = EINA_TRUE;
                   ELOG("CLIENT VIS ON", ec->pixmap, ec);
                }
@@ -2819,10 +2821,11 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
         else
           {
              /* obscured case */
-             if (ec->visibility.obscured != 1)
+             if (ec->visibility.obscured != E_VISIBILITY_FULLY_OBSCURED)
                {
                   /* previous state is unobscured: -1 or 0 */
-                  ec->visibility.obscured = 1;
+                  ec->visibility.obscured = E_VISIBILITY_FULLY_OBSCURED;
+                  ec->visibility.changed = 1;
                   changed = EINA_TRUE;
                   ELOG("CLIENT VIS OFF", ec->pixmap, ec);
                }
@@ -2841,6 +2844,9 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
 
         if (changed)
           _e_client_event_simple(ec, E_EVENT_CLIENT_VISIBILITY_CHANGE);
+
+        _e_client_hook_call(E_CLIENT_HOOK_EVAL_VISIBILITY, ec);
+        ec->visibility.changed = 0;
      }
 
    eina_tiler_free(t);
@@ -3127,8 +3133,9 @@ e_client_new(E_Comp *c EINA_UNUSED, E_Pixmap *cp, int first_map, int internal)
    ec->netwm.action.close = 0;
    ec->netwm.opacity = 255;
 
-   ec->visibility.obscured = -1;
+   ec->visibility.obscured = E_VISIBILITY_UNKNOWN;
    ec->visibility.opaque = -1;
+   ec->visibility.changed = 0;
 
    ec->transform.zoom = 1.0;
    ec->transform.angle = 0.0;
index e1e9999..e261bf2 100644 (file)
@@ -163,6 +163,14 @@ typedef enum _E_Client_Rotation_Type
 } E_Client_Rotation_Type;
 #endif
 
+typedef enum _E_Visibility
+{
+   E_VISIBILITY_UNKNOWN = -1,
+   E_VISIBILITY_UNOBSCURED = 0,
+   E_VISIBILITY_PARTIALLY_OBSCURED = 1,
+   E_VISIBILITY_FULLY_OBSCURED = 2
+} E_Visibility;
+
 typedef struct E_Client E_Client;
 
 typedef struct E_Event_Client E_Event_Client;
@@ -205,6 +213,7 @@ typedef enum _E_Client_Hook_Point
 #ifdef _F_E_CLIENT_NEW_CLIENT_POST_HOOK_
    E_CLIENT_HOOK_NEW_CLIENT_POST,
 #endif
+   E_CLIENT_HOOK_EVAL_VISIBILITY,
    E_CLIENT_HOOK_LAST,
 } E_Client_Hook_Point;
 
@@ -658,6 +667,7 @@ struct E_Client
    {
       int opaque;
       int obscured;
+      unsigned char changed : 1;
    } visibility;
 
    struct