summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-06-16 14:48:30 +0300
committerYossi Kantor <yossi.kantor@samsung.com>2014-08-03 14:49:46 +0300
commitef7289c1b78c08d8473e5cea6d2eed5ff10783a6 (patch)
tree48156f7e51ef86822f79e1ef96e5ae12a9eeb542
parent4a67429167c9ae5003af50ba1101471081b1287e (diff)
Integration of Hoversel Item
-rw-r--r--src/lib/Makefile.am7
-rw-r--r--src/lib/elc_hoversel.c187
-rw-r--r--src/lib/elm_hoversel_item.eo45
-rw-r--r--src/lib/elm_widget_hoversel.h26
4 files changed, 174 insertions, 91 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 4b13b957d..8e2fe037f 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -780,7 +780,9 @@ BUILT_SOURCES = \
780 elm_color_item.eo.c \ 780 elm_color_item.eo.c \
781 elm_color_item.eo.h \ 781 elm_color_item.eo.h \
782 elm_dayselector_item.eo.c \ 782 elm_dayselector_item.eo.c \
783 elm_dayselector_item.eo.h 783 elm_dayselector_item.eo.h \
784 elm_hoversel_item.eo.c \
785 elm_hoversel_item.eo.h
784 786
785elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 787elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
786elementaryeolianfiles_DATA = \ 788elementaryeolianfiles_DATA = \
@@ -875,7 +877,8 @@ elementaryeolianfiles_DATA = \
875 elm_win.eo \ 877 elm_win.eo \
876 elm_widget_item.eo \ 878 elm_widget_item.eo \
877 elm_color_item.eo \ 879 elm_color_item.eo \
878 elm_dayselector_item.eo 880 elm_dayselector_item.eo \
881 elm_hoversel_item.eo
879 882
880EXTRA_DIST += \ 883EXTRA_DIST += \
881 ${elementaryeolianfiles_DATA} 884 ${elementaryeolianfiles_DATA}
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index db73d3b4a..cffda052c 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -39,11 +39,11 @@ static const Elm_Action key_actions[] = {
39EOLIAN static Eina_Bool 39EOLIAN static Eina_Bool
40_elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) 40_elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
41{ 41{
42 Elm_Hoversel_Item *it; 42 Elm_Widobj_Item *it;
43 Eina_List *l; 43 Eina_List *l;
44 44
45 EINA_LIST_FOREACH(sd->items, l, it) 45 EINA_LIST_FOREACH(sd->items, l, it)
46 elm_widget_item_translate(it); 46 eo_do(it, elm_wdg_item_translate());
47 47
48 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 48 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
49 49
@@ -98,11 +98,12 @@ _on_item_clicked(void *data,
98 Evas_Object *obj EINA_UNUSED, 98 Evas_Object *obj EINA_UNUSED,
99 void *event_info EINA_UNUSED) 99 void *event_info EINA_UNUSED)
100{ 100{
101 Elm_Hoversel_Item *item = data; 101 Elm_Widobj_Item *eo_item = data;
102 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
102 Evas_Object *obj2 = WIDGET(item); 103 Evas_Object *obj2 = WIDGET(item);
103 104
104 if (item->func) item->func((void *)item->base.data, obj2, item); 105 if (item->func) item->func((void *)item->base->data, obj2, eo_item);
105 evas_object_smart_callback_call(obj2, SIG_SELECTED, item); 106 evas_object_smart_callback_call(obj2, SIG_SELECTED, eo_item);
106 elm_hoversel_hover_end(obj2); 107 elm_hoversel_hover_end(obj2);
107} 108}
108 109
@@ -111,9 +112,9 @@ _item_focused_cb(void *data,
111 Evas_Object *obj EINA_UNUSED, 112 Evas_Object *obj EINA_UNUSED,
112 void *event_info EINA_UNUSED) 113 void *event_info EINA_UNUSED)
113{ 114{
114 Elm_Object_Item *it = data; 115 Elm_Widobj_Item *eo_item = data;
115 116 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it);
116 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_FOCUSED, it); 117 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_FOCUSED, eo_item);
117} 118}
118 119
119static void 120static void
@@ -121,15 +122,15 @@ _item_unfocused_cb(void *data,
121 Evas_Object *obj EINA_UNUSED, 122 Evas_Object *obj EINA_UNUSED,
122 void *event_info EINA_UNUSED) 123 void *event_info EINA_UNUSED)
123{ 124{
124 Elm_Object_Item *it = data; 125 Elm_Widobj_Item *eo_item = data;
125 126 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it);
126 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_UNFOCUSED, it); 127 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_UNFOCUSED, eo_item);
127} 128}
128 129
129static void 130static void
130_activate(Evas_Object *obj) 131_activate(Evas_Object *obj)
131{ 132{
132 Elm_Hoversel_Item *item; 133 Elm_Widobj_Item *eo_item;
133 Evas_Object *bt, *bx, *ic; 134 Evas_Object *bt, *bx, *ic;
134 const Eina_List *l; 135 const Eina_List *l;
135 char buf[4096]; 136 char buf[4096];
@@ -175,8 +176,9 @@ _activate(Evas_Object *obj)
175 snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s", 176 snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
176 elm_widget_style_get(obj)); 177 elm_widget_style_get(obj));
177 178
178 EINA_LIST_FOREACH(sd->items, l, item) 179 EINA_LIST_FOREACH(sd->items, l, eo_item)
179 { 180 {
181 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
180 VIEW(item) = bt = elm_button_add(bx); 182 VIEW(item) = bt = elm_button_add(bx);
181 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 183 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
182 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj)); 184 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
@@ -197,10 +199,10 @@ _activate(Evas_Object *obj)
197 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 199 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
198 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 200 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
199 elm_box_pack_end(bx, bt); 201 elm_box_pack_end(bx, bt);
200 evas_object_smart_callback_add(bt, "clicked", _on_item_clicked, item); 202 evas_object_smart_callback_add(bt, "clicked", _on_item_clicked, eo_item);
201 evas_object_show(bt); 203 evas_object_show(bt);
202 evas_object_smart_callback_add(bt, SIG_LAYOUT_FOCUSED, _item_focused_cb, item); 204 evas_object_smart_callback_add(bt, SIG_LAYOUT_FOCUSED, _item_focused_cb, eo_item);
203 evas_object_smart_callback_add(bt, SIG_LAYOUT_UNFOCUSED, _item_unfocused_cb, item); 205 evas_object_smart_callback_add(bt, SIG_LAYOUT_UNFOCUSED, _item_unfocused_cb, eo_item);
204 } 206 }
205 207
206 if (sd->horizontal) 208 if (sd->horizontal)
@@ -232,39 +234,41 @@ _on_parent_del(void *data,
232} 234}
233 235
234static const char * 236static const char *
235_item_text_get_hook(const Elm_Object_Item *it, 237_elm_hoversel_item_elm_widget_item_part_text_get(Eo *obj EINA_UNUSED,
236 const char *part) 238 Elm_Hoversel_Item_Data *it,
239 const char *part)
237{ 240{
238 if (part && strcmp(part, "default")) return NULL; 241 if (part && strcmp(part, "default")) return NULL;
239 return ((Elm_Hoversel_Item *)it)->label; 242 return it->label;
240} 243}
241 244
242static void 245EOLIAN static void
243_item_signal_emit_hook(Elm_Object_Item *it, 246_elm_hoversel_item_elm_widget_item_signal_emit(Eo *obj EINA_UNUSED,
244 const char *emission, 247 Elm_Hoversel_Item_Data *it,
245 const char *source) 248 const char *emission,
249 const char *source)
246{ 250{
247 elm_object_signal_emit(VIEW(it), emission, source); 251 elm_object_signal_emit(VIEW(it), emission, source);
248} 252}
249 253
250static void 254EOLIAN static void
251_item_style_set_hook(Elm_Object_Item *it, 255_elm_hoversel_item_elm_widget_item_style_set(Eo *obj EINA_UNUSED,
252 const char *style) 256 Elm_Hoversel_Item_Data *it,
257 const char *style)
253{ 258{
254 elm_object_style_set(VIEW(it), style); 259 elm_object_style_set(VIEW(it), style);
255} 260}
256 261
257static const char * 262EOLIAN static const char *
258_item_style_get_hook(Elm_Object_Item *it) 263_elm_hoversel_item_elm_widget_item_style_get(Eo *obj EINA_UNUSED,
264 Elm_Hoversel_Item_Data *it)
259{ 265{
260 return elm_object_style_get(VIEW(it)); 266 return elm_object_style_get(VIEW(it));
261} 267}
262 268
263static Eina_Bool 269EOLIAN static Eina_Bool
264_item_del_pre_hook(Elm_Object_Item *it) 270_elm_hoversel_item_elm_widget_item_del_pre(Eo *obj EINA_UNUSED, Elm_Hoversel_Item_Data *item)
265{ 271{
266 Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
267
268 ELM_HOVERSEL_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE); 272 ELM_HOVERSEL_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE);
269 273
270 elm_hoversel_hover_end(WIDGET(item)); 274 elm_hoversel_hover_end(WIDGET(item));
@@ -293,14 +297,15 @@ _elm_hoversel_evas_object_smart_add(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED)
293EOLIAN static void 297EOLIAN static void
294_elm_hoversel_evas_object_smart_del(Eo *obj, Elm_Hoversel_Data *sd) 298_elm_hoversel_evas_object_smart_del(Eo *obj, Elm_Hoversel_Data *sd)
295{ 299{
296 Elm_Hoversel_Item *item; 300 Elm_Widobj_Item *eo_item;
297 301
298 EINA_LIST_FREE(sd->items, item) 302 EINA_LIST_FREE(sd->items, eo_item)
299 { 303 {
304 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
300 eina_stringshare_del(item->label); 305 eina_stringshare_del(item->label);
301 eina_stringshare_del(item->icon_file); 306 eina_stringshare_del(item->icon_file);
302 eina_stringshare_del(item->icon_group); 307 eina_stringshare_del(item->icon_group);
303 elm_widget_item_free(item); 308 eo_del(eo_item);
304 } 309 }
305 elm_hoversel_hover_parent_set(obj, NULL); 310 elm_hoversel_hover_parent_set(obj, NULL);
306 311
@@ -395,15 +400,16 @@ _elm_hoversel_hover_begin(Eo *obj, Elm_Hoversel_Data *sd)
395EOLIAN static void 400EOLIAN static void
396_elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd) 401_elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd)
397{ 402{
398 Elm_Object_Item *it; 403 Elm_Widobj_Item *eo_item;
399 Eina_List *l; 404 Eina_List *l;
400 405
401 if (!sd->hover) return; 406 if (!sd->hover) return;
402 407
403 sd->expanded = EINA_FALSE; 408 sd->expanded = EINA_FALSE;
404 409
405 EINA_LIST_FOREACH(sd->items, l, it) 410 EINA_LIST_FOREACH(sd->items, l, eo_item)
406 { 411 {
412 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it);
407 VIEW(it) = NULL; 413 VIEW(it) = NULL;
408 } 414 }
409 ELM_SAFE_FREE(sd->hover, evas_object_del); 415 ELM_SAFE_FREE(sd->hover, evas_object_del);
@@ -420,12 +426,12 @@ _elm_hoversel_expanded_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
420EOLIAN static void 426EOLIAN static void
421_elm_hoversel_clear(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) 427_elm_hoversel_clear(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
422{ 428{
423 Elm_Object_Item *it; 429 Elm_Widobj_Item *it;
424 Eina_List *l, *ll; 430 Eina_List *l, *ll;
425 431
426 EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it) 432 EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it)
427 { 433 {
428 elm_widget_item_del(it); 434 eo_do(it, elm_wdg_item_del());
429 } 435 }
430} 436}
431 437
@@ -435,69 +441,69 @@ _elm_hoversel_items_get(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
435 return sd->items; 441 return sd->items;
436} 442}
437 443
444EOLIAN static void
445_elm_hoversel_item_eo_base_constructor(Eo *obj, Elm_Hoversel_Item_Data *it)
446{
447 eo_do_super(obj, ELM_HOVERSEL_ITEM_CLASS, eo_constructor());
448 it->base = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
449}
450
438EOLIAN static Elm_Object_Item* 451EOLIAN static Elm_Object_Item*
439_elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *sd, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) 452_elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *sd, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data)
440{ 453{
441 Elm_Hoversel_Item *item = elm_widget_item_new(obj, Elm_Hoversel_Item); 454 Elm_Widobj_Item *eo_item = eo_add(ELM_HOVERSEL_ITEM_CLASS, obj);
442 if (!item) return NULL; 455 if (!eo_item) return NULL;
443 456
444 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook); 457 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
445 elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
446 elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
447 elm_widget_item_style_set_hook_set(item, _item_style_set_hook);
448 elm_widget_item_style_get_hook_set(item, _item_style_get_hook);
449 458
450 item->label = eina_stringshare_add(label); 459 item->label = eina_stringshare_add(label);
451 item->icon_file = eina_stringshare_add(icon_file); 460 item->icon_file = eina_stringshare_add(icon_file);
452 item->icon_type = icon_type; 461 item->icon_type = icon_type;
453 item->func = func; 462 item->func = func;
454 item->base.data = data; 463 item->base->data = data;
455 464
456 sd->items = eina_list_append(sd->items, item); 465 sd->items = eina_list_append(sd->items, eo_item);
457 466
458 return (Elm_Object_Item *)item; 467 return (Elm_Object_Item *)eo_item;
459} 468}
460 469
461EAPI void 470EOLIAN static void
462elm_hoversel_item_icon_set(Elm_Object_Item *it, 471_elm_hoversel_item_icon_set(Eo *obj EINA_UNUSED,
463 const char *icon_file, 472 Elm_Hoversel_Item_Data *item,
464 const char *icon_group, 473 const char *icon_file,
465 Elm_Icon_Type icon_type) 474 const char *icon_group,
475 Elm_Icon_Type icon_type)
466{ 476{
467 ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(it);
468
469 Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
470
471 eina_stringshare_replace(&item->icon_file, icon_file); 477 eina_stringshare_replace(&item->icon_file, icon_file);
472 eina_stringshare_replace(&item->icon_group, icon_group); 478 eina_stringshare_replace(&item->icon_group, icon_group);
473 479
474 item->icon_type = icon_type; 480 item->icon_type = icon_type;
475} 481}
476 482
477EAPI void 483EOLIAN static void
478elm_hoversel_item_icon_get(const Elm_Object_Item *it, 484_elm_hoversel_item_icon_get(Eo *obj EINA_UNUSED,
479 const char **icon_file, 485 Elm_Hoversel_Item_Data *item,
480 const char **icon_group, 486 const char **icon_file,
481 Elm_Icon_Type *icon_type) 487 const char **icon_group,
488 Elm_Icon_Type *icon_type)
482{ 489{
483 ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(it);
484
485 Elm_Hoversel_Item *item = (Elm_Hoversel_Item *)it;
486
487 if (icon_file) *icon_file = item->icon_file; 490 if (icon_file) *icon_file = item->icon_file;
488 if (icon_group) *icon_group = item->icon_group; 491 if (icon_group) *icon_group = item->icon_group;
489 if (icon_type) *icon_type = item->icon_type; 492 if (icon_type) *icon_type = item->icon_type;
490} 493}
491 494
492static Elm_Hoversel_Item * 495static Elm_Widobj_Item *
493item_focused_get(Elm_Hoversel_Data *sd) 496item_focused_get(Elm_Hoversel_Data *sd)
494{ 497{
495 Elm_Hoversel_Item *item; 498 Elm_Widobj_Item *eo_item;
496 Eina_List *l; 499 Eina_List *l;
497 500
498 EINA_LIST_FOREACH(sd->items, l, item) 501 EINA_LIST_FOREACH(sd->items, l, eo_item)
499 if (elm_object_focus_get(VIEW(item))) 502 {
500 return item; 503 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
504 if (elm_object_focus_get(VIEW(item)))
505 return eo_item;
506 }
501 return NULL; 507 return NULL;
502} 508}
503 509
@@ -507,15 +513,16 @@ _key_action_move(Evas_Object *obj, const char *params)
507 ELM_HOVERSEL_DATA_GET(obj, sd); 513 ELM_HOVERSEL_DATA_GET(obj, sd);
508 const char *dir = params; 514 const char *dir = params;
509 515
510 Elm_Hoversel_Item *litem, *fitem; 516 Elm_Widobj_Item *eo_litem, *eo_fitem;
511 litem = eina_list_last_data_get(sd->items); 517 eo_litem = eina_list_last_data_get(sd->items);
512 fitem = eina_list_data_get(sd->items); 518 eo_fitem = eina_list_data_get(sd->items);
513 519
514 if (!strcmp(dir, "down")) 520 if (!strcmp(dir, "down"))
515 { 521 {
516 if ((!sd->horizontal) && 522 if ((!sd->horizontal) &&
517 (item_focused_get(sd) == litem)) 523 (item_focused_get(sd) == eo_litem))
518 { 524 {
525 ELM_HOVERSEL_ITEM_DATA_GET(eo_fitem, fitem);
519 elm_object_focus_set(VIEW(fitem), EINA_TRUE); 526 elm_object_focus_set(VIEW(fitem), EINA_TRUE);
520 return EINA_TRUE; 527 return EINA_TRUE;
521 } 528 }
@@ -525,8 +532,9 @@ _key_action_move(Evas_Object *obj, const char *params)
525 else if (!strcmp(dir, "up")) 532 else if (!strcmp(dir, "up"))
526 { 533 {
527 if ((!sd->horizontal) && 534 if ((!sd->horizontal) &&
528 (item_focused_get(sd) == fitem)) 535 (item_focused_get(sd) == eo_fitem))
529 { 536 {
537 ELM_HOVERSEL_ITEM_DATA_GET(eo_litem, litem);
530 elm_object_focus_set(VIEW(litem), EINA_TRUE); 538 elm_object_focus_set(VIEW(litem), EINA_TRUE);
531 return EINA_TRUE; 539 return EINA_TRUE;
532 } 540 }
@@ -536,8 +544,9 @@ _key_action_move(Evas_Object *obj, const char *params)
536 else if (!strcmp(dir, "left")) 544 else if (!strcmp(dir, "left"))
537 { 545 {
538 if (sd->horizontal && 546 if (sd->horizontal &&
539 (item_focused_get(sd) == fitem)) 547 (item_focused_get(sd) == eo_fitem))
540 { 548 {
549 ELM_HOVERSEL_ITEM_DATA_GET(eo_litem, litem);
541 elm_object_focus_set(VIEW(litem), EINA_TRUE); 550 elm_object_focus_set(VIEW(litem), EINA_TRUE);
542 return EINA_TRUE; 551 return EINA_TRUE;
543 } 552 }
@@ -547,8 +556,9 @@ _key_action_move(Evas_Object *obj, const char *params)
547 else if (!strcmp(dir, "right")) 556 else if (!strcmp(dir, "right"))
548 { 557 {
549 if (sd->horizontal && 558 if (sd->horizontal &&
550 (item_focused_get(sd) == litem)) 559 (item_focused_get(sd) == eo_litem))
551 { 560 {
561 ELM_HOVERSEL_ITEM_DATA_GET(eo_fitem, fitem);
552 elm_object_focus_set(VIEW(fitem), EINA_TRUE); 562 elm_object_focus_set(VIEW(fitem), EINA_TRUE);
553 return EINA_TRUE; 563 return EINA_TRUE;
554 } 564 }
@@ -585,4 +595,23 @@ _elm_hoversel_class_constructor(Eo_Class *klass)
585 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 595 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
586} 596}
587 597
598EAPI void
599elm_hoversel_item_icon_set(Elm_Object_Item *it,
600 const char *icon_file,
601 const char *icon_group,
602 Elm_Icon_Type icon_type)
603{
604 eo_do((Elm_Widobj_Item*)it, elm_obj_hoversel_item_icon_set(icon_file, icon_group, icon_type));
605}
606
607EAPI void
608elm_hoversel_item_icon_get(const Elm_Object_Item *it,
609 const char **icon_file,
610 const char **icon_group,
611 Elm_Icon_Type *icon_type)
612{
613 eo_do((Elm_Widobj_Item*)it, elm_obj_hoversel_item_icon_get(icon_file, icon_group, icon_type));
614}
615
616#include "elm_hoversel_item.eo.c"
588#include "elc_hoversel.eo.c" 617#include "elc_hoversel.eo.c"
diff --git a/src/lib/elm_hoversel_item.eo b/src/lib/elm_hoversel_item.eo
new file mode 100644
index 000000000..712661f0f
--- /dev/null
+++ b/src/lib/elm_hoversel_item.eo
@@ -0,0 +1,45 @@
1class Elm_Hoversel_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_hoversel_item;
5 properties {
6 icon {
7 get {
8 /*@
9 @brief This sets the icon for the given hoversel item.
10
11 The icon can be loaded from the standard set, from an image file, or from
12 an edje file.
13
14 @see elm_hoversel_item_add()
15
16 @ingroup Hoversel
17 */
18 }
19 set {
20 /*@
21 @brief Get the icon object of the hoversel item.
22
23 @see elm_hoversel_item_add()
24
25 @ingroup Hoversel
26 */
27 }
28 values {
29 const char *icon_file; /*@ An image file path on disk to use for the icon or standard icon name */
30 const char *icon_group; /*@ The edje group to use if @p icon_file is an edje file. Set this to NULL if the icon is not an edje file */
31 Elm_Icon_Type icon_type; /*@ The icon type */
32 }
33 }
34 }
35 methods {
36 }
37 implements {
38 Eo_Base::constructor;
39 Elm_Widget_Item::signal_emit;
40 Elm_Widget_Item::del_pre;
41 Elm_Widget_Item::part_text::get;
42 Elm_Widget_Item::style::get;
43 Elm_Widget_Item::style::set;
44 }
45} \ No newline at end of file
diff --git a/src/lib/elm_widget_hoversel.h b/src/lib/elm_widget_hoversel.h
index 0a22961a9..6b5ffc901 100644
--- a/src/lib/elm_widget_hoversel.h
+++ b/src/lib/elm_widget_hoversel.h
@@ -2,6 +2,9 @@
2#define ELM_WIDGET_HOVERSEL_H 2#define ELM_WIDGET_HOVERSEL_H
3 3
4#include "Elementary.h" 4#include "Elementary.h"
5#include "elm_hoversel_item.eo.h"
6
7#include "elm_object_item_migration_temp.h"
5 8
6#include <Eio.h> 9#include <Eio.h>
7 10
@@ -32,10 +35,10 @@ struct _Elm_Hoversel_Data
32 Eina_Bool expanded : 1; 35 Eina_Bool expanded : 1;
33}; 36};
34 37
35typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item; 38typedef struct _Elm_Hoversel_Item_Data Elm_Hoversel_Item_Data;
36struct _Elm_Hoversel_Item 39struct _Elm_Hoversel_Item_Data
37{ 40{
38 ELM_WIDGET_ITEM; 41 Elm_Widget_Item_Data *base;
39 42
40 const char *label; 43 const char *label;
41 const char *icon_file; 44 const char *icon_file;
@@ -70,16 +73,19 @@ struct _Elm_Hoversel_Item
70 return val; \ 73 return val; \
71 } 74 }
72 75
73#define ELM_HOVERSEL_CHECK(obj) \ 76#define ELM_HOVERSEL_CHECK(obj) \
74 if (EINA_UNLIKELY(!eo_isa((obj), ELM_HOVERSEL_CLASS))) \ 77 if (EINA_UNLIKELY(!eo_isa((obj), ELM_HOVERSEL_CLASS))) \
75 return 78 return
76 79
77#define ELM_HOVERSEL_ITEM_CHECK(it) \ 80#define ELM_HOVERSEL_ITEM_DATA_GET(o, sd) \
78 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, ); \ 81 Elm_Hoversel_Item_Data * sd = eo_data_scope_get(o, ELM_HOVERSEL_ITEM_CLASS)
79 ELM_HOVERSEL_CHECK(it->base.widget); 82
83#define ELM_HOVERSEL_ITEM_CHECK(obj) \
84 if (EINA_UNLIKELY(!eo_isa((obj), ELM_HOVERSEL_ITEM_CLASS))) \
85 return
80 86
81#define ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(it, ...) \ 87#define ELM_HOVERSEL_ITEM_CHECK_OR_RETURN(obj, ...) \
82 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ 88 if (EINA_UNLIKELY(!eo_isa((obj), ELM_HOVERSEL_ITEM_CLASS))) \
83 ELM_HOVERSEL_CHECK(it->base.widget) __VA_ARGS__; 89 return __VA_ARGS__;
84 90
85#endif 91#endif