Add Data structure encapsulation for e_zone 74/313274/1
authorjinbong.lee <jinbong.lee@samsung.com>
Thu, 20 Jun 2024 05:21:39 +0000 (05:21 +0000)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 21 Jun 2024 08:14:09 +0000 (17:14 +0900)
 - add some get / set interfaces for variable of E_Zone structure
 - e_zone_display_state_get is changed from EINTERN to E_API

Change-Id: I1146b6d998c318b0b055d85bad14d0d8800fcd05

src/bin/core/e_zone.c
src/bin/core/e_zone_intern.h
src/include/e_zone.h

index f16747f..7d5cb1e 100644 (file)
@@ -771,6 +771,24 @@ e_zone_current_get(void)
    return eina_list_data_get(e_comp->zones);
 }
 
+E_API int
+e_zone_id_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->id;
+}
+
+E_API int
+e_zone_number_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->num;
+}
+
 EINTERN E_Zone *
 e_zone_get_by_id(int id)
 {
@@ -1182,7 +1200,7 @@ e_zone_display_state_set(E_Zone *zone, E_Zone_Display_State state)
    ecore_event_add(E_EVENT_ZONE_DISPLAY_STATE_CHANGE, ev, _e_zone_event_generic_free, NULL);
 }
 
-EINTERN E_Zone_Display_State
+E_API E_Zone_Display_State
 e_zone_display_state_get(E_Zone *zone)
 {
    E_OBJECT_CHECK_RETURN(zone, E_ZONE_DISPLAY_STATE_OFF);
@@ -1191,6 +1209,15 @@ e_zone_display_state_get(E_Zone *zone)
    return zone->display_state;
 }
 
+E_API char *
+e_zone_output_id_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, NULL);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
+
+   return zone->output_id;
+}
+
 E_API void
 e_zone_orientation_callback_set(E_Zone *zone,
                                 E_Zone_Cb_Orientation_Block_Set block_set,
@@ -1439,6 +1466,213 @@ e_zone_hook_del(E_Zone_Hook *zh)
      _e_zone_hooks_delete++;
 }
 
+E_API void
+e_zone_rotation_prev_angle_set(E_Zone *zone, int angle)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.prev = angle;
+}
+
+E_API int
+e_zone_rotation_prev_angle_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->rot.prev;
+}
+
+E_API void
+e_zone_rotation_curr_angle_set(E_Zone *zone, int angle)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.curr = angle;
+}
+
+E_API int
+e_zone_rotation_curr_angle_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->rot.curr;
+}
+
+E_API void
+e_zone_rotation_next_angle_set(E_Zone *zone, int angle)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.next = angle;
+}
+
+E_API int
+e_zone_rotation_next_angle_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->rot.next;
+}
+
+E_API void
+e_zone_rotation_sub_angle_set(E_Zone *zone, int angle)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.sub = angle;
+}
+
+E_API int
+e_zone_rotation_sub_angle_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->rot.sub;
+}
+
+E_API void
+e_zone_rotation_act_angle_set(E_Zone *zone, int angle)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.act = angle;
+}
+
+E_API int
+e_zone_rotation_act_angle_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, -1);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, -1);
+
+   return zone->rot.act;
+}
+
+E_API void
+e_zone_rotation_unblock_app_hint_set(E_Zone *zone, Eina_Bool unblock_app_hint)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.unblock.app_hint = unblock_app_hint;
+}
+
+E_API Eina_Bool
+e_zone_rotation_unblock_app_hint_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   return zone->rot.unblock.app_hint;
+}
+
+E_API void
+e_zone_rotation_block_mod_count_set(E_Zone *zone, int block_mod_count)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.block.mod_count = block_mod_count;
+}
+
+E_API int
+e_zone_rotation_block_mod_count_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, 0);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
+
+   return zone->rot.block.mod_count;
+}
+
+E_API void
+e_zone_rotation_block_sys_auto_rot_set(E_Zone *zone, Eina_Bool block_sys_auto_rot)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.block.sys_auto_rot = block_sys_auto_rot;
+}
+
+E_API Eina_Bool
+e_zone_rotation_block_sys_auto_rot_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   return zone->rot.block.sys_auto_rot;
+}
+
+E_API void
+e_zone_rotation_unknown_state_set(E_Zone *zone, Eina_Bool unknown_state)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.unknown_state = unknown_state;
+}
+
+E_API Eina_Bool
+e_zone_rotation_unknown_state_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   return zone->rot.unknown_state;
+}
+
+E_API void
+e_zone_rotation_wait_for_done_set(E_Zone *zone, Eina_Bool wait_for_done)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.wait_for_done = wait_for_done;
+}
+
+E_API Eina_Bool
+e_zone_rotation_wait_for_done_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   return zone->rot.wait_for_done;
+}
+
+E_API void
+e_zone_rotation_pending_set(E_Zone *zone, Eina_Bool pending)
+{
+   E_OBJECT_CHECK(zone);
+   E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
+
+   zone->rot.pending = pending;
+}
+
+E_API Eina_Bool
+e_zone_rotation_pending_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, EINA_FALSE);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE);
+
+   return zone->rot.pending;
+}
+
+E_API Evas_Object *
+e_zone_over_get(E_Zone *zone)
+{
+   E_OBJECT_CHECK_RETURN(zone, NULL);
+   E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
+
+   return zone->over;
+}
+
 EINTERN E_Zone *
 e_zone_screen_new(int num, int w, int h)
 {
index 88b8cea..ac94a5f 100644 (file)
@@ -28,7 +28,6 @@ EINTERN void                 e_zone_client_add(E_Zone *zone, E_Client *ec);
 EINTERN Eina_Bool            e_zone_has_ec(E_Zone *zone, E_Client *ec);
 EINTERN Eina_Bool            e_zone_is_displaying(E_Zone *zone);
 EINTERN Eina_Bool            e_zone_visibility_calculate(E_Zone *zone);
-EINTERN E_Zone_Display_State e_zone_display_state_get(E_Zone *zone);
 
 EINTERN void      e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count);
 EINTERN void      e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count);
