summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-12-10 14:26:14 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-12-10 14:26:14 +0900
commit2c96a37041bf39d5f504427cfc64301bb38dbc22 (patch)
treecaa054a7237dbd25abfd85fc5b4fef00f9beaa11
parent272ec87edb55fe01cbf20a41846061cf0ab507c4 (diff)
Animate flip at startup, 4 times
-rw-r--r--main.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/main.c b/main.c
index ae0805e..6eab6aa 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,6 @@
1#include <Elementary.h> 1#include <Elementary.h>
2#include <Ecore.h>
3
2#include <assert.h> 4#include <assert.h>
3 5
4#define WIDTH 600 6#define WIDTH 600
@@ -11,7 +13,7 @@
11#define PANE_V_TOP 30 13#define PANE_V_TOP 30
12#define PANE_H_LEFT 80 14#define PANE_H_LEFT 80
13 15
14const char *DEFAULT_STYLE = "blend input output 0 0 color=blue;"; 16const char *DEFAULT_STYLE = "blend(color=red);";
15const char *AUTOSAVE_FILE = "/tmp/textstyle.txt"; 17const char *AUTOSAVE_FILE = "/tmp/textstyle.txt";
16const char *AUTOSAVE_CONTENT = "/tmp/textsample.txt"; 18const char *AUTOSAVE_CONTENT = "/tmp/textsample.txt";
17const char *AUTOSAVE_CONFIG = "/tmp/text_styles.cfg"; 19const char *AUTOSAVE_CONFIG = "/tmp/text_styles.cfg";
@@ -42,6 +44,16 @@ blur(10, color=orange, oy=5);
42blur(2, color=white, oy=7); 44blur(2, color=white, oy=7);
43*/ 45*/
44 46
47static Eina_Bool
48_timer_cb(void *data)
49{
50 Eo *flip = data;
51 static int cnt = 0;
52 elm_flip_go(flip, ELM_FLIP_CUBE_DOWN);
53 if (++cnt >= 4) return EINA_FALSE;
54 return EINA_TRUE;
55}
56
45static void 57static void
46_spacer_add(Eo *box) 58_spacer_add(Eo *box)
47{ 59{
@@ -329,7 +341,7 @@ _panes_key_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
329EAPI_MAIN int 341EAPI_MAIN int
330elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) 342elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
331{ 343{
332 Eo *win, *panes, *panes2, *vbox, *o, *hbox, *flip, *vb; 344 Eo *win, *panes, *panes2, *vbox, *o, *hbox, *vb, *flip;
333 Eina_File *f; 345 Eina_File *f;
334 Eina_Bool ok; 346 Eina_Bool ok;
335 Evas *evas; 347 Evas *evas;
@@ -427,7 +439,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
427 } 439 }
428 440
429 // helper popup 441 // helper popup
430 elm_object_tooltip_text_set(flip, "Drag this frame to switch between Text and Textblock"); 442 //elm_object_tooltip_text_set(flip, "Drag this frame to switch between Text and Textblock");
431 443
432 // bottom pane: another pane 444 // bottom pane: another pane
433 o = elm_frame_add(panes); 445 o = elm_frame_add(panes);
@@ -639,6 +651,9 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
639 // Apply default style 651 // Apply default style
640 _style_apply(); 652 _style_apply();
641 653
654 // Add some animation at the beginning: switch to Textblock view after 1s
655 ecore_timer_add(1., _timer_cb, flip);
656
642 elm_run(); 657 elm_run();
643 658
644 // Save config 659 // Save config