return EINA_TRUE;
}
+static Eina_Bool
+_elm_access_smart_activate(Evas_Object *obj, Elm_Activate act)
+{
+ if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
+
+ Elm_Access_Info *ac = evas_object_data_get(obj, "_elm_access");
+ if (!ac) return EINA_FALSE;
+
+ if (ac->activate)
+ ac->activate(ac->activate_data, ac->part_object, ac->widget_item);
+
+ return EINA_TRUE;
+}
+
static void
_elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
{
sc->focus_next = NULL;
sc->focus_direction = NULL;
sc->on_focus = _elm_access_smart_on_focus;
+ sc->activate = _elm_access_smart_activate;
return;
}
}
EAPI void
+_elm_access_activate_callback_set(Elm_Access_Info *ac,
+ Elm_Access_Activate_Cb func,
+ void *data)
+{
+ if (!ac) return;
+ ac->activate = func;
+ ac->activate_data = data;
+}
+
+EAPI void
_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
{
Evas_Object *highlight_obj;
Evas_Object *ao;
Evas_Object *po = (Evas_Object *)edje_object_part_object_get(eobj, part);
Evas_Coord x, y, w, h;
+ Elm_Access_Info *ac;
if (!obj || !po) return NULL;
// set access object
evas_object_data_set(po, "_part_access_obj", ao);
+ /* set owner part object */
+ ac = evas_object_data_get(ao, "_elm_access");
+ ac->part_object = po;
+
return ao;
}
{
Evas_Object *ao, *ho;
Evas_Coord x, y, w, h;
+ Elm_Access_Info *ac;
if (!item) return;
_elm_access_object_register(ao, ho);
item->access_obj = ao;
+
+ /* set owner widget item */
+ ac = evas_object_data_get(ao, "_elm_access");
+ ac->widget_item = item;
}
EAPI void
}
static void
+_access_activate_cb(void *data,
+ Evas_Object *part_obj,
+ Elm_Widget_Item *item __UNUSED__)
+{
+ Evas_Object *digit, *inc_btn;
+ ELM_CLOCK_DATA_GET(data, sd);
+
+ digit = evas_object_smart_parent_get(part_obj);
+ if (!digit) return;
+
+ inc_btn = (Evas_Object *)edje_object_part_object_get(digit, "access.t");
+
+ if (part_obj != inc_btn)
+ _on_clock_val_down_start(data, digit, NULL, NULL);
+ else
+ _on_clock_val_up_start(data, digit, NULL, NULL);
+
+ _on_clock_val_change_stop(sd, NULL, NULL, NULL);
+}
+
+static void
_access_time_register(Evas_Object *obj, Eina_Bool is_access)
{
Evas_Object *ao, *po;
"clock increment button for %s", digit);
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, eina_strbuf_string_get(strbuf));
+ _elm_access_activate_callback_set
+ (_elm_access_object_get(ao), _access_activate_cb, obj);
/* decrement button */
ao = _elm_access_edje_object_part_object_register
eina_strbuf_replace(strbuf, "increment", "decrement", 1);
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, eina_strbuf_string_get(strbuf));
+ _elm_access_activate_callback_set
+ (_elm_access_object_get(ao), _access_activate_cb, obj);
eina_strbuf_free(strbuf);
(obj, sd->am_pm_obj, "access.t");
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, E_("clock increment button for am,pm"));
+ _elm_access_activate_callback_set
+ (_elm_access_object_get(ao), _access_activate_cb, obj);
/* decrement button */
ao = _elm_access_edje_object_part_object_register
(obj, sd->am_pm_obj, "access.b");
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, E_("clock decrement button for am,pm"));
+ _elm_access_activate_callback_set
+ (_elm_access_object_get(ao), _access_activate_cb, obj);
edje_object_signal_emit
(sd->am_pm_obj, "elm,state,access,edit,on", "elm");
gettimeofday(&timev, NULL);
t = ((double)(1000000 - timev.tv_usec)) / 1000000.0;
+
sd->ticker = ecore_timer_add(t, _ticker, data);
if (!sd->edit)
{
typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj, Elm_Widget_Item *item);
typedef void (*Elm_Access_On_Highlight_Cb)(void *data);
+typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Widget_Item *item);
struct _Elm_Access_Item
{
Ecore_Timer *delay_timer;
void *on_highlight_data;
Elm_Access_On_Highlight_Cb on_highlight;
+
+ void *activate_data;
+ Elm_Access_Activate_Cb activate;
+
+ /* the owner widget item that owns this access info */
+ Elm_Widget_Item *widget_item;
+
+ /* the owner part object that owns this access info */
+ Evas_Object *part_object;
};
EAPI void _elm_access_clear(Elm_Access_Info *ac);
EAPI void _elm_access_widget_item_register(Elm_Widget_Item *item);
EAPI void _elm_access_widget_item_unregister(Elm_Widget_Item *item);
EAPI void _elm_access_on_highlight_hook_set(Elm_Access_Info *ac, Elm_Access_On_Highlight_Cb func, void *data);
+EAPI void _elm_access_activate_callback_set(Elm_Access_Info *ac, Elm_Access_Activate_Cb func, void *data);
EAPI void _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act);
/**< put this as the first member in your widget item struct */