summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Kosinski <z.kosinski@samsung.com>2014-07-25 10:13:02 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2014-07-25 10:13:15 +0200
commit06cd087da13b7703725b65074b556e435dbf28c9 (patch)
treece177a2a8f43d24b28f13b056da9fb0cb32cadcb
parentbe2aa99ce8fa9efdb9644cc0197c750ccbc7af5e (diff)
atspi: value interface implementation for elm_spinner
Reviewers: stanluk Differential Revision: https://phab.enlightenment.org/D1122
-rw-r--r--src/lib/elm_spinner.c47
-rw-r--r--src/lib/elm_spinner.eo7
2 files changed, 53 insertions, 1 deletions
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index fa03342d7..8f167c618 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -14,6 +14,9 @@
14#include "elm_interface_atspi_accessible.h" 14#include "elm_interface_atspi_accessible.h"
15#include "elm_interface_atspi_accessible.eo.h" 15#include "elm_interface_atspi_accessible.eo.h"
16 16
17#define ELM_INTERFACE_ATSPI_VALUE_PROTECTED
18#include "elm_interface_atspi_value.eo.h"
19
17#define MY_CLASS ELM_SPINNER_CLASS 20#define MY_CLASS ELM_SPINNER_CLASS
18 21
19#define MY_CLASS_NAME "Elm_Spinner" 22#define MY_CLASS_NAME "Elm_Spinner"
@@ -115,6 +118,7 @@ _label_write(Evas_Object *obj)
115 118
116apply: 119apply:
117 elm_layout_text_set(obj, "elm.text", buf); 120 elm_layout_text_set(obj, "elm.text", buf);
121 elm_interface_atspi_accessible_name_changed_signal_emit(obj);
118 if (sd->entry_visible) _entry_show(sd); 122 if (sd->entry_visible) _entry_show(sd);
119} 123}
120 124
@@ -158,6 +162,7 @@ _value_set(Evas_Object *obj,
158 sd->val = new_val; 162 sd->val = new_val;
159 163
160 evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); 164 evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
165 elm_interface_atspi_accessible_value_changed_signal_emit(obj);
161 ecore_timer_del(sd->delay_change_timer); 166 ecore_timer_del(sd->delay_change_timer);
162 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME, 167 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
163 _delay_change_timer_cb, obj); 168 _delay_change_timer_cb, obj);
@@ -1062,4 +1067,46 @@ _elm_spinner_class_constructor(Eo_Class *klass)
1062 _elm_spinner_smart_focus_next_enable = EINA_TRUE; 1067 _elm_spinner_smart_focus_next_enable = EINA_TRUE;
1063} 1068}
1064 1069
1070// A11Y Accessibility
1071
1072EOLIAN static void
1073_elm_spinner_elm_interface_atspi_value_value_and_text_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *value, const char **text)
1074{
1075 if (value) *value = sd->val;
1076 if (text) *text = NULL;
1077}
1078
1079EOLIAN static Eina_Bool
1080_elm_spinner_elm_interface_atspi_value_value_and_text_set(Eo *obj, Elm_Spinner_Data *sd, double value, const char *text EINA_UNUSED)
1081{
1082 if (sd->val_min > value) return EINA_FALSE;
1083 if (sd->val_max < value) return EINA_FALSE;
1084
1085 sd->val = value;
1086 _val_set(obj);
1087
1088 return EINA_TRUE;
1089}
1090
1091EOLIAN static void
1092_elm_spinner_elm_interface_atspi_value_range_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *lower, double *upper, const char **descr)
1093{
1094 if (lower) *lower = sd->val_min;
1095 if (upper) *upper = sd->val_max;
1096 if (descr) *descr = NULL;
1097}
1098
1099EOLIAN static double
1100_elm_spinner_elm_interface_atspi_value_increment_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
1101{
1102 return sd->step;
1103}
1104
1105EOLIAN static const char*
1106_elm_spinner_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED)
1107{
1108 return elm_layout_text_get(obj, "elm.text");
1109}
1110// A11Y Accessibility - END
1111
1065#include "elm_spinner.eo.c" 1112#include "elm_spinner.eo.c"
diff --git a/src/lib/elm_spinner.eo b/src/lib/elm_spinner.eo
index ec35135aa..cf29276b9 100644
--- a/src/lib/elm_spinner.eo
+++ b/src/lib/elm_spinner.eo
@@ -1,4 +1,4 @@
1class Elm_Spinner (Elm_Layout) 1class Elm_Spinner (Elm_Layout, Elm_Interface_Atspi_Value)
2{ 2{
3 eo_prefix: elm_obj_spinner; 3 eo_prefix: elm_obj_spinner;
4 properties { 4 properties {
@@ -374,6 +374,11 @@ class Elm_Spinner (Elm_Layout)
374 Elm_Widget.on_focus; 374 Elm_Widget.on_focus;
375 Elm_Widget.event; 375 Elm_Widget.event;
376 Elm_Layout.sizing_eval; 376 Elm_Layout.sizing_eval;
377 Elm_Interface_Atspi_Accessible.name.get;
378 Elm_Interface_Atspi_Value.value_and_text.get;
379 Elm_Interface_Atspi_Value.value_and_text.set;
380 Elm_Interface_Atspi_Value.range.get;
381 Elm_Interface_Atspi_Value.increment.get;
377 } 382 }
378 events { 383 events {
379 changed; 384 changed;