e_zone: added APIs for orientation callback 50/81150/2
authorMinJeong Kim <minjjj.kim@samsung.com>
Thu, 21 Jul 2016 13:19:58 +0000 (22:19 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 25 Jul 2016 13:34:25 +0000 (22:34 +0900)
Change-Id: I481a844262f985630d262ab53e259ac8cee783e3
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_zone.c
src/bin/e_zone.h

index ed9d399e322fa3fe0ec8a7a0abc8d3d95aa3da69..18ba390868ef51414d5f64c1caaba4d1a6170380 100644 (file)
@@ -1154,6 +1154,51 @@ e_zone_display_state_get(E_Zone *zone)
    return zone->display_state;
 }
 
+E_API void
+e_zone_orientation_callback_set(E_Zone *zone,
+                                E_Zone_Cb_Orientation_Block_Set block_set,
+                                E_Zone_Cb_Orientation_Force_Update_Add force_update_add,
+                                E_Zone_Cb_Orientation_Force_Update_Del force_update_del)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->orientation.block_set = block_set;
+   zone->orientation.force_update_add = force_update_add;
+   zone->orientation.force_update_del = force_update_del;
+}
+
+E_API Eina_Bool
+e_zone_orientation_block_set(E_Zone *zone, const char* name_hint,  Eina_Bool set)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   if (zone->orientation.block_set)
+     return zone->orientation.block_set(zone, name_hint, set);
+
+   return EINA_FALSE;
+}
+
+E_API void
+e_zone_orientation_force_update_add(E_Zone *zone, E_Client *client)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   if (zone->orientation.force_update_add)
+     zone->orientation.force_update_add(zone, (void*)client);
+}
+
+E_API void
+e_zone_orientation_force_update_del(E_Zone *zone, E_Client *client)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   if (zone->orientation.force_update_del)
+     zone->orientation.force_update_del(zone, (void*)client);
+}
 
 /* local subsystem functions */
 static void
index 73693bcabda4ff9c27b93daadc1c68a39f5284c8..dceefbce72bba3f38d7c8e838f1e964b25349997 100644 (file)
@@ -41,6 +41,10 @@ typedef struct _E_Event_Zone_Display_State_Change   E_Event_Zone_Display_State_C
 #ifndef E_ZONE_H
 #define E_ZONE_H
 
+typedef Eina_Bool (*E_Zone_Cb_Orientation_Block_Set)(E_Zone *zone, const char* name_hint, Eina_Bool set);
+typedef void      (*E_Zone_Cb_Orientation_Force_Update_Add)(E_Zone *zone, E_Client *client);
+typedef void      (*E_Zone_Cb_Orientation_Force_Update_Del)(E_Zone *zone, E_Client *client);
+
 #define E_ZONE_TYPE (int)0xE0b0100d
 
 struct _E_Zone
@@ -108,6 +112,13 @@ struct _E_Zone
    } rot;
 #endif
 
+   struct
+   {
+      E_Zone_Cb_Orientation_Block_Set block_set;
+      E_Zone_Cb_Orientation_Force_Update_Add force_update_add;
+      E_Zone_Cb_Orientation_Force_Update_Del force_update_del;
+   } orientation;
+
    E_Zone_Display_State display_state;
    char                 *output_id; // same id we get from e_comp_screen so look it up there
 };
@@ -196,6 +207,11 @@ E_API void      e_zone_fade_handle(E_Zone *zone, int out, double tim);
 E_API void                 e_zone_display_state_set(E_Zone *zone, E_Zone_Display_State state);
 E_API E_Zone_Display_State e_zone_display_state_get(E_Zone *zone);
 
+E_API void      e_zone_orientation_callback_set(E_Zone *zone, E_Zone_Cb_Orientation_Block_Set block_set, E_Zone_Cb_Orientation_Force_Update_Add force_update_add, E_Zone_Cb_Orientation_Force_Update_Del force_update_del);
+E_API Eina_Bool e_zone_orientation_block_set(E_Zone *zone, const char *name_hint, Eina_Bool set);
+E_API void      e_zone_orientation_force_update_add(E_Zone *zone, E_Client *client);
+E_API void      e_zone_orientation_force_update_del(E_Zone *zone, E_Client *client);
+
 extern E_API int E_EVENT_ZONE_DESK_COUNT_SET;
 extern E_API int E_EVENT_ZONE_MOVE_RESIZE;
 extern E_API int E_EVENT_ZONE_ADD;