e_comp_object: remove "hiding" smart call 69/309569/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 12 Apr 2024 04:37:43 +0000 (13:37 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 12 Apr 2024 06:08:30 +0000 (15:08 +0900)
e_comp_object provide hiding singal and e_conformant_part
use this signal.

Change-Id: I997a6809f407b77519554b046f7805295a8fa8aa

src/bin/e_comp_object.c
src/bin/e_comp_object_intern.h
src/bin/e_policy_conformant.c

index 6a85994..07fdcb4 100644 (file)
@@ -2471,7 +2471,9 @@ _e_comp_intercept_hide(void *data, Evas_Object *obj)
                     _e_comp_object_animating_begin(cw);
                   if (!_e_comp_object_effect_visibility_start(cw, 0)) return;
                }
-             evas_object_smart_callback_call(obj, "hiding", cw->ec);
+
+             wl_signal_emit(&cw->events.hiding, NULL);
+
              cw->defer_hide = !!cw->animating;
              if (!cw->animating)
                e_comp_object_effect_set(obj, NULL);
@@ -3192,6 +3194,7 @@ _e_comp_smart_add(Evas_Object *obj)
 #endif
    wl_signal_init(&cw->events.show);
    wl_signal_init(&cw->events.hide);
+   wl_signal_init(&cw->events.hiding);
 #ifdef REFACTOR_DESK_AREA
    wl_signal_init(&cw->events.set_layer);
    wl_signal_init(&cw->events.stack_above);
@@ -6691,6 +6694,13 @@ e_comp_object_hide_listener_add(Evas_Object *obj, struct wl_listener *listener)
    wl_signal_add(&cw->events.hide, listener);
 }
 
+EINTERN void
+e_comp_object_hiding_listener_add(Evas_Object *obj, struct wl_listener *listener)
+{
+   API_ENTRY;
+   wl_signal_add(&cw->events.hiding, listener);
+}
+
 #ifdef REFACTOR_DESK_AREA
 EINTERN void
 e_comp_object_set_layer_listener_add(Evas_Object *obj, struct wl_listener *listener)
index a6ee784..be895f4 100644 (file)
@@ -146,6 +146,7 @@ struct _E_Comp_Object
         struct wl_signal raise;
         struct wl_signal show;
         struct wl_signal hide;
+        struct wl_signal hiding;
         struct wl_signal set_layer;
         struct wl_signal stack_above;
         struct wl_signal stack_below;
@@ -281,6 +282,7 @@ EINTERN void e_comp_object_raise_listener_add(Evas_Object *obj, struct wl_listen
 //#endif
 EINTERN void e_comp_object_show_listener_add(Evas_Object *obj, struct wl_listener *listener);
 EINTERN void e_comp_object_hide_listener_add(Evas_Object *obj, struct wl_listener *listener);
+EINTERN void e_comp_object_hiding_listener_add(Evas_Object *obj, struct wl_listener *listener);
 //#ifdef REFACTOR_DESK_AREA
 EINTERN void e_comp_object_set_layer_listener_add(Evas_Object *obj, struct wl_listener *listener);
 EINTERN void e_comp_object_stack_above_listener_add(Evas_Object *obj, struct wl_listener *listener);
index 9609eb1..8cbd084 100644 (file)
@@ -1,6 +1,7 @@
 #include "e_policy_intern.h"
 #include "e_comp_wl_intern.h"
 #include "e_config_intern.h"
+#include "e_comp_object_intern.h"
 
 #include <wayland-server.h>
 #include <tizen-extension-server-protocol.h>
@@ -28,24 +29,31 @@ typedef struct
    E_Client_Hook *owner_del_hook;
 } Defer_Job;
 
