2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2012-05-03 15:41:42 -07:00
|
|
|
#include "elm_widget_button.h"
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "elm_widget_layout.h"
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
EAPI Eo_Op ELM_OBJ_BUTTON_BASE_ID = EO_NOOP;
|
|
|
|
|
|
|
|
#define MY_CLASS ELM_OBJ_BUTTON_CLASS
|
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Button"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_button"
|
2008-09-29 23:58:56 -07:00
|
|
|
|
Proxy Elementary widget signals to Edje.
Add support to automatic proxy events from Elementary to Edje using
callbacks described with Evas_Smart_Cb_Description and set to
Evas_Smart_Class or per-instance with
evas_object_smart_callbacks_descriptions_set().
Right now elm_widget is not subclassable, so there is no way to define
class signals, just instance signals.
Just doing it for button, lots of widgets to do... If you can help,
please follow the process:
* see example at src/lib/elm_button.c, copy it.
* read your widget documentation at Elementary.h
* grep for evas_object_smart_callback_call(), see if they are all
documented in Elementary.h, or if there are some missing. Fix Elementary.h
* paste and change based on fixed Elementary.h My recommendation is
to create "static const char []" variables and replace all
evas_object_smart_callback_call() with that, to force sync.
With callback descriptions pre-defined and using the same pointer with
a custom variation evas_object_smart_callback_call_ptr() we may later
optimize signal calling heavily, removing the requirement to call
eina_stringshare_add()/eina_stringshare_del() and also not mixing all
the callbacks in teh same list, instead having an array for defined
signals, and a list from there. These optimizations are not in, but
they are easily added later without breaking the API/ABI.
SVN revision: 47461
2010-03-25 17:58:14 -07:00
|
|
|
static const char SIG_CLICKED[] = "clicked";
|
|
|
|
static const char SIG_REPEATED[] = "repeated";
|
2011-06-30 16:43:24 -07:00
|
|
|
static const char SIG_PRESSED[] = "pressed";
|
Proxy Elementary widget signals to Edje.
Add support to automatic proxy events from Elementary to Edje using
callbacks described with Evas_Smart_Cb_Description and set to
Evas_Smart_Class or per-instance with
evas_object_smart_callbacks_descriptions_set().
Right now elm_widget is not subclassable, so there is no way to define
class signals, just instance signals.
Just doing it for button, lots of widgets to do... If you can help,
please follow the process:
* see example at src/lib/elm_button.c, copy it.
* read your widget documentation at Elementary.h
* grep for evas_object_smart_callback_call(), see if they are all
documented in Elementary.h, or if there are some missing. Fix Elementary.h
* paste and change based on fixed Elementary.h My recommendation is
to create "static const char []" variables and replace all
evas_object_smart_callback_call() with that, to force sync.
With callback descriptions pre-defined and using the same pointer with
a custom variation evas_object_smart_callback_call_ptr() we may later
optimize signal calling heavily, removing the requirement to call
eina_stringshare_add()/eina_stringshare_del() and also not mixing all
the callbacks in teh same list, instead having an array for defined
signals, and a list from there. These optimizations are not in, but
they are easily added later without breaking the API/ABI.
SVN revision: 47461
2010-03-25 17:58:14 -07:00
|
|
|
static const char SIG_UNPRESSED[] = "unpressed";
|
2013-06-09 02:54:43 -07:00
|
|
|
|
|
|
|
/* smart callbacks coming from elm button objects (besides the ones
|
|
|
|
* coming from elm layout): */
|
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|
|
|
{SIG_CLICKED, ""},
|
|
|
|
{SIG_REPEATED, ""},
|
|
|
|
{SIG_PRESSED, ""},
|
|
|
|
{SIG_UNPRESSED, ""},
|
elm: do not declare SIG_FUCSED/SIG_UNFOCUSED if the const char is not used more than once.
ctxpopup, fileselector_button, naviframe, player, popup, bubble, button, calendar, check, clock, colorselector, datetime, diskselector, flipselector, gengrid.
2013-06-09 22:05:33 -07:00
|
|
|
{"focused", ""}, /**< handled by elm_widget */
|
|
|
|
{"unfocused", ""}, /**< handled by elm_widget */
|
2013-06-09 02:54:43 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
|
|
|
|
{
|
|
|
|
{"icon", "elm.swallow.content"},
|
|
|
|
{NULL, NULL}
|
Proxy Elementary widget signals to Edje.
Add support to automatic proxy events from Elementary to Edje using
callbacks described with Evas_Smart_Cb_Description and set to
Evas_Smart_Class or per-instance with
evas_object_smart_callbacks_descriptions_set().
Right now elm_widget is not subclassable, so there is no way to define
class signals, just instance signals.
Just doing it for button, lots of widgets to do... If you can help,
please follow the process:
* see example at src/lib/elm_button.c, copy it.
* read your widget documentation at Elementary.h
* grep for evas_object_smart_callback_call(), see if they are all
documented in Elementary.h, or if there are some missing. Fix Elementary.h
* paste and change based on fixed Elementary.h My recommendation is
to create "static const char []" variables and replace all
evas_object_smart_callback_call() with that, to force sync.
With callback descriptions pre-defined and using the same pointer with
a custom variation evas_object_smart_callback_call_ptr() we may later
optimize signal calling heavily, removing the requirement to call
eina_stringshare_add()/eina_stringshare_del() and also not mixing all
the callbacks in teh same list, instead having an array for defined
signals, and a list from there. These optimizations are not in, but
they are easily added later without breaking the API/ABI.
SVN revision: 47461
2010-03-25 17:58:14 -07:00
|
|
|
};
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
|
2010-09-22 10:45:49 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
{"default", "elm.text"},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2011-09-14 02:53:11 -07:00
|
|
|
|
2012-05-02 18:19:05 -07:00
|
|
|
static void
|
2012-05-03 15:41:42 -07:00
|
|
|
_activate(Evas_Object *obj)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_DATA_GET_OR_RETURN(obj, sd);
|
|
|
|
|
2013-05-29 04:41:01 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->repeating = EINA_FALSE;
|
|
|
|
|
|
|
|
if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
|
|
|
|
(_elm_access_2nd_click_timeout(obj)))
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
|
|
|
|
_elm_access_say(E_("Clicked"));
|
|
|
|
if (!elm_widget_disabled_get(obj) &&
|
|
|
|
!evas_object_freeze_events_get(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
}
|
2009-08-16 04:35:55 -07:00
|
|
|
|
2012-05-02 18:19:05 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_button_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2013-10-05 01:13:39 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-03 15:41:42 -07:00
|
|
|
Evas_Coord minw = -1, minh = -1;
|
2010-10-07 07:49:35 -07:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
edje_object_size_min_restricted_calc
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, &minw, &minh, minw, minh);
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-09-03 01:49:45 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Activate act = va_arg(*list, Elm_Activate);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
|
2013-11-08 04:49:52 -08:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
2012-11-25 22:32:53 -08:00
|
|
|
if (act != ELM_ACTIVATE_DEFAULT) return;
|
2013-11-08 04:49:52 -08:00
|
|
|
if (evas_object_freeze_events_get(obj)) return;
|
2012-09-16 20:01:46 -07:00
|
|
|
|
2013-11-08 04:49:52 -08:00
|
|
|
evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
|
|
|
|
elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
|
2012-09-16 20:01:46 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2012-09-03 01:49:45 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
/* FIXME: replicated from elm_layout just because button's icon spot
|
|
|
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
|
|
|
* can changed the theme API */
|
2012-05-02 18:19:05 -07:00
|
|
|
static void
|
2012-05-03 15:41:42 -07:00
|
|
|
_icon_signal_emit(Evas_Object *obj)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
char buf[64];
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
|
|
|
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_layout_signal_emit(obj, buf, "elm");
|
2012-07-12 04:11:21 -07:00
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(obj));
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_layout_sizing_eval());
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
/* FIXME: replicated from elm_layout just because button's icon spot
|
|
|
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
|
|
|
* can changed the theme API */
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2013-02-20 21:57:05 -08:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
2012-05-03 15:41:42 -07:00
|
|
|
_icon_signal_emit(obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
/* FIXME: replicated from elm_layout just because button's icon spot
|
|
|
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
|
|
|
* can changed the theme API */
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *sobj = va_arg(*list, Evas_Object *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_sub_object_del(sobj, &int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
2011-10-24 18:23:25 -07:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
_icon_signal_emit(obj);
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
/* FIXME: replicated from elm_layout just because button's icon spot
|
|
|
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
|
|
|
* can changed the theme API */
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
const char *part = va_arg(*list, const char *);
|
|
|
|
Evas_Object *content = va_arg(*list, Evas_Object *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_container_content_set(part, content, &int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
2008-10-06 23:55:11 -07:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
_icon_signal_emit(obj);
|
2012-05-02 09:58:26 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2010-09-22 10:45:43 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *src = va_arg(*list, Evas_Object *);
|
|
|
|
Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
|
2013-10-28 07:06:14 -07:00
|
|
|
Evas_Event_Key_Down *ev = va_arg(*list, void *);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
2013-10-28 07:06:14 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_FALSE;
|
2013-10-28 07:06:14 -07:00
|
|
|
(void) src;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2013-07-30 23:14:09 -07:00
|
|
|
if ((strcmp(ev->key, "Return")) &&
|
|
|
|
(strcmp(ev->key, "KP_Enter")) &&
|
|
|
|
(strcmp(ev->key, "space")))
|
2012-11-25 22:32:53 -08:00
|
|
|
return;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
|
2013-12-04 17:01:43 -08:00
|
|
|
_activate(obj);
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2013-11-12 16:54:37 -08:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2010-09-22 10:45:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_clicked_signal(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2010-09-22 10:45:43 -07:00
|
|
|
{
|
|
|
|
_activate(data);
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2010-01-23 17:53:37 -08:00
|
|
|
_autorepeat_send(void *data)
|
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_DATA_GET_OR_RETURN_VAL(data, sd, ECORE_CALLBACK_CANCEL);
|
2010-01-23 17:53:37 -08:00
|
|
|
|
Proxy Elementary widget signals to Edje.
Add support to automatic proxy events from Elementary to Edje using
callbacks described with Evas_Smart_Cb_Description and set to
Evas_Smart_Class or per-instance with
evas_object_smart_callbacks_descriptions_set().
Right now elm_widget is not subclassable, so there is no way to define
class signals, just instance signals.
Just doing it for button, lots of widgets to do... If you can help,
please follow the process:
* see example at src/lib/elm_button.c, copy it.
* read your widget documentation at Elementary.h
* grep for evas_object_smart_callback_call(), see if they are all
documented in Elementary.h, or if there are some missing. Fix Elementary.h
* paste and change based on fixed Elementary.h My recommendation is
to create "static const char []" variables and replace all
evas_object_smart_callback_call() with that, to force sync.
With callback descriptions pre-defined and using the same pointer with
a custom variation evas_object_smart_callback_call_ptr() we may later
optimize signal calling heavily, removing the requirement to call
eina_stringshare_add()/eina_stringshare_del() and also not mixing all
the callbacks in teh same list, instead having an array for defined
signals, and a list from there. These optimizations are not in, but
they are easily added later without breaking the API/ABI.
SVN revision: 47461
2010-03-25 17:58:14 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_REPEATED, NULL);
|
2012-05-03 15:41:42 -07:00
|
|
|
if (!sd->repeating)
|
2010-04-08 08:15:22 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->timer = NULL;
|
2011-02-27 14:59:12 -08:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2010-04-08 08:15:22 -07:00
|
|
|
}
|
2010-01-23 17:53:37 -08:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2010-01-23 17:53:37 -08:00
|
|
|
_autorepeat_initial_send(void *data)
|
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_DATA_GET_OR_RETURN_VAL(data, sd, ECORE_CALLBACK_CANCEL);
|
2010-01-23 17:53:37 -08:00
|
|
|
|
2013-05-29 04:41:01 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->repeating = EINA_TRUE;
|
2010-01-23 17:53:37 -08:00
|
|
|
_autorepeat_send(data);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->timer = ecore_timer_add(sd->ar_interval, _autorepeat_send, data);
|
2010-01-23 17:53:37 -08:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_pressed_signal(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_DATA_GET_OR_RETURN(data, sd);
|
2010-01-23 17:53:37 -08:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
if ((sd->autorepeat) && (!sd->repeating))
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
if (sd->ar_threshold <= 0.0)
|
|
|
|
_autorepeat_initial_send(data); /* call immediately */
|
2011-02-27 14:59:12 -08:00
|
|
|
else
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->timer = ecore_timer_add
|
|
|
|
(sd->ar_threshold, _autorepeat_initial_send, data);
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
2011-06-30 16:43:24 -07:00
|
|
|
|
|
|
|
evas_object_smart_callback_call(data, SIG_PRESSED, NULL);
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_unpressed_signal(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_DATA_GET_OR_RETURN(data, sd);
|
2010-01-23 17:53:37 -08:00
|
|
|
|
2013-05-29 04:41:01 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->repeating = EINA_FALSE;
|
2010-04-08 08:15:22 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_UNPRESSED, NULL);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2011-08-19 04:07:42 -07:00
|
|
|
static char *
|
2012-12-23 06:50:56 -08:00
|
|
|
_access_info_cb(void *data __UNUSED__, Evas_Object *obj)
|
2011-08-19 04:07:42 -07:00
|
|
|
{
|
2011-08-25 19:02:15 -07:00
|
|
|
const char *txt = elm_widget_access_info_get(obj);
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
if (!txt) txt = elm_layout_text_get(obj, NULL);
|
2011-08-19 04:07:42 -07:00
|
|
|
if (txt) return strdup(txt);
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2011-08-25 19:02:15 -07:00
|
|
|
return NULL;
|
2011-08-19 04:07:42 -07:00
|
|
|
}
|
|
|
|
|
2011-08-19 04:20:45 -07:00
|
|
|
static char *
|
2012-12-23 06:50:56 -08:00
|
|
|
_access_state_cb(void *data __UNUSED__, Evas_Object *obj)
|
2011-08-19 04:20:45 -07:00
|
|
|
{
|
|
|
|
if (elm_widget_disabled_get(obj))
|
2011-08-25 19:02:15 -07:00
|
|
|
return strdup(E_("State: Disabled"));
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2011-08-19 04:20:45 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
static void
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_button_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-05-03 15:41:42 -07:00
|
|
|
{
|
2013-10-05 01:13:39 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-03 15:41:42 -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-02-20 21:57:05 -08:00
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
edje_object_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(wd->resize_obj, "elm,action,click", "*",
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_clicked_signal, obj);
|
|
|
|
edje_object_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(wd->resize_obj, "elm,action,press", "*",
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_pressed_signal, obj);
|
|
|
|
edje_object_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(wd->resize_obj, "elm,action,unpress", "*",
|
2012-05-03 15:41:42 -07:00
|
|
|
_on_unpressed_signal, obj);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_access_object_register(obj, wd->resize_obj);
|
2012-05-03 15:41:42 -07:00
|
|
|
_elm_access_text_set
|
2013-07-30 20:53:04 -07:00
|
|
|
(_elm_access_info_get(obj), ELM_ACCESS_TYPE, E_("Button"));
|
2012-05-03 15:41:42 -07:00
|
|
|
_elm_access_callback_set
|
2013-07-30 20:53:04 -07:00
|
|
|
(_elm_access_info_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
|
2012-05-03 15:41:42 -07:00
|
|
|
_elm_access_callback_set
|
2013-07-30 20:53:04 -07:00
|
|
|
(_elm_access_info_get(obj), ELM_ACCESS_STATE, _access_state_cb, obj);
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2012-05-03 15:41:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_button_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-03 15:41:42 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
|
|
|
|
*aliases = _content_aliases;
|
2012-05-03 15:41:42 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_button_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-03 15:41:42 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
|
|
|
|
*aliases = _text_aliases;
|
2012-05-03 15:41:42 -07:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_button_add(Evas_Object *parent)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-05-03 15:41:42 -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);
|
|
|
|
eo_unref(obj);
|
|
|
|
return obj;
|
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|
|
|
{
|
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),
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2010-01-23 17:53:37 -08:00
|
|
|
EAPI void
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_button_autorepeat_set(Evas_Object *obj,
|
|
|
|
Eina_Bool on)
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_button_autorepeat_set(on));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_autorepeat_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool on = va_arg(*list, int);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2013-05-29 04:41:01 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->autorepeat = on;
|
|
|
|
sd->repeating = EINA_FALSE;
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define _AR_CAPABLE(obj) \
|
|
|
|
(_elm_button_admits_autorepeat_get(obj))
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_button_admits_autorepeat_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
eo_do((Eo *) obj, elm_obj_button_admits_autorepeat_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_admits_autorepeat_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
*ret = EINA_TRUE;
|
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2010-10-27 07:38:45 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_button_autorepeat_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj) EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
eo_do((Eo *) obj, elm_obj_button_autorepeat_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_autorepeat_get(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
|
|
|
*ret = _AR_CAPABLE(obj) & sd->autorepeat;
|
2010-10-27 07:38:45 -07:00
|
|
|
}
|
|
|
|
|
2010-01-23 17:53:37 -08:00
|
|
|
EAPI void
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_button_autorepeat_initial_timeout_set(Evas_Object *obj,
|
|
|
|
double t)
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_button_autorepeat_initial_timeout_set(t));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_autorepeat_initial_timeout_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
double t = va_arg(*list, double);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!_AR_CAPABLE(obj))
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ERR("this widget does not support auto repetition of clicks.");
|
|
|
|
return;
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
if (sd->ar_threshold == t) return;
|
2013-05-29 04:41:01 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
2012-05-03 15:41:42 -07:00
|
|
|
sd->ar_threshold = t;
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
|
|
|
|
2010-10-27 07:38:45 -07:00
|
|
|
EAPI double
|
|
|
|
elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj) 0.0;
|
2012-11-25 22:32:53 -08:00
|
|
|
double ret = 0.0;
|
|
|
|
eo_do((Eo *) obj, elm_obj_button_autorepeat_initial_timeout_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_autorepeat_initial_timeout_get(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
double *ret = va_arg(*list, double *);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!_AR_CAPABLE(obj))
|
|
|
|
*ret = 0.0;
|
|
|
|
else
|
|
|
|
*ret = sd->ar_threshold;
|
2010-10-27 07:38:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-05-03 15:41:42 -07:00
|
|
|
elm_button_autorepeat_gap_timeout_set(Evas_Object *obj,
|
|
|
|
double t)
|
2010-01-23 17:53:37 -08:00
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_button_autorepeat_gap_timeout_set(t));
|
|
|
|
}
|
2010-04-08 08:15:22 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_autorepeat_gap_timeout_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
double t = va_arg(*list, double);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
if (!_AR_CAPABLE(obj))
|
2012-05-03 15:41:42 -07:00
|
|
|
{
|
|
|
|
ERR("this widget does not support auto repetition of clicks.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->ar_interval == t) return;
|
|
|
|
|
|
|
|
sd->ar_interval = t;
|
|
|
|
if ((sd->repeating) && (sd->timer)) ecore_timer_interval_set(sd->timer, t);
|
2010-01-23 17:53:37 -08:00
|
|
|
}
|
2010-10-27 07:38:45 -07:00
|
|
|
|
|
|
|
EAPI double
|
|
|
|
elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:41:42 -07:00
|
|
|
ELM_BUTTON_CHECK(obj) 0.0;
|
2012-11-25 22:32:53 -08:00
|
|
|
double ret = 0.0;
|
|
|
|
eo_do((Eo *) obj, elm_obj_button_autorepeat_gap_timeout_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_autorepeat_gap_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
double *ret = va_arg(*list, double *);
|
|
|
|
Elm_Button_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->ar_interval;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_button_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
*ret = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_button_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
*ret = EINA_FALSE;
|
2010-10-27 07:38:45 -07:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_class_constructor(Eo_Class *klass)
|
|
|
|
{
|
|
|
|
const Eo_Op_Func_Description func_desc[] = {
|
|
|
|
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
|
|
|
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_button_smart_add),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_button_smart_theme),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_button_smart_event),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_button_smart_sub_object_del),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_button_smart_activate),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_button_smart_focus_next_manager_is),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_button_smart_focus_direction_manager_is),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_button_smart_content_set),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_button_smart_sizing_eval),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_button_smart_content_aliases_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_button_smart_text_aliases_get),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _admits_autorepeat_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET), _autorepeat_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET), _autorepeat_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET), _autorepeat_initial_timeout_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET), _autorepeat_initial_timeout_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET), _autorepeat_gap_timeout_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET), _autorepeat_gap_timeout_get),
|
|
|
|
EO_OP_FUNC_SENTINEL
|
|
|
|
};
|
|
|
|
eo_class_funcs_set(klass, func_desc);
|
2013-02-09 23:52:31 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static const Eo_Op_Description op_desc[] = {
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET, "Get whether auto-repetition is implemented or not"),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET, "Turn on/off the autorepeat event generated when the button is kept pressed."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET, "Get whether the autorepeat feature is enabled."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET, "Set the initial timeout before the autorepeat event is generated."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET, "Get the initial timeout before the autorepeat event is generated."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET, "Set the interval between each generated autorepeat event."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET, "Get the interval between each generated autorepeat event."),
|
|
|
|
EO_OP_DESCRIPTION_SENTINEL
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Eo_Class_Description class_desc = {
|
|
|
|
EO_VERSION,
|
|
|
|
MY_CLASS_NAME,
|
|
|
|
EO_CLASS_TYPE_REGULAR,
|
|
|
|
EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_BUTTON_BASE_ID, op_desc, ELM_OBJ_BUTTON_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
sizeof(Elm_Button_Smart_Data),
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
EO_DEFINE_CLASS(elm_obj_button_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
|