[Tizen][ATSPI] Introduce SetListenPostRender interface 19/288619/8 accepted/tizen/unified/20230310.062701
authorWoochan Lee <wc0917.lee@samsung.com>
Mon, 20 Feb 2023 12:02:37 +0000 (21:02 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Thu, 9 Mar 2023 08:10:55 +0000 (08:10 +0000)
Change-Id: I1b9d8223bb2a72e5f4f16dee195fc734460cddc9

src/lib/elementary/efl_access_object.c
src/lib/elementary/efl_access_object.eo
src/lib/elementary/efl_access_window.eo
src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo
src/lib/elementary/elm_atspi_bridge.c

index b48e067..f08a3f0 100644 (file)
@@ -558,6 +558,15 @@ _efl_access_object_can_highlight_get(const Eo *obj EINA_UNUSED, Efl_Access_Objec
 }
 //
 
+//TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
+EOLIAN static void
+_efl_access_object_listen_render_post_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED, Eina_Bool enabled EINA_UNUSED)
+{
+   WRN("The %s object does not implement the \"listen_render_post\" function.",
+       efl_class_name_get(efl_class_get(obj)));
+}
+//
+
 EOLIAN Efl_Access_Relation_Set
 _efl_access_object_relation_set_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED)
 {
index 59a03d8..10c2637 100644 (file)
@@ -629,6 +629,20 @@ mixin @beta Efl.Access.Object requires Efl.Object
          }
       }
       //
+      //TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
+      @property listen_render_post @protected {
+           [[ To listen render post callback
+
+              It makes to listen render post callback in window,
+              then emit render post callback to atspi client.
+           ]]
+           set {
+           }
+           values {
+              enabled: bool; [[If \@c true, start listen render post callback.]]
+           }
+      }
+      //
    }
    implements {
       Efl.Object.destructor;
index 12c00a8..24c92cd 100644 (file)
@@ -9,5 +9,8 @@ interface @beta Efl.Access.Window
       window,maximized: void; [[Called when window has been maximized]]
       window,minimized: void; [[Called when window has been minimized]]
       window,restored: void; [[Called when window has been restored]]
+      //TIZEN_ONLY(20230220): Add render post event
+      window,render_post: void; [[Called when window has been rendered]]
+      //
    }
 }
index e64e6f2..3bb5f97 100644 (file)
@@ -351,6 +351,10 @@ struct _Efl_Ui_Win_Data
    // TIZEN_ONLY(20160120): support visibility_change event
    Eina_Bool    obscured : 1;
    //
+
+   //TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
+   Eina_Bool    listen_render_post : 1;
+   //
 };
 
 struct _Input_Pointer_Iterator
@@ -8575,6 +8579,33 @@ _efl_ui_win_efl_access_object_attributes_get(const Eo *obj, Efl_Ui_Win_Data *sd)
 }
 //
 