index 8190cbc..e41e5cb 100644 (file)
@@ -67,7 +67,7 @@ struct _E_Zone
    const char  *name;
    /* num matches the id of the xinerama screen
     * this zone belongs to. */
-   unsigned int num;
+   int num;
 
    EINA_DEPRECATED Evas_Object *bg_object;
    Evas_Object *bg_event_object;
@@ -185,10 +185,15 @@ extern E_API int E_EVENT_ZONE_ROTATION_EFFECT_DONE;
 #endif
 
 E_API E_Zone    *e_zone_current_get(void);
+E_API int        e_zone_id_get(E_Zone *zone);
+E_API int        e_zone_number_get(E_Zone *zone);
+E_API char      *e_zone_output_id_get(E_Zone *zone);
 E_API void       e_zone_useful_geometry_get(E_Zone *zone, int *x, int *y, int *w, int *h);
-E_API void       e_zone_display_state_set(E_Zone *zone, E_Zone_Display_State state);
 E_API E_Desk    *e_zone_desk_find_by_ec(E_Zone *zone, E_Client *ec);
 
+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);
@@ -197,4 +202,34 @@ E_API void        e_zone_orientation_force_update_del(E_Zone *zone, E_Client *cl
 E_API E_Zone_Hook *e_zone_hook_add(E_Zone_Hook_Point hookpoint, E_Zone_Hook_Cb func, const void *data);
 E_API void         e_zone_hook_del(E_Zone_Hook *zh);
 
+#ifdef _F_ZONE_WINDOW_ROTATION_
+E_API void        e_zone_rotation_prev_angle_set(E_Zone *zone, int angle);
+E_API int         e_zone_rotation_prev_angle_get(E_Zone *zone);
+E_API void        e_zone_rotation_curr_angle_set(E_Zone *zone, int angle);
+E_API int         e_zone_rotation_curr_angle_get(E_Zone *zone);
+E_API void        e_zone_rotation_next_angle_set(E_Zone *zone, int angle);
+E_API int         e_zone_rotation_next_angle_get(E_Zone *zone);
+E_API void        e_zone_rotation_sub_angle_set(E_Zone *zone, int angle);
+E_API int         e_zone_rotation_sub_angle_get(E_Zone *zone);
+E_API void        e_zone_rotation_act_angle_set(E_Zone *zone, int angle);
+E_API int         e_zone_rotation_act_angle_get(E_Zone *zone);
+
+E_API void        e_zone_rotation_unblock_app_hint_set(E_Zone *zone, Eina_Bool unblock_app_hint);
+E_API Eina_Bool   e_zone_rotation_unblock_app_hint_get(E_Zone *zone);
+
+E_API void        e_zone_rotation_block_mod_count_set(E_Zone *zone, int block_mod_count);
+E_API int         e_zone_rotation_block_mod_count_get(E_Zone *zone);
+E_API void        e_zone_rotation_block_sys_auto_rot_set(E_Zone *zone, Eina_Bool block_sys_auto_rot);
+E_API Eina_Bool   e_zone_rotation_block_sys_auto_rot_get(E_Zone *zone);
+
+E_API void        e_zone_rotation_unknown_state_set(E_Zone *zone, Eina_Bool unknown_state);
+E_API Eina_Bool   e_zone_rotation_unknown_state_get(E_Zone *zone);
+E_API void        e_zone_rotation_wait_for_done_set(E_Zone *zone, Eina_Bool wait_for_done);
+E_API Eina_Bool   e_zone_rotation_wait_for_done_get(E_Zone *zone);
+E_API void        e_zone_rotation_pending_set(E_Zone *zone, Eina_Bool pending);
+E_API Eina_Bool   e_zone_rotation_pending_get(E_Zone *zone);
+#endif
+
+E_API Evas_Object     *e_zone_over_get(E_Zone *zone);
+
 #endif