elm_atspi_bridge: Support org.a11y.atspi.Value.Text property 75/291275/3
authorArtur Świgoń <a.swigon@samsung.com>
Wed, 12 Apr 2023 12:29:34 +0000 (14:29 +0200)
committerLukasz Oleksak <l.oleksak@samsung.com>
Mon, 17 Apr 2023 08:38:39 +0000 (08:38 +0000)
Change-Id: I33b7a93bc515e369fc6a96fdcca531cef053ffb5

src/lib/elementary/elm_atspi_bridge.c

index f1a7d58..7ec6133 100644 (file)
@@ -1299,6 +1299,7 @@ _accessible_reading_material_get(const Eldbus_Service_Interface *iface, const El
    const char *name = NULL;
    unsigned int s1, s2;
    double value = 0;
+   const char *value_text = NULL;
    double increment = 0;
    double max_value = 0;
    double min_value = 0;
@@ -1410,11 +1411,12 @@ _accessible_reading_material_get(const Eldbus_Service_Interface *iface, const El
    min_value = 0;
    if (efl_isa(obj, EFL_ACCESS_VALUE_INTERFACE))
      {
-        efl_access_value_and_text_get(obj, &value, NULL);
+        efl_access_value_and_text_get(obj, &value, &value_text);
         increment = efl_access_value_increment_get(obj);
         efl_access_value_range_get(obj, &min_value, &max_value, NULL);
      }
    eldbus_message_iter_basic_append(iter, 'd', value);
+   eldbus_message_iter_basic_append(iter, 's', value_text ? value_text : "");
    eldbus_message_iter_basic_append(iter, 'd', increment);
    eldbus_message_iter_basic_append(iter, 'd', max_value);
    eldbus_message_iter_basic_append(iter, 'd', min_value);
@@ -1630,7 +1632,7 @@ static const Eldbus_Method accessible_methods[] = {
                  {"s", "labledByName"},{"s", "textIfceName"},
                  {"u", "role"}, {"au", "stateSet"},
                  {"s", "localizedName"}, {"i", "childCount"},
-                 {"d", "currentValue"},{"d", "minimumIncrement"},
+                 {"d", "currentValue"}, {"s", "currentValueText"}, {"d", "minimumIncrement"},
                  {"d", "maximumValue"},{"d", "minimumValue"},
                  {"s", "description"}, {"i", "indexInParent"},
                  {"b", "isSelectedInParent"}, {"b", "hasCheckboxChild"},
@@ -3599,6 +3601,13 @@ _value_properties_get(const Eldbus_Service_Interface *interface, const char *pro
         eldbus_message_iter_basic_append(iter, 'd', value);
         return EINA_TRUE;
      }
+   if (!strcmp(property, "Text"))
+     {
+        const char *value_text = NULL;
+        efl_access_value_and_text_get(obj, NULL, &value_text);
+        eldbus_message_iter_basic_append(iter, 's', value_text ? value_text : "");
+        return EINA_TRUE;
+     }
    return EINA_FALSE;
 }
 
@@ -3767,6 +3776,7 @@ static const Eldbus_Property value_properties[] = {
    { "MaximumValue", "d", NULL, NULL, 0 },
    { "MinimumIncrement", "d", NULL, NULL, 0 },
    { "CurrentValue", "d", NULL, NULL, 0 },
+   { "Text", "s", NULL, NULL, 0 },
    { NULL, NULL, NULL, NULL, 0 }
 };