visibility: remove Pol_Win_Opaque and replace it with ec->visibility.opaque
authorGwanglim Lee <gl77.lee@samsung.com>
Tue, 24 Nov 2015 13:34:53 +0000 (22:34 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 24 Nov 2015 13:34:53 +0000 (22:34 +0900)
Change-Id: I1722be3e2890bd416f8a2b79a64f36723b12466e

src/e_mod_visivility.c

index d835ab7..817b991 100644 (file)
@@ -6,7 +6,6 @@
 #endif
 
 typedef struct _Pol_Visibility Pol_Visibility;
-typedef struct _Pol_Win_Opaque Pol_Win_Opaque;
 
 struct _Pol_Visibility
 {
@@ -14,22 +13,12 @@ struct _Pol_Visibility
    int       visibility;
 };
 
-struct _Pol_Win_Opaque
-{
-   E_Client *ec;
-   int       opaque;
-};
-
 static Eina_Hash *hash_pol_visibilities = NULL;
-static Eina_Hash *hash_pol_win_opaques = NULL;
 
 static Pol_Visibility *_visibility_add(E_Client *ec, int visibility);
 static Pol_Visibility *_visibility_find(E_Client *ec);
 static void            _visibility_notify_send(E_Client *ec, int visibility);
 static void            _pol_cb_visibility_data_free(void *data);
-static Pol_Win_Opaque *_win_opaque_find(E_Client *ec);
-static void            _pol_cb_win_opaque_data_free(void *data);
-static Pol_Win_Opaque *_win_opaque_add(E_Client *ec, int opaque);
 
 static Pol_Visibility *
 _visibility_add(E_Client *ec, int visibility)
@@ -76,55 +65,16 @@ _pol_cb_visibility_data_free(void *data)
    free(data);
 }
 
-static Pol_Win_Opaque *
-_win_opaque_find(E_Client *ec)
-{
-   Pol_Win_Opaque *pwo;
-
-   pwo = eina_hash_find(hash_pol_win_opaques, &ec);
-
-   return pwo;
-}
-
-static void
-_pol_cb_win_opaque_data_free(void *data)
-{
-   free(data);
-}
-
-static Pol_Win_Opaque *
-_win_opaque_add(E_Client *ec, int opaque)
-{
-   Pol_Win_Opaque *pwo;
-
-   if (e_object_is_del(E_OBJECT(ec))) return NULL;
-
-   pwo = eina_hash_find(hash_pol_win_opaques, &ec);
-   if (pwo) return NULL;
-
-   pwo = E_NEW(Pol_Win_Opaque, 1);
-   if (!pwo) return NULL;
-
-   pwo->ec = ec;
-   pwo->opaque = opaque;
-
-   eina_hash_add(hash_pol_win_opaques, &ec, pwo);
-
-   return pwo;
-}
-
 void
 e_mod_pol_visibility_init(void)
 {
    hash_pol_visibilities = eina_hash_pointer_new(_pol_cb_visibility_data_free);
-   hash_pol_win_opaques = eina_hash_pointer_new(_pol_cb_win_opaque_data_free);
 }
 
 void
 e_mod_pol_visibility_shutdown(void)
 {
    E_FREE_FUNC(hash_pol_visibilities, eina_hash_free);
-   E_FREE_FUNC(hash_pol_win_opaques, eina_hash_free);
 }
 
 static Eina_Bool
@@ -191,7 +141,6 @@ e_mod_pol_zone_visibility_calc(E_Zone *zone)
 
         if (_client_tiler_intersects(ec, t))
           {
-             Pol_Win_Opaque *pwo;
              Eina_Bool opaque = EINA_FALSE;
              /* unobscured case */
              pv = _visibility_find(ec);
@@ -217,8 +166,9 @@ e_mod_pol_zone_visibility_calc(E_Zone *zone)
                }
 
              /* check alpha window is opaque or not. */
-             pwo = _win_opaque_find(ec);
-             if (pwo && pwo->opaque && ec->argb) opaque = EINA_TRUE;
+             if ((ec->argb) &&
+                 (ec->visibility.opaque == 1))
+               opaque = EINA_TRUE;
 
              /* if e_client is not alpha or opaque then delete intersect rect */
              if (!ec->argb || opaque)
@@ -274,13 +224,9 @@ void
 e_mod_pol_client_visibility_del(E_Client *ec)
 {
    Pol_Visibility *pv;
-   Pol_Win_Opaque *pwo;
 
    if (!ec) return;
 
-   pwo = eina_hash_find(hash_pol_win_opaques, &ec);
-   if (pwo) eina_hash_del_by_key(hash_pol_win_opaques, &ec);
-
    pv = eina_hash_find(hash_pol_visibilities, &ec);
    if (!pv) return;
 
@@ -303,5 +249,5 @@ e_mod_pol_client_window_opaque_set(E_Client *ec)
    opaque = cdata->opaque_state;
 #endif
 
-   _win_opaque_add(ec, opaque);
+   ec->visibility.opaque = opaque;
 }