raster pushed a commit to branch master.
commit a841a145a54846d84661c1d68ffb0b55ca486e8a
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date: Thu Jul 18 19:02:08 2013 +0900
make video test notify usage less annoying.
---
src/bin/test_video.c | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/src/bin/test_video.c b/src/bin/test_video.c
index 3917ef5..75b0604 100644
--- a/src/bin/test_video.c
+++ b/src/bin/test_video.c
@@ -19,6 +19,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__)
{
evas_object_show(data);
@@ -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);
--
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk