2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2008-12-08 01:24:46 -08:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2012-08-01 14:04:20 -07:00
|
|
|
#include "elm_widget_hoversel.h"
|
2008-12-08 01:24:46 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
EAPI Eo_Op ELM_OBJ_HOVERSEL_BASE_ID = EO_NOOP;
|
|
|
|
|
|
|
|
#define MY_CLASS ELM_OBJ_HOVERSEL_CLASS
|
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Hoversel"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_hoversel"
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2011-04-15 10:01:39 -07:00
|
|
|
static const char SIG_SELECTED[] = "selected";
|
|
|
|
static const char SIG_DISMISSED[] = "dismissed";
|
2012-05-03 15:43:00 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2011-04-15 10:01:39 -07:00
|
|
|
{SIG_SELECTED, ""},
|
|
|
|
{SIG_DISMISSED, ""},
|
2013-08-30 02:30:19 -07:00
|
|
|
{"clicked", ""}, /**< handled by parent button class */
|
2011-04-15 10:01:39 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2013-04-23 04:30:15 -07:00
|
|
|
static void
|
|
|
|
_elm_hoversel_smart_translate(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
Elm_Hoversel_Item *it;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
|
|
|
elm_widget_item_translate(it);
|
|
|
|
|
|
|
|
if (ret) *ret = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_hoversel_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2009-11-13 14:22:05 -08: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;
|
|
|
|
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2013-10-05 01:12:44 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
char buf[4096];
|
|
|
|
const char *style;
|
2008-12-08 01:24:46 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
style = eina_stringshare_add(elm_widget_style_get(obj));
|
2011-02-10 07:13:05 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
if (sd->horizontal)
|
|
|
|
snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", style);
|
2010-01-18 02:28:00 -08:00
|
|
|
else
|
2012-05-03 15:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "hoversel_vertical/%s", style);
|
2010-10-05 12:09:52 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
/* hoversel's style has an extra bit: orientation */
|
2012-11-25 22:32:53 -08:00
|
|
|
eina_stringshare_replace(&(wd->style), buf);
|
2012-05-02 09:59:40 -07: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-02 09:59:40 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
eina_stringshare_replace(&(wd->style), style);
|
2012-05-02 09:59:40 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
eina_stringshare_del(style);
|
|
|
|
|
|
|
|
if (sd->hover)
|
|
|
|
elm_widget_mirrored_set(sd->hover, elm_widget_mirrored_get(obj));
|
|
|
|
|
|
|
|
elm_hoversel_hover_end(obj);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2008-12-08 01:24:46 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:43:00 -07:00
|
|
|
_on_hover_clicked(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2008-12-08 01:24:46 -08:00
|
|
|
{
|
|
|
|
elm_hoversel_hover_end(data);
|
|
|
|
}
|
|
|
|
|
2008-12-15 16:15:34 -08:00
|
|
|
static void
|
2012-05-03 15:43:00 -07:00
|
|
|
_on_item_clicked(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2008-12-15 16:15:34 -08:00
|
|
|
{
|
2010-11-02 04:26:50 -07:00
|
|
|
Elm_Hoversel_Item *item = data;
|
2011-10-20 18:08:01 -07:00
|
|
|
Evas_Object *obj2 = WIDGET(item);
|
2009-09-27 13:10:03 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
if (item->func) item->func((void *)item->base.data, obj2, item);
|
2011-04-15 10:01:39 -07:00
|
|
|
evas_object_smart_callback_call(obj2, SIG_SELECTED, item);
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_hover_end(obj2);
|
2008-12-15 16:15:34 -08:00
|
|
|
}
|
|
|
|
|
2008-12-09 22:33:24 -08:00
|
|
|
static void
|
2009-03-19 06:36:46 -07:00
|
|
|
_activate(Evas_Object *obj)
|
2008-12-09 22:33:24 -08:00
|
|
|
{
|
2013-10-13 21:53:27 -07:00
|
|
|
Elm_Hoversel_Item *item;
|
2008-12-09 22:33:24 -08:00
|
|
|
Evas_Object *bt, *bx, *ic;
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
2009-09-02 05:48:00 -07:00
|
|
|
char buf[4096];
|
2009-02-25 11:50:45 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->expanded)
|
2010-09-22 10:45:49 -07:00
|
|
|
{
|
|
|
|
elm_hoversel_hover_end(obj);
|
|
|
|
return;
|
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
sd->expanded = EINA_TRUE;
|
2010-09-22 10:45:49 -07:00
|
|
|
|
2009-09-27 13:10:03 -07:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
sd->hover = elm_hover_add(sd->hover_parent);
|
2013-04-02 11:11:34 -07:00
|
|
|
elm_widget_sub_object_add(obj, sd->hover);
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_widget_mirrored_automatic_set(sd->hover, EINA_FALSE);
|
|
|
|
|
|
|
|
if (sd->horizontal)
|
|
|
|
snprintf(buf, sizeof(buf), "hoversel_horizontal/%s",
|
|
|
|
elm_widget_style_get(obj));
|
2010-01-18 02:28:00 -08:00
|
|
|
else
|
2012-05-03 15:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "hoversel_vertical/%s",
|
|
|
|
elm_widget_style_get(obj));
|
2008-12-09 22:33:24 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_object_style_set(sd->hover, buf);
|
|
|
|
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(sd->hover, "clicked", _on_hover_clicked, obj);
|
|
|
|
elm_hover_target_set(sd->hover, obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
/* hover's content */
|
|
|
|
bx = elm_box_add(sd->hover);
|
|
|
|
elm_widget_mirrored_automatic_set(bx, EINA_FALSE);
|
|
|
|
elm_box_homogeneous_set(bx, EINA_TRUE);
|
|
|
|
elm_box_horizontal_set(bx, sd->horizontal);
|
2011-04-01 04:51:11 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
if (sd->horizontal)
|
2010-01-18 02:28:00 -08:00
|
|
|
snprintf(buf, sizeof(buf), "hoversel_horizontal_entry/%s",
|
|
|
|
elm_widget_style_get(obj));
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
|
|
|
|
elm_widget_style_get(obj));
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, item)
|
2008-12-15 16:15:34 -08:00
|
|
|
{
|
2013-10-13 21:53:27 -07:00
|
|
|
VIEW(item) = bt = elm_button_add(bx);
|
2011-02-10 07:13:05 -08:00
|
|
|
elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
|
2011-02-08 04:08:28 -08:00
|
|
|
elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
|
2011-04-01 04:51:11 -07:00
|
|
|
elm_object_style_set(bt, buf);
|
2011-06-29 02:31:01 -07:00
|
|
|
elm_object_text_set(bt, item->label);
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2011-04-01 04:51:11 -07:00
|
|
|
if (item->icon_file)
|
|
|
|
{
|
|
|
|
ic = elm_icon_add(obj);
|
2012-05-28 14:50:11 -07:00
|
|
|
elm_image_resizable_set(ic, EINA_FALSE, EINA_TRUE);
|
2011-04-01 04:51:11 -07:00
|
|
|
if (item->icon_type == ELM_ICON_FILE)
|
2012-05-28 14:50:11 -07:00
|
|
|
elm_image_file_set(ic, item->icon_file, item->icon_group);
|
2011-04-01 04:51:11 -07:00
|
|
|
else if (item->icon_type == ELM_ICON_STANDARD)
|
|
|
|
elm_icon_standard_set(ic, item->icon_file);
|
2011-11-17 13:02:31 -08:00
|
|
|
elm_object_part_content_set(bt, "icon", ic);
|
2011-04-01 04:51:11 -07:00
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2011-04-01 04:51:11 -07:00
|
|
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, bt);
|
2012-05-03 15:43:00 -07:00
|
|
|
evas_object_smart_callback_add(bt, "clicked", _on_item_clicked, item);
|
2011-04-01 04:51:11 -07:00
|
|
|
evas_object_show(bt);
|
2008-12-15 16:15:34 -08:00
|
|
|
}
|
2008-12-09 22:33:24 -08:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
if (sd->horizontal)
|
|
|
|
elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get
|
|
|
|
(sd->hover, ELM_HOVER_AXIS_HORIZONTAL), bx);
|
2010-01-18 02:28:00 -08:00
|
|
|
else
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get
|
|
|
|
(sd->hover, ELM_HOVER_AXIS_VERTICAL), bx);
|
2010-09-22 10:45:43 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
evas_object_show(sd->hover);
|
2008-12-09 22:33:24 -08:00
|
|
|
}
|
|
|
|
|
2008-12-08 01:24:46 -08:00
|
|
|
static void
|
2012-05-03 15:43:00 -07:00
|
|
|
_on_clicked(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2008-12-08 01:24:46 -08:00
|
|
|
{
|
2012-05-02 18:19:05 -07:00
|
|
|
_activate(data);
|
2011-06-29 22:43:56 -07:00
|
|
|
}
|
|
|
|
|
2012-05-02 18:19:05 -07:00
|
|
|
static void
|
2012-05-03 15:43:00 -07:00
|
|
|
_on_parent_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-06-29 22:43:56 -07:00
|
|
|
{
|
2012-05-24 07:08:18 -07:00
|
|
|
elm_hoversel_hover_parent_set(data, NULL);
|
2011-12-19 18:44:46 -08:00
|
|
|
}
|
|
|
|
|
2012-05-02 18:19:05 -07:00
|
|
|
static const char *
|
2012-05-03 15:43:00 -07:00
|
|
|
_item_text_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part)
|
2011-12-19 18:44:46 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
if (part && strcmp(part, "default")) return NULL;
|
|
|
|
return ((Elm_Hoversel_Item *)it)->label;
|
2011-12-19 18:44:46 -08:00
|
|
|
}
|
|
|
|
|
2013-10-13 21:53:27 -07:00
|
|
|
static void
|
|
|
|
_item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
|
|
|
{
|
|
|
|
if (VIEW(it))
|
|
|
|
elm_object_signal_emit(VIEW(it), emission, source);
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_del_pre_hook(Elm_Object_Item *it)
|
2011-12-19 18:44:46 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
|
2012-05-02 09:59:40 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE);
|
2012-05-02 09:59:40 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_hover_end(WIDGET(item));
|
|
|
|
sd->items = eina_list_remove(sd->items, item);
|
|
|
|
eina_stringshare_del(item->label);
|
|
|
|
eina_stringshare_del(item->icon_file);
|
|
|
|
eina_stringshare_del(item->icon_group);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2012-05-02 09:59:40 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
static void
|
2013-01-04 11:10:19 -08:00
|
|
|
_elm_hoversel_smart_add(Eo *obj, void *_pd __UNUSED__,
|
|
|
|
va_list *list EINA_UNUSED)
|
2012-05-02 18:19:05 -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 08:29:45 -07:00
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
|
|
|
|
|
|
|
|
evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj);
|
|
|
|
|
2013-08-26 08:29:45 -07:00
|
|
|
//What are you doing here?
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_wdg_theme(NULL));
|
2011-12-19 18:44:46 -08:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_hoversel_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
Elm_Hoversel_Item *item;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2013-03-08 20:23:42 -08:00
|
|
|
EINA_LIST_FREE(sd->items, item)
|
2012-05-03 15:43:00 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(item->label);
|
|
|
|
eina_stringshare_del(item->icon_file);
|
|
|
|
eina_stringshare_del(item->icon_group);
|
|
|
|
elm_widget_item_free(item);
|
|
|
|
}
|
2012-05-23 19:26:55 -07:00
|
|
|
elm_hoversel_hover_parent_set(obj, NULL);
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2012-01-27 03:56:14 -08:00
|
|
|
|
2013-04-02 22:46:14 -07:00
|
|
|
static void
|
|
|
|
_elm_hoversel_smart_show(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
|
|
|
|
evas_object_show(sd->hover);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_hoversel_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
|
2013-04-08 21:07:37 -07:00
|
|
|
evas_object_hide(sd->hover);
|
2013-04-02 22:46:14 -07:00
|
|
|
}
|
|
|
|
|
2012-07-18 14:03:39 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_hoversel_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-07-18 14:03:39 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
2012-07-18 14:03:39 -07:00
|
|
|
elm_hoversel_hover_parent_set(obj, parent);
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:43:00 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_hoversel_smart_admits_autorepeat_get(Eo *obj EINA_UNUSED, 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 *);
|
|
|
|
*ret = EINA_FALSE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2008-12-08 01:24:46 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_hoversel_add(Evas_Object *parent)
|
|
|
|
{
|
2012-05-03 15:43:00 -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:43:00 -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-12-08 01:24:46 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_hover_parent_set(Evas_Object *obj,
|
|
|
|
Evas_Object *parent)
|
2008-12-08 01:24:46 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_hoversel_hover_parent_set(parent));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hover_parent_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
if (sd->hover_parent)
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->hover_parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
|
|
|
|
|
|
|
sd->hover_parent = parent;
|
|
|
|
if (sd->hover_parent)
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->hover_parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
2008-12-08 01:24:46 -08:00
|
|
|
}
|
|
|
|
|
2010-10-14 11:54:42 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_hoversel_hover_parent_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj) NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *ret = NULL;
|
|
|
|
eo_do((Eo *) obj, elm_obj_hoversel_hover_parent_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object **ret = va_arg(*list, Evas_Object **);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->hover_parent;
|
2010-10-14 11:54:42 -07:00
|
|
|
}
|
|
|
|
|
2010-01-13 19:47:28 -08:00
|
|
|
EAPI void
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_horizontal_set(Evas_Object *obj,
|
|
|
|
Eina_Bool horizontal)
|
2010-01-13 19:47:28 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_hoversel_horizontal_set(horizontal));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_horizontal_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool horizontal = va_arg(*list, int);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
sd->horizontal = !!horizontal;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_wdg_theme(NULL));
|
2010-01-13 19:47:28 -08:00
|
|
|
}
|
|
|
|
|
2010-04-07 00:37:49 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_hoversel_horizontal_get(const Evas_Object *obj)
|
2009-08-11 03:44:49 -07:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj) EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
eo_do((Eo *) obj, elm_obj_hoversel_horizontal_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->horizontal;
|
2009-08-11 03:44:49 -07:00
|
|
|
}
|
|
|
|
|
2009-03-19 06:36:46 -07:00
|
|
|
EAPI void
|
|
|
|
elm_hoversel_hover_begin(Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_hoversel_hover_begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hover_begin(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
if (sd->hover) return;
|
|
|
|
|
2009-03-19 06:36:46 -07:00
|
|
|
_activate(obj);
|
|
|
|
}
|
|
|
|
|
2008-12-08 01:24:46 -08:00
|
|
|
EAPI void
|
|
|
|
elm_hoversel_hover_end(Evas_Object *obj)
|
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_hoversel_hover_end());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hover_end(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
2013-11-19 09:13:31 -08:00
|
|
|
Elm_Object_Item *it;
|
|
|
|
Eina_List *l;
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
if (!sd->hover) return;
|
|
|
|
|
|
|
|
sd->expanded = EINA_FALSE;
|
|
|
|
|
2013-11-19 09:13:31 -08:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
|
|
|
{
|
|
|
|
VIEW(it) = NULL;
|
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
evas_object_del(sd->hover);
|
|
|
|
sd->hover = NULL;
|
|
|
|
|
2011-04-15 10:01:39 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
|
2008-12-09 22:33:24 -08:00
|
|
|
}
|
|
|
|
|
2010-04-06 18:31:36 -07:00
|
|
|
EAPI Eina_Bool
|
2010-10-25 07:34:22 -07:00
|
|
|
elm_hoversel_expanded_get(const Evas_Object *obj)
|
2010-04-06 18:31:36 -07:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj) EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
eo_do((Eo *) obj, elm_obj_hoversel_expanded_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_expanded_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
*ret = (sd->hover) ? EINA_TRUE : EINA_FALSE;
|
2010-04-06 18:31:36 -07:00
|
|
|
}
|
2011-04-01 04:51:11 -07:00
|
|
|
|
2009-08-14 04:17:06 -07:00
|
|
|
EAPI void
|
|
|
|
elm_hoversel_clear(Evas_Object *obj)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
|
|
|
ELM_HOVERSEL_CHECK(obj);
|
|
|
|
eo_do(obj, elm_obj_hoversel_clear());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
|
2009-08-14 04:17:06 -07:00
|
|
|
{
|
2011-12-19 17:03:17 -08:00
|
|
|
Elm_Object_Item *it;
|
2009-08-14 04:17:06 -07:00
|
|
|
Eina_List *l, *ll;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_widget_item_del(it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
2009-08-14 04:17:06 -07:00
|
|
|
}
|
|
|
|
|
2009-10-04 16:05:50 -07:00
|
|
|
EAPI const Eina_List *
|
2010-03-23 20:06:00 -07:00
|
|
|
elm_hoversel_items_get(const Evas_Object *obj)
|
2009-10-04 16:05:50 -07:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj) NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
const Eina_List *ret = NULL;
|
|
|
|
eo_do((Eo *) obj, elm_obj_hoversel_items_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const Eina_List **ret = va_arg(*list, const Eina_List **);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->items;
|
2009-10-04 16:05:50 -07:00
|
|
|
}
|
|
|
|
|
2011-12-19 17:03:17 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_item_add(Evas_Object *obj,
|
|
|
|
const char *label,
|
|
|
|
const char *icon_file,
|
|
|
|
Elm_Icon_Type icon_type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *data)
|
2008-12-09 22:33:24 -08:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_CHECK(obj) NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Object_Item *ret = NULL;
|
|
|
|
eo_do(obj, elm_obj_hoversel_item_add(label, icon_file, icon_type, func, data, &ret));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_add(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const char *label = va_arg(*list, const char *);
|
|
|
|
const char *icon_file = va_arg(*list, const char *);
|
|
|
|
Elm_Icon_Type icon_type = va_arg(*list, Elm_Icon_Type);
|
|
|
|
Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
*ret = NULL;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
Elm_Hoversel_Item *item = elm_widget_item_new(obj, Elm_Hoversel_Item);
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!item) return;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
|
2011-12-19 18:44:46 -08:00
|
|
|
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
|
2013-10-13 21:53:27 -07:00
|
|
|
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
item->label = eina_stringshare_add(label);
|
|
|
|
item->icon_file = eina_stringshare_add(icon_file);
|
|
|
|
item->icon_type = icon_type;
|
|
|
|
item->func = func;
|
|
|
|
item->base.data = data;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
|
|
|
sd->items = eina_list_append(sd->items, item);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
*ret = (Elm_Object_Item *)item;
|
2008-12-09 22:33:24 -08:00
|
|
|
}
|
|
|
|
|
2009-08-14 04:17:06 -07:00
|
|
|
EAPI void
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_item_icon_set(Elm_Object_Item *it,
|
|
|
|
const char *icon_file,
|
|
|
|
const char *icon_group,
|
|
|
|
Elm_Icon_Type icon_type)
|
2009-08-14 04:17:06 -07:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
eina_stringshare_replace(&item->icon_file, icon_file);
|
|
|
|
eina_stringshare_replace(&item->icon_group, icon_group);
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
item->icon_type = icon_type;
|
2009-08-14 04:17:06 -07:00
|
|
|
}
|
|
|
|
|
2009-09-16 12:13:55 -07:00
|
|
|
EAPI void
|
2012-05-03 15:43:00 -07:00
|
|
|
elm_hoversel_item_icon_get(const Elm_Object_Item *it,
|
|
|
|
const char **icon_file,
|
|
|
|
const char **icon_group,
|
|
|
|
Elm_Icon_Type *icon_type)
|
2009-09-16 12:13:55 -07:00
|
|
|
{
|
2012-05-03 15:43:00 -07:00
|
|
|
ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
|
2012-05-03 15:43:00 -07:00
|
|
|
|
2010-11-02 04:26:50 -07:00
|
|
|
if (icon_file) *icon_file = item->icon_file;
|
|
|
|
if (icon_group) *icon_group = item->icon_group;
|
|
|
|
if (icon_type) *icon_type = item->icon_type;
|
2009-09-16 12:13:55 -07:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-13 03:32:31 -08:00
|
|
|
static void
|
|
|
|
_elm_hoversel_smart_event(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object *src = va_arg(*list, Evas_Object *);
|
|
|
|
(void) src;
|
|
|
|
Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
|
|
|
|
void *event_info = va_arg(*list, void *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
2013-11-18 05:33:37 -08:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2013-11-13 03:32:31 -08:00
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
Elm_Hoversel_Smart_Data *sd = _pd;
|
|
|
|
|
2013-11-18 05:33:37 -08:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_event(src, type, event_info, &int_ret));
|
|
|
|
if (int_ret) return;
|
2013-11-13 03:32:31 -08:00
|
|
|
|
|
|
|
if (!sd || !sd->hover) return;
|
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
|
|
|
|
|
|
|
if ((!strcmp(ev->key, "Down")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
elm_widget_focus_cycle(sd->hover, ELM_FOCUS_DOWN);
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->key, "Up")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
elm_widget_focus_cycle(sd->hover, ELM_FOCUS_UP);
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->key, "Left")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
elm_widget_focus_cycle(sd->hover, ELM_FOCUS_LEFT);
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->key, "Right")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
elm_widget_focus_cycle(sd->hover, ELM_FOCUS_RIGHT);
|
|
|
|
goto success;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
success:
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
if (ret) *ret = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
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_hoversel_smart_add),
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_hoversel_smart_del),
|
2013-04-02 22:46:14 -07:00
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_hoversel_smart_show),
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_hoversel_smart_hide),
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_hoversel_smart_theme),
|
2013-04-23 04:30:15 -07:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_hoversel_smart_translate),
|
2012-11-25 22:32:53 -08:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_hoversel_smart_parent_set),
|
2013-11-13 03:32:31 -08:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_hoversel_smart_event),
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_hoversel_smart_admits_autorepeat_get),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_SET), _hover_parent_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET), _hover_parent_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET), _horizontal_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET), _horizontal_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN), _hover_begin),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END), _hover_end),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET), _expanded_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_CLEAR), _clear),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET), _items_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD), _item_add),
|
|
|
|
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_HOVERSEL_SUB_ID_HOVER_PARENT_SET, "Set the Hover parent."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET, "Get the Hover parent."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET, "This sets the hoversel to expand horizontally."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET, "This returns whether the hoversel is set to expand horizontally."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN, "This triggers the hoversel popup from code, the same as if the user had clicked the button."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END, "This dismisses the hoversel popup as if the user had clicked outside the hover."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET, "Returns whether the hoversel is expanded."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_CLEAR, "This will remove all the children items from the hoversel."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET, "Get the list of items within the given hoversel."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD, "Add an item to the hoversel button."),
|
|
|
|
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_HOVERSEL_BASE_ID, op_desc, ELM_OBJ_HOVERSEL_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
sizeof(Elm_Hoversel_Smart_Data),
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
EO_DEFINE_CLASS(elm_obj_hoversel_class_get, &class_desc, ELM_OBJ_BUTTON_CLASS, EVAS_SMART_SELECTABLE_INTERFACE, NULL);
|