atspi: suppress runtime error, build warning 86/136486/2
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 30 Jun 2017 02:35:51 +0000 (11:35 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 4 Jul 2017 05:07:27 +0000 (05:07 +0000)
[runtime error]
(1) elm_atspi_bridge.c:2787 _bridge_path_from_object() safety check failed: eo == NULL
(2) elm_atspi_bridge.c:6184 _bridge_object_register() Unable to register class w/o Elm_Interface_Atspi_Accessible!
(3) lib/eo/eo.c:697 _eo_call_resolve() in elm_widget.eo.c:169: func 'elm_obj_widget_access_highlight_in_theme_get' (288) could not be resolved for class 'Edje_Object'

- Note: The access_highlight_in_theme (3) should handle non Elm_LAYOUT_CLASS.
  Or the access_highlight_in_theme should be removed. If the screen-reader
  shows highlight, then the access_highlight_in_theme doesn't make sense.

[build warning]
(1) warning: passing argument 2 of '_object_get_bus_name_and_path' discards 'const' qualifier from pointer target type
(2) warning: passing argument 3 of '_object_get_bus_name_and_path' from incompatible pointer type

Change-Id: I4a690afdbf90f2bf72b497d0c3916c7fc83ddb74

src/lib/elm_atspi_bridge.c
src/lib/elm_main.c

index fd679fc195ec59f255c9cdf95666b5c13cc34be4..d0f12e8e8de3d5740769bd635f963648ca86ce03 100644 (file)
@@ -181,7 +181,7 @@ static Eina_Bool _on_object_add(void *data, Eo *obj, const Eo_Event_Description
 static Eina_Bool _on_object_del(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED);
 static void _plug_connect(Eldbus_Connection *conn, Eo *proxy);
 static void _socket_ifc_create(Eldbus_Connection *conn, Eo *proxy);
-static void _object_get_bus_name_and_path(Eo *bridge, Eo *obj, const char **bus_name, const char **path);
+static void _object_get_bus_name_and_path(Eo *bridge, const Eo *obj, const char **bus_name, const char **path);
 // TIZEN_ONLY(20170310) - implementation of get object under coordinates for accessibility
 static Eo *_calculate_navigable_accessible_at_point(Eo *bridge, Eo *root, Eina_Bool coord_type, int x, int y);
 static Eo *_calculate_neighbor(Eo *bridge, Eo *root, Eo *current, Eina_Bool forward, int search_mode);
@@ -1079,7 +1079,7 @@ _accessible_get_navigable_at_point(const Eldbus_Service_Interface *iface EINA_UN
 
    /* Send deputy */
    _bridge_iter_object_reference_append(bridge, iter, deputy);
-   _bridge_object_register(bridge, deputy);
+   if (deputy) _bridge_object_register(bridge, deputy);
 
    return ret;
 }
@@ -1293,7 +1293,10 @@ _accessible_reading_material_get(const Eldbus_Service_Interface *iface, const El
 
    /* is selected in parent */
    eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
-   eo_do(parent, is_selected = elm_interface_atspi_selection_is_child_selected(idx));
+   if (eo_isa(parent, ELM_INTERFACE_ATSPI_SELECTION_INTERFACE))
+     {
+        eo_do(parent, is_selected = elm_interface_atspi_selection_is_child_selected(idx));
+     }
    eldbus_message_arguments_append(ret, "b", is_selected);
 
    /* has checkbox child */
@@ -1364,7 +1367,10 @@ _accessible_reading_material_get(const Eldbus_Service_Interface *iface, const El
    eldbus_message_iter_basic_append(iter, 'u', atspi_role);
 
    /* parent - child count */
-   eo_do(parent, selected_child_count = elm_interface_atspi_selection_selected_children_count_get());
+   if (eo_isa(parent, ELM_INTERFACE_ATSPI_SELECTION_INTERFACE))
+     {
+        eo_do(parent, selected_child_count = elm_interface_atspi_selection_selected_children_count_get());
+     }
    eldbus_message_iter_basic_append(iter, 'i', selected_child_count);
 
    /* relation object - DESCRIBED_BY */
@@ -2784,7 +2790,8 @@ _bridge_path_from_object(Eo *bridge, const Eo *eo)
 {
    static char path[64];
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(eo, ATSPI_DBUS_PATH_NULL);
+   if (!eo)
+     return ATSPI_DBUS_PATH_NULL;
 
    if (eo == elm_atspi_bridge_root_get(bridge))
      snprintf(path, sizeof(path), "%s%s", ELM_ACCESS_OBJECT_PATH_PREFIX, ELM_ACCESS_OBJECT_PATH_ROOT);
@@ -3820,7 +3827,7 @@ static const Eldbus_Service_Interface_Desc collection_iface_desc = {
 };
 
 static void
-_object_get_bus_name_and_path(Eo *bridge, Eo *obj, const char **bus_name, const char **path)
+_object_get_bus_name_and_path(Eo *bridge, const Eo *obj, const char **bus_name, const char **path)
 {
    ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
 
@@ -3847,7 +3854,7 @@ _bridge_iter_object_reference_append(Eo *bridge, Eldbus_Message_Iter *iter, cons
 {
    EINA_SAFETY_ON_NULL_RETURN(iter);
 
-   char *pbus = "", *ppath = ATSPI_DBUS_PATH_NULL;
+   const char *pbus = NULL, *ppath = NULL;
    _object_get_bus_name_and_path(bridge, obj, &pbus, &ppath);
    Eldbus_Message_Iter *iter_struct = eldbus_message_iter_container_new(iter, 'r', NULL);
    eldbus_message_iter_basic_append(iter_struct, 's', pbus);
index e2cfdb88af73c1a312bb164fb9c2c7f543cceb16..c84bddd6bf6c95bbb41d90e7c95dc8df1e96d56a 100644 (file)
@@ -1918,7 +1918,7 @@ elm_object_accessibility_highlight_set(void *obj, Eina_Bool visible)
           _accessibility_currently_highlighted_obj = obj;
      }
 
-   if (elm_widget_access_highlight_in_theme_get(target))
+   if (eo_isa(target, ELM_LAYOUT_CLASS) && elm_widget_access_highlight_in_theme_get(target))
      {
        if (visible)
          {