summaryrefslogtreecommitdiff
path: root/src/bin/widgets_list_2_grouped.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-08-09 06:43:33 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-08-09 06:43:33 +0000
commit845bab2130f40ea1f45af7e000763966e8a0cd59 (patch)
treedea547cf28e5d38737edd5a538f22a879b9887ec /src/bin/widgets_list_2_grouped.c
parente3b0932cc1fc92a2eabafe3df5891ca77e5c1611 (diff)
more tests ahoy!
SVN revision: 50922
Diffstat (limited to 'src/bin/widgets_list_2_grouped.c')
-rw-r--r--src/bin/widgets_list_2_grouped.c158
1 files changed, 158 insertions, 0 deletions
diff --git a/src/bin/widgets_list_2_grouped.c b/src/bin/widgets_list_2_grouped.c
new file mode 100644
index 0000000..fae8011
--- /dev/null
+++ b/src/bin/widgets_list_2_grouped.c
@@ -0,0 +1,158 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME widgets_list_2_grouped_start
7#define NAME "Widgets List 2 Grouped"
8#define ICON "widgets.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16/* private data */
17#define NUM 512
18#define ICON_SIZE 64
19static Evas_Object *o_images[NUM];
20static Evas_Object *o_texts[NUM];
21
22static const char *labels[] =
23{
24 "Andrew",
25 "Alex",
26 "Amanda",
27 "Arthur",
28 "Astrid",
29 "Avery",
30
31 "Beethoven",
32 "Billy",
33 "Bob",
34 "Bundy",
35
36 "Candy",
37 "Carsten",
38
39 "Danny",
40 "Dennis",
41 "Dirk",
42 "Doug",
43
44 "Edmond",
45 "Erik",
46
47 "Fernando",
48 "Frank",
49 "Frederick",
50
51 "Gabby",
52 "George",
53 "Gilroy",
54 "Goodrich",
55 "Gumby",
56};
57
58/* setup */
59static void _setup(void)
60{
61 int i;
62 Evas_Object *o;
63 for (i = 0; i < NUM; i++)
64 {
65 o = evas_object_image_filled_add(evas);
66 o_images[i] = o;
67 evas_object_image_border_set(o, 2, 2, 2, 2);
68 evas_object_image_file_set(o, build_path("pan.png"), NULL);
69 evas_object_resize(o, win_w, ICON_SIZE);
70 evas_object_show(o);
71
72 o = evas_object_text_add(evas);
73 o_texts[i] = o;
74 evas_object_text_font_set(o, "Vera-Bold", 10);
75 evas_object_text_text_set(o, labels[i % 26]);
76 evas_object_color_set(o, 0, 0, 0, 255);
77 evas_object_show(o);
78 }
79 for (i = 0; i < NUM; i++)
80 {
81 evas_object_raise(o_images[i]);
82 }
83 for (i = 0; i < NUM; i++)
84 {
85 evas_object_raise(o_texts[i]);
86 }
87 done = 0;
88}
89
90/* cleanup */
91static void _cleanup(void)
92{
93 int i;
94 for (i = 0; i < NUM; i++) evas_object_del(o_images[i]);
95 for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]);
96}
97
98/* loop - do things */
99static void _loop(double t, int f)
100{
101 int i;
102 Evas_Coord x, y, w, h, tw, th, cent;
103 x = 0;
104 y = 0 - f;
105 w = win_w;
106 h = ICON_SIZE;
107 for (i = 0; i < NUM; i++)
108 {
109 evas_object_move(o_images[i], x, y);
110 evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th);
111 cent = (ICON_SIZE - th) / 2;
112 evas_object_move(o_texts[i], x + 8, y + cent);
113 y += ICON_SIZE;
114 }
115 FPS_STD(NAME);
116}
117
118/* prepend special key handlers if interactive (before STD) */
119static void _key(char *key)
120{
121 KEY_STD;
122}
123
124
125
126
127
128
129
130
131
132
133
134
135/* template stuff - ignore */
136# endif
137#endif
138
139#ifdef UI
140_ui_menu_item_add(ICON, NAME, FNAME);
141#endif
142
143#ifdef PROTO
144void FNAME(void);
145#endif
146
147#ifndef PROTO
148# ifndef UI
149void FNAME(void)
150{
151 ui_func_set(_key, _loop);
152 _setup();
153}
154# endif
155#endif
156#undef FNAME
157#undef NAME
158#undef ICON