2010-09-17 11:26:04 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include <Elementary_Cursor.h>
|
|
|
|
#ifndef ELM_LIB_QUICKLAUNCH
|
|
|
|
|
|
|
|
void
|
|
|
|
test_cursor(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *bt, *list, *entry, *ck;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Cursor");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
elm_object_cursor_set(bg, ELM_CURSOR_CIRCLE);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
ck = elm_clock_add(win);
|
|
|
|
elm_object_cursor_set(ck, ELM_CURSOR_CLOCK);
|
|
|
|
elm_box_pack_end(bx, ck);
|
|
|
|
evas_object_show(ck);
|
|
|
|
|
|
|
|
bt = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(bt, ELM_CURSOR_COFFEE_MUG);
|
|
|
|
elm_button_label_set(bt, "Coffee Mug");
|
|
|
|
elm_box_pack_end(bx, bt);
|
|
|
|
evas_object_show(bt);
|
|
|
|
|
|
|
|
bt = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(bt, ELM_CURSOR_CLOCK);
|
|
|
|
elm_button_label_set(bt, "Cursor unset");
|
|
|
|
elm_object_cursor_unset(bt);
|
|
|
|
elm_box_pack_end(bx, bt);
|
|
|
|
evas_object_show(bt);
|
|
|
|
|
|
|
|
list = elm_list_add(win);
|
|
|
|
elm_box_pack_end(bx, list);
|
|
|
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_object_cursor_set(list, ELM_CURSOR_WATCH);
|
|
|
|
elm_list_item_append(list, "watch over list", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_append(list, "watch over list", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_go(list);
|
|
|
|
evas_object_show(list);
|
|
|
|
|
|
|
|
entry = elm_scrolled_entry_add(win);
|
|
|
|
elm_scrolled_entry_entry_set(entry, "Xterm cursor");
|
|
|
|
elm_scrolled_entry_single_line_set(entry, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
|
|
|
|
evas_object_size_hint_fill_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, entry);
|
|
|
|
evas_object_show(entry);
|
|
|
|
elm_object_cursor_set(entry, ELM_CURSOR_XTERM);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
test_cursor2(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *o;
|
|
|
|
Elm_Toolbar_Item *tit;
|
|
|
|
Elm_List_Item *lit;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_win_title_set(win, "Cursor 2");
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
o = elm_toolbar_add(win);
|
|
|
|
elm_toolbar_homogenous_set(o, 0);
|
|
|
|
evas_object_size_hint_weight_set(o, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
|
|
|
|
tit = elm_toolbar_item_add(o, NULL, "Bogosity", NULL, NULL);
|
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_BOGOSITY);
|
|
|
|
tit = elm_toolbar_item_add(o, NULL, "Unset", NULL, NULL);
|
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_BOGOSITY);
|
|
|
|
elm_toolbar_item_cursor_unset(tit);
|
|
|
|
tit = elm_toolbar_item_add(o, NULL, "Xterm", NULL, NULL);
|
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_XTERM);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_list_add(win);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
lit = elm_list_item_append(o, "cursor bogosity", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
|
|
|
|
lit = elm_list_item_append(o, "cursor unset", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
|
|
|
|
elm_list_item_cursor_unset(lit);
|
|
|
|
lit = elm_list_item_append(o, "cursor xterm", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_XTERM);
|
|
|
|
elm_list_go(o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
void
|
|
|
|
test_cursor3(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *o;
|
|
|
|
Elm_List_Item *lit;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Cursor 3");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND1);
|
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
|
|
|
elm_button_label_set(o, "hand1");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_button_label_set(o, "hand2 x");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
|
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_button_label_set(o, "hand2");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_button_label_set(o, "hand3");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_object_cursor_style_set(o, "transparent");
|
|
|
|
elm_button_label_set(o, "hand3 transparent");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_object_cursor_unset(o);
|
|
|
|
elm_button_label_set(o, "unset");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand4");
|
|
|
|
elm_button_label_set(o, "not existent");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2010-09-25 15:04:51 -07:00
|
|
|
elm_cursor_engine_only_set(0);
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand2");
|
|
|
|
elm_button_label_set(o, "hand 2 engine only config false");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
elm_cursor_engine_only_set(1);
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand2");
|
|
|
|
elm_button_label_set(o, "hand 2 engine only config true");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
o = elm_list_add(win);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2010-09-25 15:03:37 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand2 x", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand2", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand3", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand3 transparent", NULL, NULL,
|
|
|
|
NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, "hand3");
|
|
|
|
elm_list_item_cursor_style_set(lit, "transparent");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_list_go(o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
2010-09-17 11:26:04 -07:00
|
|
|
#endif
|