e_focus : add e_focus_focused_ec_changed_listener_add 44/308944/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 3 Apr 2024 04:39:19 +0000 (13:39 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 3 Apr 2024 05:32:07 +0000 (14:32 +0900)
This function registers the wl_listener which let it know
when the focused ec has been changed.

Change-Id: If3776747e9c0da023ac65d1c7a4de6684d683d76

src/bin/e_focus.c
src/bin/e_focus_intern.h
src/bin/e_focus_policy_iface.h

index 8de9bd4..6c0ef66 100644 (file)
@@ -95,3 +95,18 @@ e_focus_update(E_Focus *focus)
 
    return policy_iface->update(policy_iface->impl);
 }
+
+EINTERN void
+e_focus_focused_ec_changed_listener_add(E_Focus *focus, struct wl_listener *listener)
+{
+   E_Focus_Policy_Iface *policy_iface;
+
+   EINA_SAFETY_ON_NULL_RETURN(focus);
+   EINA_SAFETY_ON_NULL_RETURN(focus->policy_iface);
+   policy_iface = focus->policy_iface;
+   EINA_SAFETY_ON_NULL_RETURN(policy_iface->focused_ec_changed_listener_add);
+
+   policy_iface->focused_ec_changed_listener_add(policy_iface->impl, listener);
+
+   return;
+}
index 648a740..fb3e3f1 100644 (file)
@@ -9,5 +9,6 @@ EINTERN E_Focus   *e_focus_new(E_Zone* zone, E_Focus_Policy_Ext policy_type);
 EINTERN void       e_focus_del(E_Focus *focus);
 EINTERN E_Client  *e_focus_focused_ec_get(E_Focus *focus);  // get the current focused ec
 EINTERN Eina_Bool  e_focus_update(E_Focus *focus); // update (find and set) the current focused ec
+EINTERN void       e_focus_focused_ec_changed_listener_add(E_Focus *focus, struct wl_listener *listener);
 
 #endif
index ed27b8d..f1fcf75 100644 (file)
@@ -14,6 +14,7 @@ struct _E_Focus_Policy_Iface
 
    E_Client   *(*focused_ec_get)(E_Focus_Policy_Impl *impl);  // get the current focused ec
    Eina_Bool   (*update)(E_Focus_Policy_Impl *impl);          // update the current focus
+   void        (*focused_ec_changed_listener_add)(E_Focus_Policy_Impl *impl, struct wl_listener *listener); // add the listener to notify focused_ec_changed
 };
 
 EINTERN E_Focus_Policy_Iface *e_focus_policy_iface_topmost_new(E_Zone* zone);