Add Data structure encapsulation for e_comp 72/313272/1
authorjinbong.lee <jinbong.lee@samsung.com>
Thu, 20 Jun 2024 05:09:34 +0000 (05:09 +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_Comp structure
  - add some lock / unlock interfaces for mutex variable of E_Comp structure

Change-Id: Ia466ef8fa3ec555148d997b466a8d79df9fce595

src/bin/compmgr/e_comp.c
src/include/e_comp.h

index bf1ef84..19e4e3f 100644 (file)
@@ -876,6 +876,61 @@ e_comp_zone_find(const char *output_id)
    return NULL;
 }
 
+E_API Evas *
+e_comp_evas_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->evas;
+}
+
+E_API Ecore_Evas *
+e_comp_ee_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->ee;
+}
+
+E_API Ecore_Window
+e_comp_ee_win_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, 0);
+
+   return e_comp->ee_win;
+}
+
+E_API Eina_List *
+e_comp_zone_list_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->zones;
+}
+
+E_API Eina_List*
+e_comp_ec_list_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->clients;
+}
+
+E_API Eina_List *
+e_comp_connected_ec_list_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->connected_clients;
+}
+
+E_API Eina_List *
+e_comp_launchscrn_list_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->launchscrns;
+}
 
 E_API Eina_List *
 e_comp_vis_ec_list_get(E_Zone *zone)
@@ -927,6 +982,47 @@ e_comp_vis_ec_list_get(E_Zone *zone)
    return ec_list;
 }
 
+E_API void
+e_comp_size_get(int *w, int *h)
+{
+   EINA_SAFETY_ON_NULL_RETURN(e_comp);
+
+   if (w) *w = e_comp->w;
+   if (h) *h = e_comp->h;
+}
+
+E_API E_Pointer *
+e_comp_pointer_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->pointer;
+}
+
+E_API E_Comp_Screen *
+e_comp_screen_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+
+   return e_comp->e_comp_screen;
+}
+
+E_API int
+e_comp_norender_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, 0);
+
+   return e_comp->norender;
+}
+
+E_API int
+e_comp_nocomp_override_get(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, 0);
+
+   return e_comp->nocomp_override;
+}
+
 static int
 e_getpwnam_r(const char *name)
 {
@@ -1299,6 +1395,8 @@ e_comp_image_filter_set(E_Comp_Image_Filter filter)
 {
    E_Client *ec;
 
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
+
    if (e_comp->image_filter == filter) return EINA_TRUE;
    E_CLIENT_FOREACH(ec)
      {
@@ -1318,6 +1416,22 @@ e_comp_image_filter_get(void)
    return e_comp->image_filter;
 }
 
+E_API void
+e_comp_ec_list_lock(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN(e_comp);
+
+   g_rec_mutex_lock(&e_comp->ec_list_mutex);
+}
+
+E_API void
+e_comp_ec_list_unlock(void)
+{
+   EINA_SAFETY_ON_NULL_RETURN(e_comp);
+
+   g_rec_mutex_lock(&e_comp->ec_list_mutex);
+}
+
 E_API E_Zone *
 e_comp_zone_find_by_ec(E_Client *ec)
 {
index ff4c665..e8ffe7a 100644 (file)
@@ -186,11 +186,28 @@ E_API Eina_Bool       e_comp_grab_input(Eina_Bool mouse, Eina_Bool kbd);
 E_API void            e_comp_ungrab_input(Eina_Bool mouse, Eina_Bool kbd);
 E_API void            e_comp_client_override_add(E_Client *ec);
 E_API void            e_comp_client_override_del(E_Client *ec);
+
+E_API Evas           *e_comp_evas_get(void);
+E_API Ecore_Evas     *e_comp_ee_get(void);
+E_API Ecore_Window    e_comp_ee_win_get(void);
+E_API Eina_List      *e_comp_zone_list_get(void);
+E_API Eina_List      *e_comp_ec_list_get(void);
+E_API Eina_List      *e_comp_connected_ec_list_get(void);
+E_API Eina_List      *e_comp_launchscrn_list_get(void);
 E_API Eina_List      *e_comp_vis_ec_list_get(E_Zone *zone); // visible ec list sorted by z order
 
+E_API void            e_comp_size_get(int *w, int *h);
+E_API E_Pointer      *e_comp_pointer_get(void);
+E_API E_Comp_Screen  *e_comp_screen_get(void);
+E_API int             e_comp_norender_get(void);
+E_API int             e_comp_nocomp_override_get(void);
+
 E_API Eina_Bool           e_comp_image_filter_set(E_Comp_Image_Filter filter);
 E_API E_Comp_Image_Filter e_comp_image_filter_get(void);
 
+E_API void            e_comp_ec_list_lock(void);
+E_API void            e_comp_ec_list_unlock(void);
+
 E_API E_Zone *e_comp_zone_find_by_ec(E_Client *ec);
 E_API E_Desk *e_comp_desk_find_by_ec(E_Client *ec);
 E_API E_Desk_Area *e_comp_desk_area_find_by_ec(E_Client *ec);