summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-28 23:08:28 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-28 23:08:36 +0900
commita4f7a90453da0dc56e88d32792849f69d7eb22b1 (patch)
tree3750da03c74c1745108e613fe1c296af9891bbfc
parent9c6d1a500d7f72739f351b1383e13e80cd822ae8 (diff)
test_win_state: Add win lower and deiconify samples.
-rw-r--r--src/bin/test_win_state.c97
1 files changed, 77 insertions, 20 deletions
diff --git a/src/bin/test_win_state.c b/src/bin/test_win_state.c
index 97965427c..aef758fc5 100644
--- a/src/bin/test_win_state.c
+++ b/src/bin/test_win_state.c
@@ -31,13 +31,22 @@ my_bt_38_alpha_off(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
31} 31}
32 32
33static Eina_Bool 33static Eina_Bool
34_unic(void *data) 34_activate_timer_cb(void *data)
35{ 35{
36 printf("activate\n"); 36 printf("Activate window\n");
37 elm_win_activate(data); 37 elm_win_activate(data);
38 return EINA_FALSE; 38 return ECORE_CALLBACK_CANCEL;
39}
40
41static Eina_Bool
42_deiconify_timer_cb(void *data)
43{
44 printf("Deiconify window\n");
45 elm_win_iconified_set(data, EINA_FALSE);
46 return ECORE_CALLBACK_CANCEL;
39} 47}
40 48
49
41static Eina_Bool 50static Eina_Bool
42_unwith(void *data) 51_unwith(void *data)
43{ 52{
@@ -48,15 +57,6 @@ _unwith(void *data)
48} 57}
49 58
50static void 59static void
51my_bt_38_iconify(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
52{
53 Evas_Object *win = data;
54 printf("iconify, current %i\n", elm_win_iconified_get(win));
55 elm_win_iconified_set(win, EINA_TRUE);
56 ecore_timer_add(10.0, _unic, win);
57}
58
59static void
60my_bt_38_withdraw(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 60my_bt_38_withdraw(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
61{ 61{
62 Evas_Object *win = data; 62 Evas_Object *win = data;
@@ -182,6 +182,36 @@ _move_0_0(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
182} 182}
183 183
184static void 184static void
185_bt_win_lower(void *data, Evas_Object *obj EINA_UNUSED,
186 void *event_info EINA_UNUSED)
187{
188 printf("Lower window\n");
189 elm_win_lower(data);
190}
191
192static void
193_bt_win_iconify_and_activate(void *data, Evas_Object *obj EINA_UNUSED,
194 void *event_info EINA_UNUSED)
195{
196 printf("Iconify window. (current status: %i)\n", elm_win_iconified_get(data));
197 elm_win_iconified_set(data, EINA_TRUE);
198
199 printf("This window will be activated in 5 seconds.\n");
200 ecore_timer_add(5.0, _activate_timer_cb, data);
201}
202
203static void
204_bt_win_iconify_and_deiconify(void *data, Evas_Object *obj EINA_UNUSED,
205 void *event_info EINA_UNUSED)
206{
207 printf("Iconify window. (current status: %i)\n", elm_win_iconified_get(data));
208 elm_win_iconified_set(data, EINA_TRUE);
209
210 printf("This window will be deiconified in 5 seconds.\n");
211 ecore_timer_add(5.0, _deiconify_timer_cb, data);
212}
213
214static void
185_win_state_print_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 215_win_state_print_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
186{ 216{
187 printf("WIN: %s\n", (char *)data); 217 printf("WIN: %s\n", (char *)data);
@@ -273,14 +303,6 @@ test_win_state(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
273 evas_object_show(bt); 303 evas_object_show(bt);
274 304
275 bt = elm_button_add(win); 305 bt = elm_button_add(win);
276 elm_object_text_set(bt, "Iconify");
277 evas_object_smart_callback_add(bt, "clicked", my_bt_38_iconify, win);
278 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
279 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
280 elm_box_pack_end(bx2, bt);
281 evas_object_show(bt);
282
283 bt = elm_button_add(win);
284 elm_object_text_set(bt, "Withdraw"); 306 elm_object_text_set(bt, "Withdraw");
285 evas_object_smart_callback_add(bt, "clicked", my_bt_38_withdraw, win); 307 evas_object_smart_callback_add(bt, "clicked", my_bt_38_withdraw, win);
286 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 308 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -310,6 +332,41 @@ test_win_state(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
310 bx2 = elm_box_add(win); 332 bx2 = elm_box_add(win);
311 elm_box_horizontal_set(bx2, EINA_TRUE); 333 elm_box_horizontal_set(bx2, EINA_TRUE);
312 elm_box_homogeneous_set(bx2, EINA_TRUE); 334 elm_box_homogeneous_set(bx2, EINA_TRUE);
335 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
336 evas_object_size_hint_fill_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
337
338 bt = elm_button_add(win);
339 elm_object_text_set(bt, "Lower");
340 evas_object_smart_callback_add(bt, "clicked", _bt_win_lower, win);
341 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
342 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
343 elm_box_pack_end(bx2, bt);
344 evas_object_show(bt);
345
346 bt = elm_button_add(win);
347 elm_object_text_set(bt, "Iconify and Activate");
348 evas_object_smart_callback_add(bt, "clicked",
349 _bt_win_iconify_and_activate, win);
350 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
351 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
352 elm_box_pack_end(bx2, bt);
353 evas_object_show(bt);
354
355 bt = elm_button_add(win);
356 elm_object_text_set(bt, "Iconify and Deiconify");
357 evas_object_smart_callback_add(bt, "clicked",
358 _bt_win_iconify_and_deiconify, win);
359 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
360 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
361 elm_box_pack_end(bx2, bt);
362 evas_object_show(bt);
363
364 elm_box_pack_end(bx, bx2);
365 evas_object_show(bx2);
366
367 bx2 = elm_box_add(win);
368 elm_box_horizontal_set(bx2, EINA_TRUE);
369 elm_box_homogeneous_set(bx2, EINA_TRUE);
313 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 370 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
314 evas_object_size_hint_fill_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); 371 evas_object_size_hint_fill_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
315 372