From 9b09b11c226b04ae9722bf6ccd0e120d5cfb686c Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 5 Nov 2015 17:27:25 +0900 Subject: [PATCH] e_zone: added display state feature - event type: E_EVENT_ZONE_DISPLAY_STATE_CHANGE - APIs: e_zone_display_state_set/get - added a value(display_state) in the E_Zone structure Change-Id: I8a6ed17f0a4e623a1a1fdffa6ee598275c0bce23 --- src/bin/e_zone.c | 31 +++++++++++++++++++++++++++++++ src/bin/e_zone.h | 19 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index 2436837..3a8ed10 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -34,6 +34,7 @@ EAPI int E_EVENT_ZONE_ROTATION_CHANGE_BEGIN = 0; EAPI int E_EVENT_ZONE_ROTATION_CHANGE_CANCEL = 0; EAPI int E_EVENT_ZONE_ROTATION_CHANGE_END = 0; #endif +EAPI int E_EVENT_ZONE_DISPLAY_STATE_CHANGE = 0; #define E_ZONE_FLIP_LEFT(zone) (((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0)) && (zone)->edge.left) #define E_ZONE_FLIP_RIGHT(zone) (((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count)) && (zone)->edge.right) @@ -60,6 +61,7 @@ e_zone_init(void) E_EVENT_ZONE_ROTATION_CHANGE_CANCEL = ecore_event_type_new(); E_EVENT_ZONE_ROTATION_CHANGE_END = ecore_event_type_new(); #endif + E_EVENT_ZONE_DISPLAY_STATE_CHANGE = ecore_event_type_new(); return 1; } @@ -216,6 +218,8 @@ e_zone_new(E_Comp *c, int num, int id, int x, int y, int w, int h) zone->useful_geometry.w = -1; zone->useful_geometry.h = -1; + zone->display_state = E_ZONE_DISPLAY_STATE_ON; + //printf("@@@@@@@@@@ e_zone_new: %i %i | %i %i %ix%i = %p\n", num, id, x, y, w, h, zone); snprintf(name, sizeof(name), "Zone %d", zone->num); @@ -1441,6 +1445,33 @@ e_zone_unstow(E_Zone *zone) zone->stowed = EINA_FALSE; } +EAPI void +e_zone_display_state_set(E_Zone *zone, E_Zone_Display_State state) +{ + E_Event_Zone_Display_State_Change *ev; + + E_OBJECT_CHECK(zone); + E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); + + zone->display_state = state; + + ev = E_NEW(E_Event_Zone_Display_State_Change, 1); + if (!ev) return; + ev->zone = zone; + e_object_ref(E_OBJECT(ev->zone)); + ecore_event_add(E_EVENT_ZONE_DISPLAY_STATE_CHANGE, ev, _e_zone_event_generic_free, NULL); +} + +EAPI E_Zone_Display_State +e_zone_display_state_get(E_Zone *zone) +{ + E_OBJECT_CHECK_RETURN(zone, E_ZONE_DISPLAY_STATE_OFF); + E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, E_ZONE_DISPLAY_STATE_OFF); + + return zone->display_state; +} + + /* local subsystem functions */ static void _e_zone_free(E_Zone *zone) diff --git a/src/bin/e_zone.h b/src/bin/e_zone.h index dc24915..c967463 100644 --- a/src/bin/e_zone.h +++ b/src/bin/e_zone.h @@ -13,6 +13,12 @@ typedef enum _E_Zone_Edge E_ZONE_EDGE_BOTTOM_LEFT } E_Zone_Edge; +typedef enum _E_Zone_Display_State +{ + E_ZONE_DISPLAY_STATE_OFF, + E_ZONE_DISPLAY_STATE_ON, +} E_Zone_Display_State; + typedef struct _E_Zone E_Zone; typedef struct _E_Event_Zone_Generic E_Event_Zone_Desk_Count_Set; @@ -29,6 +35,7 @@ typedef struct _E_Event_Zone_Rotation_Change_Begin E_Event_Zone_Rotation_Change typedef struct _E_Event_Zone_Rotation_Change_Cancel E_Event_Zone_Rotation_Change_Cancel; typedef struct _E_Event_Zone_Rotation_Change_End E_Event_Zone_Rotation_Change_End; #endif +typedef struct _E_Event_Zone_Display_State_Change E_Event_Zone_Display_State_Change; #else #ifndef E_ZONE_H @@ -106,6 +113,8 @@ struct _E_Zone Eina_Bool unknown_state : 1; } rot; #endif + + E_Zone_Display_State display_state; }; struct _E_Event_Zone_Generic @@ -152,6 +161,11 @@ struct _E_Event_Zone_Rotation_Change_End }; #endif +struct _E_Event_Zone_Display_State_Change +{ + E_Zone *zone; +}; + EINTERN int e_zone_init(void); EINTERN int e_zone_shutdown(void); EAPI E_Zone *e_zone_new(E_Comp *con, int num, int id, int x, int y, int w, int h); @@ -185,6 +199,9 @@ EAPI void e_zone_unstow(E_Zone *zone); EAPI void e_zone_fade_handle(E_Zone *zone, int out, double tim); +EAPI void e_zone_display_state_set(E_Zone *zone, E_Zone_Display_State state); +EAPI E_Zone_Display_State e_zone_display_state_get(E_Zone *zone); + extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET; extern EAPI int E_EVENT_ZONE_MOVE_RESIZE; extern EAPI int E_EVENT_ZONE_ADD; @@ -202,5 +219,7 @@ extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE_CANCEL; extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE_END; #endif +extern EAPI int E_EVENT_ZONE_DISPLAY_STATE_CHANGE; + #endif #endif -- 2.7.4