e_client: added API to change client pixmap 68/72368/3
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 31 May 2016 15:09:34 +0000 (00:09 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Thu, 2 Jun 2016 04:28:58 +0000 (21:28 -0700)
Change-Id: I7a8268b0d5c3ff8885eb56d354b39afbc7e42598
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_client.c
src/bin/e_client.h

index 998fcfe..88bbf3e 100644 (file)
@@ -6051,3 +6051,33 @@ e_client_transform_core_transform_get(E_Client *ec, int index)
 
    return (E_Util_Transform*)eina_list_nth(ec->transform_core.transform_list, index);
 }
+
+E_API E_Pixmap *
+e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp)
+{
+   E_Pixmap_Type oldtype, newtype;
+   E_Pixmap *oldcp;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec->pixmap, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(newcp, NULL);
+
+   oldcp = ec->pixmap;
+
+   oldtype = e_pixmap_type_get(oldcp);
+   if (oldtype >= E_PIXMAP_TYPE_MAX) return NULL;
+
+   newtype = e_pixmap_type_get(newcp);
+   if (newtype >= E_PIXMAP_TYPE_MAX) return NULL;
+
+   if (eina_hash_find(clients_hash[oldtype], &oldcp))
+     eina_hash_del_by_key(clients_hash[oldtype], &oldcp);
+   e_pixmap_client_set(oldcp, NULL);
+
+   ec->pixmap = newcp;
+   e_pixmap_client_set(newcp, ec);
+
+   eina_hash_add(clients_hash[newtype], &newcp, ec);
+
+   return oldcp;
+}
index 26fc521..44ba01f 100644 (file)
@@ -1021,6 +1021,8 @@ E_API void              e_client_transform_core_update(E_Client *ec);
 E_API int               e_client_transform_core_transform_count_get(E_Client *ec);
 E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int index);
 
+E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
+
 /**
  * Move window to coordinates that do not account client decorations yet.
  *