2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
|
|
|
#define ELM_INTERFACE_ATSPI_VALUE_PROTECTED
|
|
|
|
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
|
|
|
|
2009-09-03 05:36:39 -07:00
|
|
|
#include <Elementary.h>
|
2014-01-22 08:24:42 -08:00
|
|
|
#include <ctype.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2009-09-03 05:36:39 -07:00
|
|
|
#include "elm_priv.h"
|
2012-08-01 14:03:58 -07:00
|
|
|
#include "elm_widget_spinner.h"
|
2009-09-03 05:36:39 -07:00
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
#include "Eo.h"
|
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_SPINNER_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Spinner"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_spinner"
|
2009-09-03 05:36:39 -07:00
|
|
|
|
2014-01-22 07:11:48 -08:00
|
|
|
#define ELM_SPINNER_DELAY_CHANGE_TIME 0.2
|
|
|
|
|
2011-04-21 17:42:32 -07:00
|
|
|
static const char SIG_CHANGED[] = "changed";
|
2013-10-23 06:43:02 -07:00
|
|
|
static const char SIG_DRAG_START[] = "spinner,drag,start";
|
|
|
|
static const char SIG_DRAG_STOP[] = "spinner,drag,stop";
|
2011-04-21 17:42:32 -07:00
|
|
|
static const char SIG_DELAY_CHANGED[] = "delay,changed";
|
2013-04-23 05:00:50 -07:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2011-04-21 17:42:32 -07:00
|
|
|
{SIG_CHANGED, ""},
|
|
|
|
{SIG_DELAY_CHANGED, ""},
|
2013-10-23 06:43:02 -07:00
|
|
|
{SIG_DRAG_START, ""},
|
|
|
|
{SIG_DRAG_STOP, ""},
|
2014-01-23 02:30:34 -08:00
|
|
|
{SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
|
2014-02-07 21:05:06 -08:00
|
|
|
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
|
2014-02-05 23:18:57 -08:00
|
|
|
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
|
|
|
|
{SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
|
2011-04-21 17:42:32 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void _access_increment_decrement_info_say(Evas_Object *obj,
|
|
|
|
Eina_Bool is_incremented);
|
2014-04-17 00:03:48 -07:00
|
|
|
|
2009-09-03 05:36:39 -07:00
|
|
|
static void
|
2014-03-26 06:12:34 -07:00
|
|
|
_entry_show(Elm_Spinner_Data *sd)
|
2010-01-27 12:16:43 -08:00
|
|
|
{
|
|
|
|
char buf[32], fmt[32] = "%0.f";
|
|
|
|
|
|
|
|
/* try to construct just the format from given label
|
|
|
|
* completely ignoring pre/post words
|
|
|
|
*/
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sd->label)
|
2010-01-27 12:16:43 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
const char *start = strchr(sd->label, '%');
|
2010-01-27 12:16:43 -08:00
|
|
|
while (start)
|
|
|
|
{
|
2011-04-01 04:24:15 -07:00
|
|
|
/* handle %% */
|
|
|
|
if (start[1] != '%')
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
start = strchr(start + 2, '%');
|
2010-01-27 12:16:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (start)
|
|
|
|
{
|
2011-04-01 04:24:15 -07:00
|
|
|
const char *itr, *end = NULL;
|
|
|
|
for (itr = start + 1; *itr != '\0'; itr++)
|
|
|
|
{
|
|
|
|
/* allowing '%d' is quite dangerous, remove it? */
|
|
|
|
if ((*itr == 'd') || (*itr == 'f'))
|
|
|
|
{
|
|
|
|
end = itr + 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((end) && ((size_t)(end - start + 1) < sizeof(fmt)))
|
|
|
|
{
|
|
|
|
memcpy(fmt, start, end - start);
|
|
|
|
fmt[end - start] = '\0';
|
|
|
|
}
|
2010-01-27 12:16:43 -08:00
|
|
|
}
|
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
snprintf(buf, sizeof(buf), fmt, sd->val);
|
|
|
|
elm_object_text_set(sd->ent, buf);
|
2010-01-27 12:16:43 -08:00
|
|
|
}
|
|
|
|
|
2009-09-03 05:36:39 -07:00
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_label_write(Evas_Object *obj)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2010-04-17 17:31:07 -07:00
|
|
|
Eina_List *l;
|
2009-09-03 05:36:39 -07:00
|
|
|
char buf[1024];
|
2012-05-14 14:52:06 -07:00
|
|
|
Elm_Spinner_Special_Value *sv;
|
|
|
|
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->special_values, l, sv)
|
2010-10-07 00:44:50 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sv->value == sd->val)
|
2010-10-07 00:44:50 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s", sv->label);
|
|
|
|
goto apply;
|
|
|
|
}
|
|
|
|
}
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sd->label)
|
|
|
|
snprintf(buf, sizeof(buf), sd->label, sd->val);
|
2009-09-03 05:36:39 -07:00
|
|
|
else
|
2012-05-14 14:52:06 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%.0f", sd->val);
|
2010-04-17 17:31:07 -07:00
|
|
|
|
|
|
|
apply:
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
elm_layout_text_set(sd->text_button, "elm.text", buf);
|
2014-07-25 01:13:02 -07:00
|
|
|
elm_interface_atspi_accessible_name_changed_signal_emit(obj);
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sd->entry_visible) _entry_show(sd);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2011-04-01 04:24:15 -07:00
|
|
|
static Eina_Bool
|
2014-01-22 07:11:48 -08:00
|
|
|
_delay_change_timer_cb(void *data)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2014-01-22 07:11:48 -08:00
|
|
|
sd->delay_change_timer = NULL;
|
2012-05-14 14:52:06 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL);
|
2012-02-15 04:32:02 -08:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2012-02-15 04:32:02 -08:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_value_set(Evas_Object *obj,
|
|
|
|
double new_val)
|
|
|
|
{
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->round > 0)
|
|
|
|
new_val = sd->val_base +
|
|
|
|
(double)((((int)(new_val - sd->val_base)) / sd->round) * sd->round);
|
|
|
|
|
|
|
|
if (sd->wrap)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
elementary: fix spinner wrap
It's weird, but looks like wrap mode of the spinner is broken at least
since the move of elm to trunk.
The current code:
if (sd->wrap)
{
while (new_val < sd->val_min)
new_val = sd->val_max + new_val + 1 - sd->val_min;
while (new_val > sd->val_max)
new_val = sd->val_min + new_val - sd->val_max - 1;
}
doesn't seems correct. Since even the documented example would fails:
* E.g.:
* @li min value = 10
* @li max value = 50
* @li step value = 20
* @li displayed value = 20
*
* When the user decrement value (using left or bottom arrow), it will
* displays @c 40, because max - (min - (displayed - step)) is
* @c 50 - (@c 10 - (@c 20 - @c 20)) = @c 40.
With the current code the value will be 41.
It also could lead to values above min, like happens on the first spinner test,
when you could go to -50.5 because new value will become:
250 + (-50.5) + 1 - (-50) in the first while() and later since these value
is bigger then 250, would go back to -50.5 ...
So, a reasonable algorithm would be
if (sd->wrap)
{
if (new_val < sd->val_min)
new_val = sd->val_max + new_val - sd->val_min;
else if (new_val > sd->val_max)
new_val = sd->val_min + new_val - sd->val_max;
}
But it doesn't works fine for cases like the months spinners test, when you
have min = 1, max = 12, step = 1 and each option should be displayed with
wrap. This algorithm would wraps from 1 to 11, so would skip December...
So, I think just going to the max value when min is reached is the better
choice.
if (sd->wrap)
{
if (new_val < sd->val_min)
new_val = sd->val_max;
else if (new_val > sd->val_max)
new_val = sd->val_min;
}
SVN revision: 77278
2012-10-01 13:44:19 -07:00
|
|
|
if (new_val < sd->val_min)
|
|
|
|
new_val = sd->val_max;
|
|
|
|
else if (new_val > sd->val_max)
|
|
|
|
new_val = sd->val_min;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
if (new_val < sd->val_min)
|
|
|
|
new_val = sd->val_min;
|
|
|
|
else if (new_val > sd->val_max)
|
|
|
|
new_val = sd->val_max;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
if (new_val == sd->val) return EINA_FALSE;
|
|
|
|
sd->val = new_val;
|
2009-09-03 05:36:39 -07:00
|
|
|
|
2011-04-21 17:42:32 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
|
2014-07-25 01:13:02 -07:00
|
|
|
elm_interface_atspi_accessible_value_changed_signal_emit(obj);
|
2014-01-22 07:11:48 -08:00
|
|
|
ecore_timer_del(sd->delay_change_timer);
|
|
|
|
sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
|
|
|
|
_delay_change_timer_cb, obj);
|
2009-09-03 05:36:39 -07:00
|
|
|
|
2010-06-05 06:12:45 -07:00
|
|
|
return EINA_TRUE;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_val_set(Evas_Object *obj)
|
|
|
|
{
|
2009-10-20 14:02:37 -07:00
|
|
|
double pos = 0.0;
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2013-10-05 01:15:53 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
if (sd->val_max > sd->val_min)
|
|
|
|
pos = ((sd->val - sd->val_min) / (sd->val_max - sd->val_min));
|
2009-09-03 05:36:39 -07:00
|
|
|
if (pos < 0.0) pos = 0.0;
|
2012-05-14 14:52:06 -07:00
|
|
|
else if (pos > 1.0)
|
|
|
|
pos = 1.0;
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.dragable.slider", pos, pos);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_drag_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *_obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2013-03-02 07:40:07 -08:00
|
|
|
double pos = 0.0, delta;
|
2012-05-14 14:52:06 -07:00
|
|
|
Evas_Object *obj = data;
|
|
|
|
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2013-10-05 01:15:53 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
if (sd->entry_visible) return;
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
|
|
|
|
if (!strncmp(elm_widget_style_get(obj), "vertical", 8))
|
|
|
|
eo_do((Eo *)wd->resize_obj,
|
|
|
|
edje_obj_part_drag_value_get("elm.dragable.slider", NULL, &pos));
|
|
|
|
else
|
|
|
|
eo_do((Eo *)wd->resize_obj,
|
|
|
|
edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL));
|
2012-02-15 04:32:02 -08:00
|
|
|
|
2013-03-02 07:40:07 -08:00
|
|
|
delta = pos * sd->step * _elm_config->scale;
|
2011-02-08 04:08:28 -08:00
|
|
|
/* If we are on rtl mode, change the delta to be negative on such changes */
|
2012-02-15 04:32:02 -08:00
|
|
|
if (elm_widget_mirrored_get(obj)) delta *= -1;
|
2013-03-02 06:50:35 -08:00
|
|
|
if (_value_set(data, sd->drag_start_val + delta)) _label_write(data);
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->dragging = 1;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_drag_start_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
|
|
|
|
2013-03-02 06:50:35 -08:00
|
|
|
sd->drag_start_val = sd->val;
|
2013-10-23 06:43:02 -07:00
|
|
|
|
|
|
|
evas_object_smart_callback_call(obj, SIG_DRAG_START, NULL);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_drag_stop_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2013-10-05 01:15:53 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2013-03-02 06:50:35 -08:00
|
|
|
sd->drag_start_val = 0;
|
2012-05-14 14:52:06 -07:00
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
|
2013-10-23 06:43:02 -07:00
|
|
|
|
|
|
|
evas_object_smart_callback_call(obj, SIG_DRAG_STOP, NULL);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2009-09-04 11:16:59 -07:00
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_entry_hide(Evas_Object *obj)
|
2009-09-04 11:16:59 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm");
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,button,active", "elm");
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->entry_visible = EINA_FALSE;
|
2009-09-04 11:16:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 14:52:06 -07:00
|
|
|
_entry_value_apply(Evas_Object *obj)
|
2009-09-04 11:16:59 -07:00
|
|
|
{
|
2010-01-27 11:34:45 -08:00
|
|
|
const char *str;
|
2009-09-04 11:16:59 -07:00
|
|
|
double val;
|
2012-05-14 14:52:06 -07:00
|
|
|
char *end;
|
|
|
|
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2011-04-01 04:24:15 -07:00
|
|
|
|
2012-08-07 11:49:39 -07:00
|
|
|
if (!sd->entry_visible) return;
|
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
_entry_hide(obj);
|
|
|
|
str = elm_object_text_get(sd->ent);
|
2010-01-27 11:34:45 -08:00
|
|
|
if (!str) return;
|
|
|
|
val = strtod(str, &end);
|
|
|
|
if ((*end != '\0') && (!isspace(*end))) return;
|
2009-09-04 11:16:59 -07:00
|
|
|
elm_spinner_value_set(obj, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-21 05:12:53 -08:00
|
|
|
_entry_activated_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
_entry_value_apply(data);
|
|
|
|
evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
|
2014-01-22 07:11:48 -08:00
|
|
|
ecore_timer_del(sd->delay_change_timer);
|
|
|
|
sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
|
|
|
|
_delay_change_timer_cb, data);
|
2014-01-21 05:12:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_entry_show_cb(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
|
|
|
_entry_show(sd);
|
|
|
|
elm_object_focus_set(obj, EINA_TRUE);
|
|
|
|
elm_entry_select_all(obj);
|
|
|
|
sd->entry_visible = EINA_TRUE;
|
|
|
|
elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_toggle_entry(Evas_Object *obj)
|
2009-09-04 11:16:59 -07:00
|
|
|
{
|
2014-01-21 05:12:53 -08:00
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
if (sd->dragging)
|
2009-09-04 11:16:59 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->dragging = 0;
|
2009-09-04 11:16:59 -07:00
|
|
|
return;
|
|
|
|
}
|
2014-01-21 05:12:53 -08:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
2012-05-14 14:52:06 -07:00
|
|
|
if (!sd->editable) return;
|
2014-01-21 05:12:53 -08:00
|
|
|
if (sd->entry_visible) _entry_value_apply(obj);
|
2009-09-04 11:16:59 -07:00
|
|
|
else
|
|
|
|
{
|
2014-01-21 05:12:53 -08:00
|
|
|
if (!sd->ent)
|
|
|
|
{
|
|
|
|
sd->ent = elm_entry_add(obj);
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj));
|
|
|
|
elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
2014-01-21 05:12:53 -08:00
|
|
|
elm_entry_single_line_set(sd->ent, EINA_TRUE);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(sd->ent, "activated", _entry_activated_cb, obj);
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->ent, EVAS_CALLBACK_SHOW, _entry_show_cb, obj);
|
2014-01-21 05:12:53 -08:00
|
|
|
elm_layout_content_set(obj, "elm.swallow.entry", sd->ent);
|
|
|
|
}
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
|
2009-09-04 11:16:59 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_entry_toggle_cb(void *data EINA_UNUSED,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
|
|
|
{
|
|
|
|
_toggle_entry(obj);
|
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2009-09-03 05:36:39 -07:00
|
|
|
_spin_value(void *data)
|
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2012-07-28 06:29:50 -07:00
|
|
|
double real_speed = sd->spin_speed;
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2012-07-28 06:29:50 -07:00
|
|
|
/* Sanity check: our step size should be at least as large as our rounding value */
|
|
|
|
if ((sd->spin_speed != 0.0) && (abs(sd->spin_speed) < sd->round))
|
|
|
|
{
|
|
|
|
WRN("The spinning step is smaller than the rounding value, please check your code");
|
|
|
|
real_speed = sd->spin_speed > 0 ? sd->round : -sd->round;
|
|
|
|
}
|
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->interval = sd->interval / 1.05;
|
2013-12-04 22:53:32 -08:00
|
|
|
|
|
|
|
// spin_timer does not exist when _spin_value() is called from wheel event
|
|
|
|
if (sd->spin_timer)
|
|
|
|
ecore_timer_interval_set(sd->spin_timer, sd->interval);
|
2013-10-07 07:38:28 -07:00
|
|
|
if (_value_set(data, sd->val + real_speed)) _label_write(data);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2009-09-04 11:10:18 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-02-04 08:29:14 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_val_inc_start(void *data)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2014-02-04 08:29:14 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
sd->interval = sd->first_interval;
|
|
|
|
sd->spin_speed = sd->step;
|
2014-02-04 08:29:14 -08:00
|
|
|
sd->longpress_timer = NULL;
|
2014-01-21 06:16:41 -08:00
|
|
|
ecore_timer_del(sd->spin_timer);
|
2014-02-04 08:29:14 -08:00
|
|
|
sd->spin_timer = ecore_timer_add(sd->interval, _spin_value, data);
|
|
|
|
_spin_value(data);
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-02-04 08:29:14 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_val_dec_start(void *data)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2014-02-04 08:29:14 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
sd->interval = sd->first_interval;
|
|
|
|
sd->spin_speed = -sd->step;
|
2014-02-04 08:29:14 -08:00
|
|
|
sd->longpress_timer = NULL;
|
2014-01-21 06:16:41 -08:00
|
|
|
ecore_timer_del(sd->spin_timer);
|
2014-02-04 08:29:14 -08:00
|
|
|
sd->spin_timer = ecore_timer_add(sd->interval, _spin_value, data);
|
|
|
|
_spin_value(data);
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-04-16 04:58:37 -07:00
|
|
|
_spin_stop(Evas_Object *obj)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->interval = sd->first_interval;
|
|
|
|
sd->spin_speed = 0;
|
2013-09-24 07:56:00 -07:00
|
|
|
ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2009-09-11 10:41:29 -07:00
|
|
|
static void
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_inc_button_clicked_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-09-11 10:41:29 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
|
|
|
|
2014-04-16 04:58:37 -07:00
|
|
|
_spin_stop(data);
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
sd->spin_speed = sd->step;
|
|
|
|
_spin_value(data);
|
|
|
|
|
|
|
|
if (sd->entry_visible) _entry_value_apply(data);
|
|
|
|
if (_elm_config->access_mode)
|
|
|
|
_access_increment_decrement_info_say(data, EINA_TRUE);
|
2009-09-11 10:41:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_inc_button_pressed_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-09-11 10:41:29 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
|
2014-02-04 08:29:14 -08:00
|
|
|
sd->longpress_timer = ecore_timer_add
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
(_elm_config->longpress_timeout,
|
|
|
|
_val_inc_start, data);
|
|
|
|
|
|
|
|
if (sd->entry_visible) _entry_value_apply(data);
|
2009-09-11 10:41:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_inc_button_unpressed_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-09-11 10:41:29 -07:00
|
|
|
{
|
2014-02-04 08:29:14 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
|
2014-02-04 08:29:14 -08:00
|
|
|
if (sd->longpress_timer)
|
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ecore_timer_del(sd->longpress_timer);
|
|
|
|
sd->longpress_timer = NULL;
|
2014-02-04 08:29:14 -08:00
|
|
|
}
|
2014-04-16 04:58:37 -07:00
|
|
|
_spin_stop(data);
|
2009-09-11 10:41:29 -07:00
|
|
|
}
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_text_button_clicked_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-14 14:52:06 -07:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_toggle_entry(data);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_dec_button_clicked_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2014-04-17 00:03:48 -07:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2014-04-17 00:03:48 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_spin_stop(data);
|
|
|
|
sd->spin_speed = -sd->step;
|
|
|
|
_spin_value(data);
|
2014-04-17 00:03:48 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->entry_visible) _entry_value_apply(data);
|
|
|
|
|
|
|
|
if (_elm_config->access_mode)
|
|
|
|
_access_increment_decrement_info_say(data, EINA_FALSE);
|
2014-04-17 00:03:48 -07:00
|
|
|
}
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_dec_button_pressed_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2014-04-17 00:03:48 -07:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2014-04-17 00:03:48 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
|
|
|
|
sd->longpress_timer = ecore_timer_add
|
|
|
|
(_elm_config->longpress_timeout,
|
|
|
|
_val_dec_start, data);
|
2014-04-17 00:03:48 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->entry_visible) _entry_value_apply(data);
|
2014-04-17 00:03:48 -07:00
|
|
|
}
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_dec_button_unpressed_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2009-09-11 10:41:29 -07:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2013-10-28 07:06:14 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->longpress_timer)
|
2010-09-27 14:13:41 -07:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ecore_timer_del(sd->longpress_timer);
|
|
|
|
sd->longpress_timer = NULL;
|
2010-09-27 14:13:41 -07:00
|
|
|
}
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_spin_stop(data);
|
|
|
|
}
|
2013-11-12 17:29:30 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_elm_layout_sizing_eval(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Coord minw = -1, minh = -1;
|
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
|
|
|
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
edje_object_size_min_restricted_calc
|
|
|
|
(wd->resize_obj, &minw, &minh, minw, minh);
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
|
|
|
evas_object_size_hint_max_set(obj, -1, -1);
|
2009-09-11 10:41:29 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_elm_widget_on_focus(Eo *obj, Elm_Spinner_Data *sd)
|
2012-08-03 00:27:02 -07:00
|
|
|
{
|
2014-04-03 08:55:07 -07:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
|
|
|
eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
|
2014-03-26 06:12:34 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2012-08-03 00:27:02 -07:00
|
|
|
|
2012-08-03 09:43:26 -07:00
|
|
|
if (!elm_widget_focus_get(obj))
|
2013-08-06 02:13:10 -07:00
|
|
|
{
|
2014-01-22 07:11:48 -08:00
|
|
|
ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del);
|
2013-09-24 07:56:00 -07:00
|
|
|
ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
|
|
|
|
|
2013-08-06 02:13:10 -07:00
|
|
|
_entry_value_apply(obj);
|
|
|
|
}
|
2012-08-03 09:43:26 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
return EINA_TRUE;
|
2012-08-03 00:27:02 -07:00
|
|
|
}
|
|
|
|
|
2012-08-21 03:08:56 -07:00
|
|
|
static char *
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
|
|
|
Evas_Object *spinner;
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
const char *txt = NULL;
|
|
|
|
|
|
|
|
spinner = (Evas_Object *)(data);
|
|
|
|
ELM_SPINNER_DATA_GET(spinner, sd);
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->entry_visible)
|
|
|
|
txt = elm_object_text_get(sd->ent);
|
|
|
|
else
|
|
|
|
txt = elm_object_text_get(sd->text_button);
|
2012-08-21 03:08:56 -07:00
|
|
|
if (txt) return strdup(txt);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2014-01-06 06:30:02 -08:00
|
|
|
_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
if (elm_widget_disabled_get(data))
|
2012-08-21 03:08:56 -07:00
|
|
|
return strdup(E_("State: Disabled"));
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_access_activate_spinner_cb(void *data,
|
|
|
|
Evas_Object *part_obj EINA_UNUSED,
|
|
|
|
Elm_Object_Item *item EINA_UNUSED)
|
2012-11-26 02:59:00 -08:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(data, sd);
|
2012-11-26 02:59:00 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (elm_widget_disabled_get(data)) return;
|
|
|
|
if (!sd->entry_visible)
|
|
|
|
_toggle_entry(data);
|
|
|
|
}
|
2012-11-26 02:59:00 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static void
|
|
|
|
_access_increment_decrement_info_say(Evas_Object *obj,
|
|
|
|
Eina_Bool is_incremented)
|
|
|
|
{
|
|
|
|
char *text;
|
|
|
|
Eina_Strbuf *buf;
|
2012-11-26 02:59:00 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2012-11-26 02:59:00 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
buf = eina_strbuf_new();
|
|
|
|
if (is_incremented)
|
|
|
|
{
|
|
|
|
elm_object_signal_emit
|
|
|
|
(sd->inc_button, "elm,action,anim,activate", "elm");
|
|
|
|
eina_strbuf_append(buf, E_("incremented"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elm_object_signal_emit
|
|
|
|
(sd->dec_button, "elm,action,anim,activate", "elm");
|
|
|
|
eina_strbuf_append(buf, E_("decremented"));
|
|
|
|
}
|
2012-11-26 02:59:00 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
eina_strbuf_append_printf
|
|
|
|
(buf, "%s", elm_object_text_get(sd->text_button));
|
2012-11-26 02:59:00 -08:00
|
|
|
|
|
|
|
text = eina_strbuf_string_steal(buf);
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
_elm_access_say(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_access_spinner_register(Evas_Object *obj, Eina_Bool is_access)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
2012-11-26 02:59:00 -08:00
|
|
|
Evas_Object *ao;
|
2012-08-21 03:08:56 -07:00
|
|
|
Elm_Access_Info *ai;
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
2012-08-21 03:08:56 -07:00
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
if (!is_access)
|
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
/* unregister access */
|
|
|
|
_elm_access_edje_object_part_object_unregister
|
|
|
|
(obj, elm_layout_edje_get(obj), "access");
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,access,inactive", "elm");
|
2012-11-26 02:59:00 -08:00
|
|
|
return;
|
|
|
|
}
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
elm_layout_signal_emit(obj, "elm,state,access,active", "elm");
|
2012-11-26 02:59:00 -08:00
|
|
|
ao = _elm_access_edje_object_part_object_register
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
(obj, elm_layout_edje_get(obj), "access");
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2013-07-30 20:53:04 -07:00
|
|
|
ai = _elm_access_info_get(ao);
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner"));
|
|
|
|
_elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, obj);
|
|
|
|
_elm_access_activate_callback_set(ai, _access_activate_spinner_cb, obj);
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
/*Do not register spinner buttons if widget is disabled*/
|
|
|
|
if (!elm_widget_disabled_get(obj))
|
|
|
|
{
|
|
|
|
ai = _elm_access_info_get(sd->inc_button);
|
|
|
|
_elm_access_text_set(ai, ELM_ACCESS_TYPE,
|
|
|
|
E_("spinner increment button"));
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ai = _elm_access_info_get(sd->dec_button);
|
|
|
|
_elm_access_text_set(ai, ELM_ACCESS_TYPE,
|
|
|
|
E_("spinner decrement button"));
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ai = _elm_access_info_get(sd->text_button);
|
|
|
|
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner text"));
|
|
|
|
_elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, obj);
|
|
|
|
}
|
2012-08-21 03:08:56 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv)
|
2012-05-14 14:52:06 -07:00
|
|
|
{
|
2013-10-05 01:15:53 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2013-08-26 22:19:19 -07:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
priv->val_max = 100.0;
|
|
|
|
priv->step = 1.0;
|
|
|
|
priv->first_interval = 0.85;
|
|
|
|
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set(obj, "spinner", "base",
|
|
|
|
elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2013-03-01 18:04:31 -08:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
elm_layout_signal_callback_add(obj, "drag", "*", _drag_cb, obj);
|
|
|
|
elm_layout_signal_callback_add(obj, "drag,start", "*", _drag_start_cb, obj);
|
|
|
|
elm_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop_cb, obj);
|
|
|
|
elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_stop_cb, obj);
|
|
|
|
elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop_cb, obj);
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
priv->inc_button = elm_button_add(obj);
|
|
|
|
elm_object_style_set(priv->inc_button, "spinner/increase/default");
|
|
|
|
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->inc_button, "clicked", _inc_button_clicked_cb, obj);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->inc_button, "pressed", _inc_button_pressed_cb, obj);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->inc_button, "unpressed", _inc_button_unpressed_cb, obj);
|
|
|
|
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.inc_button", priv->inc_button);
|
|
|
|
elm_widget_sub_object_add(obj, priv->inc_button);
|
|
|
|
|
|
|
|
priv->text_button = elm_button_add(obj);
|
|
|
|
elm_object_style_set(priv->text_button, "spinner/default");
|
|
|
|
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->text_button, "clicked", _text_button_clicked_cb, obj);
|
|
|
|
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.text_button", priv->text_button);
|
|
|
|
elm_widget_sub_object_add(obj, priv->text_button);
|
|
|
|
|
|
|
|
|
|
|
|
priv->dec_button = elm_button_add(obj);
|
|
|
|
elm_object_style_set(priv->dec_button, "spinner/decrease/default");
|
|
|
|
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->dec_button, "clicked", _dec_button_clicked_cb, obj);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->dec_button, "pressed", _dec_button_pressed_cb, obj);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(priv->dec_button, "unpressed", _dec_button_unpressed_cb, obj);
|
|
|
|
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.dec_button", priv->dec_button);
|
|
|
|
elm_widget_sub_object_add(obj, priv->dec_button);
|
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
elm_layout_signal_callback_add
|
2014-01-21 05:12:53 -08:00
|
|
|
(obj, "elm,action,entry,toggle", "*", _entry_toggle_cb, NULL);
|
2012-05-14 14:52:06 -07:00
|
|
|
|
|
|
|
_label_write(obj);
|
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2012-08-21 03:08:56 -07:00
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
/* access */
|
|
|
|
if (_elm_config->access_mode)
|
|
|
|
_access_spinner_register(obj, EINA_TRUE);
|
2012-05-14 14:52:06 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_spinner_evas_object_smart_del(Eo *obj, Elm_Spinner_Data *sd)
|
2012-05-14 14:52:06 -07:00
|
|
|
{
|
|
|
|
Elm_Spinner_Special_Value *sv;
|
|
|
|
|
2014-01-21 06:16:41 -08:00
|
|
|
eina_stringshare_del(sd->label);
|
2014-01-22 07:11:48 -08:00
|
|
|
ecore_timer_del(sd->delay_change_timer);
|
2014-01-21 06:16:41 -08:00
|
|
|
ecore_timer_del(sd->spin_timer);
|
2014-03-27 19:52:21 -07:00
|
|
|
ecore_timer_del(sd->longpress_timer);
|
2013-05-22 23:54:49 -07:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sd->special_values)
|
|
|
|
{
|
2013-03-08 20:23:42 -08:00
|
|
|
EINA_LIST_FREE(sd->special_values, sv)
|
2012-05-14 14:52:06 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(sv->label);
|
|
|
|
free(sv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2012-05-14 14:52:06 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
Eina_Bool int_ret = elm_layout_theme_set(obj, "spinner", "base",
|
2012-08-21 03:08:56 -07:00
|
|
|
elm_widget_style_get(obj));
|
|
|
|
|
2013-12-25 20:03:55 -08:00
|
|
|
if (!int_ret) CRI("Failed to set layout!");
|
2013-03-01 18:04:31 -08:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (sd->ent)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj));
|
|
|
|
elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->inc_button)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "spinner/increase/%s", elm_widget_style_get(obj));
|
|
|
|
elm_widget_style_set(sd->inc_button, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->text_button)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj));
|
|
|
|
elm_widget_style_set(sd->text_button, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->dec_button)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "spinner/decrease/%s", elm_widget_style_get(obj));
|
|
|
|
elm_widget_style_set(sd->dec_button, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
}
|
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
if (_elm_config->access_mode)
|
|
|
|
_access_spinner_register(obj, EINA_TRUE);
|
2014-02-18 21:02:44 -08:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2014-03-26 06:12:34 -07:00
|
|
|
return int_ret;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return _elm_spinner_smart_focus_next_enable;
|
2012-08-21 03:08:56 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_elm_widget_focus_direction(Eo *obj, Elm_Spinner_Data *_pd, const Evas_Object *base, double degree, Evas_Object **direction, double *weight)
|
|
|
|
{
|
|
|
|
Eina_Bool ret;
|
|
|
|
Eina_List *items = NULL;
|
|
|
|
void *(*list_data_get)(const Eina_List *list);
|
|
|
|
|
|
|
|
ELM_SPINNER_CHECK(obj) EINA_FALSE;
|
|
|
|
|
|
|
|
if (!_pd)
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
list_data_get = eina_list_data_get;
|
|
|
|
items = eina_list_append(items, _pd->inc_button);
|
|
|
|
if (_pd->entry_visible)
|
|
|
|
items = eina_list_append(items, _pd->ent);
|
|
|
|
else
|
|
|
|
items = eina_list_append(items, _pd->text_button);
|
|
|
|
items = eina_list_append(items, _pd->dec_button);
|
|
|
|
|
|
|
|
ret = elm_widget_focus_list_direction_get
|
|
|
|
(obj, base, items, list_data_get, degree, direction, weight);
|
|
|
|
eina_list_free(items);
|
|
|
|
|
|
|
|
return ret;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
static Evas_Object *
|
|
|
|
_access_object_get(const Evas_Object *obj, const char* part)
|
|
|
|
{
|
|
|
|
Evas_Object *eo, *po, *ao;
|
|
|
|
|
|
|
|
eo = elm_layout_edje_get(obj);
|
|
|
|
|
|
|
|
po = (Evas_Object *)edje_object_part_object_get(eo, part);
|
|
|
|
ao = evas_object_data_get(po, "_part_access_obj");
|
|
|
|
|
|
|
|
return ao;
|
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
_elm_spinner_elm_widget_focus_next(Eo *obj, Elm_Spinner_Data *_pd, Elm_Focus_Direction dir, Evas_Object **next)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
2012-11-26 02:59:00 -08:00
|
|
|
Evas_Object *ao;
|
2012-08-21 03:08:56 -07:00
|
|
|
Eina_List *items = NULL;
|
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ELM_SPINNER_CHECK(obj) EINA_FALSE;
|
|
|
|
|
|
|
|
if (_elm_config->access_mode)
|
2012-11-26 02:59:00 -08:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
ao = _access_object_get(obj, "access");
|
|
|
|
items = eina_list_append(items, ao);
|
2012-11-26 02:59:00 -08:00
|
|
|
}
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
if (!elm_widget_disabled_get(obj))
|
2012-11-26 02:59:00 -08:00
|
|
|
{
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
items = eina_list_append(items, _pd->dec_button);
|
|
|
|
items = eina_list_append(items, _pd->inc_button);
|
|
|
|
if (_pd->entry_visible)
|
|
|
|
items = eina_list_append(items, _pd->ent);
|
|
|
|
else
|
|
|
|
items = eina_list_append(items, _pd->text_button);
|
2012-08-21 03:08:56 -07:00
|
|
|
|
Elm_spinner focus UI, accessibility fix
Summary:
Issue: Focus was not getting transferred individually on arrow buttons and text area.
Solution: Remove the usage of image parts and text parts and replace them with buttons
so as to handle the focus transfer normally than forcibly via smart event.
hence Focus next hook and focus direction hook is implemented.
Signed-off by: Subodh Kumar<s7158.kumar@samsung.com>
Signed-off by: Shilpa Singh<shilpa.singh@samsung.com>
Test Plan:
Use keyboard keys on spinner and test focus transfer, enable accessibility and test
accessibility.
Reviewers: woohyun, Hermet, shilpasingh, raster, seoz
Reviewed By: shilpasingh, raster
Subscribers: stefan_schmidt, raster, rajeshps, govi
Differential Revision: https://phab.enlightenment.org/D1911
2015-03-03 22:59:24 -08:00
|
|
|
}
|
2014-03-26 06:12:34 -07:00
|
|
|
return elm_widget_focus_list_next_get
|
2012-08-21 03:08:56 -07:00
|
|
|
(obj, items, eina_list_data_get, dir, next);
|
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_elm_widget_access(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED, Eina_Bool acs)
|
2012-08-21 03:08:56 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
_elm_spinner_smart_focus_next_enable = acs;
|
2012-11-26 02:59:00 -08:00
|
|
|
_access_spinner_register(obj, _elm_spinner_smart_focus_next_enable);
|
2012-08-21 03:08:56 -07:00
|
|
|
}
|
|
|
|
|
2009-09-03 05:36:39 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_spinner_add(Evas_Object *parent)
|
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = eo_add(MY_CLASS, parent);
|
|
|
|
return obj;
|
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_eo_base_constructor(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_constructor());
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj,
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_obj_type_set(MY_CLASS_NAME_LEGACY),
|
2014-06-10 19:07:15 -07:00
|
|
|
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks),
|
|
|
|
elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_SPIN_BUTTON));
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
eina_stringshare_replace(&sd->label, fmt);
|
|
|
|
_label_write(obj);
|
|
|
|
elm_layout_sizing_eval(obj);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static const char*
|
|
|
|
_elm_spinner_label_format_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->label;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_min_max_set(Eo *obj, Elm_Spinner_Data *sd, double min, double max)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
if ((sd->val_min == min) && (sd->val_max == max)) return;
|
|
|
|
sd->val_min = min;
|
|
|
|
sd->val_max = max;
|
|
|
|
if (sd->val < sd->val_min) sd->val = sd->val_min;
|
|
|
|
if (sd->val > sd->val_max) sd->val = sd->val_max;
|
2009-09-03 05:36:39 -07:00
|
|
|
_val_set(obj);
|
2012-05-14 14:52:06 -07:00
|
|
|
_label_write(obj);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_min_max_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *min, double *max)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
if (min) *min = sd->val_min;
|
|
|
|
if (max) *max = sd->val_max;
|
2010-04-01 07:22:32 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_step_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double step)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->step = step;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_spinner_step_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2012-05-14 14:52:06 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->step;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_value_set(Eo *obj, Elm_Spinner_Data *sd, double val)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
if (sd->val == val) return;
|
|
|
|
sd->val = val;
|
2013-11-02 04:33:00 -07:00
|
|
|
sd->val_updated = EINA_FALSE;
|
|
|
|
if (sd->val < sd->val_min)
|
|
|
|
{
|
|
|
|
sd->val = sd->val_min;
|
|
|
|
sd->val_updated = EINA_TRUE;
|
|
|
|
}
|
|
|
|
if (sd->val > sd->val_max)
|
|
|
|
{
|
|
|
|
sd->val = sd->val_max;
|
|
|
|
sd->val_updated = EINA_TRUE;
|
|
|
|
}
|
2009-09-03 05:36:39 -07:00
|
|
|
_val_set(obj);
|
2012-05-14 14:52:06 -07:00
|
|
|
_label_write(obj);
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_spinner_value_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2009-09-03 05:36:39 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->val;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_wrap_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, Eina_Bool wrap)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->wrap = wrap;
|
2009-09-03 05:36:39 -07:00
|
|
|
}
|
2010-04-01 07:22:32 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_wrap_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2010-04-01 07:22:32 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->wrap;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_special_value_add(Eo *obj, Elm_Spinner_Data *sd, double value, const char *label)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2011-04-01 04:24:15 -07:00
|
|
|
Elm_Spinner_Special_Value *sv;
|
2012-10-08 15:39:05 -07:00
|
|
|
Eina_List *l;
|
2010-04-17 17:31:07 -07:00
|
|
|
|
2012-10-08 15:39:05 -07:00
|
|
|
EINA_LIST_FOREACH(sd->special_values, l, sv)
|
|
|
|
{
|
|
|
|
if (sv->value != value)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
eina_stringshare_replace(&sv->label, label);
|
|
|
|
_label_write(obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-04-01 04:24:15 -07:00
|
|
|
sv = calloc(1, sizeof(*sv));
|
|
|
|
if (!sv) return;
|
|
|
|
sv->value = value;
|
|
|
|
sv->label = eina_stringshare_add(label);
|
2010-04-17 17:31:07 -07:00
|
|
|
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->special_values = eina_list_append(sd->special_values, sv);
|
|
|
|
_label_write(obj);
|
2010-04-17 17:31:07 -07:00
|
|
|
}
|
|
|
|
|
2012-10-08 15:39:15 -07:00
|
|
|
EAPI void
|
|
|
|
elm_spinner_special_value_del(Evas_Object *obj,
|
|
|
|
double value)
|
|
|
|
{
|
|
|
|
Elm_Spinner_Special_Value *sv;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_SPINNER_CHECK(obj);
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->special_values, l, sv)
|
|
|
|
{
|
|
|
|
if (sv->value != value)
|
|
|
|
continue;
|
|
|
|
|
2012-10-09 01:49:06 -07:00
|
|
|
sd->special_values = eina_list_remove_list(sd->special_values, l);
|
2012-10-08 15:39:15 -07:00
|
|
|
eina_stringshare_del(sv->label);
|
|
|
|
free(sv);
|
|
|
|
_label_write(obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
|
|
|
elm_spinner_special_value_get(Evas_Object *obj,
|
|
|
|
double value)
|
|
|
|
{
|
|
|
|
Elm_Spinner_Special_Value *sv;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_SPINNER_CHECK(obj) NULL;
|
|
|
|
ELM_SPINNER_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->special_values, l, sv)
|
|
|
|
{
|
|
|
|
if (sv->value == value)
|
|
|
|
return sv->label;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_editable_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, Eina_Bool editable)
|
2010-04-17 17:31:07 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->editable = editable;
|
2010-04-17 17:31:07 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_editable_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->editable;
|
2010-04-17 17:31:07 -07:00
|
|
|
}
|
2010-07-20 14:38:17 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_interval_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double interval)
|
2010-07-20 14:38:17 -07:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->first_interval = interval;
|
2010-07-20 14:38:17 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_spinner_interval_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2010-07-20 14:38:17 -07:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->first_interval;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_base_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double base)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->val_base = base;
|
2012-02-15 04:32:02 -08:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_spinner_base_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->val_base;
|
2012-02-15 04:32:02 -08:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_round_set(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, int rnd)
|
2012-02-15 04:32:02 -08:00
|
|
|
{
|
2012-05-14 14:52:06 -07:00
|
|
|
sd->round = rnd;
|
2012-02-15 04:32:02 -08:00
|
|
|
}
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static int
|
|
|
|
_elm_spinner_round_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
2012-02-15 04:32:02 -08:00
|
|
|
{
|
2014-03-26 06:12:34 -07:00
|
|
|
return sd->round;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-14 14:52:06 -07:00
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_class_constructor(Eo_Class *klass)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
2013-02-09 23:52:31 -08:00
|
|
|
|
2012-11-26 02:59:00 -08:00
|
|
|
if (_elm_config->access_mode)
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_spinner_smart_focus_next_enable = EINA_TRUE;
|
2012-02-15 04:32:02 -08:00
|
|
|
}
|
2014-03-26 06:12:34 -07:00
|
|
|
|
2014-07-25 01:13:02 -07:00
|
|
|
// A11Y Accessibility
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_elm_interface_atspi_value_value_and_text_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *value, const char **text)
|
|
|
|
{
|
|
|
|
if (value) *value = sd->val;
|
|
|
|
if (text) *text = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_spinner_elm_interface_atspi_value_value_and_text_set(Eo *obj, Elm_Spinner_Data *sd, double value, const char *text EINA_UNUSED)
|
|
|
|
{
|
|
|
|
if (sd->val_min > value) return EINA_FALSE;
|
|
|
|
if (sd->val_max < value) return EINA_FALSE;
|
|
|
|
|
|
|
|
sd->val = value;
|
|
|
|
_val_set(obj);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_elm_spinner_elm_interface_atspi_value_range_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd, double *lower, double *upper, const char **descr)
|
|
|
|
{
|
|
|
|
if (lower) *lower = sd->val_min;
|
|
|
|
if (upper) *upper = sd->val_max;
|
|
|
|
if (descr) *descr = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
|
|
|
_elm_spinner_elm_interface_atspi_value_increment_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd)
|
|
|
|
{
|
|
|
|
return sd->step;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
|
|
|
_elm_spinner_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return elm_layout_text_get(obj, "elm.text");
|
|
|
|
}
|
2014-07-25 01:33:19 -07:00
|
|
|
|
2014-07-25 01:13:02 -07:00
|
|
|
// A11Y Accessibility - END
|
|
|
|
|
2014-03-26 06:12:34 -07:00
|
|
|
#include "elm_spinner.eo.c"
|