+//TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
+static void
+_elm_win_render_post_event_cb(void *data,
+                              Evas *e EINA_UNUSED,
+                              void *event_info EINA_UNUSED)
+{
+   Eo *win = data;
+
+   efl_access_object_event_emit(win, EFL_ACCESS_WINDOW_EVENT_WINDOW_RENDER_POST, NULL);
+}
+
+EOLIAN void
+_efl_ui_win_efl_access_object_listen_render_post_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
+{
+   if (enabled && !sd->listen_render_post)
+     {
+        evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_POST,_elm_win_render_post_event_cb, obj);
+        sd->listen_render_post = EINA_TRUE;
+     }
+   else if (!enabled && sd->listen_render_post)
+     {
+        evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_POST, _elm_win_render_post_event_cb, obj);
+        sd->listen_render_post = EINA_FALSE;
+     }
+}
+//
+
 EOLIAN static Eina_Rect
 _efl_ui_win_efl_access_component_extents_get(const Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
 {
index b19111e..2632f9f 100644 (file)
@@ -865,6 +865,9 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
       //TIZEN_ONLY(20220322): add resource id to window attribute
       Efl.Access.Object.attributes { get; }
       //
+      //TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
+      Efl.Access.Object.listen_render_post { set;}
+      //
       Efl.Access.Component.extents { get; }
       Efl.Access.Widget.Action.elm_actions { get; }
       Efl.Input.State.modifier_enabled { get; }
index bbe5a00..05b5b2b 100644 (file)
@@ -241,6 +241,9 @@ static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = {
    { EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED, _window_signal_send},
    { EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED, _window_signal_send},
    { EFL_ACCESS_WINDOW_EVENT_WINDOW_RESTORED, _window_signal_send},
+   //TIZEN_ONLY(20230220): Add render post event
+   { EFL_ACCESS_WINDOW_EVENT_WINDOW_RENDER_POST, _window_signal_send},
+   //
    { EFL_ACCESS_SELECTION_EVENT_ACCESS_SELECTION_CHANGED, _selection_signal_send},
    { EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, _text_caret_moved_send },
    { EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_INSERTED, _text_text_inserted_send },
@@ -333,6 +336,9 @@ enum _Atspi_Window_Signals
    ATSPI_WINDOW_EVENT_SHADE,
    ATSPI_WINDOW_EVENT_UUSHADE,
    ATSPI_WINDOW_EVENT_RESTYLE,
+   //TIZEN_ONLY(20230220): Add render post event
+   ATSPI_WINDOW_EVENT_RENDER_POST,
+   //
 };
 
 static const Eldbus_Signal _event_obj_signals[] = {
@@ -387,6 +393,9 @@ static const Eldbus_Signal _window_obj_signals[] = {
    [ATSPI_WINDOW_EVENT_SHADE] = {"Shade", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
    [ATSPI_WINDOW_EVENT_UUSHADE] = {"uUshade", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
    [ATSPI_WINDOW_EVENT_RESTYLE] = {"Restyle", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
+   //TIZEN_ONLY(20230220): Add render post event
+   [ATSPI_WINDOW_EVENT_RENDER_POST] = {"PostRender", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
+   //
    {NULL, ELDBUS_ARGS({NULL, NULL}), 0}
 };
 
@@ -1033,6 +1042,29 @@ _accessible_gesture_do(const Eldbus_Service_Interface *iface, const Eldbus_Messa
 }
 //
 
+//TIZEN_ONLY(20230220) Add SetListenPostRender to accessible object
+static Eldbus_Message *
+_accessible_set_listen_render_post(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+   const char *obj_path = eldbus_message_path_get(msg);
+   Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
+   Eo *obj = _bridge_object_from_path(bridge, obj_path);
+   Eina_Bool enabled;
+   Eldbus_Message *ret = NULL;
+   Eina_Bool result = EINA_FALSE;
+
+   if (!eldbus_message_arguments_get(msg, "b", &enabled))
+     return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
+
+   ret = eldbus_message_method_return_new(msg);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+   efl_access_object_listen_render_post_set(obj, enabled);
+
+   return ret;
+}
+//
+
 static Eina_Bool
 _ee_obscured_get(Eo *obj)
 {
@@ -1615,6 +1647,9 @@ static const Eldbus_Method accessible_methods[] = {
      NULL, ELDBUS_ARGS({"(so)", "defaultLabelObject"}, {"u", "defaultLabelRole"},{"a{ss}", "attributes"}),
      _accessible_default_label_info_get, 0},
    //
+   //TIZEN_ONLY(20230220): Provide render post callback to client
+   { "SetListenPostRender", ELDBUS_ARGS({"b", "enabled"}), NULL, _accessible_set_listen_render_post, 0 },
+   //
    { NULL, NULL, NULL, NULL, 0 }
 };
 
@@ -6119,6 +6154,10 @@ _set_broadcast_flag(const char *event, Eo *bridge)
           STATE_TYPE_SET(pd->window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_RESIZE);
         else if (!strcmp(tokens[1], "Restore"))
           STATE_TYPE_SET(pd->window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_RESTORE);
+        //TIZEN_ONLY(20230220): Add render post event
+        else if (!strcmp(tokens[1], "PostRender"))
+          STATE_TYPE_SET(pd->window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_RENDER_POST);
+        //
      }
 
 end:
@@ -6546,6 +6585,10 @@ _window_signal_send(void *data, const Efl_Event *event)
      type = ATSPI_WINDOW_EVENT_DEACTIVATE;
    else if (event->desc == EFL_ACCESS_WINDOW_EVENT_WINDOW_ACTIVATED)
      type = ATSPI_WINDOW_EVENT_ACTIVATE;
+   //TIZEN_ONLY(20230220): Add render post event
+   else if (event->desc == EFL_ACCESS_WINDOW_EVENT_WINDOW_RENDER_POST)
+     type = ATSPI_WINDOW_EVENT_RENDER_POST;
+   //
    else if (event->desc == EFL_ACCESS_WINDOW_EVENT_WINDOW_MAXIMIZED)
      type = ATSPI_WINDOW_EVENT_MAXIMIZE;
    else if (event->desc == EFL_ACCESS_WINDOW_EVENT_WINDOW_MINIMIZED)