hoverlist -> ctxpopup - as its not just a list really. it is a popup

of arbitrary content. list is one of them.



SVN revision: 55112
This commit is contained in:
Carsten Haitzler 2010-12-01 06:52:46 +00:00
parent 192d645277
commit ea1672a331
7 changed files with 144 additions and 144 deletions

View File

@ -6981,7 +6981,7 @@ collections {
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
group { name: "elm/hover/base/hoverlist/default"; group { name: "elm/hover/base/ctxpopup/default";
images { images {
image: "bt_base2.png" COMP; image: "bt_base2.png" COMP;
image: "bt_hilight.png" COMP; image: "bt_hilight.png" COMP;
@ -7418,10 +7418,10 @@ collections {
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
group { name: "elm/list/item/hoverlist"; group { name: "elm/list/item/ctxpopup";
alias: "elm/list/item_odd/hoverlist"; alias: "elm/list/item_odd/ctxpopup";
alias: "elm/list/h_item/hoverlist"; alias: "elm/list/h_item/ctxpopup";
alias: "elm/list/h_item_odd/hoverlist"; alias: "elm/list/h_item_odd/ctxpopup";
parts { parts {
part { name: "button_image"; part { name: "button_image";
mouse_events: 1; mouse_events: 1;
@ -7551,7 +7551,7 @@ collections {
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
group { name: "elm/list/base/hoverlist"; group { name: "elm/list/base/ctxpopup";
data { data {
item: "focus_highlight" "on"; item: "focus_highlight" "on";
} }

View File

@ -91,7 +91,7 @@ test_focus2.c \
test_flipselector.c \ test_flipselector.c \
test_diskselector.c \ test_diskselector.c \
test_colorselector.c \ test_colorselector.c \
test_hoverlist.c \ test_ctxpopup.c \
test_bubble.c \ test_bubble.c \
test_store.c test_store.c

View File

@ -115,7 +115,7 @@ void test_focus2(void *data, Evas_Object *obj, void *event_info);
void test_flipselector(void *data, Evas_Object *obj, void *event_info); void test_flipselector(void *data, Evas_Object *obj, void *event_info);
void test_diskselector(void *data, Evas_Object *obj, void *event_info); void test_diskselector(void *data, Evas_Object *obj, void *event_info);
void test_colorselector(void *data, Evas_Object *obj, void *event_info); void test_colorselector(void *data, Evas_Object *obj, void *event_info);
void test_hoverlist(void *data, Evas_Object *obj, void *event_info); void test_ctxpopup(void *data, Evas_Object *obj, void *event_info);
void test_bubble(void *data, Evas_Object *obj, void *event_info); void test_bubble(void *data, Evas_Object *obj, void *event_info);
void test_store(void *data, Evas_Object *obj, void *event_info); void test_store(void *data, Evas_Object *obj, void *event_info);
@ -350,7 +350,7 @@ my_win_main(char *autorun)
ADD_TEST("Flip Selector", test_flipselector); ADD_TEST("Flip Selector", test_flipselector);
ADD_TEST("Disk Selector", test_diskselector); ADD_TEST("Disk Selector", test_diskselector);
ADD_TEST("Color Selector", test_colorselector); ADD_TEST("Color Selector", test_colorselector);
ADD_TEST("Hoverlist", test_hoverlist); ADD_TEST("Ctxpopup", test_ctxpopup);
ADD_TEST("Bubble", test_bubble); ADD_TEST("Bubble", test_bubble);
ADD_TEST("Store", test_store); ADD_TEST("Store", test_store);
#undef ADD_TEST #undef ADD_TEST

View File

@ -11,10 +11,10 @@ _list_item_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED
} }
static void static void
_hoverlist_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) _ctxpopup_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{ {
printf("hoverlist item selected: %s\n", printf("ctxpopup item selected: %s\n",
elm_hoverlist_item_label_get(event_info)); elm_ctxpopup_item_label_get(event_info));
} }
static void _list_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) static void _list_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
@ -23,10 +23,10 @@ static void _list_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, vo
} }
void void
test_hoverlist(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) test_ctxpopup(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{ {
Evas_Object *win, *bg, *list, *hov1, *hov2, *hov3, *hov4, *ic; Evas_Object *win, *bg, *list, *hov1, *hov2, *hov3, *hov4, *ic;
Elm_Hoverlist_Item *it; Elm_Ctxpopup_Item *it;
win = elm_win_add(NULL, "Contexual Popup 2", ELM_WIN_BASIC); win = elm_win_add(NULL, "Contexual Popup 2", ELM_WIN_BASIC);
elm_win_title_set(win, "Contextual Popup 2"); elm_win_title_set(win, "Contextual Popup 2");
@ -46,39 +46,39 @@ test_hoverlist(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
ic = elm_icon_add(win); \ ic = elm_icon_add(win); \
elm_icon_standard_set(ic, _icon); \ elm_icon_standard_set(ic, _icon); \
elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); \ elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); \
it = elm_hoverlist_item_append(_hov, _label, ic, _hoverlist_item_cb, NULL); it = elm_ctxpopup_item_append(_hov, _label, ic, _ctxpopup_item_cb, NULL);
hov1 = elm_hoverlist_add(win); hov1 = elm_ctxpopup_add(win);
ITEM_NEW(hov1, "home", "Go to home folder"); ITEM_NEW(hov1, "home", "Go to home folder");
ITEM_NEW(hov1, "file", "Save file"); ITEM_NEW(hov1, "file", "Save file");
ITEM_NEW(hov1, "delete", "Delete file"); ITEM_NEW(hov1, "delete", "Delete file");
ITEM_NEW(hov1, "folder", "Navigate to folder"); ITEM_NEW(hov1, "folder", "Navigate to folder");
elm_hoverlist_item_disabled_set(it, EINA_TRUE); elm_ctxpopup_item_disabled_set(it, EINA_TRUE);
ITEM_NEW(hov1, "edit", "Edit entry"); ITEM_NEW(hov1, "edit", "Edit entry");
ITEM_NEW(hov1, "clock", "Set date and time"); ITEM_NEW(hov1, "clock", "Set date and time");
ITEM_NEW(hov1, "arrow_up", "Go up"); ITEM_NEW(hov1, "arrow_up", "Go up");
ITEM_NEW(hov1, "arrow_down", "Go down"); ITEM_NEW(hov1, "arrow_down", "Go down");
ITEM_NEW(hov1, "arrow_left", "Go left"); ITEM_NEW(hov1, "arrow_left", "Go left");
elm_hoverlist_item_disabled_set(it, EINA_TRUE); elm_ctxpopup_item_disabled_set(it, EINA_TRUE);
ITEM_NEW(hov1, "arrow_right", "Go right"); ITEM_NEW(hov1, "arrow_right", "Go right");
hov2 = elm_hoverlist_add(win); hov2 = elm_ctxpopup_add(win);
ITEM_NEW(hov2, "home", NULL); ITEM_NEW(hov2, "home", NULL);
ITEM_NEW(hov2, "file", NULL); ITEM_NEW(hov2, "file", NULL);
ITEM_NEW(hov2, "delete", NULL); ITEM_NEW(hov2, "delete", NULL);
ITEM_NEW(hov2, "folder", NULL); ITEM_NEW(hov2, "folder", NULL);
ITEM_NEW(hov2, "edit", NULL); ITEM_NEW(hov2, "edit", NULL);
elm_hoverlist_item_disabled_set(it, EINA_TRUE); elm_ctxpopup_item_disabled_set(it, EINA_TRUE);
ITEM_NEW(hov2, "clock", NULL); ITEM_NEW(hov2, "clock", NULL);
ITEM_NEW(hov2, "arrow_up", NULL); ITEM_NEW(hov2, "arrow_up", NULL);
ITEM_NEW(hov2, "arrow_down", NULL); ITEM_NEW(hov2, "arrow_down", NULL);
ITEM_NEW(hov2, "arrow_left", NULL); ITEM_NEW(hov2, "arrow_left", NULL);
ITEM_NEW(hov2, "arrow_right", NULL); ITEM_NEW(hov2, "arrow_right", NULL);
hov3 = elm_hoverlist_add(win); hov3 = elm_ctxpopup_add(win);
elm_hoverlist_horizontal_set(hov3, EINA_TRUE); elm_ctxpopup_horizontal_set(hov3, EINA_TRUE);
ITEM_NEW(hov3, "home", "Zero"); ITEM_NEW(hov3, "home", "Zero");
ITEM_NEW(hov3, "file", "Um"); ITEM_NEW(hov3, "file", "Um");
@ -87,25 +87,25 @@ test_hoverlist(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
ITEM_NEW(hov3, "edit", "Vier"); ITEM_NEW(hov3, "edit", "Vier");
ITEM_NEW(hov3, "clock", ""); ITEM_NEW(hov3, "clock", "");
hov4 = elm_hoverlist_add(win); hov4 = elm_ctxpopup_add(win);
ITEM_NEW(hov4, NULL, "Eina"); ITEM_NEW(hov4, NULL, "Eina");
ITEM_NEW(hov4, NULL, "Eet"); ITEM_NEW(hov4, NULL, "Eet");
ITEM_NEW(hov4, NULL, "Evas"); ITEM_NEW(hov4, NULL, "Evas");
ITEM_NEW(hov4, NULL, "Ecore"); ITEM_NEW(hov4, NULL, "Ecore");
elm_hoverlist_item_disabled_set(it, EINA_TRUE); elm_ctxpopup_item_disabled_set(it, EINA_TRUE);
ITEM_NEW(hov4, NULL, "Embryo"); ITEM_NEW(hov4, NULL, "Embryo");
ITEM_NEW(hov4, NULL, "Edje"); ITEM_NEW(hov4, NULL, "Edje");
#undef ITEM_NEW #undef ITEM_NEW
elm_list_item_append(list, "Hoverlist with icons and labels", NULL, NULL, elm_list_item_append(list, "Ctxpopup with icons and labels", NULL, NULL,
_list_item_cb, hov1); _list_item_cb, hov1);
elm_list_item_append(list, "Hoverlist with icons only", NULL, NULL, elm_list_item_append(list, "Ctxpopup with icons only", NULL, NULL,
_list_item_cb, hov2); _list_item_cb, hov2);
elm_list_item_append(list, "Hoverlist at horizontal mode", NULL, NULL, elm_list_item_append(list, "Ctxpopup at horizontal mode", NULL, NULL,
_list_item_cb, hov3); _list_item_cb, hov3);
elm_list_item_append(list, "Hoverlist with no icons", NULL, NULL, elm_list_item_append(list, "Ctxpopup with no icons", NULL, NULL,
_list_item_cb, hov4); _list_item_cb, hov4);
evas_object_show(list); evas_object_show(list);
elm_list_go(list); elm_list_go(list);

View File

@ -2365,26 +2365,26 @@ extern "C" {
* "changed" - when the color value changes * "changed" - when the color value changes
*/ */
/* hoverlist */ /* ctxpopup */
typedef struct _Elm_Hoverlist_Item Elm_Hoverlist_Item; typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
EAPI Evas_Object *elm_hoverlist_add(Evas_Object* parent); EAPI Evas_Object *elm_ctxpopup_add(Evas_Object* parent);
EAPI void elm_hoverlist_hover_end(Evas_Object *obj); EAPI void elm_ctxpopup_hover_end(Evas_Object *obj);
EAPI Evas_Object *elm_hoverlist_item_icon_get(const Elm_Hoverlist_Item *item); EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item);
EAPI void elm_hoverlist_item_icon_set(Elm_Hoverlist_Item *item, Evas_Object *icon); EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon);
EAPI const char *elm_hoverlist_item_label_get(const Elm_Hoverlist_Item *item); EAPI const char *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item);
EAPI void elm_hoverlist_item_label_set(Elm_Hoverlist_Item *item, const char *label); EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label);
EAPI void elm_hoverlist_hover_parent_set(Evas_Object *obj, Evas_Object *parent); EAPI void elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
EAPI Evas_Object *elm_hoverlist_hover_parent_get(const Evas_Object *obj); EAPI Evas_Object *elm_ctxpopup_hover_parent_get(const Evas_Object *obj);
EAPI void elm_hoverlist_clear(Evas_Object* obj); EAPI void elm_ctxpopup_clear(Evas_Object* obj);
EAPI void elm_hoverlist_horizontal_set(Evas_Object* obj, Eina_Bool horizontal); EAPI void elm_ctxpopup_horizontal_set(Evas_Object* obj, Eina_Bool horizontal);
EAPI Eina_Bool elm_hoverlist_horizontal_get(const Evas_Object *obj); EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Evas_Object *obj);
EAPI Elm_Hoverlist_Item *elm_hoverlist_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); EAPI Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data);
EAPI void elm_hoverlist_item_del(Elm_Hoverlist_Item *item); EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item);
EAPI void elm_hoverlist_item_disabled_set(Elm_Hoverlist_Item *item, Eina_Bool disabled); EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled);
EAPI Eina_Bool elm_hoverlist_item_disabled_get(const Elm_Hoverlist_Item *item); EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item);
/* smart callbacks called: /* smart callbacks called:
* "dismissed" - the hoverlist was dismissed * "dismissed" - the ctxpopup was dismissed
*/ */
/* transit */ /* transit */

View File

@ -92,6 +92,7 @@ elm_calendar.c \
elm_flipselector.c \ elm_flipselector.c \
elm_diskselector.c \ elm_diskselector.c \
elm_colorselector.c \ elm_colorselector.c \
elm_ctxpopup.c \
\ \
elc_anchorblock.c \ elc_anchorblock.c \
elc_anchorview.c \ elc_anchorview.c \
@ -99,7 +100,6 @@ elc_fileselector.c \
elc_fileselector_button.c \ elc_fileselector_button.c \
elc_fileselector_entry.c \ elc_fileselector_entry.c \
elc_hoversel.c \ elc_hoversel.c \
elc_hoverlist.c \
elc_scrolled_entry.c \ elc_scrolled_entry.c \
\ \
els_tooltip.c \ els_tooltip.c \

View File

@ -2,13 +2,13 @@
#include "elm_priv.h" #include "elm_priv.h"
/** /**
* @defgroup Hoverlist * @defgroup Ctxpopup
* *
* A hoverlist is a widget that, when show, pops up a list of items. * A ctxpopup is a widget that, when show, pops up a list of items.
* It automatically chooses an area inside its parent object's view * It automatically chooses an area inside its parent object's view
* (set via elm_hoverlist_add() and elm_hoverlist_hover_parent_set()) * (set via elm_ctxpopup_add() and elm_ctxpopup_hover_parent_set())
* to optimally fit into it. In the default theme, it will also point * to optimally fit into it. In the default theme, it will also point
* an arrow to the cursor position at the time one shows it. Hoverlist * an arrow to the cursor position at the time one shows it. Ctxpopup
* items have a label and/or an icon. It is intended for a small * items have a label and/or an icon. It is intended for a small
* number of items (hence the use of list, not genlist). * number of items (hence the use of list, not genlist).
* *
@ -19,7 +19,7 @@
typedef struct _Widget_Data Widget_Data; typedef struct _Widget_Data Widget_Data;
struct _Elm_Hoverlist_Item struct _Elm_Ctxpopup_Item
{ {
Elm_Widget_Item base; Elm_Widget_Item base;
@ -54,8 +54,8 @@ static void _del_pre_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj);
static void _hover_clicked_cb(void *data, Evas_Object *obj, void *event_info); static void _hover_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void _parent_resize_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _parent_resize_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _hoverlist_show(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _ctxpopup_show(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _hoverlist_hide(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _ctxpopup_hide(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static const char SIG_DISMISSED[] = "dismissed"; static const char SIG_DISMISSED[] = "dismissed";
static const Evas_Smart_Cb_Description _signals[] = { static const Evas_Smart_Cb_Description _signals[] = {
@ -63,16 +63,16 @@ static const Evas_Smart_Cb_Description _signals[] = {
{NULL, NULL} {NULL, NULL}
}; };
#define ELM_HOVERLIST_ITEM_CHECK_RETURN(it, ...) \ #define ELM_CTXPOPUP_ITEM_CHECK_RETURN(it, ...) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
ELM_CHECK_WIDTYPE(item->base.widget, widtype) __VA_ARGS__; ELM_CHECK_WIDTYPE(item->base.widget, widtype) __VA_ARGS__;
static Elm_Hoverlist_Item * static Elm_Ctxpopup_Item *
_item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
{ {
Elm_Hoverlist_Item *it; Elm_Ctxpopup_Item *it;
it = elm_widget_item_new(obj, Elm_Hoverlist_Item); it = elm_widget_item_new(obj, Elm_Ctxpopup_Item);
if (!it) if (!it)
return NULL; return NULL;
@ -85,7 +85,7 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb
} }
static inline void static inline void
_item_free(Elm_Hoverlist_Item *it) _item_free(Elm_Ctxpopup_Item *it)
{ {
eina_stringshare_del(it->label); eina_stringshare_del(it->label);
elm_widget_item_del(it); elm_widget_item_del(it);
@ -104,7 +104,7 @@ _del_pre_hook(Evas_Object* obj)
static void static void
_del_hook(Evas_Object* obj) _del_hook(Evas_Object* obj)
{ {
Elm_Hoverlist_Item *it; Elm_Ctxpopup_Item *it;
Widget_Data *wd; Widget_Data *wd;
wd = elm_widget_data_get(obj); wd = elm_widget_data_get(obj);
@ -169,9 +169,9 @@ _theme_hook(Evas_Object* obj)
if (!wd) if (!wd)
return; return;
elm_widget_style_set(wd->list, "hoverlist"); elm_widget_style_set(wd->list, "ctxpopup");
snprintf(buf, sizeof(buf), "hoverlist/%s", elm_widget_style_get(obj)); snprintf(buf, sizeof(buf), "ctxpopup/%s", elm_widget_style_get(obj));
elm_object_style_set(wd->hover, buf); elm_object_style_set(wd->hover, buf);
} }
@ -204,7 +204,7 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
static void static void
_item_func_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) _item_func_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{ {
Elm_Hoverlist_Item *it; Elm_Ctxpopup_Item *it;
elm_list_item_selected_set(event_info, EINA_FALSE); elm_list_item_selected_set(event_info, EINA_FALSE);
@ -234,7 +234,7 @@ _content_placement_changed_cb(void *data, Evas_Object *obj __UNUSED__, void *eve
} }
static void static void
_hoverlist_show(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) _ctxpopup_show(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{ {
Widget_Data* wd; Widget_Data* wd;
int px, py; int px, py;
@ -257,7 +257,7 @@ _hoverlist_show(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj,
} }
static void static void
_hoverlist_hide(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) _ctxpopup_hide(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{ {
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) if (!wd)
@ -292,15 +292,15 @@ _parent_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
} }
/** /**
* Add a new Hoverlist object to the parent. * Add a new Ctxpopup object to the parent.
* *
* @param parent Parent object * @param parent Parent object
* @return New object or @c NULL, if it cannot be created * @return New object or @c NULL, if it cannot be created
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Evas_Object* EAPI Evas_Object*
elm_hoverlist_add(Evas_Object* parent) elm_ctxpopup_add(Evas_Object* parent)
{ {
Evas_Object* obj; Evas_Object* obj;
Widget_Data* wd; Widget_Data* wd;
@ -309,8 +309,8 @@ elm_hoverlist_add(Evas_Object* parent)
wd = ELM_NEW(Widget_Data); wd = ELM_NEW(Widget_Data);
wd->evas = evas_object_evas_get(parent); wd->evas = evas_object_evas_get(parent);
obj = elm_widget_add(wd->evas); obj = elm_widget_add(wd->evas);
ELM_SET_WIDTYPE(widtype, "hoverlist"); ELM_SET_WIDTYPE(widtype, "ctxpopup");
elm_widget_type_set(obj, "hoverlist"); elm_widget_type_set(obj, "ctxpopup");
elm_widget_sub_object_add(parent, obj); elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd); elm_widget_data_set(obj, wd);
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
@ -324,7 +324,7 @@ elm_hoverlist_add(Evas_Object* parent)
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
wd->list = elm_list_add(obj); wd->list = elm_list_add(obj);
elm_widget_style_set(wd->list, "hoverlist"); elm_widget_style_set(wd->list, "ctxpopup");
elm_list_mode_set(wd->list, ELM_LIST_EXPAND); elm_list_mode_set(wd->list, ELM_LIST_EXPAND);
evas_object_show(wd->list); evas_object_show(wd->list);
@ -340,21 +340,21 @@ elm_hoverlist_add(Evas_Object* parent)
wd->hover = elm_hover_add(obj); wd->hover = elm_hover_add(obj);
snprintf(buf, sizeof(buf), "hoverlist/%s", elm_widget_style_get(obj)); snprintf(buf, sizeof(buf), "ctxpopup/%s", elm_widget_style_get(obj));
elm_object_style_set(wd->hover, buf); elm_object_style_set(wd->hover, buf);
evas_object_smart_callback_add(wd->hover, "smart,changed", evas_object_smart_callback_add(wd->hover, "smart,changed",
_content_placement_changed_cb, obj); _content_placement_changed_cb, obj);
elm_hoverlist_hover_parent_set(obj, parent); elm_ctxpopup_hover_parent_set(obj, parent);
elm_hover_target_set(wd->hover, wd->target); elm_hover_target_set(wd->hover, wd->target);
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked_cb, obj); evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked_cb, obj);
elm_hover_content_set(wd->hover, "smart", wd->list); elm_hover_content_set(wd->hover, "smart", wd->list);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _hoverlist_show, evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _ctxpopup_show,
NULL); NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hoverlist_hide, evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _ctxpopup_hide,
NULL); NULL);
elm_widget_sub_object_add(obj, wd->list); elm_widget_sub_object_add(obj, wd->list);
@ -365,15 +365,15 @@ elm_hoverlist_add(Evas_Object* parent)
} }
/** /**
* This ends the Hoverlist's popup as if the user had clicked * This ends the Ctxpopup's popup as if the user had clicked
* outside the hover. * outside the hover.
* *
* @param obj The hoverlist object * @param obj The ctxpopup object
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_hover_end(Evas_Object *obj) elm_ctxpopup_hover_end(Evas_Object *obj)
{ {
ELM_CHECK_WIDTYPE(obj, widtype); ELM_CHECK_WIDTYPE(obj, widtype);
@ -388,38 +388,38 @@ elm_hoverlist_hover_end(Evas_Object *obj)
} }
/** /**
* Get the icon object for the given hoverlist item. * Get the icon object for the given ctxpopup item.
* *
* @param item Hoverlist item * @param item Ctxpopup item
* @return icon object or @c NULL, if the item does not have icon or * @return icon object or @c NULL, if the item does not have icon or
* an error occured * an error occured
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Evas_Object * EAPI Evas_Object *
elm_hoverlist_item_icon_get(const Elm_Hoverlist_Item *item) elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item, NULL); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
return item->icon; return item->icon;
} }
/** /**
* Sets the side icon associated with the hoverlist item. * Sets the side icon associated with the ctxpopup item.
* *
* Once the icon object is set, a previously set one will be deleted. * Once the icon object is set, a previously set one will be deleted.
* You probably don't want, then, to have the <b>same</b> icon object * You probably don't want, then, to have the <b>same</b> icon object
* set for more than one item of the list (when replacing one of its * set for more than one item of the list (when replacing one of its
* instances). * instances).
* *
* @param item Hoverlist item * @param item Ctxpopup item
* @param icon Icon object to be set * @param icon Icon object to be set
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_item_icon_set(Elm_Hoverlist_Item *item, Evas_Object *icon) elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
Widget_Data *wd; Widget_Data *wd;
@ -439,33 +439,33 @@ elm_hoverlist_item_icon_set(Elm_Hoverlist_Item *item, Evas_Object *icon)
} }
/** /**
* Get the label object for the given hoverlist item. * Get the label object for the given ctxpopup item.
* *
* @param item Hoverlist item * @param item Ctxpopup item
* @return label object or @c NULL, if the item does not have label or * @return label object or @c NULL, if the item does not have label or
* an error occured * an error occured
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI const char * EAPI const char *
elm_hoverlist_item_label_get(const Elm_Hoverlist_Item *item) elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item, NULL); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
return item->label; return item->label;
} }
/** /**
* (Re)set the label on the given hoverlist item. * (Re)set the label on the given ctxpopup item.
* *
* @param obj Hoverlist item * @param obj Ctxpopup item
* @param label String to set as label * @param label String to set as label
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_item_label_set(Elm_Hoverlist_Item *item, const char *label) elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
Widget_Data *wd; Widget_Data *wd;
@ -481,22 +481,22 @@ elm_hoverlist_item_label_set(Elm_Hoverlist_Item *item, const char *label)
} }
/** /**
* Set the Hoverlist's parent. * Set the Ctxpopup's parent.
* *
* Sets the hover's parent object (it would much probably be the * Sets the hover's parent object (it would much probably be the
* window that the hoverlist is in). See Hover objects for more * window that the ctxpopup is in). See Hover objects for more
* information. * information.
* *
* @param obj The hoverlist object * @param obj The ctxpopup object
* @param parent The parent to use * @param parent The parent to use
* *
* @note elm_hoverlist_add() will automatically call this function * @note elm_ctxpopup_add() will automatically call this function
* with its @c parent argument. * with its @c parent argument.
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_hover_parent_set(Evas_Object *obj, Evas_Object *parent) elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
{ {
ELM_CHECK_WIDTYPE(obj, widtype); ELM_CHECK_WIDTYPE(obj, widtype);
@ -527,17 +527,17 @@ elm_hoverlist_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
} }
/** /**
* Get the Hoverlist's parent object. * Get the Ctxpopup's parent object.
* *
* @param obj The hoverlist object * @param obj The ctxpopup object
* @param parent The parent to use * @param parent The parent to use
* *
* See elm_hoverlist_hover_parent_set() for more information. * See elm_ctxpopup_hover_parent_set() for more information.
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Evas_Object * EAPI Evas_Object *
elm_hoverlist_hover_parent_get(const Evas_Object *obj) elm_ctxpopup_hover_parent_get(const Evas_Object *obj)
{ {
ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_CHECK_WIDTYPE(obj, widtype) NULL;
@ -551,18 +551,18 @@ elm_hoverlist_hover_parent_get(const Evas_Object *obj)
} }
/** /**
* Clear all items in the given hoverlist object. * Clear all items in the given ctxpopup object.
* *
* @param obj Hoverlist object * @param obj Ctxpopup object
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_clear(Evas_Object* obj) elm_ctxpopup_clear(Evas_Object* obj)
{ {
ELM_CHECK_WIDTYPE(obj, widtype); ELM_CHECK_WIDTYPE(obj, widtype);
Elm_Hoverlist_Item *item; Elm_Ctxpopup_Item *item;
Widget_Data *wd; Widget_Data *wd;
wd = elm_widget_data_get(obj); wd = elm_widget_data_get(obj);
@ -579,16 +579,16 @@ elm_hoverlist_clear(Evas_Object* obj)
} }
/** /**
* Change the hoverlist's orientation to horizontal or vertical. * Change the ctxpopup's orientation to horizontal or vertical.
* *
* @param obj Hoverlist object * @param obj Ctxpopup object
* @param horizontal @c EINA_TRUE for horizontal mode, @c EINA_FALSE * @param horizontal @c EINA_TRUE for horizontal mode, @c EINA_FALSE
* for vertical * for vertical
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_horizontal_set(Evas_Object* obj, Eina_Bool horizontal) elm_ctxpopup_horizontal_set(Evas_Object* obj, Eina_Bool horizontal)
{ {
ELM_CHECK_WIDTYPE(obj, widtype); ELM_CHECK_WIDTYPE(obj, widtype);
@ -606,16 +606,16 @@ elm_hoverlist_horizontal_set(Evas_Object* obj, Eina_Bool horizontal)
} }
/** /**
* Get the value of current hoverlist object's orientation. * Get the value of current ctxpopup object's orientation.
* *
* @param obj Hoverlist object * @param obj Ctxpopup object
* @return @c EINA_TRUE for horizontal mode, @c EINA_FALSE for * @return @c EINA_TRUE for horizontal mode, @c EINA_FALSE for
* vertical mode (or errors) * vertical mode (or errors)
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Eina_Bool EAPI Eina_Bool
elm_hoverlist_horizontal_get(const Evas_Object *obj) elm_ctxpopup_horizontal_get(const Evas_Object *obj)
{ {
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
@ -629,23 +629,23 @@ elm_hoverlist_horizontal_get(const Evas_Object *obj)
} }
/** /**
* Append a new item to a hoverlist object. * Append a new item to a ctxpopup object.
* *
* @param obj Hoverlist object * @param obj Ctxpopup object
* @param label The label of the new item * @param label The label of the new item
* @param icon Icon to be set on new item * @param icon Icon to be set on new item
* @param func Convenience function called when item selected * @param func Convenience function called when item selected
* @param data Data passed to @p func above * @param data Data passed to @p func above
* @return A handle to the item added or @c NULL, on errors * @return A handle to the item added or @c NULL, on errors
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Elm_Hoverlist_Item * EAPI Elm_Ctxpopup_Item *
elm_hoverlist_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
{ {
ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Elm_Hoverlist_Item* item; Elm_Ctxpopup_Item* item;
Widget_Data* wd; Widget_Data* wd;
wd = elm_widget_data_get(obj); wd = elm_widget_data_get(obj);
@ -664,16 +664,16 @@ elm_hoverlist_item_append(Evas_Object *obj, const char *label, Evas_Object *icon
} }
/** /**
* Delete the given item in a hoverlist object. * Delete the given item in a ctxpopup object.
* *
* @param item Hoverlist item to be deleted * @param item Ctxpopup item to be deleted
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_item_del(Elm_Hoverlist_Item *item) elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
Widget_Data *wd; Widget_Data *wd;
@ -693,17 +693,17 @@ elm_hoverlist_item_del(Elm_Hoverlist_Item *item)
} }
/** /**
* Set the hoverlist item's state as disabled or enabled * Set the ctxpopup item's state as disabled or enabled
* *
* @param item Hoverlist item to be enabled/disabled * @param item Ctxpopup item to be enabled/disabled
* @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable * @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI void EAPI void
elm_hoverlist_item_disabled_set(Elm_Hoverlist_Item *item, Eina_Bool disabled) elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
Widget_Data *wd; Widget_Data *wd;
@ -719,17 +719,17 @@ elm_hoverlist_item_disabled_set(Elm_Hoverlist_Item *item, Eina_Bool disabled)
} }
/** /**
* Get the hoverlist item's disabled/enabled state. * Get the ctxpopup item's disabled/enabled state.
* *
* @param item Hoverlist item to be enabled/disabled * @param item Ctxpopup item to be enabled/disabled
* @return @c EINA_TRUE, if disabled, @c EINA_FALSE otherwise * @return @c EINA_TRUE, if disabled, @c EINA_FALSE otherwise
* *
* @ingroup Hoverlist * @ingroup Ctxpopup
*/ */
EAPI Eina_Bool EAPI Eina_Bool
elm_hoverlist_item_disabled_get(const Elm_Hoverlist_Item *item) elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item)
{ {
ELM_HOVERLIST_ITEM_CHECK_RETURN(item, EINA_FALSE); ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, EINA_FALSE);
return item->disabled; return item->disabled;
} }