summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-03-23 07:23:26 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-03-23 07:23:26 +0000
commit91f8728bb4fee70303cad2c053971658f56ee8d2 (patch)
tree2148cd73d2cafe3d733001041e89be9527c61c14
parentf1c642d3d065c6cc8e2e0cc36769ca3a80cfafb7 (diff)
Elm examples: add win32 thread examples, remove some whitespaces in the corresponding pthread code, and rework a bit Makefile.am
SVN revision: 69580
-rw-r--r--legacy/elementary/src/examples/Makefile.am564
-rw-r--r--legacy/elementary/src/examples/efl_thread_1.c16
-rw-r--r--legacy/elementary/src/examples/efl_thread_2.c16
-rw-r--r--legacy/elementary/src/examples/efl_thread_3.c15
-rw-r--r--legacy/elementary/src/examples/efl_thread_4.c11
-rw-r--r--legacy/elementary/src/examples/efl_thread_5.c18
-rw-r--r--legacy/elementary/src/examples/efl_thread_6.c9
-rw-r--r--legacy/elementary/src/examples/efl_thread_win32_1.c83
-rw-r--r--legacy/elementary/src/examples/efl_thread_win32_2.c99
-rw-r--r--legacy/elementary/src/examples/efl_thread_win32_3.c101
-rw-r--r--legacy/elementary/src/examples/efl_thread_win32_4.c125
11 files changed, 738 insertions, 319 deletions
diff --git a/legacy/elementary/src/examples/Makefile.am b/legacy/elementary/src/examples/Makefile.am
index b4265c841a..a618a5c552 100644
--- a/legacy/elementary/src/examples/Makefile.am
+++ b/legacy/elementary/src/examples/Makefile.am
@@ -2,15 +2,15 @@ MAINTAINERCLEANFILES = Makefile.in
2 2
3.PHONY: screenshots 3.PHONY: screenshots
4 4
5examplesdir = $(datadir)/$(PACKAGE)/examples 5examplesdir = $(pkgdatadir)/examples
6filesdir = $(datadir)/$(PACKAGE)/examples 6filesdir = $(pkgdatadir)/examples
7files_DATA = 7files_DATA =
8 8
9AM_CPPFLAGS = \ 9AM_CPPFLAGS = \
10-I. \ 10-I. \
11-I$(top_srcdir)/src/lib \ 11-I$(top_srcdir)/src/lib \
12-I$(top_builddir)/src/lib \ 12-I$(top_builddir)/src/lib \
13-DPACKAGE_DATA_DIR="\"$(datadir)/elementary\"" \ 13-DPACKAGE_DATA_DIR="\"$(pkgdatadir)\"" \
14-DPACKAGE_BIN_DIR=\"$(bindir)\" \ 14-DPACKAGE_BIN_DIR=\"$(bindir)\" \
15-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 15-DPACKAGE_LIB_DIR=\"$(libdir)\" \
16@ELEMENTARY_EDBUS_CFLAGS@ \ 16@ELEMENTARY_EDBUS_CFLAGS@ \
@@ -21,10 +21,10 @@ AM_CPPFLAGS = \
21@ELEMENTARY_CFLAGS@ 21@ELEMENTARY_CFLAGS@
22 22
23LDADD = \ 23LDADD = \
24 @ELEMENTARY_LIBS@ \ 24@ELEMENTARY_LIBS@ \
25 @ELEMENTARY_ETHUMB_LIBS@ \ 25@ELEMENTARY_ETHUMB_LIBS@ \
26 @ELEMENTARY_X_LIBS@ \ 26@ELEMENTARY_X_LIBS@ \
27 $(top_builddir)/src/lib/libelementary.la 27$(top_builddir)/src/lib/libelementary.la
28 28
29EDJE_CC = @edje_cc@ 29EDJE_CC = @edje_cc@
30EDJE_FLAGS_VERBOSE_ = 30EDJE_FLAGS_VERBOSE_ =
@@ -33,102 +33,104 @@ EDJE_FLAGS_VERBOSE_1 = -v
33EDJE_FLAGS = $(EDJE_FLAGS_$(V)) 33EDJE_FLAGS = $(EDJE_FLAGS_$(V))
34 34
35SRCS = \ 35SRCS = \
36 actionslider_example_01.c \ 36actionslider_example_01.c \
37 bubble_example_01.c \ 37bg_example_01.c \
38 button_example_00.c \ 38bg_example_02.c \
39 button_example_01.c \ 39bg_example_03.c \
40 check_example_01.c \ 40box_example_02.c \
41 colorselector_example_01.c \ 41bubble_example_01.c \
42 frame_example_01.c \ 42button_example_00.c \
43 transit_example_01.c \ 43button_example_01.c \
44 transit_example_02.c \ 44calendar_example_01.c \
45 transit_example_03.c \ 45calendar_example_02.c \
46 transit_example_04.c \ 46calendar_example_03.c \
47 bg_example_01.c \ 47calendar_example_04.c \
48 bg_example_02.c \ 48calendar_example_05.c \
49 bg_example_03.c \ 49calendar_example_06.c \
50 box_example_02.c \ 50check_example_01.c \
51 flip_example_01.c \ 51clock_example.c \
52 general_funcs_example.c \ 52colorselector_example_01.c \
53 hover_example_01.c \ 53conformant_example_01.c \
54 hoversel_example_01.c \ 54conformant_example_02.c \
55 label_example_01.c \ 55ctxpopup_example_01.c \
56 theme_example_01.c \ 56datetime_example.c \
57 theme_example_02.c \ 57dayselector_example.c \
58 calendar_example_01.c \ 58diskselector_example_01.c \
59 calendar_example_02.c \ 59diskselector_example_02.c \
60 calendar_example_03.c \ 60efl_thread_1.c \
61 calendar_example_04.c \ 61efl_thread_2.c \
62 calendar_example_05.c \ 62efl_thread_3.c \
63 calendar_example_06.c \ 63efl_thread_4.c \
64 datetime_example.c \ 64efl_thread_5.c \
65 map_example_01.c \ 65efl_thread_6.c \
66 map_example_02.c \ 66efl_thread_win32_1.c \
67 map_example_03.c \ 67efl_thread_win32_2.c \
68 toolbar_example_01.c \ 68efl_thread_win32_3.c \
69 toolbar_example_02.c \ 69efl_thread_win32_4.c \
70 toolbar_example_03.c \ 70entry_example.c \
71 spinner_example.c \ 71fileselector_button_example.c \
72 clock_example.c \ 72fileselector_entry_example.c \
73 dayselector_example.c \ 73fileselector_example.c \
74 mapbuf_example.c \ 74flip_example_01.c \
75 conformant_example_01.c \ 75flipselector_example.c \
76 conformant_example_02.c \ 76frame_example_01.c \
77 image_example_01.c \ 77general_funcs_example.c \
78 icon_example_01.c \ 78gengrid_example.c \
79 layout_example_01.c \ 79genlist_example_01.c \
80 layout_example_02.c \ 80genlist_example_02.c \
81 layout_example_03.c \ 81genlist_example_03.c \
82 list_example_01.c \ 82genlist_example_04.c \
83 list_example_02.c \ 83genlist_example_05.c \
84 list_example_03.c \ 84hover_example_01.c \
85 segment_control_example.c \ 85hoversel_example_01.c \
86 flipselector_example.c \ 86icon_example_01.c \
87 fileselector_example.c \ 87image_example_01.c \
88 fileselector_button_example.c \ 88index_example_01.c \
89 fileselector_entry_example.c \ 89index_example_02.c \
90 diskselector_example_01.c \ 90inwin_example.c \
91 diskselector_example_02.c \ 91label_example_01.c \
92 index_example_01.c \ 92layout_example.edc \
93 index_example_02.c \ 93layout_example_01.c \
94 genlist_example_01.c \ 94layout_example_02.c \
95 genlist_example_02.c \ 95layout_example_03.c \
96 genlist_example_03.c \ 96list_example_01.c \
97 genlist_example_04.c \ 97list_example_02.c \
98 genlist_example_05.c \ 98list_example_03.c \
99 theme_example.edc \ 99map_example_01.c \
100 layout_example.edc \ 100map_example_02.c \
101 slider_example.c \ 101map_example_03.c \
102 panes_example.c \ 102mapbuf_example.c \
103 ctxpopup_example_01.c \ 103menu_example_01.c \
104 separator_example_01.c \ 104notify_example_01.c \
105 radio_example_01.c \ 105panes_example.c \
106 panel_example_01.c \ 106panel_example_01.c \
107 gengrid_example.c \ 107photocam_example_01.c \
108 entry_example.c \ 108popup_example_01.c \
109 slideshow_example.c \ 109popup_example_02.c \
110 progressbar_example.c \ 110popup_example_03.c \
111 notify_example_01.c \ 111progressbar_example.c \
112 photocam_example_01.c \ 112radio_example_01.c \
113 popup_example_01.c \ 113segment_control_example.c \
114 popup_example_02.c \ 114separator_example_01.c \
115 popup_example_03.c \ 115slider_example.c \
116 inwin_example.c \ 116slideshow_example.c \
117 scroller_example_01.c \ 117spinner_example.c \
118 table_example_01.c \ 118scroller_example_01.c \
119 table_example_02.c \ 119table_example_01.c \
120 menu_example_01.c \ 120table_example_02.c \
121 thumb_example_01.c \ 121theme_example.edc \
122 web_example.c \ 122theme_example_01.c \
123 win_example.c \ 123theme_example_02.c \
124 efl_thread_1.c \ 124thumb_example_01.c \
125 efl_thread_2.c \ 125toolbar_example_01.c \
126 efl_thread_3.c \ 126toolbar_example_02.c \
127 efl_thread_4.c \ 127toolbar_example_03.c \
128 efl_thread_5.c \ 128transit_example_01.c \
129 efl_thread_6.c 129transit_example_02.c \
130 130transit_example_03.c \
131examples_PROGRAMS = 131transit_example_04.c \
132web_example.c \
133win_example.c
132 134
133.edc.edj: 135.edc.edj:
134 $(EDJE_CC) $(EDJE_FLAGS) $< $@ 136 $(EDJE_CC) $(EDJE_FLAGS) $< $@
@@ -146,183 +148,195 @@ files_DATA += \
146clean-local: 148clean-local:
147 rm -f *.edj 149 rm -f *.edj
148 150
149examples_PROGRAMS += \ 151examples_PROGRAMS = \
150 actionslider_example_01 \ 152actionslider_example_01 \
151 bubble_example_01 \ 153bg_example_01 \
152 button_example_00 \ 154bg_example_02 \
153 button_example_01 \ 155bg_example_03 \
154 check_example_01 \ 156box_example_02 \
155 colorselector_example_01 \ 157bubble_example_01 \
156 frame_example_01 \ 158button_example_00 \
157 transit_example_01 \ 159button_example_01 \
158 transit_example_02 \ 160calendar_example_01 \
159 transit_example_03 \ 161calendar_example_02 \
160 transit_example_04 \ 162calendar_example_03 \
161 bg_example_01 \ 163calendar_example_04 \
162 bg_example_02 \ 164calendar_example_05 \
163 bg_example_03 \ 165calendar_example_06 \
164 box_example_02 \ 166check_example_01 \
165 flip_example_01 \ 167clock_example \
166 general_funcs_example \ 168colorselector_example_01 \
167 hover_example_01 \ 169conformant_example_01 \
168 hoversel_example_01 \ 170conformant_example_02 \
169 label_example_01 \ 171ctxpopup_example_01 \
170 theme_example_01 \ 172datetime_example \
171 theme_example_02 \ 173dayselector_example \
172 calendar_example_01 \ 174diskselector_example_01 \
173 calendar_example_02 \ 175diskselector_example_02 \
174 calendar_example_03 \ 176efl_thread_1 \
175 calendar_example_04 \ 177efl_thread_2 \
176 calendar_example_05 \ 178efl_thread_3 \
177 calendar_example_06 \ 179efl_thread_4 \
178 datetime_example \ 180efl_thread_5 \
179 map_example_01 \ 181efl_thread_6 \
180 map_example_02 \ 182entry_example \
181 map_example_03 \ 183fileselector_button_example \
182 toolbar_example_01 \ 184fileselector_entry_example \
183 toolbar_example_02 \ 185fileselector_example \
184 toolbar_example_03 \ 186flip_example_01 \
185 spinner_example \ 187flipselector_example \
186 clock_example \ 188frame_example_01 \
187 dayselector_example \ 189general_funcs_example \
188 mapbuf_example \ 190gengrid_example \
189 conformant_example_01 \ 191genlist_example_01 \
190 conformant_example_02 \ 192genlist_example_02 \
191 image_example_01 \ 193genlist_example_03 \
192 diskselector_example_01 \ 194genlist_example_04 \
193 diskselector_example_02 \ 195genlist_example_05 \
194 icon_example_01 \ 196hover_example_01 \
195 layout_example_01 \ 197hoversel_example_01 \
196 layout_example_02 \ 198icon_example_01 \
197 layout_example_03 \ 199image_example_01 \
198 list_example_01 \ 200index_example_01 \
199 list_example_02 \ 201index_example_02 \
200 list_example_03 \ 202inwin_example \
201 segment_control_example \ 203label_example_01 \
202 slider_example \ 204layout_example_01 \
203 panes_example \ 205layout_example_02 \
204 ctxpopup_example_01 \ 206layout_example_03 \
205 flipselector_example \ 207list_example_01 \
206 fileselector_example \ 208list_example_02 \
207 fileselector_button_example \ 209list_example_03 \
208 fileselector_entry_example \ 210map_example_01 \
209 index_example_01 \ 211map_example_02 \
210 index_example_02 \ 212map_example_03 \
211 separator_example_01 \ 213mapbuf_example \
212 radio_example_01 \ 214menu_example_01 \
213 panel_example_01 \ 215notify_example_01 \
214 gengrid_example \ 216panes_example \
215 genlist_example_01 \ 217panel_example_01 \
216 genlist_example_02 \ 218photocam_example_01 \
217 genlist_example_03 \ 219popup_example_01 \
218 genlist_example_04 \ 220popup_example_02 \
219 genlist_example_05 \ 221popup_example_03 \
220 entry_example \ 222progressbar_example \
221 slideshow_example \ 223radio_example_01 \
222 progressbar_example \ 224segment_control_example \
223 notify_example_01 \ 225separator_example_01 \
224 photocam_example_01 \ 226slider_example \
225 popup_example_01 \ 227slideshow_example \
226 popup_example_02 \ 228spinner_example \
227 popup_example_03 \ 229scroller_example_01 \
228 inwin_example \ 230table_example_01 \
229 scroller_example_01 \ 231table_example_02 \
230 table_example_01 \ 232theme_example_01 \
231 table_example_02 \ 233theme_example_02 \
232 menu_example_01 \ 234thumb_example_01 \
233 thumb_example_01 \ 235toolbar_example_01 \
234 web_example \ 236toolbar_example_02 \
235 win_example \ 237toolbar_example_03 \
236 efl_thread_1 \ 238transit_example_01 \
237 efl_thread_2 \ 239transit_example_02 \
238 efl_thread_3 \ 240transit_example_03 \
239 efl_thread_4 \ 241transit_example_04 \
240 efl_thread_5 \ 242web_example \
241 efl_thread_6 243win_example
244
245if ELEMENTARY_WINDOWS_BUILD
246efl_thread_1_SOURCES = efl_thread_win32_1.c
247efl_thread_2_SOURCES = efl_thread_win32_2.c
248efl_thread_3_SOURCES = efl_thread_win32_3.c
249efl_thread_4_SOURCES = efl_thread_win32_4.c
250else
251efl_thread_1_SOURCES = efl_thread_1.c
252efl_thread_2_SOURCES = efl_thread_2.c
253efl_thread_3_SOURCES = efl_thread_3.c
254efl_thread_4_SOURCES = efl_thread_4.c
255endif
242 256
243# This variable will hold the list of screenshots that will be made 257# This variable will hold the list of screenshots that will be made
244# by "make screenshots". Each item in the list is of the form: 258# by "make screenshots". Each item in the list is of the form:
245# <example executable>:<screenshot filename>:<delay in seconds> 259# <example executable>:<screenshot filename>:<delay in seconds>
246SCREENSHOTS = \ 260SCREENSHOTS = \
247 actionslider_example_01:actionslider_01.png:0.0 \ 261actionslider_example_01:actionslider_01.png:0.0 \
248 bg_example_02:bg_01.png:0.0 \ 262bg_example_02:bg_01.png:0.0 \
249 box_example_02:box_example_02.png:1.3 \ 263box_example_02:box_example_02.png:1.3 \
250 bubble_example_01:bubble_example_01.png:0.0 \ 264bubble_example_01:bubble_example_01.png:0.0 \
251 button_example_00:button_00.png:0.0 \ 265button_example_00:button_00.png:0.0 \
252 button_example_01:button_01.png:0.0 \ 266button_example_01:button_01.png:0.0 \
253 check_example_01:check_example_01.png:0.0 \ 267check_example_01:check_example_01.png:0.0 \
254 colorselector_example_01:colorselector_example_01.png:0.0 \ 268colorselector_example_01:colorselector_example_01.png:0.0 \
255 animator_example_01:animator_example_01.png:0.2 \ 269animator_example_01:animator_example_01.png:0.2 \
256 animator_example_01:animator_example_02.png:0.5 \ 270animator_example_01:animator_example_02.png:0.5 \
257 animator_example_01:animator_example_03.png:0.9 \ 271animator_example_01:animator_example_03.png:0.9 \
258 flip_example_01:flip_example_01.png:0.0 \ 272flip_example_01:flip_example_01.png:0.0 \
259 frame_example_01:frame_example_01.png:0.0 \ 273frame_example_01:frame_example_01.png:0.0 \
260 hover_example_01:hover_example_01.png:0.0 \ 274hover_example_01:hover_example_01.png:0.0 \
261 hoversel_example_01:hoversel_example_01.png:0.0 \ 275hoversel_example_01:hoversel_example_01.png:0.0 \
262 label_example_01:label_example_01.png:0.0 \ 276label_example_01:label_example_01.png:0.0 \
263 theme_example_01:theme_example_01.png:0.0 \ 277theme_example_01:theme_example_01.png:0.0 \
264 conformant_example_01:conformant_example_01.png:0.0 \ 278conformant_example_01:conformant_example_01.png:0.0 \
265 conformant_example_02:conformant_example_02.png:0.0 \ 279conformant_example_02:conformant_example_02.png:0.0 \
266 calendar_example_01:calendar_example_01.png:0.0 \ 280calendar_example_01:calendar_example_01.png:0.0 \
267 calendar_example_02:calendar_example_02.png:0.0 \ 281calendar_example_02:calendar_example_02.png:0.0 \
268 calendar_example_03:calendar_example_03.png:0.0 \ 282calendar_example_03:calendar_example_03.png:0.0 \
269 calendar_example_04:calendar_example_04.png:0.0 \ 283calendar_example_04:calendar_example_04.png:0.0 \
270 calendar_example_05:calendar_example_05.png:0.0 \ 284calendar_example_05:calendar_example_05.png:0.0 \
271 calendar_example_06:calendar_example_06.png:0.0 \ 285calendar_example_06:calendar_example_06.png:0.0 \
272 datetime_example:datetime_example.png:0.0 \ 286datetime_example:datetime_example.png:0.0 \
273 map_example_01:map_example_01.png:2 \ 287map_example_01:map_example_01.png:2 \
274 map_example_02:map_example_02.png:2.5 \ 288map_example_02:map_example_02.png:2.5 \
275 map_example_03:map_example_03.png:2 \ 289map_example_03:map_example_03.png:2 \
276 toolbar_example_01:toolbar_example_01.png:0.0 \ 290toolbar_example_01:toolbar_example_01.png:0.0 \
277 toolbar_example_02:toolbar_example_02.png:1 \ 291toolbar_example_02:toolbar_example_02.png:1 \
278 toolbar_example_03:toolbar_example_03.png:1 \ 292toolbar_example_03:toolbar_example_03.png:1 \
279 spinner_example:spinner_example.png:0.0 \ 293spinner_example:spinner_example.png:0.0 \
280 clock_example:clock_example.png:0.5 \ 294clock_example:clock_example.png:0.5 \
281 dayselector_example:dayselector_example.png:0.0 \ 295dayselector_example:dayselector_example.png:0.0 \
282 mapbuf_example:mapbuf_example.png:0.0 \ 296mapbuf_example:mapbuf_example.png:0.0 \
283 image_example_01:image_example_01.png:0.0 \ 297image_example_01:image_example_01.png:0.0 \
284 diskselector_example_01:diskselector_example_01.png:0.2 \ 298diskselector_example_01:diskselector_example_01.png:0.2 \
285 diskselector_example_02:diskselector_example_02.png:0.2 \ 299diskselector_example_02:diskselector_example_02.png:0.2 \
286 icon_example_01:icon_example_01.png:0.0 \ 300icon_example_01:icon_example_01.png:0.0 \
287 layout_example_01:layout_example_01.png:0.0 \ 301layout_example_01:layout_example_01.png:0.0 \
288 layout_example_02:layout_example_02.png:0.0 \ 302layout_example_02:layout_example_02.png:0.0 \
289 layout_example_03:layout_example_03.png:0.0 \ 303layout_example_03:layout_example_03.png:0.0 \
290 list_example_01:list_example_01.png:0.0 \ 304list_example_01:list_example_01.png:0.0 \
291 list_example_02:list_example_02.png:0.0 \ 305list_example_02:list_example_02.png:0.0 \
292 list_example_03:list_example_03.png:0.0 \ 306list_example_03:list_example_03.png:0.0 \
293 segment_control_example:segment_control_example.png:0.0 \ 307segment_control_example:segment_control_example.png:0.0 \
294 flipselector_example:flipselector_example.png:0.0 \ 308flipselector_example:flipselector_example.png:0.0 \
295 fileselector_example:fileselector_example.png:0.0 \ 309fileselector_example:fileselector_example.png:0.0 \
296 index_example_02:index_example_03.png:0.3 \ 310index_example_02:index_example_03.png:0.3 \
297 slider_example:slider_example.png:0.0 \ 311slider_example:slider_example.png:0.0 \
298 panes_example:panes_example.png:0.0 \ 312panes_example:panes_example.png:0.0 \
299 ctxpopup_example_01:ctxpopup_example_01.png:0.0 \ 313ctxpopup_example_01:ctxpopup_example_01.png:0.0 \
300 separator_example_01:separator_example_01.png:0.0 \ 314separator_example_01:separator_example_01.png:0.0 \
301 radio_example_01:radio_example_01.png:0.0 \ 315radio_example_01:radio_example_01.png:0.0 \
302 panel_example_01:panel_example_01.png:0.0 \ 316panel_example_01:panel_example_01.png:0.0 \
303 gengrid_example:gengrid_example.png:0.0 \ 317gengrid_example:gengrid_example.png:0.0 \
304 genlist_example_01:genlist_example_01.png:0.1 \ 318genlist_example_01:genlist_example_01.png:0.1 \
305 genlist_example_02:genlist_example_02.png:0.1 \ 319genlist_example_02:genlist_example_02.png:0.1 \
306 genlist_example_03:genlist_example_03.png:0.1 \ 320genlist_example_03:genlist_example_03.png:0.1 \
307 genlist_example_04:genlist_example_04.png:0.1 \ 321genlist_example_04:genlist_example_04.png:0.1 \
308 genlist_example_05:genlist_example_05.png:0.1 \ 322genlist_example_05:genlist_example_05.png:0.1 \
309 thumb_example_01:thumb_example_01.png:0.5 \ 323thumb_example_01:thumb_example_01.png:0.5 \
310 entry_example:entry_example.png:0.0 \ 324entry_example:entry_example.png:0.0 \
311 progressbar_example:progressbar_example.png:0.0 \ 325progressbar_example:progressbar_example.png:0.0 \
312 notify_example_01:notify_example_01.png:0.0 \ 326notify_example_01:notify_example_01.png:0.0 \
313 notify_example_01:notify_example_01_a.png:6.0 \ 327notify_example_01:notify_example_01_a.png:6.0 \
314 popup_example_01:popup_example_01.png:1.0 \ 328popup_example_01:popup_example_01.png:1.0 \
315 popup_example_01:popup_example_01_a.png:6.0 \ 329popup_example_01:popup_example_01_a.png:6.0 \
316 popup_example_02:popup_example_02.png:0.2 \ 330popup_example_02:popup_example_02.png:0.2 \
317 popup_example_03:popup_example_03.png:0.2 \ 331popup_example_03:popup_example_03.png:0.2 \
318 slideshow_example:slideshow_example.png:1.0 \ 332slideshow_example:slideshow_example.png:1.0 \
319 photocam_example_01:photocam_example_01.png:3 \ 333photocam_example_01:photocam_example_01.png:3 \
320 scroller_example_01:scroller_example_01.png:0.0 \ 334scroller_example_01:scroller_example_01.png:0.0 \
321 inwin_example:inwin_example.png:0.0 \ 335inwin_example:inwin_example.png:0.0 \
322 inwin_example:inwin_example_a.png:0.2 \ 336inwin_example:inwin_example_a.png:0.2 \
323 table_example_01:table_example_01.png:0.0 \ 337table_example_01:table_example_01.png:0.0 \
324 table_example_02:table_example_02.png:0.0 \ 338table_example_02:table_example_02.png:0.0 \
325 menu_example_01:menu_example_01.png:0.5 339menu_example_01:menu_example_01.png:0.5
326 340
327HTML_SS_DIR=$(top_builddir)/doc/html/screenshots 341HTML_SS_DIR=$(top_builddir)/doc/html/screenshots
328LATEX_SS_DIR=$(top_builddir)/doc/latex/screenshots 342LATEX_SS_DIR=$(top_builddir)/doc/latex/screenshots
diff --git a/legacy/elementary/src/examples/efl_thread_1.c b/legacy/elementary/src/examples/efl_thread_1.c
index 48ea3d263b..baa67aeb46 100644
--- a/legacy/elementary/src/examples/efl_thread_1.c
+++ b/legacy/elementary/src/examples/efl_thread_1.c
@@ -14,13 +14,13 @@ static void *
14my_thread_run(void *arg) 14my_thread_run(void *arg)
15{ 15{
16 double t = 0.0; 16 double t = 0.0;
17 17
18 for (;;) 18 for (;;)
19 { 19 {
20 ecore_thread_main_loop_begin(); // begin critical 20 ecore_thread_main_loop_begin(); // begin critical
21 { // indented for illustration of "critical" block 21 { // indented for illustration of "critical" block
22 Evas_Coord x, y; 22 Evas_Coord x, y;
23 23
24 x = 200 + (200 * sin(t)); 24 x = 200 + (200 * sin(t));
25 y = 200 + (200 * cos(t)); 25 y = 200 + (200 * cos(t));
26 evas_object_move(rect, x - 50, y - 50); 26 evas_object_move(rect, x - 50, y - 50);
@@ -38,7 +38,7 @@ static void
38my_thread_new(void) 38my_thread_new(void)
39{ 39{
40 pthread_attr_t attr; 40 pthread_attr_t attr;
41 41
42 if (pthread_attr_init(&attr) != 0) 42 if (pthread_attr_init(&attr) != 0)
43 perror("pthread_attr_init"); 43 perror("pthread_attr_init");
44 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0) 44 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0)
@@ -49,28 +49,28 @@ int
49elm_main(int argc, char **argv) 49elm_main(int argc, char **argv)
50{ 50{
51 Evas_Object *o, *bg; 51 Evas_Object *o, *bg;
52 52
53 win = elm_win_add(NULL, "efl-thread-1", ELM_WIN_BASIC); 53 win = elm_win_add(NULL, "efl-thread-1", ELM_WIN_BASIC);
54 elm_win_title_set(win, "EFL Thread 1"); 54 elm_win_title_set(win, "EFL Thread 1");
55 elm_win_autodel_set(win, EINA_TRUE); 55 elm_win_autodel_set(win, EINA_TRUE);
56 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 56 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
57 evas_object_resize(win, 400, 400); 57 evas_object_resize(win, 400, 400);
58 evas_object_show(win); 58 evas_object_show(win);
59 59
60 bg = elm_bg_add(win); 60 bg = elm_bg_add(win);
61 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 61 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 elm_win_resize_object_add(win, bg); 62 elm_win_resize_object_add(win, bg);
63 evas_object_show(bg); 63 evas_object_show(bg);
64 64
65 o = evas_object_rectangle_add(evas_object_evas_get(win)); 65 o = evas_object_rectangle_add(evas_object_evas_get(win));
66 evas_object_color_set(o, 50, 80, 180, 255); 66 evas_object_color_set(o, 50, 80, 180, 255);
67 evas_object_resize(o, 100, 100); 67 evas_object_resize(o, 100, 100);
68 evas_object_show(o); 68 evas_object_show(o);
69 rect = o; 69 rect = o;
70 70
71 // create custom thread to do some "work on the side" 71 // create custom thread to do some "work on the side"
72 my_thread_new(); 72 my_thread_new();
73 73
74 elm_run(); 74 elm_run();
75 return 0; 75 return 0;
76} 76}
diff --git a/legacy/elementary/src/examples/efl_thread_2.c b/legacy/elementary/src/examples/efl_thread_2.c
index 1bca6bc63a..a7c7493a07 100644
--- a/legacy/elementary/src/examples/efl_thread_2.c
+++ b/legacy/elementary/src/examples/efl_thread_2.c
@@ -25,7 +25,7 @@ my_thread_run(void *arg)
25 for (;;) 25 for (;;)
26 { 26 {
27 struct info *inf = malloc(sizeof(struct info)); 27 struct info *inf = malloc(sizeof(struct info));
28 28
29 if (inf) 29 if (inf)
30 { 30 {
31 inf->x = 200 + (200 * sin(t)); 31 inf->x = 200 + (200 * sin(t));
@@ -45,7 +45,7 @@ static void
45my_thread_new(void) 45my_thread_new(void)
46{ 46{
47 pthread_attr_t attr; 47 pthread_attr_t attr;
48 48
49 if (pthread_attr_init(&attr) != 0) 49 if (pthread_attr_init(&attr) != 0)
50 perror("pthread_attr_init"); 50 perror("pthread_attr_init");
51 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0) 51 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0)
@@ -65,30 +65,30 @@ int
65elm_main(int argc, char **argv) 65elm_main(int argc, char **argv)
66{ 66{
67 Evas_Object *o, *bg; 67 Evas_Object *o, *bg;
68 68
69 win = elm_win_add(NULL, "efl-thread-2", ELM_WIN_BASIC); 69 win = elm_win_add(NULL, "efl-thread-2", ELM_WIN_BASIC);
70 elm_win_title_set(win, "EFL Thread 2"); 70 elm_win_title_set(win, "EFL Thread 2");
71 elm_win_autodel_set(win, EINA_TRUE); 71 elm_win_autodel_set(win, EINA_TRUE);
72 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 72 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
73 evas_object_resize(win, 400, 400); 73 evas_object_resize(win, 400, 400);
74 evas_object_show(win); 74 evas_object_show(win);
75 75
76 bg = elm_bg_add(win); 76 bg = elm_bg_add(win);
77 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 77 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 elm_win_resize_object_add(win, bg); 78 elm_win_resize_object_add(win, bg);
79 evas_object_show(bg); 79 evas_object_show(bg);
80 80
81 o = evas_object_rectangle_add(evas_object_evas_get(win)); 81 o = evas_object_rectangle_add(evas_object_evas_get(win));
82 evas_object_color_set(o, 50, 80, 180, 255); 82 evas_object_color_set(o, 50, 80, 180, 255);
83 evas_object_resize(o, 100, 100); 83 evas_object_resize(o, 100, 100);
84 evas_object_show(o); 84 evas_object_show(o);
85 rect = o; 85 rect = o;
86 86
87 // create custom thread to do some "work on the side" 87 // create custom thread to do some "work on the side"
88 my_thread_new(); 88 my_thread_new();
89 89
90 elm_run(); 90 elm_run();
91 return 0; 91 return 0;
92} 92}
93 93
94ELM_MAIN() 94ELM_MAIN()
diff --git a/legacy/elementary/src/examples/efl_thread_3.c b/legacy/elementary/src/examples/efl_thread_3.c
index 299776ae65..cdaa2adf63 100644
--- a/legacy/elementary/src/examples/efl_thread_3.c
+++ b/legacy/elementary/src/examples/efl_thread_3.c
@@ -26,7 +26,7 @@ my_thread_run(void *arg)
26 for (;;) 26 for (;;)
27 { 27 {
28 struct info *inf = malloc(sizeof(struct info)); 28 struct info *inf = malloc(sizeof(struct info));
29 29
30 if (inf) 30 if (inf)
31 { 31 {
32 inf->x = 200 + (200 * sin(t)); 32 inf->x = 200 + (200 * sin(t));
@@ -48,7 +48,7 @@ static void
48my_thread_new(void) 48my_thread_new(void)
49{ 49{
50 pthread_attr_t attr; 50 pthread_attr_t attr;
51 51
52 if (pthread_attr_init(&attr) != 0) 52 if (pthread_attr_init(&attr) != 0)
53 perror("pthread_attr_init"); 53 perror("pthread_attr_init");
54 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0) 54 if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0)
@@ -67,31 +67,30 @@ int
67elm_main(int argc, char **argv) 67elm_main(int argc, char **argv)
68{ 68{
69 Evas_Object *o, *bg; 69 Evas_Object *o, *bg;
70 70
71 win = elm_win_add(NULL, "efl-thread-3", ELM_WIN_BASIC); 71 win = elm_win_add(NULL, "efl-thread-3", ELM_WIN_BASIC);
72 elm_win_title_set(win, "EFL Thread 3"); 72 elm_win_title_set(win, "EFL Thread 3");
73 elm_win_autodel_set(win, EINA_TRUE); 73 elm_win_autodel_set(win, EINA_TRUE);
74 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 74 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
75 evas_object_resize(win, 400, 400); 75 evas_object_resize(win, 400, 400);
76 evas_object_show(win); 76 evas_object_show(win);
77 77
78 bg = elm_bg_add(win); 78 bg = elm_bg_add(win);
79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
80 elm_win_resize_object_add(win, bg); 80 elm_win_resize_object_add(win, bg);
81 evas_object_show(bg); 81 evas_object_show(bg);
82 82
83 o = evas_object_rectangle_add(evas_object_evas_get(win)); 83 o = evas_object_rectangle_add(evas_object_evas_get(win));
84 evas_object_color_set(o, 50, 80, 180, 255); 84 evas_object_color_set(o, 50, 80, 180, 255);
85 evas_object_resize(o, 100, 100); 85 evas_object_resize(o, 100, 100);
86 evas_object_show(o); 86 evas_object_show(o);
87 rect = o; 87 rect = o;
88 88
89 // create custom thread to do some "work on the side" 89 // create custom thread to do some "work on the side"
90 my_thread_new(); 90 my_thread_new();
91 91
92 elm_run(); 92 elm_run();
93 return 0; 93 return 0;
94} 94}
95 95
96ELM_MAIN() 96ELM_MAIN()
97
diff --git a/legacy/elementary/src/examples/efl_thread_4.c b/legacy/elementary/src/examples/efl_thread_4.c
index ddb2368918..eca9c4c40e 100644
--- a/legacy/elementary/src/examples/efl_thread_4.c
+++ b/legacy/elementary/src/examples/efl_thread_4.c
@@ -29,7 +29,7 @@ my_thread_run(void *arg)
29 { 29 {
30 struct info *inf = malloc(sizeof(struct info)); 30 struct info *inf = malloc(sizeof(struct info));
31 int do_exit; 31 int do_exit;
32 32
33 if (inf) 33 if (inf)
34 { 34 {
35 inf->x = 200 + (200 * sin(t)); 35 inf->x = 200 + (200 * sin(t));
@@ -87,14 +87,14 @@ int
87elm_main(int argc, char **argv) 87elm_main(int argc, char **argv)
88{ 88{
89 Evas_Object *o, *bg; 89 Evas_Object *o, *bg;
90 90
91 win = elm_win_add(NULL, "efl-thread-4", ELM_WIN_BASIC); 91 win = elm_win_add(NULL, "efl-thread-4", ELM_WIN_BASIC);
92 elm_win_title_set(win, "EFL Thread 4"); 92 elm_win_title_set(win, "EFL Thread 4");
93 elm_win_autodel_set(win, EINA_TRUE); 93 elm_win_autodel_set(win, EINA_TRUE);
94 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 94 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
95 evas_object_resize(win, 400, 400); 95 evas_object_resize(win, 400, 400);
96 evas_object_show(win); 96 evas_object_show(win);
97 97
98 bg = elm_bg_add(win); 98 bg = elm_bg_add(win);
99 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 99 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
100 elm_win_resize_object_add(win, bg); 100 elm_win_resize_object_add(win, bg);
@@ -108,13 +108,12 @@ elm_main(int argc, char **argv)
108 // the thread 108 // the thread
109 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL); 109 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
110 rect = o; 110 rect = o;
111 111
112 // create custom thread to do some "work on the side" 112 // create custom thread to do some "work on the side"
113 my_thread_new(); 113 my_thread_new();
114 114
115 elm_run(); 115 elm_run();
116 return 0; 116 return 0;
117} 117}
118 118
119ELM_MAIN() 119ELM_MAIN()
120
diff --git a/legacy/elementary/src/examples/efl_thread_5.c b/legacy/elementary/src/examples/efl_thread_5.c
index 4f17ef57a2..8e64dd237b 100644
--- a/legacy/elementary/src/examples/efl_thread_5.c
+++ b/legacy/elementary/src/examples/efl_thread_5.c
@@ -12,18 +12,18 @@ struct info
12 double x, y; 12 double x, y;
13}; 13};
14 14
15// BEGIN - code running in my custom pthread instance 15// BEGIN - code running in my custom thread instance
16// 16//
17static void 17static void
18th_do(void *data, Ecore_Thread *th) 18th_do(void *data, Ecore_Thread *th)
19{ 19{
20 double t = 0.0; 20 double t = 0.0;
21 21
22 // inside our "do" function for the ecore thread, lets do the real work 22 // inside our "do" function for the ecore thread, lets do the real work
23 for (;;) 23 for (;;)
24 { 24 {
25 struct info *inf = malloc(sizeof(struct info)); 25 struct info *inf = malloc(sizeof(struct info));
26 26
27 if (inf) 27 if (inf)
28 { 28 {
29 inf->x = 200 + (200 * sin(t)); 29 inf->x = 200 + (200 * sin(t));
@@ -41,7 +41,7 @@ th_do(void *data, Ecore_Thread *th)
41 } 41 }
42} 42}
43// 43//
44// END - code running in my custom pthread instance 44// END - code running in my custom thread instance
45 45
46static void // when mainloop gets feedback from worker 46static void // when mainloop gets feedback from worker
47th_feedback(void *data, Ecore_Thread *th, void *msg) 47th_feedback(void *data, Ecore_Thread *th, void *msg)
@@ -67,26 +67,26 @@ int
67elm_main(int argc, char **argv) 67elm_main(int argc, char **argv)
68{ 68{
69 Evas_Object *o, *bg; 69 Evas_Object *o, *bg;
70 70
71 win = elm_win_add(NULL, "efl-thread-5", ELM_WIN_BASIC); 71 win = elm_win_add(NULL, "efl-thread-5", ELM_WIN_BASIC);
72 elm_win_title_set(win, "EFL Thread 5"); 72 elm_win_title_set(win, "EFL Thread 5");
73 elm_win_autodel_set(win, EINA_TRUE); 73 elm_win_autodel_set(win, EINA_TRUE);
74 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 74 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
75 evas_object_resize(win, 400, 400); 75 evas_object_resize(win, 400, 400);
76 evas_object_show(win); 76 evas_object_show(win);
77 77
78 bg = elm_bg_add(win); 78 bg = elm_bg_add(win);
79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
80 elm_win_resize_object_add(win, bg); 80 elm_win_resize_object_add(win, bg);
81 evas_object_show(bg); 81 evas_object_show(bg);
82 82
83 o = evas_object_rectangle_add(evas_object_evas_get(win)); 83 o = evas_object_rectangle_add(evas_object_evas_get(win));
84 evas_object_color_set(o, 50, 80, 180, 255); 84 evas_object_color_set(o, 50, 80, 180, 255);
85 evas_object_resize(o, 100, 100); 85 evas_object_resize(o, 100, 100);
86 evas_object_show(o); 86 evas_object_show(o);
87 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL); 87 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
88 rect = o; 88 rect = o;
89 89
90 // explicitly create ecore thread to do some "work on the side" and pass 90 // explicitly create ecore thread to do some "work on the side" and pass
91 // in NULL as data ptr to callbacks and true at the end means to actually 91 // in NULL as data ptr to callbacks and true at the end means to actually
92 // make a new thread and not use the thread pool (there is a thread pool 92 // make a new thread and not use the thread pool (there is a thread pool
@@ -94,7 +94,7 @@ elm_main(int argc, char **argv)
94 // overload the cpu's with more work than you actually have processing 94 // overload the cpu's with more work than you actually have processing
95 // units *IF* your threads do actually spend their time doing actual 95 // units *IF* your threads do actually spend their time doing actual
96 // heavy computation) 96 // heavy computation)
97 th = ecore_thread_feedback_run(th_do, th_feedback, th_end, th_cancel, 97 th = ecore_thread_feedback_run(th_do, th_feedback, th_end, th_cancel,
98 NULL, EINA_TRUE); 98 NULL, EINA_TRUE);
99 elm_run(); 99 elm_run();
100 return 0; 100 return 0;
diff --git a/legacy/elementary/src/examples/efl_thread_6.c b/legacy/elementary/src/examples/efl_thread_6.c
index 2d47fb22ea..6f40862049 100644
--- a/legacy/elementary/src/examples/efl_thread_6.c
+++ b/legacy/elementary/src/examples/efl_thread_6.c
@@ -11,7 +11,7 @@ struct info
11 int *pix; 11 int *pix;
12}; 12};
13 13
14// BEGIN - code running in my custom pthread instance 14// BEGIN - code running in my custom thread instance
15// 15//
16static void 16static void
17mandel(int *pix, int w, int h) 17mandel(int *pix, int w, int h)
@@ -48,12 +48,12 @@ mandel(int *pix, int w, int h)
48 } 48 }
49 val = (((x * x) + (y * y)) * 2.55) / 100.0; 49 val = (((x * x) + (y * y)) * 2.55) / 100.0;
50 if (val > 255) val = 255; 50 if (val > 255) val = 255;
51 if (iteration >= 99999) 51 if (iteration >= 99999)
52 { 52 {
53 rr = (r * val) / 255; 53 rr = (r * val) / 255;
54 gg = (g * val) / 255; 54 gg = (g * val) / 255;
55 bb = (b * val) / 255; 55 bb = (b * val) / 255;
56 pix[(hy * w) + hx] = 56 pix[(hy * w) + hx] =
57 (val << 24) | (rr << 16) | (gg << 8) | (bb); 57 (val << 24) | (rr << 16) | (gg << 8) | (bb);
58 } 58 }
59 else 59 else
@@ -71,7 +71,7 @@ th_do(void *data, Ecore_Thread *th)
71 mandel(inf->pix, 256, 256); 71 mandel(inf->pix, 256, 256);
72} 72}
73// 73//
74// END - code running in my custom pthread instance 74// END - code running in my custom thread instance
75 75
76static void // thread job finished - collect results and put in img obj 76static void // thread job finished - collect results and put in img obj
77th_end(void *data, Ecore_Thread *th) 77th_end(void *data, Ecore_Thread *th)
@@ -165,4 +165,3 @@ elm_main(int argc, char **argv)
165} 165}
166 166
167ELM_MAIN() 167ELM_MAIN()
168
diff --git a/legacy/elementary/src/examples/efl_thread_win32_1.c b/legacy/elementary/src/examples/efl_thread_win32_1.c
new file mode 100644
index 0000000000..75d8465b81
--- /dev/null
+++ b/legacy/elementary/src/examples/efl_thread_win32_1.c
@@ -0,0 +1,83 @@
1//Compile with:
2//gcc -o efl_thread_1 efl_thread_win32_1.c -g `pkg-config --cflags --libs elementary`
3#include <Elementary.h>
4#define WIN32_LEAN_AND_MEAN
5#include <windows.h>
6
7static Evas_Object *win = NULL;
8static Evas_Object *rect = NULL;
9
10static HANDLE thread;
11
12// BEGIN - code running in my custom win32 thread instance
13//
14static DWORD WINAPI
15my_thread_run(LPVOID arg)
16{
17 double t = 0.0;
18
19 for (;;)
20 {
21 ecore_thread_main_loop_begin(); // begin critical
22 { // indented for illustration of "critical" block
23 Evas_Coord x, y;
24
25 x = 200 + (200 * sin(t));
26 y = 200 + (200 * cos(t));
27 evas_object_move(rect, x - 50, y - 50);
28 }
29 ecore_thread_main_loop_end(); // end critical
30 usleep(1000);
31 t += 0.02;
32 }
33 return 0;
34}
35//
36// END - code running in my custom win32 thread instance
37
38static void
39my_thread_new(void)
40{
41 thread = CreateThread(NULL, 0, my_thread_run, NULL, 0, NULL);
42 if (!thread)
43 {
44 char *str = evil_last_error_get();
45 if (str)
46 {
47 fprintf("thread creation failed: %s\n", str);
48 free(str);
49 }
50 }
51}
52
53int
54elm_main(int argc, char **argv)
55{
56 Evas_Object *o, *bg;
57
58 win = elm_win_add(NULL, "efl-thread-1", ELM_WIN_BASIC);
59 elm_win_title_set(win, "EFL Thread 1");
60 elm_win_autodel_set(win, EINA_TRUE);
61 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
62 evas_object_resize(win, 400, 400);
63 evas_object_show(win);
64
65 bg = elm_bg_add(win);
66 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
67 elm_win_resize_object_add(win, bg);
68 evas_object_show(bg);
69
70 o = evas_object_rectangle_add(evas_object_evas_get(win));
71 evas_object_color_set(o, 50, 80, 180, 255);
72 evas_object_resize(o, 100, 100);
73 evas_object_show(o);
74 rect = o;
75
76 // create custom thread to do some "work on the side"
77 my_thread_new();
78
79 elm_run();
80 return 0;
81}
82
83ELM_MAIN()
diff --git a/legacy/elementary/src/examples/efl_thread_win32_2.c b/legacy/elementary/src/examples/efl_thread_win32_2.c
new file mode 100644
index 0000000000..a84c242a15
--- /dev/null
+++ b/legacy/elementary/src/examples/efl_thread_win32_2.c
@@ -0,0 +1,99 @@
1//Compile with:
2//gcc -o efl_thread_2 efl_thread_win32_2.c -g `pkg-config --cflags --libs elementary`
3#include <Elementary.h>
4#define WIN32_LEAN_AND_MEAN
5#include <windows.h>
6
7static Evas_Object *win = NULL;
8static Evas_Object *rect = NULL;
9
10struct info
11{
12 double x, y;
13};
14
15static void *my_thread_mainloop_code(void *data);
16
17static HANDLE thread;
18
19// BEGIN - code running in my custom win32 thread instance
20//
21static DWORD WINAPI
22my_thread_run(LPVOID arg)
23{
24 double t = 0.0;
25
26 for (;;)
27 {
28 struct info *inf = malloc(sizeof(struct info));
29
30 if (inf)
31 {
32 inf->x = 200 + (200 * sin(t));
33 inf->y = 200 + (200 * cos(t));
34 ecore_main_loop_thread_safe_call_sync
35 (my_thread_mainloop_code, inf);
36 }
37 // and sleep and loop
38 usleep(1000);
39 t += 0.02;
40 }
41 return 0;
42}
43//
44// END - code running in my custom win32 thread instance
45static void
46my_thread_new(void)
47{
48 thread = CreateThread(NULL, 0, my_thread_run, NULL, 0, NULL);
49 if (!thread)
50 {
51 char *str = evil_last_error_get();
52 if (str)
53 {
54 fprintf("thread creation failed: %s\n", str);
55 free(str);
56 }
57 }
58}
59
60static void *
61my_thread_mainloop_code(void *data)
62{
63 struct info *inf = data;
64 evas_object_move(rect, inf->x - 50, inf->y - 50);
65 free(inf);
66 return NULL;
67}
68
69int
70elm_main(int argc, char **argv)
71{
72 Evas_Object *o, *bg;
73
74 win = elm_win_add(NULL, "efl-thread-2", ELM_WIN_BASIC);
75 elm_win_title_set(win, "EFL Thread 2");
76 elm_win_autodel_set(win, EINA_TRUE);
77 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
78 evas_object_resize(win, 400, 400);
79 evas_object_show(win);
80
81 bg = elm_bg_add(win);
82 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
83 elm_win_resize_object_add(win, bg);
84 evas_object_show(bg);
85
86 o = evas_object_rectangle_add(evas_object_evas_get(win));
87 evas_object_color_set(o, 50, 80, 180, 255);
88 evas_object_resize(o, 100, 100);
89 evas_object_show(o);
90 rect = o;
91
92 // create custom thread to do some "work on the side"
93 my_thread_new();
94
95 elm_run();
96 return 0;
97}
98
99ELM_MAIN()
diff --git a/legacy/elementary/src/examples/efl_thread_win32_3.c b/legacy/elementary/src/examples/efl_thread_win32_3.c
new file mode 100644
index 0000000000..bda24050dc
--- /dev/null
+++ b/legacy/elementary/src/examples/efl_thread_win32_3.c
@@ -0,0 +1,101 @@
1//Compile with:
2//gcc -o efl_thread_3 efl_thread_win32_3.c -g `pkg-config --cflags --libs elementary`
3#include <Elementary.h>
4#define WIN32_LEAN_AND_MEAN
5#include <windows.h>
6
7static Evas_Object *win = NULL;
8static Evas_Object *rect = NULL;
9
10struct info
11{
12 double x, y;
13};
14
15static void my_thread_mainloop_code(void *data);
16
17static HANDLE thread;
18
19// BEGIN - code running in my custom win32 thread instance
20//
21static DWORD WINAPI
22my_thread_run(LPVOID arg)
23{
24 double t = 0.0;
25
26 // inside the thread function lets loop forever incrimenting a time point
27 for (;;)
28 {
29 struct info *inf = malloc(sizeof(struct info));
30
31 if (inf)
32 {
33 inf->x = 200 + (200 * sin(t));
34 inf->y = 200 + (200 * cos(t));
35 // now call a function in the mainloop and pass it our allocated
36 // data that it will free when it gets it
37 ecore_main_loop_thread_safe_call_async
38 (my_thread_mainloop_code, inf);
39 }
40 // and sleep and loop
41 usleep(1000);
42 t += 0.02;
43 }
44 return NULL;
45}
46//
47// END - code running in my custom win32 thread instance
48static void
49my_thread_new(void)
50{
51 thread = CreateThread(NULL, 0, my_thread_run, NULL, 0, NULL);
52 if (!thread)
53 {
54 char *str = evil_last_error_get();
55 if (str)
56 {
57 fprintf("thread creation failed: %s\n", str);
58 free(str);
59 }
60 }
61}
62
63static void
64my_thread_mainloop_code(void *data)
65{
66 struct info *inf = data;
67 evas_object_move(rect, inf->x - 50, inf->y - 50);
68 free(inf);
69}
70
71int
72elm_main(int argc, char **argv)
73{
74 Evas_Object *o, *bg;
75
76 win = elm_win_add(NULL, "efl-thread-3", ELM_WIN_BASIC);
77 elm_win_title_set(win, "EFL Thread 3");
78 elm_win_autodel_set(win, EINA_TRUE);
79 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
80 evas_object_resize(win, 400, 400);
81 evas_object_show(win);
82
83 bg = elm_bg_add(win);
84 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
85 elm_win_resize_object_add(win, bg);
86 evas_object_show(bg);
87
88 o = evas_object_rectangle_add(evas_object_evas_get(win));
89 evas_object_color_set(o, 50, 80, 180, 255);
90 evas_object_resize(o, 100, 100);
91 evas_object_show(o);
92 rect = o;
93
94 // create custom thread to do some "work on the side"
95 my_thread_new();
96
97 elm_run();
98 return 0;
99}
100
101ELM_MAIN()
diff --git a/legacy/elementary/src/examples/efl_thread_win32_4.c b/legacy/elementary/src/examples/efl_thread_win32_4.c
new file mode 100644
index 0000000000..4b1171be2f
--- /dev/null
+++ b/legacy/elementary/src/examples/efl_thread_win32_4.c
@@ -0,0 +1,125 @@
1//Compile with:
2//gcc -o efl_thread_4 efl_thread_win32_4.c -g `pkg-config --cflags --libs elementary`
3#include <Elementary.h>
4#define WIN32_LEAN_AND_MEAN
5#include <windows.h>
6
7static Evas_Object *win = NULL;
8static Evas_Object *rect = NULL;
9
10struct info
11{
12 double x, y;
13};
14
15static void my_thread_mainloop_code(void *data);
16
17static HANDLE thread;
18static CRITICAL_SECTION lock;
19static int th_exit = 0;
20
21// BEGIN - code running in my custom win32 thread instance
22//
23static DWORD WINAPI
24my_thread_run(LPVOID arg)
25{
26 double t = 0.0;
27
28 // inside the thread function lets loop forever incrimenting a time point
29 for (;;)
30 {
31 struct info *inf = malloc(sizeof(struct info));
32 int do_exit;
33
34 if (inf)
35 {
36 inf->x = 200 + (200 * sin(t));
37 inf->y = 200 + (200 * cos(t));
38 // now call a function in the mainloop and pass it our allocated
39 // data that it will free when it gets it
40 ecore_main_loop_thread_safe_call_async
41 (my_thread_mainloop_code, inf);
42 }
43 // and sleep and loop
44 usleep(1000);
45 t += 0.02;
46 // in case someone has asked us to cancel - then cancel this loop
47 // co-operatively (cancelling is co-operative)
48 EnterCriticalSection(&lock);
49 do_exit = th_exit;
50 LeaveCriticalSection(&lock);
51 if (do_exit) break;
52 }
53 DeleteCriticalSection(&lock);
54 return NULL;
55}
56//
57// END - code running in my custom win32 thread instance
58
59static void
60my_thread_new(void)
61{
62 InitializeCriticalSection(&lock);
63 thread = CreateThread(NULL, 0, my_thread_run, NULL, 0, NULL);
64 if (!thread)
65 {
66 char *str = evil_last_error_get();
67 if (str)
68 {
69 fprintf("thread creation failed: %s\n", str);
70 free(str);
71 }
72 }
73}
74
75static void
76my_thread_mainloop_code(void *data)
77{
78 struct info *inf = data;
79 evas_object_move(rect, inf->x - 50, inf->y - 50);
80 free(inf);
81}
82
83// just test cancelling the thread
84static void
85down(void *data, Evas *e, Evas_Object *obj, void *event_info)
86{
87 EnterCriticalSection(&lock);
88 th_exit = 1;
89 LeaveCriticalSection(&lock);
90}
91
92int
93elm_main(int argc, char **argv)
94{
95 Evas_Object *o, *bg;
96
97 win = elm_win_add(NULL, "efl-thread-4", ELM_WIN_BASIC);
98 elm_win_title_set(win, "EFL Thread 4");
99 elm_win_autodel_set(win, EINA_TRUE);
100 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
101 evas_object_resize(win, 400, 400);
102 evas_object_show(win);
103
104 bg = elm_bg_add(win);
105 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
106 elm_win_resize_object_add(win, bg);
107 evas_object_show(bg);
108
109 o = evas_object_rectangle_add(evas_object_evas_get(win));
110 evas_object_color_set(o, 50, 80, 180, 255);
111 evas_object_resize(o, 100, 100);
112 evas_object_show(o);
113 // new in the examples - we have a mouse down on the blue box cancel
114 // the thread
115 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
116 rect = o;
117
118 // create custom thread to do some "work on the side"
119 my_thread_new();
120
121 elm_run();
122 return 0;
123}
124
125ELM_MAIN()