Themes
[xdock.git] / www / tutorial2.svg
blobc958c89c056b274f68a0f6101580b16a9281d021
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!-- Created with Inkscape (http://www.inkscape.org/) -->
3 <svg
4 xmlns:dc="http://purl.org/dc/elements/1.1/"
5 xmlns:cc="http://web.resource.org/cc/"
6 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7 xmlns:svg="http://www.w3.org/2000/svg"
8 xmlns="http://www.w3.org/2000/svg"
9 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
10 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11 width="210mm"
12 height="297mm"
13 id="svg2"
14 sodipodi:version="0.32"
15 inkscape:version="0.45.1"
16 sodipodi:docbase="/home/andre/projects/xdock/www"
17 sodipodi:docname="tutorial2.svg"
18 inkscape:output_extension="org.inkscape.output.svg.inkscape"
19 inkscape:export-filename="/home/andre/projects/xdock/www/tutorial2.png"
20 inkscape:export-xdpi="155.75999"
21 inkscape:export-ydpi="155.75999">
22 <defs
23 id="defs4">
24 <marker
25 inkscape:stockid="Arrow2Lend"
26 orient="auto"
27 refY="0.0"
28 refX="0.0"
29 id="Arrow2Lend"
30 style="overflow:visible;">
31 <path
32 id="path4575"
33 style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
34 d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
35 transform="scale(1.1) rotate(180) translate(1,0)" />
36 </marker>
37 <marker
38 inkscape:stockid="Arrow2Mend"
39 orient="auto"
40 refY="0.0"
41 refX="0.0"
42 id="Arrow2Mend"
43 style="overflow:visible;">
44 <path
45 id="path3685"
46 style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
47 d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
48 transform="scale(0.6) rotate(180) translate(0,0)" />
49 </marker>
50 </defs>
51 <sodipodi:namedview
52 id="base"
53 pagecolor="#ffffff"
54 bordercolor="#666666"
55 borderopacity="1.0"
56 inkscape:pageopacity="0.0"
57 inkscape:pageshadow="2"
58 inkscape:zoom="1.4"
59 inkscape:cx="370.85253"
60 inkscape:cy="736.49022"
61 inkscape:document-units="px"
62 inkscape:current-layer="layer1"
63 inkscape:window-width="1280"
64 inkscape:window-height="725"
65 inkscape:window-x="0"
66 inkscape:window-y="25" />
67 <metadata
68 id="metadata7">
69 <rdf:RDF>
70 <cc:Work
71 rdf:about="">
72 <dc:format>image/svg+xml</dc:format>
73 <dc:type
74 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
75 </cc:Work>
76 </rdf:RDF>
77 </metadata>
79 inkscape:label="Camada 1"
80 inkscape:groupmode="layer"
81 id="layer1">
82 <text
83 xml:space="preserve"
84 style="font-size:13px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Inconsolata"
85 x="9.285718"
86 y="172.36218"
87 id="text2160"><tspan
88 sodipodi:role="line"
89 id="tspan2162"
90 x="9.285718"
91 y="172.36218"
92 style="fill:#800080">#include &lt;xdock.h&gt;</tspan><tspan
93 sodipodi:role="line"
94 x="9.285718"
95 y="188.61218"
96 id="tspan2164"
97 style="fill:#800080">#include &lt;stdlib.h&gt;</tspan><tspan
98 sodipodi:role="line"
99 x="9.285718"
100 y="204.86218"
101 id="tspan2166"
102 style="fill:#800080">#include &lt;unistd.h&gt;</tspan><tspan
103 sodipodi:role="line"
104 x="9.285718"
105 y="221.11218"
106 id="tspan2168" /><tspan
107 sodipodi:role="line"
108 x="9.285718"
109 y="237.36218"
110 id="tspan2170"><tspan
111 style="fill:#008000"
112 id="tspan2297">int</tspan> main()</tspan><tspan
113 sodipodi:role="line"
114 x="9.285718"
115 y="253.61218"
116 id="tspan2172">{</tspan><tspan
117 sodipodi:role="line"
118 x="9.285718"
119 y="269.86218"
120 id="tspan2174"><tspan
121 style="fill:#008000"
122 id="tspan2299"> int</tspan> r;</tspan><tspan
123 sodipodi:role="line"
124 x="9.285718"
125 y="286.11218"
126 id="tspan2176"><tspan
127 style="fill:#008080"
128 id="tspan2303"> xd_connect</tspan>();</tspan><tspan
129 sodipodi:role="line"
130 x="9.285718"
131 y="302.36218"
132 id="tspan2178"><tspan
133 style="fill:#008080"
134 id="tspan2305"> xd_led_draw_panel</tspan>(<tspan
135 style="fill:#ff00ff"
136 id="tspan2315">5</tspan>, <tspan
137 style="fill:#ff00ff"
138 id="tspan2317">5</tspan>, <tspan
139 style="fill:#ff00ff"
140 id="tspan2319">58</tspan>, <tspan
141 style="fill:#ff00ff"
142 id="tspan2321">58</tspan>);</tspan><tspan
143 sodipodi:role="line"
144 x="9.285718"
145 y="318.61218"
146 id="tspan2180"><tspan
147 style="fill:#800000"
148 id="tspan2301"> while</tspan>(<tspan
149 style="fill:#ff00ff"
150 id="tspan2323">1</tspan>)</tspan><tspan
151 sodipodi:role="line"
152 x="9.285718"
153 y="334.86218"
154 id="tspan2182"> {</tspan><tspan
155 sodipodi:role="line"
156 x="9.285718"
157 y="351.11218"
158 id="tspan2184"> r = <tspan
159 style="fill:#ff00ff"
160 id="tspan2325">1</tspan> + (<tspan
161 style="fill:#800000"
162 id="tspan2327">int</tspan>)(<tspan
163 style="fill:#ff00ff"
164 id="tspan2329">55.0</tspan> * (rand() / (RAND_MAX + <tspan
165 style="fill:#ff00ff"
166 id="tspan2331">1.0</tspan>)));</tspan><tspan
167 sodipodi:role="line"
168 x="9.285718"
169 y="367.36218"
170 id="tspan2186"><tspan
171 style="fill:#008080"
172 id="tspan2307"> xd_move_box</tspan>(<tspan
173 style="fill:#ff00ff"
174 id="tspan2333">6</tspan>, <tspan
175 style="fill:#ff00ff"
176 id="tspan2335">6</tspan>, <tspan
177 style="fill:#ff00ff"
178 id="tspan2337">57</tspan>, <tspan
179 style="fill:#ff00ff"
180 id="tspan2339">57</tspan>, <tspan
181 style="fill:#ff00ff"
182 id="tspan2341">XD_LEFT</tspan>, <tspan
183 style="fill:#ff00ff"
184 id="tspan2343">1</tspan>, <tspan
185 style="fill:#ff00ff"
186 id="tspan2345">XD_LED_BG</tspan>);</tspan><tspan
187 sodipodi:role="line"
188 x="9.285718"
189 y="383.61218"
190 id="tspan2188"><tspan
191 style="fill:#008080"
192 id="tspan2309"> xd_draw_line</tspan>(<tspan
193 style="fill:#ff00ff"
194 id="tspan2347">XD_LED_LIT_1</tspan>, <tspan
195 style="fill:#ff00ff"
196 id="tspan2349">57</tspan>, <tspan
197 style="fill:#ff00ff"
198 id="tspan2351">57</tspan>, <tspan
199 style="fill:#ff00ff"
200 id="tspan2353">57</tspan>, r+<tspan
201 style="fill:#ff00ff"
202 id="tspan2355">4</tspan>);</tspan><tspan
203 sodipodi:role="line"
204 x="9.285718"
205 y="399.86218"
206 id="tspan2190"><tspan
207 style="fill:#008080"
208 id="tspan2311"> xd_draw_point</tspan>(<tspan
209 style="fill:#ff00ff"
210 id="tspan2357">XD_LED_GLOW</tspan>, <tspan
211 style="fill:#ff00ff"
212 id="tspan2359">57</tspan>, <tspan
213 style="fill:#ff00ff"
214 id="tspan2361">30</tspan>);</tspan><tspan
215 sodipodi:role="line"
216 x="9.285718"
217 y="416.11218"
218 id="tspan2192"><tspan
219 style="fill:#008080"
220 id="tspan2313"> xd_flush</tspan>();</tspan><tspan
221 sodipodi:role="line"
222 x="9.285718"
223 y="432.36218"
224 id="tspan2194"> usleep(<tspan
225 style="fill:#ff00ff"
226 id="tspan2363">700000</tspan>);</tspan><tspan
227 sodipodi:role="line"
228 x="9.285718"
229 y="448.61218"
230 id="tspan2196"> }</tspan><tspan
231 sodipodi:role="line"
232 x="9.285718"
233 y="464.86218"
234 id="tspan2198">}</tspan></text>
235 <path
236 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
237 d="M 135.7148,168.42384 L 166.09117,168.53151"
238 id="path5939"
239 inkscape:connector-type="polyline"
240 sodipodi:nodetypes="cc" />
241 <text
242 xml:space="preserve"
243 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
244 x="177.14285"
245 y="171.6479"
246 id="text2465"><tspan
247 sodipodi:role="line"
248 id="tspan2467"
249 x="177.14285"
250 y="171.6479">our header</tspan></text>
251 <text
252 xml:space="preserve"
253 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
254 x="178.57143"
255 y="186.6479"
256 id="text2469"><tspan
257 sodipodi:role="line"
258 id="tspan2471"
259 x="178.57143"
260 y="186.6479">needed for RAND_MAX</tspan></text>
261 <text
262 xml:space="preserve"
263 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
264 x="180"
265 y="201.6479"
266 id="text2473"><tspan
267 sodipodi:role="line"
268 id="tspan2475"
269 x="180"
270 y="201.6479">needed for 'usleep'</tspan></text>
271 <text
272 xml:space="preserve"
273 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
274 x="174.28572"
275 y="423.79074"
276 id="text2477"><tspan
277 sodipodi:role="line"
278 id="tspan2479"
279 x="174.28572"
280 y="423.79074">update the screen</tspan></text>
281 <text
282 xml:space="preserve"
283 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
284 x="102.14285"
285 y="452.36218"
286 id="text2481"><tspan
287 sodipodi:role="line"
288 id="tspan2483"
289 x="102.14285"
290 y="452.36218">sleep for 0.7 seconds</tspan></text>
291 <path
292 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
293 d="M 137.76494,185.15388 L 168.14131,185.26155"
294 id="path2485"
295 inkscape:connector-type="polyline"
296 sodipodi:nodetypes="cc" />
297 <path
298 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
299 d="M 139.19352,201.58246 L 169.56989,201.69013"
300 id="path2487"
301 inkscape:connector-type="polyline"
302 sodipodi:nodetypes="cc" />
303 <path
304 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
305 d="M 121.33637,278.72532 L 315.99846,210.26155"
306 id="path2489"
307 inkscape:connector-type="polyline"
308 sodipodi:nodetypes="cc" />
309 <path
310 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
311 d="M 208.41363,287.99349 L 304.50429,258.10115"
312 id="path2491"
313 inkscape:connector-type="polyline"
314 sodipodi:nodetypes="cc" />
315 <path
316 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
317 d="M 142.81193,336.07262 L 208.90259,325.466"
318 id="path2493"
319 inkscape:connector-type="polyline"
320 sodipodi:nodetypes="cc" />
321 <text
322 xml:space="preserve"
323 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
324 x="212.85713"
325 y="322.36218"
326 id="text2495"><tspan
327 sodipodi:role="line"
328 id="tspan2497"
329 x="212.85713"
330 y="322.36218">get a random number</tspan><tspan
331 sodipodi:role="line"
332 x="212.85713"
333 y="333.61218"
334 id="tspan2499">for drawing the line</tspan></text>
335 <path
336 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
337 d="M 346.35009,387.74676 L 385.29788,411.42586"
338 id="path2501"
339 inkscape:connector-type="polyline"
340 sodipodi:nodetypes="cc" />
341 <path
342 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
343 d="M 293.88157,399.6656 L 383.54364,414.77327"
344 id="path2505"
345 inkscape:connector-type="polyline"
346 sodipodi:nodetypes="cc" />
347 <path
348 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
349 d="M 133.49294,413.46105 L 168.15503,420.71157"
350 id="path2507"
351 inkscape:connector-type="polyline"
352 sodipodi:nodetypes="cc" />
353 <path
354 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
355 d="M 77.784528,437.43831 L 92.44661,448.97454"
356 id="path2509"
357 inkscape:connector-type="polyline"
358 sodipodi:nodetypes="cc" />
359 <path
360 style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
361 d="M 382.77866,364.88962 L 427.44075,352.14014"
362 id="path2511"
363 inkscape:connector-type="polyline"
364 sodipodi:nodetypes="cc" />
365 <text
366 xml:space="preserve"
367 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
368 x="440.71429"
369 y="279.50504"
370 id="text2513"><tspan
371 sodipodi:role="line"
372 id="tspan2515"
373 x="440.71429"
374 y="279.50504">this function moves</tspan><tspan
375 sodipodi:role="line"
376 x="440.71429"
377 y="290.75504"
378 id="tspan2517">the whole area </tspan><tspan
379 sodipodi:role="line"
380 x="440.71429"
381 y="302.00504"
382 id="tspan2519">one pixel to the left</tspan></text>
383 <path
384 style="opacity:1;fill:#ff0000;fill-rule:evenodd;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#Arrow2Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1;stroke:#ff0000;stroke-dashoffset:0;marker-start:none"
385 d="M 512.09082,313.31613 L 458.89577,313.4238"
386 id="path2525"
387 inkscape:connector-type="polyline"
388 sodipodi:nodetypes="cc" />
389 <text
390 xml:space="preserve"
391 style="font-size:9px;font-style:italic;font-weight:normal;fill:#008000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans"
392 x="390.71429"
393 y="410.93362"
394 id="text3576"><tspan
395 sodipodi:role="line"
396 id="tspan3578"
397 x="390.71429"
398 y="410.93362">here we draw</tspan><tspan
399 sodipodi:role="line"
400 x="390.71429"
401 y="422.18362"
402 id="tspan3580">only one line at the left</tspan></text>
403 </g>
404 </svg>