make video test notify usage less annoying.
This commit is contained in:
parent
260f817986
commit
85996e0a21
|
@ -18,6 +18,15 @@ my_bt_open(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_notify_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||
evas_object_resize(data, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_notify_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -27,21 +36,23 @@ _notify_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
|||
static void
|
||||
_notify_block(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
elm_notify_timeout_set(data, 0);
|
||||
printf("in block\n");
|
||||
elm_notify_timeout_set(data, 0.0);
|
||||
evas_object_show(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_notify_unblock(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
elm_notify_timeout_set(data, 3.0);
|
||||
printf("out block\n");
|
||||
elm_notify_timeout_set(data, 10.0);
|
||||
evas_object_show(data);
|
||||
}
|
||||
|
||||
void
|
||||
test_video(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *win, *bg, *video, *bt, *tb, *notify, *player;
|
||||
Evas_Object *win, *bg, *video, *bt, *tb, *notify, *player, *grid, *rect;
|
||||
|
||||
win = elm_win_add(NULL, "video", ELM_WIN_BASIC);
|
||||
elm_win_title_set(win, "Video");
|
||||
|
@ -59,7 +70,6 @@ test_video(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
notify = elm_notify_add(win);
|
||||
elm_notify_align_set(notify, 0.5, 1.0);
|
||||
elm_notify_timeout_set(notify, 10.0);
|
||||
|
||||
player = elm_player_add(win);
|
||||
elm_object_content_set(player, video);
|
||||
|
@ -80,9 +90,21 @@ test_video(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
evas_object_show(tb);
|
||||
|
||||
evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_MOVE, _notify_show, notify);
|
||||
evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_IN, _notify_block, notify);
|
||||
evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_OUT, _notify_unblock, notify);
|
||||
grid = elm_grid_add(win);
|
||||
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_grid_size_set(grid, 100, 100);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _notify_resize, grid);
|
||||
evas_object_layer_set(grid, 32767);
|
||||
evas_object_show(grid);
|
||||
|
||||
rect = evas_object_rectangle_add(evas_object_evas_get(win));
|
||||
evas_object_color_set(rect, 0, 0, 0, 0);
|
||||
evas_object_repeat_events_set(rect, EINA_TRUE);
|
||||
elm_grid_pack(grid, rect, 0, 75, 100, 25);
|
||||
evas_object_show(rect);
|
||||
evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_MOVE, _notify_show, notify);
|
||||
evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_IN, _notify_block, notify);
|
||||
evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_OUT, _notify_unblock, notify);
|
||||
|
||||
evas_object_resize(win, 800, 500);
|
||||
evas_object_show(win);
|
||||
|
|
Loading…
Reference in New Issue