Trait with progress should be read on progressbars
authorPatryk Kaczmarek <patryk.k@samsung.com>
Tue, 25 Aug 2015 15:49:42 +0000 (17:49 +0200)
committerTomasz Olszak <t.olszak@samsung.com>
Wed, 26 Aug 2015 08:15:59 +0000 (10:15 +0200)
Change-Id: I414c30778ee83f133cc5fef4efff84aa50dba252
Signed-off-by: Patryk Kaczmarek <patryk.k@samsung.com>
res/po/en_US.po
src/navigator.c

index 8f34c17..e1dfdb7 100644 (file)
@@ -55,6 +55,12 @@ msgstr "double tap to close it"
 msgid "IDS_TRAIT_TEXT_EDIT_FOCUSED"
 msgstr "Editing, flick up and down to adjust position."
 
+msgid "IDS_TRAIT_PD_PROGRESSBAR"
+msgstr "Progressing"
+
+msgid "IDS_TRAIT_PD_PROGRESSBAR_PERCENT"
+msgstr "%.0f percent, Progressing"
+
 msgid "IDS_TEXT_BEGIN"
 msgstr "Cursor is at the begining of text"
 
index 4c8e40d..bcb1b2f 100644 (file)
@@ -230,6 +230,17 @@ display_info_about_object(AtspiAccessible *obj)
    DEBUG("POSITION ON SCREEN: x:%d y:%d", rect_screen->x, rect_screen->y);
    DEBUG("SIZE ON WIN, width:%d, height:%d",rect_win->width, rect_win->height);
    DEBUG("POSITION ON WIN: x:%d y:%d", rect_win->x, rect_win->y);
+   DEBUG("INTERFACES:");
+   GArray *ifaces = atspi_accessible_get_interfaces(obj);
+   for (a = 0; ifaces && (a < ifaces->len); ++a)
+   {
+      gchar * interface_name = g_array_index (ifaces, gchar *, a);
+      DEBUG("   %s", interface_name);
+      free(interface_name);
+   }
+   if (ifaces)
+      g_array_free(ifaces, FALSE);
+
    DEBUG("------------------------");
    DEBUG("END");
 }
@@ -437,6 +448,19 @@ generate_trait(AtspiAccessible *obj)
          else
             strncat(ret, _("IDS_TRAIT_GROUP_INDEX_COLLAPSED"), sizeof(ret) - strlen(ret) - 1);
       }
+   else if (role == ATSPI_ROLE_PROGRESS_BAR)
+      {
+         AtspiValue *value = atspi_accessible_get_value_iface(obj);
+         double val = atspi_value_get_current_value(value, NULL);
+         char trait[HOVERSEL_TRAIT_SIZE];
+         if (val > 0)
+            {
+               snprintf(trait, HOVERSEL_TRAIT_SIZE, _("IDS_TRAIT_PD_PROGRESSBAR_PERCENT"), val*100);
+               strncat(ret, trait, sizeof(ret) - strlen(ret) - 1);
+            }
+         else
+            strncat(ret, _("IDS_TRAIT_PD_PROGRESSBAR"), sizeof(ret) - strlen(ret) - 1);
+      }
    else
       {
          char *role_name = atspi_accessible_get_localized_role_name(obj, NULL);