+
 typedef struct
 {
+   Conformant_Type type;
+   E_Client *ec;
+   E_Client *owner;
    struct
-     {
-        E_Client *ec;
-        E_Client *owner;
-        struct
-          {
-             Eina_Bool restore;
-             Eina_Bool visible;
-             int x, y, w, h;
-             Eina_Bool will_hide;
-          } state;
+      {
+         Eina_Bool restore;
+         Eina_Bool visible;
+         int x, y, w, h;
+         Eina_Bool will_hide;
+      } state;
+
+   Eina_Bool changed : 1;
+   Eina_List *defer_jobs;
+   uint32_t last_serial;
 
-        Eina_Bool changed : 1;
-        Eina_List *defer_jobs;
-        uint32_t last_serial;
-     } part[CONFORMANT_TYPE_MAX];
+   // comp_object listeners
+   struct wl_listener comp_object_hiding;
+} Conformant_Part;
+
+typedef struct
+{
+   Conformant_Part part[CONFORMANT_TYPE_MAX];
 
    Eina_Hash *client_hash;
    Eina_List *handlers;
@@ -563,22 +571,25 @@ _conf_cb_part_obj_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
 }
 
 static void
-_conf_cb_part_obj_hiding(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+_conf_part_cb_comp_object_hiding(struct wl_listener *listener, void *data)
 {
-   Conformant_Type type = (Conformant_Type)data;
+   Conformant_Part *conf_part;
 
-   if (!g_conf)
-     return;
+   conf_part = wl_container_of(listener, conf_part, comp_object_hiding);
 
-   DBG("PART %s win(%zx), ec(%p) Hiding", _conf_type_to_str(type), e_client_util_win_get(g_conf->part[type].ec), g_conf->part[type].ec);
-   _conf_state_update(type,
+   DBG("PART %s win(%zx), ec(%p) Hiding",
+      _conf_type_to_str(conf_part->type), e_client_util_win_get(conf_part->ec), conf_part->ec);
+
+   _conf_state_update(conf_part->type,
                       EINA_FALSE,
-                      g_conf->part[type].state.x,
-                      g_conf->part[type].state.y,
-                      g_conf->part[type].state.w,
-                      g_conf->part[type].state.h);
-   g_conf->part[type].owner = NULL;
+                      conf_part->state.x,
+                      conf_part->state.y,
+                      conf_part->state.w,
+                      conf_part->state.h);
+
+   conf_part->owner = NULL;
 }
+
 static void
 _conf_cb_part_obj_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
@@ -621,6 +632,7 @@ _conf_part_register(E_Client *ec, Conformant_Type type)
    INF("%s Registered ec:%p", _conf_type_to_str(type), ec);
 
    g_conf->part[type].ec = ec;
+   g_conf->part[type].type = type;
 
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,      _conf_cb_part_obj_del,     (void*)type);
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,     _conf_cb_part_obj_show,    (void*)type);
@@ -628,7 +640,8 @@ _conf_part_register(E_Client *ec, Conformant_Type type)
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOVE,     _conf_cb_part_obj_move,    (void*)type);
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESIZE,   _conf_cb_part_obj_resize,  (void*)type);
 
-   evas_object_smart_callback_add(ec->frame, "hiding", _conf_cb_part_obj_hiding, (void*)type);
+   g_conf->part[type].comp_object_hiding.notify = _conf_part_cb_comp_object_hiding;
+   e_comp_object_hiding_listener_add(ec->frame, &g_conf->part[type].comp_object_hiding);
 }
 
 static void
@@ -652,6 +665,9 @@ _conf_part_deregister(E_Client *ec, Conformant_Type type)
         return;
      }
 
+   // wl_list remove
+   wl_list_remove(&g_conf->part[type].comp_object_hiding.link);
+
    // deregister callback
    evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL,      _conf_cb_part_obj_del,     (void*)type);
    evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_SHOW,     _conf_cb_part_obj_show,    (void*)type);
@@ -659,9 +675,7 @@ _conf_part_deregister(E_Client *ec, Conformant_Type type)
    evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_MOVE,     _conf_cb_part_obj_move,    (void*)type);
    evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_RESIZE,   _conf_cb_part_obj_resize,  (void*)type);
 
-   evas_object_smart_callback_del_full(ec->frame, "hiding", _conf_cb_part_obj_hiding, (void*)type);
-
-
+   g_conf->part[type].type = CONFORMANT_TYPE_MAX;
    g_conf->part[type].ec = NULL;
    g_conf->part[type].state.will_hide = EINA_FALSE;
    g_conf->part[type].last_serial = 0;