summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-08-07 04:51:53 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-08-07 04:51:53 +0000
commitd1664bd1878b22a023d808fa3d8a65d58055a9f9 (patch)
treeab076f213f8a46f17a155f10d8fad457dd3a7f89
parentcf2eab4fe66d243d8e2e50aa34d73f776fce49ae (diff)
tests++
SVN revision: 50887
-rw-r--r--src/bin/Makefile.am3
-rw-r--r--src/bin/tests.h3
-rw-r--r--src/bin/widgets_file_icons_2_grouped.c147
-rw-r--r--src/bin/widgets_file_icons_2_same.c124
-rw-r--r--src/bin/widgets_file_icons_2_same_grouped.c128
5 files changed, 405 insertions, 0 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 8589917..55f6267 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -24,6 +24,9 @@ about.c about.h \
24tests.h \ 24tests.h \
25widgets_file_icons.c \ 25widgets_file_icons.c \
26widgets_file_icons_2.c \ 26widgets_file_icons_2.c \
27widgets_file_icons_2_grouped.c \
28widgets_file_icons_2_same.c \
29widgets_file_icons_2_same_grouped.c \
27widgets_file_icons_3.c \ 30widgets_file_icons_3.c \
28widgets_file_icons_4.c \ 31widgets_file_icons_4.c \
29image_blend_unscaled.c \ 32image_blend_unscaled.c \
diff --git a/src/bin/tests.h b/src/bin/tests.h
index d854c0f..3b09e26 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -1,5 +1,8 @@
1#include "widgets_file_icons.c" 1#include "widgets_file_icons.c"
2#include "widgets_file_icons_2.c" 2#include "widgets_file_icons_2.c"
3#include "widgets_file_icons_2_grouped.c"
4#include "widgets_file_icons_2_same.c"
5#include "widgets_file_icons_2_same_grouped.c"
3#include "widgets_file_icons_3.c" 6#include "widgets_file_icons_3.c"
4#include "widgets_file_icons_4.c" 7#include "widgets_file_icons_4.c"
5#include "image_blend_unscaled.c" 8#include "image_blend_unscaled.c"
diff --git a/src/bin/widgets_file_icons_2_grouped.c b/src/bin/widgets_file_icons_2_grouped.c
new file mode 100644
index 0000000..87dc91c
--- /dev/null
+++ b/src/bin/widgets_file_icons_2_grouped.c
@@ -0,0 +1,147 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME widgets_file_icons_2_grouped_start
7#define NAME "Widgets File Icons 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 *icons[] =
23{
24 "bug.png",
25 "bulb.png",
26 "camera.png",
27 "colorbox.png",
28
29 "e.png",
30 "error.png",
31 "flower.png",
32 "house.png",
33
34 "mushroom.png",
35 "pulse.png",
36 "typewriter.png",
37 "warning.png",
38
39 "watch.png"
40};
41
42/* setup */
43static void _setup(void)
44{
45 int i;
46 Evas_Object *o;
47 for (i = 0; i < NUM; i++)
48 {
49 o = evas_object_image_add(evas);
50 o_images[i] = o;
51 evas_object_image_file_set(o, build_path(icons[i % 13]), NULL);
52 evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE);
53 evas_object_resize(o, ICON_SIZE, ICON_SIZE);
54 evas_object_show(o);
55
56 o = evas_object_text_add(evas);
57 o_texts[i] = o;
58 evas_object_text_font_set(o, "Vera-Bold", 10);
59 evas_object_text_text_set(o, icons[i % 13]);
60 evas_object_color_set(o, 0, 0, 0, 255);
61 evas_object_show(o);
62 }
63 for (i = 0; i < NUM; i++)
64 {
65 evas_object_raise(o_images[i]);
66 }
67 for (i = 0; i < NUM; i++)
68 {
69 if (i > 13) evas_object_stack_above(o_images[i], o_images[i - 13]);
70 }
71 done = 0;
72}
73
74/* cleanup */
75static void _cleanup(void)
76{
77 int i;
78 for (i = 0; i < NUM; i++) evas_object_del(o_images[i]);
79 for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]);
80}
81
82/* loop - do things */
83static void _loop(double t, int f)
84{
85 int i;
86 Evas_Coord x, y, w, h, tw, th, cent;
87 x = 0;
88 y = 0 - f;
89 w = ICON_SIZE;
90 h = ICON_SIZE;
91 for (i = 0; i < NUM; i++)
92 {
93 evas_object_move(o_images[i], x + 8, y);
94 evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th);
95 cent = (ICON_SIZE + 16 - tw) / 2;
96 evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4);
97 x += ICON_SIZE + 16;
98 if (x > win_w)
99 {
100 x = 0;
101 y += ICON_SIZE + 16;
102 }
103 }
104 FPS_STD(NAME);
105}
106
107/* prepend special key handlers if interactive (before STD) */
108static void _key(char *key)
109{
110 KEY_STD;
111}
112
113
114
115
116
117
118
119
120
121
122
123
124/* template stuff - ignore */
125# endif
126#endif
127
128#ifdef UI
129_ui_menu_item_add(ICON, NAME, FNAME);
130#endif
131
132#ifdef PROTO
133void FNAME(void);
134#endif
135
136#ifndef PROTO
137# ifndef UI
138void FNAME(void)
139{
140 ui_func_set(_key, _loop);
141 _setup();
142}
143# endif
144#endif
145#undef FNAME
146#undef NAME
147#undef ICON
diff --git a/src/bin/widgets_file_icons_2_same.c b/src/bin/widgets_file_icons_2_same.c
new file mode 100644
index 0000000..47b9b48
--- /dev/null
+++ b/src/bin/widgets_file_icons_2_same.c
@@ -0,0 +1,124 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME widgets_file_icons_2_same_start
7#define NAME "Widgets File Icons 2 Same"
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 *icons[] =
23{
24 "e.png",
25};
26
27/* setup */
28static void _setup(void)
29{
30 int i;
31 Evas_Object *o;
32 for (i = 0; i < NUM; i++)
33 {
34 o = evas_object_image_add(evas);
35 o_images[i] = o;
36 evas_object_image_file_set(o, build_path(icons[i % 1]), NULL);
37 evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE);
38 evas_object_resize(o, ICON_SIZE, ICON_SIZE);
39 evas_object_show(o);
40
41 o = evas_object_text_add(evas);
42 o_texts[i] = o;
43 evas_object_text_font_set(o, "Vera-Bold", 10);
44 evas_object_text_text_set(o, icons[i % 1]);
45 evas_object_color_set(o, 0, 0, 0, 255);
46 evas_object_show(o);
47 }
48 done = 0;
49}
50
51/* cleanup */
52static void _cleanup(void)
53{
54 int i;
55 for (i = 0; i < NUM; i++) evas_object_del(o_images[i]);
56 for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]);
57}
58
59/* loop - do things */
60static void _loop(double t, int f)
61{
62 int i;
63 Evas_Coord x, y, w, h, tw, th, cent;
64 x = 0;
65 y = 0 - f;
66 w = ICON_SIZE;
67 h = ICON_SIZE;
68 for (i = 0; i < NUM; i++)
69 {
70 evas_object_move(o_images[i], x + 8, y);
71 evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th);
72 cent = (ICON_SIZE + 16 - tw) / 2;
73 evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4);
74 x += ICON_SIZE + 16;
75 if (x > win_w)
76 {
77 x = 0;
78 y += ICON_SIZE + 16;
79 }
80 }
81 FPS_STD(NAME);
82}
83
84/* prepend special key handlers if interactive (before STD) */
85static void _key(char *key)
86{
87 KEY_STD;
88}
89
90
91
92
93
94
95
96
97
98
99
100
101/* template stuff - ignore */
102# endif
103#endif
104
105#ifdef UI
106_ui_menu_item_add(ICON, NAME, FNAME);
107#endif
108
109#ifdef PROTO
110void FNAME(void);
111#endif
112
113#ifndef PROTO
114# ifndef UI
115void FNAME(void)
116{
117 ui_func_set(_key, _loop);
118 _setup();
119}
120# endif
121#endif
122#undef FNAME
123#undef NAME
124#undef ICON
diff --git a/src/bin/widgets_file_icons_2_same_grouped.c b/src/bin/widgets_file_icons_2_same_grouped.c
new file mode 100644
index 0000000..5a2e6a0
--- /dev/null
+++ b/src/bin/widgets_file_icons_2_same_grouped.c
@@ -0,0 +1,128 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME widgets_file_icons_2_same_grouped_start
7#define NAME "Widgets File Icons 2 Same 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 *icons[] =
23{
24 "e.png",
25};
26
27/* setup */
28static void _setup(void)
29{
30 int i;
31 Evas_Object *o;
32 for (i = 0; i < NUM; i++)
33 {
34 o = evas_object_image_add(evas);
35 o_images[i] = o;
36 evas_object_image_file_set(o, build_path(icons[i % 1]), NULL);
37 evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE);
38 evas_object_resize(o, ICON_SIZE, ICON_SIZE);
39 evas_object_show(o);
40
41 o = evas_object_text_add(evas);
42 o_texts[i] = o;
43 evas_object_text_font_set(o, "Vera-Bold", 10);
44 evas_object_text_text_set(o, icons[i % 1]);
45 evas_object_color_set(o, 0, 0, 0, 255);
46 evas_object_show(o);
47 }
48 for (i = 0; i < NUM; i++)
49 {
50 evas_object_raise(o_images[i]);
51 }
52 done = 0;
53}
54
55/* cleanup */
56static void _cleanup(void)
57{
58 int i;
59 for (i = 0; i < NUM; i++) evas_object_del(o_images[i]);
60 for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]);
61}
62
63/* loop - do things */
64static void _loop(double t, int f)
65{
66 int i;
67 Evas_Coord x, y, w, h, tw, th, cent;
68 x = 0;
69 y = 0 - f;
70 w = ICON_SIZE;
71 h = ICON_SIZE;
72 for (i = 0; i < NUM; i++)
73 {
74 evas_object_move(o_images[i], x + 8, y);
75 evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th);
76 cent = (ICON_SIZE + 16 - tw) / 2;
77 evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4);
78 x += ICON_SIZE + 16;
79 if (x > win_w)
80 {
81 x = 0;
82 y += ICON_SIZE + 16;
83 }
84 }
85 FPS_STD(NAME);
86}
87
88/* prepend special key handlers if interactive (before STD) */
89static void _key(char *key)
90{
91 KEY_STD;
92}
93
94
95
96
97
98
99
100
101
102
103
104
105/* template stuff - ignore */
106# endif
107#endif
108
109#ifdef UI
110_ui_menu_item_add(ICON, NAME, FNAME);
111#endif
112
113#ifdef PROTO
114void FNAME(void);
115#endif
116
117#ifndef PROTO
118# ifndef UI
119void FNAME(void)
120{
121 ui_func_set(_key, _loop);
122 _setup();
123}
124# endif
125#endif
126#undef FNAME
127#undef NAME
128#undef ICON