elementary/doc - Fix some images placement in docs.
[framework/uifw/elementary.git] / doc / examples.dox
1 /**
2  * @page Examples Examples
3  *
4  * Here is a page with Elementary examples.
5  *
6  * @ref bg_01_example_page
7  *
8  * @ref bg_02_example_page
9  *
10  * @ref bg_03_example_page
11  *
12  * @ref actionslider_example_page
13  *
14  * @ref elm_animator_example_page_01
15  *
16  * @ref transit_example_01_explained
17  *
18  * @ref transit_example_02_explained
19  *
20  * @ref general_functions_example_page
21  *
22  * @ref calendar_example_01
23  *
24  * @ref calendar_example_02
25  *
26  * @ref calendar_example_03
27  *
28  * @ref calendar_example_04
29  *
30  * @ref calendar_example_05
31  *
32  * @ref calendar_example_06
33  *
34  * @ref clock_example
35
36  * @ref diskselector_example_01
37  *
38  * @ref diskselector_example_02
39  *
40  * @ref flipselector_example
41  *
42  * @ref fileselector_example
43  *
44  * @ref fileselector_button_example
45  *
46  * @ref fileselector_entry_example
47  */
48
49 /**
50  * @page bg_01_example_page elm_bg - Plain color background.
51  * @dontinclude bg_example_01.c
52  *
53  * The full code for this example can be found at @ref bg_example_01_c,
54  * in the function @c test_bg_plain. It's part of the @c elementar_test
55  * suite, and thus has the code for the three examples referenced by this
56  * documentation.
57  *
58  * This first example just sets a default background with a plain color. The
59  * first part consists of creating an Elementary window. It's the common
60  * piece of code that you'll see everywhere in Elementary: @skip elm_main
61  * @until autodel_set
62  *
63  * Now we really create our background object, using the window object as
64  * its parent:
65  *
66  * @skipline bg_add
67  *
68  * Then we set the size hints of the background object so that it will use
69  * all space available for it, and then add it as a resize object to the
70  * window, making it visible in the end:
71  *
72  * @skip size_hint_weight_set
73  * @until resize_object_add
74  *
75  * See @ref evas_object_size_hint_weight_set and elm_win_resize_object_add()
76  * for more detailed info about these functions.
77  *
78  * The end of the example is quite simple, just setting the minimum and
79  * maximum size of the background, so the Elementary window knows that it
80  * has to have at least the minimum size. The background also won't scale to
81  * a size above its maximum. Then we resize the window and show it in the
82  * end:
83  *
84  * @skip set size hints
85  * @until }
86  *
87  * And here we finish our very simple background object usage example.
88  */
89
90 /**
91  * @page bg_02_example_page elm_bg - Image background.
92  * @dontinclude bg_example_02.c
93  *
94  * The full code for this example can be found at @ref bg_example_02_c,
95  * in the function @c test_bg_image. It's part of the @c elementar_test
96  * suite, and thus has the code for the three examples referenced by this
97  * documentation.
98  *
99  * This is the second example, and shows how to use the Elementary
100  * background object to set an image as background of your application.
101  *
102  * We start this example exactly in the same way as the previous one, even
103  * when creating the background object:
104  *
105  * @skip elm_main
106  * @until bg_add
107  *
108  * Now it's the different part.
109  *
110  * Our background will have an image, that will be displayed over the
111  * background color. Before loading the image, we set the load size of the
112  * image. The load size is a hint about the size that we want the image
113  * displayed in the screen. It's not the exact size that the image will have,
114  * but usually a bit bigger. The background object can still be scaled to a
115  * size bigger than the one set here. Setting the image load size to
116  * something smaller than its real size will reduce the memory used to keep
117  * the pixmap representation of the image, and the time to load it. Here we
118  * set the load size to 20x20 pixels, but the image is loaded with a size
119  * bigger than that (since it's just a hint):
120  *
121  * @skipline load_size_set
122  *
123  * And set our background image to be centered, instead of stretched or
124  * scaled, so the effect of the elm_bg_load_size_set() can be easily
125  * understood:
126  *
127  * @skipline option_set
128  *
129  * We need a filename to set, so we get one from the previous installed
130  * images in the @c PACKAGE_DATA_DIR, and write its full path to a buffer.
131  * Then we use this buffer to set the filename in the background object:
132  *
133  * @skip snprintf
134  * @until bg_file_set
135  *
136  * Notice that the third argument of the elm_bg_file_set() function is @c
137  * NULL, since we are setting an image to this background. This function
138  * also supports setting an edje group as background, in which case the @c
139  * group parameter wouldn't be @c NULL, but be the name of the group
140  * instead.
141  *
142  * Finally, we can set the size hints, add the background as a resize
143  * object, and resize the window, exactly the same thing we do in the @ref
144  * bg_01_example_page example:
145  *
146  * @skip size_hint
147  * @until }
148  *
149  * And this is the end of this example.
150  *
151  * This example will look like this:
152  *
153  * @image html screenshots/bg_01.png
154  * @image latex screenshots/bg_01.eps width=\textwidth
155  */
156
157 /**
158  * @page bg_03_example_page elm_bg - Background properties.
159  * @dontinclude bg_example_03.c
160  *
161  * The full code for this example can be found at @ref bg_example_03_c, in the
162  * function @c test_bg_options, with the callbacks @c _cb_overlay_changed, @c
163  * _cb_color_changed and @c _cb_radio_changed defined in the beginning of the
164  * file. It's part of the @c elementar_test suite, and thus has the code for
165  * the three examples referenced by this documentation.
166  *
167  * This example will show the properties available for the background object,
168  * and will use of some more widgets to set them.
169  *
170  * In order to do this, we will set some callbacks for these widgets. The
171  * first is for the radio buttons that will be used to choose the option
172  * passed as argument to elm_bg_option_set():
173  *
174  * @skip _cb_radio_changed
175  * @until }
176  *
177  * The next callback will be used when setting the overlay (using
178  * elm_bg_overlay_set()):
179  *
180  * @skip _cb_overlay_changed
181  * @until }
182  * @until }
183  *
184  * And the last one, used to set the color (with elm_bg_color_set()):
185  *
186  * @skip _cb_color_changed
187  * @until }
188  *
189  * We will get back to what these functions do soon. If you want to know more
190  * about how to set these callbacks and what these widgets are, look for:
191  * @li elm_radio_add()
192  * @li elm_check_add()
193  * @li elm_spinner_add()
194  *
195  * Now going to the main function, @c test_bg_options, we have the common
196  * code with the other examples:
197  *
198  * @skip bg-options
199  * @until autodel_set
200  *
201  * We add a plain background to this window, so it will have the default
202  * background color behind everything:
203  *
204  * @skip bg = elm_bg_add
205  * @until evas_object_show(bg)
206  *
207  * Then we add a vertical box (elm_box_add()) that will hold the background
208  * object that we are going to play with, as well as a horizontal box that
209  * will hold widgets:
210  *
211  * @skip elm_box_add
212  * @until evas_object_show
213  *
214  * Now we add the background object that is going to be of use for our
215  * example. It is an image background, as used in @ref bg_02_example_page ,
216  * so the code should be familiar:
217  *
218  * @skip elm_bg_add
219  * @until evas_object_show
220  *
221  * Notice the call to elm_box_pack_end(): it will pack the background object
222  * in the end of the Elementary box declared above. Just refer to that
223  * documentation for more info.
224  *
225  * Since this Elementary background is already an image background, we are
226  * going to play with its other properties. We will change its option
227  * (CENTER, SCALE, STRETCH, TILE), its color (RGB), and add an overlay to it.
228  * For all of these properties, we are going to add widgets that will
229  * configure them.
230  *
231  * First, lets add the horizontal box that will hold these widgets:
232  * @skip hbox
233  * @until align_set
234  *
235  * For now, just consider this @c hbox as a rectangle that will contain the
236  * widgets, and will distribute them horizontally inside its content. Then we
237  * add radio buttons that will allow us to choose the property to use with
238  * this background:
239  *
240  * @skip radio_add
241  * @until evas_object_show
242  *
243  * Again, I won't give details about the use of these widgets, just look for
244  * their documentation if necessary. It's enough to know for now that we are
245  * packing them in the @c hbox, setting a label for them, and the most
246  * important parts: setting its value to @c ELM_BG_OPTION_CENTER and its
247  * callback to @c _cb_radio_changed (the function defined in the beginning of
248  * this example). We do this for the next 3 radio buttons added after this
249  * one, each of them with a different value.
250  *
251  * Now taking a look at the code of the callback @c _cb_radio_changed again,
252  * it will call elm_bg_option_set() with the value set from the checked radio
253  * button, thus setting the option for this background. The background is
254  * passed as argument to the @p data parameter of this callback, and is
255  * referenced here as @c o_bg.
256  *
257  * Later we set the default value for this radio button:
258  *
259  * @skipline elm_radio_value_set
260  *
261  * Then we add a checkbox for the elm_bg_overlay_set() function:
262  *
263  * @skip check_add
264  * @until evas_object_show
265  *
266  * Now look at the code of the @c _cb_overlay_changed again. If the checkbox
267  * state is checked, an overlay will be added to the background. It's done by
268  * creating an Edje object, and setting it with elm_bg_overlay_set() to the
269  * background object. For information about what are and how to set Edje
270  * object, look at the Edje documentation.
271  *
272  * Finally we add a spinner object (elm_spinner_add()) to be used to select
273  * the color of our background. In its callback it's possible to see the call
274  * to elm_bg_color_set(), which will change the color of this background.
275  * This color is used by the background to fill areas where the image doesn't
276  * cover (in this case, where we have an image background). The spinner is
277  * also packed into the @c hbox :
278  *
279  * @skip elm_spinner_add
280  * @until evas_object_show
281  *
282  * Then we just have to pack the @c hbox inside the @c box, set some size
283  * hints, and show our window:
284  *
285  * @skip pack_end
286  * @until }
287  *
288  * Now to see this code in action, open elementary_test, and go to the "Bg
289  * Options" test. It should demonstrate what was implemented here.
290  */
291
292 /**
293  * @page actionslider_example_page Actionslider usage
294  * @dontinclude actionslider_example_01.c
295  *
296  * For this example we are going to assume knowledge of evas smart callbacks
297  * and some basic evas object functions. Elementary is not meant to be used
298  * without evas, if you're not yet familiar with evas it probably is worth
299  * checking that out.
300  *
301  * And now to the example, when using Elementary we start by including
302  * Elementary.h:
303  * @skipline #include
304  *
305  * Next we define some callbacks, they all share the same signature because
306  * they are all to be used with evas_object_smart_callback_add().
307  * The first one just prints the selected label(in two different ways):
308  * @until }
309  *
310  * This next callback is a little more interesting, it makes the selected
311  * label magnetic(except if it's the center label):
312  * @until }
313  *
314  * This callback enables or disables the magnetic propertty of the center
315  * label:
316  * @until }
317  *
318  * And finally a callback to stop the main loop when the window is closed:
319  * @until }
320  *
321  * To be able to create our actionsliders we need to do some setup, but this
322  * isn't really relevant here, so if you want to know about that go @ref
323  * Win "here".
324  *
325  * With all that boring stuff out of the way we can proceed to creating some
326  * actionsliders.@n
327  * All actionsliders are created the same way:
328  * @skipline actionslider_add
329  * Next we must choose where the indicator starts, and for this one we choose
330  * the right, and set the right as magnetic:
331  * @skipline indicator_pos_set
332  * @until magnet_pos_set
333  *
334  * We then set the labels for the left and right, passing NULL as an argument
335  * to any of the labels makes that position have no label.
336  * @until Stop
337  *
338  * Furthermore we mark both left and right as enabled positions, if we didn't
339  * do this all three positions would be enabled:
340  * @until RIGHT
341  *
342  * Having the the enabled positions we now add a smart callback to change
343  * which position is magnetic, so that only the last selected position is
344  * magnetic:
345  * @until NULL
346  *
347  * And finally we set our printing callback and show the actionslider:
348  * @until object_show
349  * @skip pack_end
350  *
351  * For our next actionslider we are going to do much as we did for the
352  * previous except we are going to have the center as the magnet(and not
353  * change it):
354  * @skipline actionslider_add
355  * @skipline indicator_pos_set
356  * @until object_show
357  *
358  * And another actionslider, in this one the indicator starts on the left.
359  * It has labels only in the center and right, and both bositions are
360  * magnetic. Because the left doesn't have a label and is not magnetic once
361  * the indicator leaves it can't return:
362  * @skipline actionslider_add
363  * @skipline indicator_pos_set
364  * @until object_show
365  * @note The greyed out area is a @ref Styles "style".
366  *
367  * And now an actionslider with a label in the indicator, and whose magnet
368  * properties change based on what was last selected:
369  * @skipline actionslider_add
370  * @skipline indicator_pos_set
371  * @until object_show
372  * @note The greyed out area is a @ref Styles "style".
373  *
374  * We are almost done, this next one is just an actionslider with all
375  * positions magnetized and having every possible label:
376  * @skipline actionslider_add
377  * @skipline indicator_pos_set
378  * @until object_show
379  *
380  * And for our last actionslider we have one that turns the magnetic property
381  * on and off:
382  * @skipline actionslider_add
383  * @skipline indicator_pos_set
384  * @until object_show
385  *
386  * The example will look like this:
387  *
388  * @image html screenshots/actionslider_01.png
389  * @image latex screenshots/actionslider_01.eps width=\textwidth
390  *
391  * See the full source code @ref actionslider_example_01 "here"
392  */
393
394 /**
395  * @page elm_animator_example_page_01 Animator usage
396  * @dontinclude animator_example_01.c
397  *
398  * For this example we will be using a bit of evas, you could animate a
399  * elementary widget in much the same way, but to keep things simple we use
400  * an evas_object_rectangle.
401  *
402  * As every other example we start with our include and a simple callback to
403  * exit the app when the window is closed:
404  * @skipline #include
405  * @until }
406  *
407  * This next callback is the one that actually creates our animation, it
408  * changes the size, position and color of a rectangle given to it in @a
409  * data:
410  * @until }
411  *
412  * Next we have a callback that prints a string, nothing special:
413  * @until }
414  *
415  * This next callback is a little more interesting, it has a state variable
416  * to know if the animation is currently paused or running, and it toogles
417  * the state of the animation accordingly:
418  * @until }
419  * @until }
420  * @until }
421  *
422  * Finally we have a callback to stop the animation:
423  * @until }
424  *
425  * As with every example we need to do a bit of setup before we can actually
426  * use an animation, but for the purposes of this example that's not relevant
427  * so let's just skip to the good stuff, creating an animator:
428  * @skipline animator_add
429  * @note Since elm_animator is not a widget we can give it a NULL parent.
430  *
431  * Now that we have an elm_animator we set it's duration to 1 second:
432  * @line duration_set
433  *
434  * We would also like our animation to be reversible, so:
435  * @line reverse_set
436  *
437  * We also set our animation to repeat as many times as possible, which will
438  * mean that _end_cb will only be called after UINT_MAX * 2 seconds(UINT_MAX
439  * for the animation running forward and UNIT_MAX for the animation running
440  * backwards):
441  * @line repeat_set
442  *
443  * To add some fun to our animation we will use the IN_OUT curve style:
444  * @line curve_style
445  *
446  * To actually animate anything we need an operation callback:
447  * @line operation_callback
448  *
449  * Even though we set our animation to repeat for a very long time we are
450  * going to set a end callback to it:
451  * @line completion_callback
452  * @note Notice that stoping the animation with the stop button will not make
453  * _end_cb be called.
454  *
455  * Now that we have fully set up our animator we can tell it to start
456  * animating:
457  * @line animate
458  *
459  * There's a bit more of code that doesn't really matter to use so we skip
460  * right down to our last interesting point:
461  * @skipline animator_del
462  * @note Because we created our animator with no parent we need to delete it
463  * ourselves.
464  *
465  * The example should look like this:
466  *
467  * @image html screenshots/animator_example_01.png
468  * @image latex screenshots/animator_example_01.eps width=\textwidth
469  * @n
470  * @image html screenshots/animator_example_02.png
471  * @image latex screenshots/animator_example_02.eps width=\textwidth
472  * @n
473  * @image html screenshots/animator_example_03.png
474  * @image latex screenshots/animator_example_03.eps width=\textwidth
475  *
476  * The full source code for this example can be found @ref
477  * animator_example_01_c "here"
478  */
479
480 /**
481  * @page transit_example_03_c elm_transit - Combined effects and options.
482  *
483  * This example shows how to apply the following transition effects:
484  * @li translation
485  * @li color
486  * @li rotation
487  * @li wipe
488  * @li zoom
489  * @li resizing
490  *
491  * It allows you to apply more than one effect at once, and also allows to
492  * set properties like event_enabled, auto_reverse, repeat_times and
493  * tween_mode.
494  *
495  * @include transit_example_03.c
496  */
497
498 /**
499  * @page transit_example_04_c elm_transit - Combined effects over two objects.
500  *
501  * This example shows how to apply the transition effects:
502  * @li flip
503  * @li resizable_flip
504  * @li fade
505  * @li blend
506  * over two objects. This kind of transition effect is used to make one
507  * object disappear and another one appear on its place.
508  *
509  * You can mix more than one effect of this type on the same objects, and the
510  * transition will apply both.
511  *
512  * @include transit_example_04.c
513  */
514
515 /**
516  * @page transit_example_01_explained elm_transit - Basic transit usage.
517  * @dontinclude transit_example_01.c
518  *
519  * The full code for this example can be found at @ref transit_example_01_c.
520  *
521  * This example shows the simplest way of creating a transition and applying
522  * it to an object. Similarly to every other elementary example, we create a
523  * window, set its title, size, autodel property, and setup a callback to
524  * exit the program when finished:
525  *
526  * @skip on_done
527  * @until evas_object_resize
528  *
529  * We also add a resizeable white background to use behind our animation:
530  *
531  * @skip bg_add
532  * @until evas_object_show
533  *
534  * And then we add a button that we will use to demonstrate the effects of
535  * our animation:
536  *
537  * @skip button_add
538  * @until evas_object_show(win)
539  *
540  * Notice that we are not adding the button with elm_win_resize_object_add()
541  * because we don't want the window to control the size of the button. We
542  * will use the transition to change the button size, so it could conflict
543  * with something else trying to control that size.
544  *
545  * Now, the simplest code possible to create the resize animation:
546  *
547  * @skip transit_add
548  * @until transit_go
549  *
550  * As you can see, this code is very easy to understand. First, we create the
551  * transition itself with elm_transit_add(). Then we add the button to this
552  * transition with elm_transit_object_add(), which means that the transition
553  * will operate over this button. The effect that we want now is changing the
554  * object size from 100x50 to 300x150, and can be achieved by adding the
555  * resize effect with elm_transit_effect_resizing_add().
556  *
557  * Finally, we set the transition time to 5 seconds and start the transition
558  * with elm_transit_go(). If we wanted more effects applied to this
559  * button, we could add them to the same transition. See the
560  * @ref transit_example_03_c to watch many transitions being applied to an
561  * object.
562  */
563
564 /**
565  * @page transit_example_02_explained elm_transit - Chained transitions.
566  * @dontinclude transit_example_02.c
567  *
568  * The full code for this example can be found at @ref transit_example_02_c.
569  *
570  * This example shows how to implement a chain of transitions. This chain is
571  * used to start a transition just after another transition ended. Similarly
572  * to every other elementary example, we create a window, set its title,
573  * size, autodel property, and setup a callback to exit the program when
574  * finished:
575  *
576  * @skip on_done
577  * @until evas_object_resize
578  *
579  * We also add a resizeable white background to use behind our animation:
580  *
581  * @skip bg_add
582  * @until evas_object_show
583  *
584  * This example will have a chain of 4 transitions, each of them applied to
585  * one button. Thus we create 4 different buttons:
586  *
587  * @skip button_add
588  * @until evas_object_show(bt4)
589  *
590  * Now we create a simple translation transition that will be started as soon
591  * as the program loads. It will be our first transition, and the other
592  * transitions will be started just after this transition ends:
593  *
594  * @skip transit_add
595  * @until transit_go
596  *
597  * The code displayed until now has nothing different from what you have
598  * already seen in @ref transit_example_01_explained, but now comes the new
599  * part: instead of creating a second transition that will start later using
600  * a timer, we create the it normally, and use
601  * elm_transit_chain_transit_add() instead of elm_transit_go. Since we are
602  * adding it in a chain after the first transition, it will start as soon as
603  * the first transition ends:
604  *
605  * @skip transit_add
606  * @until transit_chain_transit_add
607  *
608  * Finally we add the 2 other transitions to the chain, and run our program.
609  * It will make one transition start after the other finish, and there is the
610  * transition chain.
611  */
612
613 /**
614  * @page general_functions_example_page General (top-level) functions example
615  * @dontinclude general_funcs_example.c
616  *
617  * As told in their documentation blocks, the
618  * elm_app_compile_*_dir_set() family of functions have to be called
619  * before elm_app_info_set():
620  * @skip tell elm about
621  * @until elm_app_info_set
622  *
623  * We are here setting the fallback paths to the compiling time target
624  * paths, naturally. If you're building the example out of the
625  * project's build system, we're assuming they are the canonical ones.
626  *
627  * After the program starts, elm_app_info_set() will actually run and
628  * then you'll see an intrincasy: Elementary does the prefix lookup @b
629  * twice. This is so because of the quicklaunch infrastructure in
630  * Elementary (@ref Start), which will register a predefined prefix
631  * for possible users of the launch schema. We're not hooking into a
632  * quick launch, so this first call can't be avoided.
633  *
634  * If you ran this example from your "bindir" installation
635  * directiory, no output will emerge from these both attempts -- it
636  * will find the "magic" file there registered and set the prefixes
637  * silently. Otherwise, you could get something like:
638  @verbatim
639  WARNING: Could not determine its installed prefix for 'ELM'
640        so am falling back on the compiled in default:
641          usr
642        implied by the following:
643          bindir    = usr/lib
644          libdir    = usr/lib
645          datadir   = usr/share/elementary
646          localedir = usr/share/locale
647        Try setting the following environment variables:
648          ELM_PREFIX     - points to the base prefix of install
649        or the next 4 variables
650          ELM_BIN_DIR    - provide a specific binary directory
651          ELM_LIB_DIR    - provide a specific library directory
652          ELM_DATA_DIR   - provide a specific data directory
653          ELM_LOCALE_DIR - provide a specific locale directory
654  @endverbatim
655  * if you also didn't change those environment variables (remember
656  * they are also a valid way of communicating your prefix to the
657  * binary) - this is the scenario where it fallbacks to the paths set
658  * for compile time.
659  *
660  * Then, you can check the prefixes set on the standard output:
661  * @skip prefix was set to
662  * @until locale directory is
663  *
664  * In the fragment
665  * @skip by using this policy
666  * @until elm_win_autodel_set
667  * we demonstrate the use of Elementary policies. The policy defining
668  * under which circunstances our application should quit automatically
669  * is set to when its last window is closed (this one has just one
670  * window, though). This will save us from having to set a callback
671  * ourselves on the window, like done in @ref bg_example_01_c "this"
672  * example. Note that we need to tell the window to delete itself's
673  * object on a request to destroy the canvas coming, with
674  * elm_win_autodel_set().
675  *
676  * What follows is some boilerplate code, creating a frame with a @b
677  * button, our object of interest, and, below, widgets to change the
678  * button's behavior and exemplify the group of functions in question.
679  *
680  * @dontinclude general_funcs_example.c
681  * We enabled the focus highlight object for this window, so that you
682  * can keep track of the current focused object better:
683  * @skip elm_win_focus_highlight_enabled_set
684  * @until evas_object_show
685  * Use the tab key to navigate through the focus chain.
686  *
687  * @dontinclude general_funcs_example.c
688  * While creating the button, we exemplify how to use Elementary's
689  * finger size information to scale our UI:
690  * @skip fprintf(stdout, "Elementary
691  * @until evas_object_show
692  *
693  * @dontinclude general_funcs_example.c
694  * The first checkbox's callback is:
695  * @skip static void
696  * @until }
697  * When unsetting the checkbox, we disable the button, which will get a new
698  * decoration (greyed out) and stop receiving events. The focus chain
699  * will also ignore it.
700  *
701  * Following, there are 2 more buttons whose actions are focus/unfocus
702  * the top button, respectively:
703  * @skip focus callback
704  * @until }
705  * and
706  * @skip unfocus callback
707  * @until }
708  * Note the situations in which they won't take effect:
709  * - the button is not allowed to get focus or
710  * - the button is disabled
711  *
712  * The first restriction above you'll get by a second checkbox, whose
713  * callback is:
714  * @skip focus allow callback
715  * @until }
716  * Note that the button will still get mouse events, though.
717  *
718  * Next, there's a slider controlling the button's scale:
719  * @skip scaling callback
720  * @until }
721  *
722  * Experiment with it, so you understand the effect better. If you
723  * change its value, it will mess with the button's original size,
724  * naturally.
725  *
726  * The full code for this example can be found
727  * @ref general_functions_example_c "here".
728  */
729
730 /**
731  * @page theme_example_01 Theme - Using extensions
732  *
733  * @dontinclude theme_example_01.c
734  *
735  * Using extensions is extremely easy, discarding the part where you have to
736  * write the theme for them.
737  *
738  * In the following example we'll be creating two buttons, one to load or
739  * unload our extension theme and one to cycle around three possible styles,
740  * one of which we created.
741  *
742  * After including our one and only header we'll jump to the callback for
743  * the buttons. First one takes care of loading or unloading our extension
744  * file, relative to the default theme set (thus the @c NULL in the
745  * functions first parameter).
746  * @skipline Elementary.h
747  * @skip static void
748  * @until }
749  * @until }
750  * @until }
751  *
752  * The second button, as we said before, will just switch around different
753  * styles. In this case we have three of them. The first one is our custom
754  * style, named after something very unlikely to find in the default theme.
755  * The other two styles are the standard and one more, anchor, which exists
756  * in the default and is similar to the default, except the button vanishes
757  * when the mouse is not over it.
758  * @skip static void
759  * @until }
760  * @until }
761  *
762  * So what happens if the style switches to our custom one when the
763  * extension is loaded? Elementary falls back to the default for the
764  * widget.
765  *
766  * And the main function, simply enough, will create the window, set the
767  * buttons and their callbacks, and just to begin with our button styled
768  * we're also loading our extension at the beginning.
769  * @skip int
770  * @until ELM_MAIN
771  *
772  * In this case we wanted to easily remove extensions, but all adding an
773  * extension does is tell Elementary where else it should look for themes
774  * when it can't find them in the default theme. Another way to do this
775  * is to set the theme search order using elm_theme_set(), but this requires
776  * that the developer is careful not to override any user configuration.
777  * That can be helped by adding our theme to the end of whatver is already
778  * set, like in the following snippet.
779  * @code
780  * char buf[4096];
781  * snprintf(buf, sizeof(buf), "%s:./theme_example.edj", elme_theme_get(NULL);
782  * elm_theme_set(NULL, buf);
783  * @endcode
784  *
785  * If we were using overlays instead of extensions, the same thing applies,
786  * but the custom theme must be added to the front of the search path.
787  *
788  * In the end, we should be looking at something like this:
789  *
790  * @image html screenshots/theme_example_01.png
791  * @image latex screenshots/theme_example_01.eps width=\textwidth
792  *
793  * That's all. Boringly simple, and the full code in one piece can be found
794  * @ref theme_example_01.c "here".
795  *
796  * And the code for our extension is @ref theme_example.edc "here".
797  *
798  * @example theme_example_01.c
799  * @example theme_example.edc
800  */
801
802 /**
803  * @page theme_example_02 Theme - Using overlays
804  *
805  * @dontinclude theme_example_02.c
806  *
807  * Overlays are like extensions in that you tell Elementary that some other
808  * theme contains the styles you need for your program. The difference is that
809  * they will be look in first, so they can override the default style of any
810  * widget.
811  *
812  * There's not much to say about them that hasn't been said in our previous
813  * example about @ref theme_example_01 "extensions", so going quickly through
814  * the code we have a function to load or unload the theme, which will be
815  * called when we click any button.
816  * @skipline Elementary.h
817  * @skip static void
818  * @until }
819  *
820  * And the main function, creating the window and adding some buttons to it.
821  * We load our theme as an overlay and nothing else. Notice there's no style
822  * set for any button there, which means they should be using the default
823  * that we override.
824  * @skip int
825  * @until ELM_MAIN
826  *
827  * That's pretty much it. The full code is @ref theme_example_02.c "here" and
828  * the definition of the theme is the same as before, and can be found in
829  * @ref theme_example.edc "here".
830  *
831  * @example theme_example_02.c
832  */
833
834  /**
835   * @page button_example_01 Button - Complete example
836   *
837   * @dontinclude button_example_01.c
838   *
839   * A button is simple, you click on it and something happens. That said,
840   * we'll go through an example to show in detail the button API less
841   * commonly used.
842   *
843   * In the end, we'll be presented with something that looks like this:
844   *
845   * @image html screenshots/button_01.png
846   * @image latex screenshots/button_01.eps width=\textwidth
847   *
848   * The full code of the example is @ref button_example_01.c "here" and we
849   * will follow here with a rundown of it.
850   *
851   * @skip Elementary.h
852   * @until Elementary.h
853   * @skip struct
854   * @until App_Data
855   *
856   * We have several buttons to set different times for the autorepeat timeouts
857   * of the buttons that use it and a few more that we keep track of in our
858   * data struct. The mid button doesn't do much, just moves around according
859   * to what other buttons the user presses. Then four more buttons to move the
860   * central one, and we're also keeping track of the icon set in the middle
861   * button, since when this one moves, we change the icon, and when movement
862   * is finished (by releasing one of the four arrow buttons), we set back the
863   * normal icon.
864   * @skip static void
865   * @until }
866   *
867   * Keeping any of those four buttons pressed will trigger their autorepeat
868   * callback, where we move the button doing some size hint magic. To
869   * understand how that works better, refer to the @ref Box documentation.
870   * Also, the first time the function is called, we change the icon in the
871   * middle button, using elm_button_icon_unset() first to keep the reference
872   * to the previous one, so we don't need to recreate it when we are done
873   * moving it.
874   * @skip static void
875   * @until }
876   * @until size_hint_align_set
877   * @until }
878   *
879   * One more callback for the option buttons, that just sets the timeouts for
880   * the different autorepeat options.
881   *
882   * @skip static void
883   * @until }
884   * @until }
885   * @until }
886   *
887   * And the main function, which does some setting up of the buttons in boxes
888   * to make things work. Here we'll go through some snippets only.
889   *
890   * For the option buttons, it's just the button with its label and callback.
891   * @skip elm_button_add
892   * @until smart_callback_add
893   *
894   * For the ones that move the central button, we have no labels. There are
895   * icons instead, and the autorepeat option is toggled.
896   * @skip Gap: 1.0
897   * @skip elm_button_add
898   * @until data.cursors.up
899   *
900   * And just to show the mid button, which doesn't have anything special.
901   * @skip data.cursors.left
902   * @skip elm_button_add
903   * @until data.mid
904   *
905   * And we are done.
906   *
907   * @example button_example_01.c
908   */
909
910 /**
911  * @page bubble_01_example_page elm_bubble - Simple use.
912  * @dontinclude bubble_example_01.c
913  *
914  * This example shows a bubble with all fields set(label, info, content and
915  * icon) and the selected corner changing when the bubble is clicked. To be
916  * able use a bubble we need to do some setup and create a window, for this
917  * example we are going to ignore that part of the code since it isn't
918  * relevant to the bubble.
919  *
920  * To have the selected corner change in a clockwise motion we are going to
921  * use the following callback:
922  * @skip static
923  * @until }
924  * @until }
925  *
926  * Here we are creating an elm_label that is going to be used as the content
927  * for our bubble:
928  * @skipline elm_label
929  * @until show
930  * @note You could use any evas_object for this, we are using an elm_label
931  * for simplicity.
932  *
933  * Despite it's name the bubble's icon doesn't have to be an icon, it can be
934  * any evas_object. For this example we are going to make the icon a simple
935  * blue rectangle:
936  * @until show
937  *
938  * And finally we have the actual bubble creation and the setting of it's
939  * label, info and content:
940  * @until content
941  * @skipline show
942  * @note Because we didn't set a corner, the default("top_left") will be
943  * used.
944  *
945  * Now that we have our bubble all that is left is connecting the "clicked"
946  * signals to our callback:
947  * @line smart_callback
948  *
949  * This last bubble we created was very complete, so it's pertinent to show
950  * that most of that stuff is optional a bubble can be created with nothing
951  * but content:
952  * @until content
953  * @skipline show
954  *
955  * Our example will look like this:
956  *
957  * @image html screenshots/bubble_example_01.png
958  * @image latex screenshots/bubble_example_01.eps width=\textwidth
959  *
960  * See the full source code @ref bubble_example_01.c here.
961  * @example bubble_example_01.c
962  */
963
964 /**
965  * @page box_example_01 Box - Basic API
966  *
967  * @dontinclude button_example_01.c
968  *
969  * As a special guest tonight, we have the @ref button_example_01 "simple
970  * button example". There are plenty of boxes in it, and to make the cursor
971  * buttons that moved a central one around when pressed, we had to use a
972  * variety of values for their hints.
973  *
974  * To start, let's take a look at the handling of the central button when
975  * we were moving it around. To achieve this effect without falling back to
976  * a complete manual positioning of the @c Evas_Object in our canvas, we just
977  * put it in a box and played with its alignment within it, as seen in the
978  * following snippet of the callback for the pressed buttons.
979  * @skip evas_object_size_hint_align_get
980  * @until evas_object_size_hint_align_set
981  *
982  * Not much to it. We get the current alignment of the object and change it
983  * by just a little, depending on which button was pressed, then set it
984  * again, making sure we stay within the 0.0-1.0 range so the button moves
985  * inside the space it has, instead of disappearing under the other objects.
986  *
987  * But as useful as an example as that may have been, the usual case with boxes
988  * is to set everything at the moment they are created, like we did for
989  * everything else in our main function.
990  *
991  * The entire layout of our program is made with boxes. We have one set as the
992  * resize object for the window, which means it will always be resized with
993  * the window. The weight hints set to @c EVAS_HINT_EXPAND will tell the
994  * window that the box can grow past it's minimum size, which allows resizing
995  * of it.
996  * @skip elm_main
997  * @skip elm_box_add
998  * @until evas_object_show
999  *
1000  * Two more boxes, set to horizontal, hold the buttons to change the autorepeat
1001  * configuration used by the buttons. We create each to take over all the
1002  * available space horizontally, but we don't want them to grow vertically,
1003  * so we keep that axis of the weight with 0.0. Then it gets packed in the
1004  * main box.
1005  * @skip box2
1006  * @until evas_object_show
1007  *
1008  * The buttons in each of those boxes have nothing special, they are just packed
1009  * in with their default values and the box will use their minimum size, as set
1010  * by Elementary itself based on the label, icon, finger size and theme.
1011  *
1012  * But the buttons used to move the central one have a special disposition.
1013  * The top one first, is placed right into the main box like our other smaller
1014  * boxes. Set to expand horizontally and not vertically, and in this case we
1015  * also tell it to fill that space, so it gets resized to take the entire
1016  * width of the window.
1017  * @skip Gap: 1.0
1018  * @skip elm_button_add
1019  * @until evas_object_show
1020  *
1021  * The bottom one will be the same, but for the other two we need to use a
1022  * second box set to take as much space as we have, so we can place our side
1023  * buttons in place and have the big empty space where the central button will
1024  * move.
1025  * @skip elm_box_add
1026  * @until evas_object_show
1027  *
1028  * Then the buttons will have their hints inverted to the other top and bottom
1029  * ones, to expand and fill vertically and keep their minimum size horizontally.
1030  * @skip elm_button_add
1031  * @until evas_object_show
1032  *
1033  * The central button takes every thing else. It will ask to be expanded in
1034  * both directions, but without filling its cell. Changing its alignment by
1035  * pressing the buttons will make it move around.
1036  * @skip elm_button_add
1037  * @until evas_object_show
1038  *
1039  * To end, the rightmost button is packed in the smaller box after the central
1040  * one, and back to the main box we have the bottom button at the end.
1041  */
1042
1043 /**
1044  * @page box_example_02 Box - Layout transitions
1045  *
1046  * @dontinclude box_example_02.c
1047  *
1048  * Setting a customized layout for a box is simple once you have the layout
1049  * function, which is just like the layout function for @c Evas_Box. The new
1050  * and fancier thing we can do with Elementary is animate the transition from
1051  * one layout to the next. We'll see now how to do that through a simple
1052  * example, while also taking a look at some of the API that was left
1053  * untouched in our @ref box_example_01 "previous example".
1054  *
1055  * @image html screenshots/box_example_02.png
1056  * @image latex screenshots/box_example_02.eps width=\textwidth
1057  *
1058  * @skipline Elementary.h
1059  *
1060  * Our application data consists of a list of layout functions, given by
1061  * @c transitions. We'll be animating through them throughout the entire run.
1062  * The box with the stuff to move around and the last layout that was set to
1063  * make things easier in the code.
1064  * @skip typedef
1065  * @until Transitions_Data
1066  *
1067  * The box starts with three buttons, clicking on any of them will take it
1068  * out of the box without deleting the object. There are also two more buttons
1069  * outside, one to add an object to the box and the other to clear it.
1070  * This is all to show how you can interact with the items in the box, add
1071  * things and even remove them, while the transitions occur.
1072  *
1073  * One of the callback we'll be using creates a new button, asks the box for
1074  * the list of its children and if it's not empty, we add the new object after
1075  * the first one, otherwise just place at the end as it will not make any
1076  * difference.
1077  * @skip static void
1078  * @until }
1079  * @until }
1080  *
1081  * The clear button is even simpler. Everything in the box will be deleted,
1082  * leaving it empty and ready to fill it up with more stuff.
1083  * @skip static void
1084  * @until }
1085  *
1086  * And a little function to remove buttons from the box without deleting them.
1087  * This one is set for the @c clicked callback of the original buttons,
1088  * unpacking them when clicked and placing it somewhere in the screen where
1089  * they will not disturb. Once we do this, the box no longer has any control
1090  * of it, so it will be left untouched until the program ends.
1091  * @skip static void
1092  * @until }
1093  *
1094  * If we wanted, we could just call @c evas_object_del() on the object to
1095  * destroy it. In this case, no unpack is really necessary, as the box would
1096  * be notified of a child being deleted and adjust its calculations accordingly.
1097  *
1098  * The core of the program is the following function. It takes whatever
1099  * function is first on our list of layouts and together with the
1100  * @c last_layout, it creates an ::Elm_Box_Transition to use with
1101  * elm_box_layout_transition(). In here, we tell it to start from whatever
1102  * layout we last set, end with the one that was at the top of the list and
1103  * when everything is finished, call us back so we can create another
1104  * transition. Finally, move the new layout to the end of the list so we
1105  * can continue running through them until the program ends.
1106  * @skip static void
1107  * @until }
1108  *
1109  * The main function doesn't have antyhing special. Creation of box, initial
1110  * buttons and some callback setting. The only part worth mentioning is the
1111  * initialization of our application data.
1112  * @skip tdata.box
1113  * @until evas_object_box_layout_stack
1114  *
1115  * We have a simple static variable, set the box, the first layout we are
1116  * using as last and create the list with the different functions to go
1117  * through.
1118  *
1119  * And in the end, we set the first layout and call the same function we went
1120  * through before to start the run of transitions.
1121  * @until _test_box_transition_change
1122  *
1123  * For the full code, follow @ref box_example_02.c "here".
1124  *
1125  * @example box_example_02.c
1126  */
1127
1128 /**
1129  * @page calendar_example_01 Calendar - Simple creation.
1130  * @dontinclude calendar_example_01.c
1131  *
1132  * As a first example, let's just display a calendar in our window,
1133  * explaining all steps required to do so.
1134  *
1135  * First you should declare objects we intend to use:
1136  * @skipline Evas_Object
1137  *
1138  * Then a window is created, a title is set and its set to be autodeleted.
1139  * More details can be found on windows examples:
1140  * @until elm_win_autodel
1141  *
1142  * Next a simple background is placed on our windows. More details on
1143  * @ref bg_01_example_page:
1144  * @until evas_object_show(bg)
1145  *
1146  * Now, the exciting part, let's add the calendar with elm_calendar_add(),
1147  * passing our window object as parent.
1148  * @until evas_object_show(cal);
1149  *
1150  * To conclude our example, we should show the window and run elm mainloop:
1151  * @until ELM_MAIN
1152  *
1153  * Our example will look like this:
1154  *
1155  * @image html screenshots/calendar_example_01.png
1156  * @image latex screenshots/calendar_example_01.eps width=\textwidth
1157  *
1158  * See the full source code @ref calendar_example_01.c here.
1159  * @example calendar_example_01.c
1160  */
1161
1162 /**
1163  * @page calendar_example_02 Calendar - Layout strings formatting.
1164  * @dontinclude calendar_example_02.c
1165  *
1166  * In this simple example, we'll explain how to format the label displaying
1167  * month and year, and also set weekday names.
1168  *
1169  * To format month and year label, we need to create a callback function
1170  * to create a string given the selected time, declared under a
1171  * <tt> struct tm </tt>.
1172  *
1173  * <tt> struct tm </tt>, declared on @c time.h, is a structure composed by
1174  * nine integers:
1175  * @li tm_sec   seconds [0,59]
1176  * @li tm_min   minutes [0,59]
1177  * @li tm_hour  hour [0,23]
1178  * @li tm_mday  day of month [1,31]
1179  * @li tm_mon   month of year [0,11]
1180  * @li tm_year  years since 1900
1181  * @li tm_wday  day of week [0,6] (Sunday = 0)
1182  * @li tm_yday  day of year [0,365]
1183  * @li tm_isdst daylight savings flag
1184  * @note glib version has 2 additional fields.
1185  *
1186  * For our function, only stuff that matters are tm_mon and tm_year.
1187  * But we don't need to access it directly, since there are nice functions
1188  * to format date and time, as @c strftime.
1189  * We will get abbreviated month (%b) and year (%y) (check strftime manpage
1190  * for more) in our example:
1191  * @skipline static char
1192  * @until }
1193  *
1194  * We need to alloc the string to be returned, and calendar widget will
1195  * free it when it's not needed, what is done by @c strdup.
1196  * So let's register our callback to calendar object:
1197  * @skipline elm_calendar_format_function_set
1198  *
1199  * To set weekday names, we should declare them as an array of strings:
1200  * @dontinclude calendar_example_02.c
1201  * @skipline weekdays
1202  * @until }
1203  *
1204  * And finally set them to calendar:
1205  * skipline weekdays_names_set
1206  *
1207  * Our example will look like this:
1208  *
1209  * @image html screenshots/calendar_example_02.png
1210  * @image latex screenshots/calendar_example_02.eps width=\textwidth
1211  *
1212  * See the full source code @ref calendar_example_02.c here.
1213  * @example calendar_example_02.c
1214  */
1215
1216 /**
1217  * @page calendar_example_03 Calendar - Years restrictions.
1218  * @dontinclude calendar_example_03.c
1219  *
1220  * This example explains how to set max and min year to be displayed
1221  * by a calendar object. This means that user won't be able to
1222  * see or select a date before and after selected years.
1223  * By default, limits are 1902 and maximun value will depends
1224  * on platform architecture (year 2037 for 32 bits); You can
1225  * read more about time functions on @c ctime manpage.
1226  *
1227  * Straigh to the point, to set it is enough to call
1228  * elm_calendar_min_max_year_set(). First value is minimun year, second
1229  * is maximum. If first value is negative, it won't apply limit for min
1230  * year, if the second one is negative, won't apply for max year.
1231  * Setting both to negative value will clear limits (default state):
1232  * @skipline elm_calendar_min_max_year_set
1233  *
1234  * Our example will look like this:
1235  *
1236  * @image html screenshots/calendar_example_03.png
1237  * @image latex screenshots/calendar_example_03.eps width=\textwidth
1238  *
1239  * See the full source code @ref calendar_example_03.c here.
1240  * @example calendar_example_03.c
1241  */
1242
1243 /**
1244  * @page calendar_example_04 Calendar - Days selection.
1245  * @dontinclude calendar_example_04.c
1246  *
1247  * It's possible to disable date selection and to select a date
1248  * from your program, and that's what we'll see on this example.
1249  *
1250  * If isn't required that users could select a day on calendar,
1251  * only interacting going through months, disabling days selection
1252  * could be a good idea to avoid confusion. For that:
1253  * @skipline elm_calendar_day_selection_enabled_set
1254  *
1255  * Also, regarding days selection, you could be interested to set a
1256  * date to be highlighted on calendar from your code, maybe when
1257  * a specific event happens, or after calendar creation. Let's select
1258  * two days from current day:
1259  * @dontinclude calendar_example_04.c
1260  * @skipline SECS_DAY
1261  * @skipline current_time
1262  * @until elm_calendar_selected_time_set
1263  *
1264  * Our example will look like this:
1265  *
1266  * @image html screenshots/calendar_example_04.png
1267  * @image latex screenshots/calendar_example_04.eps width=\textwidth
1268  *
1269  * See the full source code @ref calendar_example_04.c here.
1270  * @example calendar_example_04.c
1271  */
1272
1273 /**
1274  * @page calendar_example_05 Calendar - Signal callback and getters.
1275  * @dontinclude calendar_example_05.c
1276  *
1277  * Most of setters explained on previous examples have associated getters.
1278  * That's the subject of this example. We'll add a callback to display
1279  * all calendar information every time user interacts with the calendar.
1280  *
1281  * Let's check our callback function:
1282  * @skipline static void
1283  * @until double interval;
1284  *
1285  * To get selected day, we need to call elm_calendar_selected_time_get(),
1286  * but to assure nothing wrong happened, we must check for function return.
1287  * It'll return @c EINA_FALSE if fail. Otherwise we can use time set to
1288  * our structure @p stime.
1289  * @skipline elm_calendar_selected_time_get
1290  * @until return
1291  *
1292  * Next we'll get information from calendar and place on declared vars:
1293  * @skipline interval
1294  * @until elm_calendar_weekdays_names_get
1295  *
1296  * The only tricky part is that last line gets an array of strings
1297  * (char arrays), one for each weekday.
1298  *
1299  * Then we can simple print that to stdin:
1300  * @skipline printf
1301  * @until }
1302  *
1303  * <tt> struct tm </tt> is declared on @c time.h. You can check @c ctime
1304  * manpage to read about it.
1305  *
1306  * To register this callback, that will be called every time user selects
1307  * a day or goes to next or previous month, just add a callback for signal
1308  * @b changed.
1309  * @skipline evas_object_smart_callback_add
1310  *
1311  * Our example will look like this:
1312  *
1313  * @image html screenshots/calendar_example_05.png
1314  * @image latex screenshots/calendar_example_05.eps width=\textwidth
1315  *
1316  * See the full source code @ref calendar_example_05.c here.
1317  * @example calendar_example_05.c
1318  */
1319
1320 /**
1321  * @page calendar_example_06 Calendar - Calendar marks.
1322  * @dontinclude calendar_example_06.c
1323  *
1324  * On this example marks management will be explained. Functions
1325  * elm_calendar_mark_add(), elm_calendar_mark_del() and
1326  * elm_calendar_marks_clear() will be covered.
1327  *
1328  * To add a mark, will be required to choose three things:
1329  * @li mark style
1330  * @li mark date, or start date if it will be repeated
1331  * @li mark periodicity
1332  *
1333  * Style defines the kind of mark will be displayed over marked day,
1334  * on caledar. Default theme supports @b holiday and @b checked.
1335  * If more is required, is possible to set a new theme to calendar
1336  * widget using elm_object_style_set(), and use
1337  * the signal that will be used by such marks.
1338  *
1339  * Date is a <tt> struct tm </tt>, as defined by @c time.h. More can
1340  * be read on @c ctime manpage.
1341  * If a date relative from current is required, this struct can be set
1342  * as:
1343  * @skipline current_time
1344  * @until localtime_r
1345  *
1346  * Or if it's an absolute date, you can just declare the struct like:
1347  * @dontinclude calendar_example_06.c
1348  * @skipline sunday
1349  * @until christmas.tm_mon
1350  *
1351  * Periodicity is how frequently the mark will be displayed over the
1352  * calendar.  Can be a unique mark (that don't repeat), or it can repeat
1353  * daily, weekly, monthly or annually. It's enumerated by
1354  * @c Elm_Calendar_Mark_Repeat.
1355  *
1356  * So let's add some marks to our calendar. We will add christmas holiday,
1357  * set Sundays as holidays, and check current day and day after that.
1358  * @dontinclude calendar_example_06.c
1359  * @skipline sunday
1360  * @until christmas.tm_mon
1361  * @skipline current_time
1362  * @until ELM_CALENDAR_WEEKLY
1363  *
1364  * We kept the return of first mark add, because we don't really won't it
1365  * to be checked, so let's remove it:
1366  * @skipline elm_calendar_mark_del
1367  *
1368  * After all marks are added and removed, is required to draw them:
1369  * @skipline elm_calendar_marks_draw
1370  *
1371  * Finally, to clear all marks, let's set a callback for our button:
1372  * @skipline elm_button_add
1373  * @until evas_object_show(bt);
1374  *
1375  * This callback will receive our calendar object, and should clear it:
1376  * @dontinclude calendar_example_06.c
1377  * @skipline static
1378  * @until }
1379  * @note Remember to draw marks after clear the calendar.
1380  *
1381  * Our example will look like this:
1382  *
1383  * @image html screenshots/calendar_example_06.png
1384  * @image latex screenshots/calendar_example_06.eps width=\textwidth
1385  *
1386  * See the full source code @ref calendar_example_06.c here.
1387  * @example calendar_example_06.c
1388  */
1389
1390 /**
1391  * @page clock_example Clock widget example
1392  *
1393  * This code places five Elementary clock widgets on a window, each of
1394  * them exemplifying a part of the widget's API.
1395  *
1396  * The first of them is the pristine clock:
1397  * @dontinclude clock_example.c
1398  * @skip pristine
1399  * @until evas_object_show
1400  * As you see, the defaults for a clock are:
1401  * - military time
1402  * - no seconds shown
1403  *
1404  * For am/pm time, see the second clock:
1405  * @dontinclude clock_example.c
1406  * @skip am/pm
1407  * @until evas_object_show
1408  *
1409  * The third one will show the seconds digits, which will flip in
1410  * synchrony with system time. Note, besides, that the time itself is
1411  * @b different from the system's -- it was customly set with
1412  * elm_clock_time_set():
1413  * @dontinclude clock_example.c
1414  * @skip with seconds
1415  * @until evas_object_show
1416  *
1417  * In both fourth and fifth ones, we turn on the <b>edition
1418  * mode</b>. See how you can change each of the sheets on it, and be
1419  * sure to try holding the mouse pressed over one of the sheet
1420  * arrows. The forth one also starts with a custom time set:
1421  * @dontinclude clock_example.c
1422  * @skip in edition
1423  * @until evas_object_show
1424  *
1425  * The fifth, besides editable, has only the time @b units editable,
1426  * for hours, minutes and seconds. This exemplifies
1427  * elm_clock_digit_edit_set():
1428  * @dontinclude clock_example.c
1429  * @skip but only
1430  * @until evas_object_show
1431  *
1432  * See the full @ref clock_example.c "example", whose window should
1433  * look like this picture:
1434  *
1435  * @image html screenshots/clock_example.png
1436  * @image latex screenshots/clock_example.eps width=\textwidth
1437  *
1438  * See the full @ref clock_example_c "source code" for this example.
1439  *
1440  * @example clock_example.c
1441  */
1442
1443 /**
1444  * @page diskselector_example_01 Diskselector widget example
1445  *
1446  * This code places 4 Elementary diskselector widgets on a window, each of
1447  * them exemplifying a part of the widget's API.
1448  *
1449  * All of them will have weekdays as items, since we won't focus
1450  * on items management on this example. For an example about this subject,
1451  * check @ref diskselector_example_02.
1452  *
1453  * The first of them is a default diskselector.
1454  * @dontinclude diskselector_example_01.c
1455  * @skipline lbl
1456  * @until }
1457  * @skipline elm_diskselector_add
1458  * @until evas_object_show
1459  *
1460  * We are just adding the diskselector, so as you can see, defaults for it are:
1461  * @li Only 3 items visible each time.
1462  * @li Only 3 characters are displayed for labels on side positions.
1463  * @li The first added item remains centeres, i.e., it's the selected item.
1464  *
1465  * To add items, we are just appending it on a loop, using function
1466  * elm_diskselector_item_append(), that will be better exaplained on
1467  * items management example.
1468  *
1469  * For a circular diskselector, check the second widget. A circular
1470  * diskselector will display first item after last, and last previous to
1471  * the first one. So, as you can see, @b Sa will appears on left side
1472  * of selected @b Sunday. This property is set with
1473  * elm_diskselector_round_set().
1474  *
1475  * Also, we decide to display only 2 character for side labels, instead of 3.
1476  * For this we call elm_diskselector_side_label_length_set(). As result,
1477  * we'll see @b Mo displayed instead of @b Mon, when @b Monday is on a
1478  * side position.
1479  *
1480  * @skipline elm_diskselector_add
1481  * @until evas_object_show
1482  *
1483  * But so far, we are only displaying 3 items at once. If more are wanted,
1484  * is enough to call elm_diskselector_display_item_num_set(), as you can
1485  * see here:
1486  * @skipline elm_diskselector_add
1487  * @until evas_object_show
1488  *
1489  * @note You can't set less than 3 items to be displayed.
1490  *
1491  * Finally, if a bounce effect is required, or you would like to see
1492  * scrollbars, it is possible. But, for default theme, diskselector
1493  * scrollbars will be invisible anyway.
1494  * @skipline elm_diskselector_add
1495  * @until evas_object_show
1496  *
1497  * See the full @ref diskselector_example_01.c "diskselector_example_01.c"
1498  * code, whose window should look like this picture:
1499  *
1500  * @image html screenshots/diskselector_example_01.png
1501  * @image latex screenshots/diskselector_example_01.eps width=\textwidth
1502  *
1503  * @example diskselector_example_01.c
1504  */
1505
1506 /**
1507  * @page diskselector_example_02 Diskselector - Items management
1508  *
1509  * This code places a Elementary diskselector widgets on a window,
1510  * along with some buttons trigerring actions on it (though its API).
1511  * It covers most of Elm_Diskselector_Item functions.
1512  *
1513  * On our @c main function, we are adding a default diskselector with
1514  * 3 items. We are only setting their labels (second parameter of function
1515  * elm_diskselector_item_append):
1516  * @dontinclude diskselector_example_02.c
1517  * @skipline elm_diskselector_add
1518  * @until Item 2
1519  *
1520  * Next we are adding lots of buttons, each one for a callback function
1521  * that will realize a task covering part of diskselector items API.
1522  * Lets check the first one:
1523  * @skipline elm_button_add
1524  * @until evas_object_show
1525  *
1526  * We are labeling the button with a task description with
1527  * elm_object_text_set() and setting a callback
1528  * function evas_object_smart_callback_add().
1529  * Each callback function will have the signature:
1530  * <tt> static void _task_cb(void *data, Evas_Object *obj,
1531  * void *event_info)</tt> with the function name varying for each task.
1532  *
1533  * Now let's cover all of them.
1534  *
1535  * <b> Appending an item: </b>
1536  * @dontinclude diskselector_example_02.c
1537  * @skipline _add_cb
1538  * @until }
1539  *
1540  * All items are included on diskselector after last one. You @b can't
1541  * preprend items.
1542  *
1543  * The first parameter of elm_diskselector_item_append() is the diskselector
1544  * object, that we are receiving as data on our callback function.
1545  * The second one is a label, the string that will be placed in the center
1546  * of our item. As we don't wan't icons or callback functions, we can
1547  * send NULL as third, fourth and fifth parameters.
1548  *
1549  * <b> Appending an item with icon: </b>
1550  * @dontinclude diskselector_example_02.c
1551  * @skipline _add_ic_cb
1552  * @until }
1553  *
1554  * If an icon is required, you can pass it as third paramenter on our
1555  * elm_diskselector_item_append() function. It will be place on the
1556  * left side of item's label, that will be shifted to right a bit.
1557  *
1558  * For more details about how to create icons, look for elm_icon examples.
1559  *
1560  * <b> Appending an item with callback function for selected: </b>
1561  * @dontinclude diskselector_example_02.c
1562  * @skipline _sel_cb
1563  * @until }
1564  * @until }
1565  *
1566  * To set a callback function that will be called every time an item is
1567  * selected, i.e., everytime the diskselector stops with this item in
1568  * center position, just pass the function as fourth paramenter.
1569  *
1570  * <b> Appending an item with callback function for selected with data: </b>
1571  * @dontinclude diskselector_example_02.c
1572  * @skipline _sel_data_cb
1573  * @until }
1574  * @until }
1575  * @until }
1576  * @until }
1577  *
1578  * If the callback function request an extra data, it can be attached to our
1579  * item passing a pointer for data as fifth parameter.
1580  * Our function _sel_data_cb will receive it as <tt> void *data </tt>.
1581  *
1582  * If you want to free this data, or handle that the way you need when the
1583  * item is deleted, set a callback function for that, with
1584  * elm_diskselector_item_del_cb_set().
1585  *
1586  * As you can see we check if @c it is not @c NULL after appending it.
1587  * If an error happens, we won't try to set a function for it.
1588  *
1589  * <b> Deleting an item: </b>
1590  * @dontinclude diskselector_example_02.c
1591  * @skip _del_cb
1592  * @skipline _del_cb
1593  * @until }
1594  *
1595  * To delete an item we simple need to call elm_diskselector_item_del() with
1596  * a pointer for such item.
1597  *
1598  * If you need, you can get selected item with
1599  * elm_diskselector_selected_item_get(), that will return a pointer for it.
1600  *
1601  * <b> Unselecting an item: </b>
1602  * @dontinclude diskselector_example_02.c
1603  * @skipline _unselect_cb
1604  * @until }
1605  *
1606  * To select an item, you should call elm_diskselector_item_selected_set()
1607  * passing @c EINA_TRUE, and to unselect it, @c EINA_FALSE.
1608  *
1609  * If you unselect the selected item, diskselector will automatically select
1610  * the first item.
1611  *
1612  * <b> Printing all items: </b>
1613  * @dontinclude diskselector_example_02.c
1614  * @skipline _print_cb
1615  * @until }
1616  *
1617  * <b> Clearing the diskselector: </b>
1618  * @dontinclude diskselector_example_02.c
1619  * @skipline _clear_cb
1620  * @until }
1621  *
1622  * <b> Selecting the first item: </b>
1623  * @dontinclude diskselector_example_02.c
1624  * @skipline _select_first_cb
1625  * @until }
1626  *
1627  * <b> Selecting the last item: </b>
1628  * @dontinclude diskselector_example_02.c
1629  * @skipline _select_last_cb
1630  * @until }
1631  *
1632  * <b> Selecting the next item: </b>
1633  * @dontinclude diskselector_example_02.c
1634  * @skipline _select_next_cb
1635  * @until }
1636  *
1637  * <b> Selecting the previous item: </b>
1638  * @dontinclude diskselector_example_02.c
1639  * @skipline _select_prev_cb
1640  * @until }
1641  *
1642  * See the full @ref diskselector_example_02.c "diskselector_example_02.c"
1643  * code, whose window should look like this picture:
1644  *
1645  * @image html screenshots/diskselector_example_02.png
1646  * @image latex screenshots/diskselector_example_02.eps width=\textwidth
1647  *
1648  * @example diskselector_example_02.c
1649  */
1650
1651 /**
1652  * @page flipselector_example Flip selector widget example
1653  *
1654  * This code places an Elementary flip selector widget on a window,
1655  * along with two buttons trigerring actions on it (though its API).
1656  *
1657  * The selector is being populated with the following items:
1658  * @dontinclude flipselector_example.c
1659  * @skip lbl[]
1660  * @until ;
1661  *
1662  * Next, we create it, populating it with those items and registering
1663  * two (smart) callbacks on it:
1664  * @dontinclude flipselector_example.c
1665  * @skip fp = elm_flipselector_add
1666  * @until object_show
1667  *
1668  * Those two callbacks will take place whenever one of those smart
1669  * events occur, and they will just print something to @c stdout:
1670  * @dontinclude flipselector_example.c
1671  * @skip underflow callback
1672  * @until static void
1673  * Flip the sheets on the widget while looking at the items list, in
1674  * the source code, and you'll get the idea of those events.
1675  *
1676  * The two buttons below the flip selector will take the actions
1677  * described in their labels:
1678  * @dontinclude flipselector_example.c
1679  * @skip bt = elm_button_add
1680  * @until callback_add(win
1681  *
1682  * @dontinclude flipselector_example.c
1683  * @skip unselect the item
1684  * @until underflow
1685  *
1686  * Click on them to exercise those flip selector API calls. To
1687  * interact with the other parts of this API, there's a command line
1688  * interface, whose help string can be asked for with the 'h' key:
1689  * @dontinclude flipselector_example.c
1690  * @skip commands
1691  * @until ;
1692  *
1693  * The 'n' and 'p' keys will exemplify elm_flipselector_flip_next()
1694  * and elm_flipselector_flip_prev(), respectively. 'f' and 'l' account
1695  * for elm_flipselector_first_item_get() and
1696  * elm_flipselector_last_item_get(), respectively. Finally, 's' will
1697  * issue elm_flipselector_selected_item_get() on our example flip
1698  * selector widget.
1699  *
1700  * See the full @ref flipselector_example.c "example", whose window should
1701  * look like this picture:
1702  *
1703  * @image html screenshots/flipselector_example.png
1704  * @image latex screenshots/flipselector_example.eps width=\textwidth
1705  *
1706  * See the full @ref flipselector_example_c "source code" for this example.
1707  *
1708  * @example flipselector_example.c
1709  */
1710
1711 /**
1712  * @page fileselector_example File selector widget example
1713  *
1714  * This code places two Elementary file selector widgets on a window.
1715  * The one on the left is layouting file system items in a @b list,
1716  * while the the other is layouting them in a @b grid.
1717  *
1718  * The one having the majority of hooks of interest is on the left,
1719  * which we create as follows:
1720  * @dontinclude fileselector_example.c
1721  * @skip first file selector
1722  * @until object_show
1723  *
1724  * Note that we enable custom edition of file/directory selection, via
1725  * the text entry it has on its bottom, via
1726  * elm_fileselector_is_save_set(). It starts with the list view, which
1727  * is the default, and we make it not expandable in place
1728  * (elm_fileselector_expandable_set()), so that it replaces its view's
1729  * contents with the current directory's entries each time one
1730  * navigates to a different folder.  For both of file selectors we are
1731  * starting to list the contents found in the @c "/tmp" directory
1732  * (elm_fileselector_path_set()).
1733  *
1734  * Note the code setting it to "grid mode" and observe the differences
1735  * in the file selector's views, in the example. We also hide the
1736  * second file selector's Ok/Cancel buttons -- since it's there just
1737  * to show the grid view (and navigation) -- via
1738  * elm_fileselector_buttons_ok_cancel_set().
1739  *
1740  * The @c "done" event, which triggers the callback below
1741  * @dontinclude fileselector_example.c
1742  * @skip 'done' cb
1743  * @until }
1744  * will be called at the time one clicks the "Ok"/"Cancel" buttons of
1745  * the file selector (on the left). Note that it will print the path
1746  * to the current selection, if any.
1747  *
1748  * The @c "selected" event, which triggers the callback below
1749  * @dontinclude fileselector_example.c
1750  * @skip bt = 'selected' cb
1751  * @until }
1752  * takes place when one selects a file (if the file selector is @b not
1753  * under folders-only mode) or when one selects a folder (when in
1754  * folders-only mode). Experiment it by selecting different file
1755  * system entries.
1756  *
1757  * What comes next is the code creating the three check boxes and two
1758  * buttons below the file selector in the right. They will exercise a
1759  * bunch of functions on the file selector's API, for the instance on
1760  * the left. Experiment with them, specially the buttons, to get the
1761  * difference between elm_fileselector_path_get() and
1762  * elm_fileselector_selected_get().
1763  *
1764  * Finally, there's the code adding the second file selector, on the
1765  * right:
1766  * @dontinclude fileselector_example.c
1767  * @skip second file selector
1768  * @until object_show
1769  *
1770  * Pay attention to the code setting it to "grid mode" and observe the
1771  * differences in the file selector's views, in the example. We also
1772  * hide the second file selector's Ok/Cancel buttons -- since it's
1773  * there just to show the grid view (and navigation) -- via
1774  * elm_fileselector_buttons_ok_cancel_set().
1775  *
1776  * See the full @ref fileselector_example.c "example", whose window
1777  * should look like this picture:
1778  *
1779  * @image html screenshots/fileselector_example.png
1780  * @image latex screenshots/fileselector_example.eps width=\textwidth
1781  *
1782  * See the full @ref fileselector_example_c "source code" for this example.
1783  *
1784  * @example fileselector_example.c
1785  */
1786
1787 /**
1788  * @page fileselector_button_example File selector button widget example
1789  *
1790  * This code places an Elementary file selector button widget on a
1791  * window, along with some other checkboxes and a text entry. Those
1792  * are there just as knobs on the file selector button's state and to
1793  * display information from it.
1794  *
1795  * Here's how we instantiate it:
1796  * @dontinclude fileselector_button_example.c
1797  * @skip ic = elm_icon_add
1798  * @until evas_object_show
1799  *
1800  * Note that we set on it both icon and label decorations. It's set to
1801  * list the contents of the @c "/tmp" directory, too, with
1802  * elm_fileselector_button_path_set(). What follows are checkboxes to
1803  * exercise some of its API funtions:
1804  * @dontinclude fileselector_button_example.c
1805  * @skip ck = elm_check_add
1806  * @until evas_object_show(en)
1807  *
1808  * The checkboxes will toggle whether the file selector button's
1809  * internal file selector:
1810  * - must have an editable text entry for file names (thus, be in
1811  *   "save dialog mode")
1812  * - is to be raised as an "inner window" (note it's the default
1813  *   behavior) or as a dedicated window
1814  * - is to populate its view with folders only
1815  * - is to expand its folders, in its view, <b>in place</b>, and not
1816  *   repainting it entirely just with the contents of a sole
1817  *   directory.
1818  *
1819  * The entry labeled @c "Last selection" will exercise the @c
1820  * "file,chosen" smart event coming from the file selector button:
1821  * @dontinclude fileselector_button_example.c
1822  * @skip hook on the
1823  * @until toggle inwin
1824  *
1825  * Whenever you dismiss or acknowledges the file selector, after it's
1826  * raised, the @c event_info string will contain the last selection on
1827  * it (if any was made).
1828  *
1829  * This is how the example, just after called, should look like:
1830  *
1831  * @image html screenshots/fileselector_button_example_00.png
1832  * @image latex screenshots/fileselector_button_example_00.eps width=\textwidth
1833  *
1834  * Click on the file selector button to raise its internal file
1835  * selector, which will be contained on an <b>"inner window"</b>:
1836  *
1837  * @image html screenshots/fileselector_button_example_01.png
1838  * @image latex screenshots/fileselector_button_example_01.eps width=\textwidth
1839  *
1840  * Toggle the "inwin mode" switch off and, if you click on the file
1841  * selector button again, you'll get @b two windows, the original one
1842  * (note the last selection there!)
1843  *
1844  * @image html screenshots/fileselector_button_example_02.png
1845  * @image latex screenshots/fileselector_button_example_02.eps width=\textwidth
1846  *
1847  * and the file selector's new one
1848  *
1849  * @image html screenshots/fileselector_button_example_03.png
1850  * @image latex screenshots/fileselector_button_example_03.eps width=\textwidth
1851  *
1852  * Play with the checkboxes to get the behavior changes on the file
1853  * selector button. The respective API calls on the widget coming from
1854  * those knobs where shown in the code already.
1855  *
1856  * See the full @ref fileselector_button_example_c "source code" for
1857  * this example.
1858  *
1859  * @example fileselector_button_example.c
1860  */
1861
1862 /**
1863  * @page fileselector_entry_example File selector entry widget example
1864  *
1865  * This code places an Elementary file selector entry widget on a
1866  * window, along with some other checkboxes. Those are there just as
1867  * knobs on the file selector entry's state.
1868  *
1869  * Here's how we instantiate it:
1870  * @dontinclude fileselector_entry_example.c
1871  * @skip ic = elm_icon_add
1872  * @until evas_object_show
1873  *
1874  * Note that we set on it's button both icon and label
1875  * decorations. It's set to exhibit the path of (and list the contents
1876  * of, when internal file selector is launched) the @c "/tmp"
1877  * directory, also, with elm_fileselector_entry_path_set(). What
1878  * follows are checkboxes to exercise some of its API funtions:
1879  * @dontinclude fileselector_entry_example.c
1880  * @skip ck = elm_check_add
1881  * @until callback_add(fs_entry
1882  *
1883  * The checkboxes will toggle whether the file selector entry's
1884  * internal file selector:
1885  * - must have an editable text entry for file names (thus, be in
1886  *   "save dialog mode")
1887  * - is to be raised as an "inner window" (note it's the default
1888  *   behavior) or as a dedicated window
1889  * - is to populate its view with folders only
1890  * - is to expand its folders, in its view, <b>in place</b>, and not
1891  *   repainting it entirely just with the contents of a sole
1892  *   directory.
1893  *
1894  * Observe how the entry's text will match the string coming from the
1895  * @c "file,chosen" smart event:
1896  * @dontinclude fileselector_entry_example.c
1897  * @skip hook on the
1898  * @until }
1899  * Whenever you dismiss or acknowledges the file selector, after it's
1900  * raised, the @c event_info string will contain the last selection on
1901  * it (if any was made).
1902  *
1903  * Try, also, to type in a valid system path and, then, open the file
1904  * selector's window: it will start the file browsing there, for you.
1905  *
1906  * This is how the example, just after called, should look like:
1907  *
1908  * @image html screenshots/fileselector_entry_example_00.png
1909  * @image latex screenshots/fileselector_entry_example_00.eps width=\textwidth
1910  *
1911  * Click on the file selector entry to raise its internal file
1912  * selector, which will be contained on an <b>"inner window"</b>:
1913  *
1914  * @image html screenshots/fileselector_entry_example_01.png
1915  * @image latex screenshots/fileselector_entry_example_01.eps width=\textwidth
1916  *
1917  * Toggle the "inwin mode" switch off and, if you click on the file
1918  * selector entry again, you'll get @b two windows, the original one
1919  * (note the last selection there!)
1920  *
1921  * @image html screenshots/fileselector_entry_example_02.png
1922  * @image latex screenshots/fileselector_entry_example_02.eps width=\textwidth
1923  *
1924  * and the file selector's new one
1925  *
1926  * @image html screenshots/fileselector_entry_example_03.png
1927  * @image latex screenshots/fileselector_entry_example_03.eps width=\textwidth
1928  *
1929  * Play with the checkboxes to get the behavior changes on the file
1930  * selector entry. The respective API calls on the widget coming from
1931  * those knobs where shown in the code already.
1932  *
1933  * See the full @ref fileselector_entry_example_c "source code" for
1934  * this example.
1935  *
1936  * @example fileselector_entry_example.c
1937  */
1938
1939 /**
1940  * @page tutorial_hover Hover example
1941  * @dontinclude hover_example_01.c
1942  *
1943  * On this example we are going to have a button that when clicked will show our
1944  * hover widget, this hover will have content set on it's left, top, right and
1945  * middle positions. In the middle position we are placing a button that when
1946  * clicked will hide the hover. We are also going to use a non-default theme
1947  * for our hover. We won't explain the functioning of button for that see @ref
1948  * Button.
1949  *
1950  * We start our example with a couple of callbacks that show and hide the data
1951  * they're given(which we'll see later on is the hover widget):
1952  * @skip static
1953  * @until }
1954  * @until }
1955  *
1956  * In our main function we'll do some initialization and then create 3
1957  * rectangles, one red, one green and one blue to use in our hover. We'll also
1958  * create the 2 buttons that will show and hide the hover:
1959  * @until show(bt2)
1960  *
1961  * With all of that squared away we can now get to the heart of the matter,
1962  * creating our hover widget, which is easy as pie:
1963  * @until hover
1964  *
1965  * Having created our hover we now need to set the parent and target. Which if
1966  * you recall from the function documentations are going to tell the hover which
1967  * area it should cover and where it should be centered:
1968  * @until bt
1969  *
1970  * Now we set the theme for our hover. We're using the popout theme which gives
1971  * our contents a white background and causes their appearance to be animated:
1972  * @until popout
1973  *
1974  * And finally we set the content for our positions:
1975  * @until bt2
1976  *
1977  * So far so good? Great 'cause that's all there is too it, what is left now is
1978  * just connecting our buttons to the callbacks we defined at the beginning of
1979  * the example and run the main loop:
1980  * @until ELM_MAIN
1981  *
1982  * Our example will initially look like this:
1983  *
1984  * @image html screenshots/hover_example_01.png
1985  * @image latex screenshots/hover_example_01.eps width=\textwidth
1986  *
1987  * And after you click the "Show hover" button it will look like this:
1988  *
1989  * @image html screenshots/hover_example_01_a.png
1990  * @image latex screenshots/hover_example_01_a.eps width=\textwidth
1991  *
1992  * @example hover_example_01.c
1993  */
1994
1995 /**
1996   * @page tutorial_flip Flip example
1997   * @dontinclude flip_example_01.c
1998   *
1999   * This example will show a flip with two rectangles on it(one blue, one
2000   * green). Our example will allow the user to choose the animation the flip
2001   * uses and to interact with it. To allow the user to choose the interaction
2002   * mode we use radio buttons, we will however not explain them, if you would
2003   * like to know more about radio buttons see @ref radio.
2004   *
2005   * We start our example with the usual setup and then create the 2 rectangles
2006   * we will use in our flip:
2007   * @until show(rect2)
2008   *
2009   * The next thing to do is to create our flip and set it's front and back
2010   * content:
2011   * @until show
2012   *
2013   * The next thing we do is set the interaction mode(which the user can later
2014   * change) to the page animation:
2015   * @until PAGE
2016   *
2017   * Setting a interaction mode however is not sufficient, we also need to
2018   * choose which directions we allow interaction from, for this example we
2019   * will use all of them:
2020   * @until RIGHT
2021   *
2022   * We are also going to set the hitsize to the entire flip(in all directions)
2023   * to make our flip very easy to interact with:
2024   * @until RIGHT
2025   *
2026   * After that we create our radio buttons and start the main loop:
2027   * @until ELM_MAIN()
2028   *
2029   * When the user clicks a radio button a function that changes the
2030   * interaction mode and animates the flip is called:
2031   * @until }
2032   * @note The elm_flip_go() call here serves no purpose other than to
2033   * ilustrate that it's possible to animate the flip programmatically.
2034   *
2035   * Our example will look like this:
2036   *
2037   * @image html screenshots/flip_example_01.png
2038   * @image latex screenshots/flip_example_01.eps width=\textwidth
2039   *
2040   * @note Since this is an animated example the screenshot doesn't do it
2041   * justice, it is a good idea to compile it and see the animations.
2042   *
2043   * @example flip_example_01.c
2044   */
2045
2046  /**
2047   * @page tutorial_label Label example
2048   * @dontinclude label_example_01.c
2049   *
2050   * In this example we are going to create 6 labels, set some properties on
2051   * them and see what changes in appearance those properties cause.
2052   *
2053   * We start with the setup code that by now you should be familiar with:
2054   * @until show(bg)
2055   *
2056   * For our first label we have a moderately long text(that doesn't fit in the
2057   * label's width) so we will make it a sliding label. Since the text isn't
2058   * too long we don't need the animation to be very long, 3 seconds should
2059   * give us a nice speed:
2060   * @until show(label
2061   *
2062   * For our second label we have the same text, but this time we aren't going
2063   * to have it slide, we're going to ellipsize it. Because we ask our label
2064   * widget to ellipsize the text it will first diminsh the fontsize so that it
2065   * can show as much of the text as possible:
2066   * @until show(label
2067   *
2068   * For the third label we are going to ellipsize the text again, however this
2069   * time to make sure the fontsize isn't diminshed we will set a line wrap.
2070   * The wrap won't actually cause a line break because we set the label to
2071   * ellipsize:
2072   * @until show(label
2073   *
2074   * For our fourth label we will set line wrapping but won't set ellipsis, so
2075   * that our text will indeed be wrapped instead of ellipsized. For this label
2076   * we choose character wrap:
2077   * @until show(label
2078   *
2079   * Just two more, for our fifth label we do the same as for the fourth
2080   * except we set the wrap to word:
2081   * @until show(label
2082   *
2083   * And last but not least for our sixth label we set the style to "marker" and
2084   * the color to red(the default color is white which would be hard to see on
2085   * our white background):
2086   * @until show(label
2087   *
2088   * Our example will look like this:
2089   *
2090   * @image html screenshots/label_example_01.png
2091   * @image latex screenshots/label_example_01.eps width=\textwidth
2092   *
2093   * @example label_example_01.c
2094   */
2095
2096  /**
2097   * @page tutorial_image Image example
2098   * @dontinclude image_example_01.c
2099   *
2100   * This example is as simple as possible. An image object will be added to the
2101   * window over a white background, and set to be resizeable together with the
2102   * window. All the options set through the example will affect the behavior of
2103   * this image.
2104   *
2105   * We start with the code for creating a window and its background, and also
2106   * add the code to write the path to the image that will be loaded:
2107   *
2108   * @skip int
2109   * @until snprintf
2110   *
2111   * Now we create the image object, and set that file to be loaded:
2112   *
2113   * @until }
2114   *
2115   * We can now go setting our options.
2116   *
2117   * elm_image_no_scale_set() is used just to set this value to true (we
2118   * don't want to scale our image anyway, just resize it).
2119   *
2120   * elm_image_scale_set() is used to allow the image to be resized to a size
2121   * smaller than the original one, but not to a size bigger than it.
2122   *
2123   * elm_elm_image_smooth_set() will disable the smooth scaling, so the scale
2124   * algorithm used to scale the image to the new object size is going to be
2125   * faster, but with a lower quality.
2126   *
2127   * elm_image_orient_set() is used to flip the image around the (1, 0) (0, 1)
2128   * diagonal.
2129   *
2130   * elm_image_aspect_ratio_retained_set() is used to keep the original aspect
2131   * ratio of the image, even when the window is resized to another aspect ratio.
2132   *
2133   * elm_image_fill_outside_set() is used to ensure that the image will fill the
2134   * entire area available to it, even if keeping the aspect ratio. The image
2135   * will overflow its width or height (any of them that is necessary) to the
2136   * object area, instead of resizing the image down until it can fit entirely in
2137   * this area.
2138   *
2139   * elm_image_editable_set() is used just to cover the API, but won't affect
2140   * this example since we are not using any copy & paste property.
2141   *
2142   * This is the code for setting these options:
2143   *
2144   * @until editable
2145   *
2146   * Now some last touches in our object size hints, window and background, to
2147   * display this image properly:
2148   *
2149   * @until ELM_MAIN
2150   *
2151   * This example will look like this:
2152   *
2153   * @image html screenshots/image_example_01.png
2154   * @image latex screenshots/image_example_01.eps width=\textwidth
2155   *
2156   * @example image_example_01.c
2157   */
2158
2159  /**
2160   * @page tutorial_icon Icon example
2161   * @dontinclude icon_example_01.c
2162   *
2163   * This example is as simple as possible. An icon object will be added to the
2164   * window over a white background, and set to be resizeable together with the
2165   * window. All the options set through the example will affect the behavior of
2166   * this icon.
2167   *
2168   * We start with the code for creating a window and its background:
2169   *
2170   * @skip int
2171   * @until show(bg)
2172   *
2173   * Now we create the icon object, and set lookup order of the icon, and choose
2174   * the "home" icon:
2175   *
2176   * @until home
2177   *
2178   * An intersting thing is that after setting this, it's possible to check where
2179   * in the filesystem is the theme used by this icon, and the name of the group
2180   * used:
2181   *
2182   * @until printf
2183   *
2184   * We can now go setting our options.
2185   *
2186   * elm_icon_no_scale_set() is used just to set this value to true (we
2187   * don't want to scale our icon anyway, just resize it).
2188   *
2189   * elm_icon_scale_set() is used to allow the icon to be resized to a size
2190   * smaller than the original one, but not to a size bigger than it.
2191   *
2192   * elm_elm_icon_smooth_set() will disable the smooth scaling, so the scale
2193   * algorithm used to scale the icon to the new object size is going to be
2194   * faster, but with a lower quality.
2195   *
2196   * elm_icon_fill_outside_set() is used to ensure that the icon will fill the
2197   * entire area available to it, even if keeping the aspect ratio. The icon
2198   * will overflow its width or height (any of them that is necessary) to the
2199   * object area, instead of resizing the icon down until it can fit entirely in
2200   * this area.
2201   *
2202   * This is the code for setting these options:
2203   *
2204   * @until fill_outside
2205   *
2206   * However, if you try this example you may notice that this image is not being
2207   * affected by all of these options. This happens because the used icon will be
2208   * from elementary theme, and thus it has its own set of options like smooth
2209   * scaling and fill_outside options. You can change the "home" icon to use some
2210   * image (from your system) and see that then those options will be respected.
2211   *
2212   * Now some last touches in our object size hints, window and background, to
2213   * display this icon properly:
2214   *
2215   * @until ELM_MAIN
2216   *
2217   * This example will look like this:
2218   *
2219   * @image html screenshots/icon_example_01.png
2220   * @image latex screenshots/icon_example_01.eps width=\textwidth
2221   *
2222   * @example icon_example_01.c
2223   */
2224
2225 /**
2226  * @page tutorial_hoversel Hoversel example
2227  * @dontinclude hoversel_example_01.c
2228  *
2229  * In this example we will create a hoversel with 3 items, one with a label but
2230  * no icon and two with both a label and an icon. Every item that is clicked
2231  * will be deleted, but everytime the hoversel is activated we will also add an
2232  * item. In addition our first item will print all items when clicked and our
2233  * third item will clear all items in the hoversel.
2234  *
2235  * We will start with the normal creation of window stuff:
2236  * @until show(bg)
2237  *
2238  * Next we will create a red rectangle to use as the icon of our hoversel:
2239  * @until show
2240  *
2241  * And now we create our hoversel and set some of it's properties. We set @p win
2242  * as its parent, ask it to not be horizontal(be vertical) and give it a label
2243  * and icon:
2244  * @until icon_set
2245  *
2246  * Next we will add our three items, setting a callback to be called for the
2247  * first and third:
2248  * @until _rm_items
2249  *
2250  * We also set a pair of callbacks to be called whenever any item is selected or
2251  * when the hoversel is activated:
2252  * @until clicked
2253  *
2254  * And then ask that our hoversel be shown and run the main loop:
2255  * @until ELM_MAIN
2256  *
2257  * We now have the callback for our first item which prints all items in the
2258  * hoversel:
2259  * @until }
2260  *
2261  * Next we have the callback for our third item which removes all items from the
2262  * hoversel:
2263  * @until }
2264  *
2265  * Next we have the callback that is called whenever an item is clicked and
2266  * deletes that item:
2267  * @until }
2268  *
2269  * And the callback that is called when the hoversel is activated and adds an
2270  * item to the hoversel. Note that since we allocate memory for the item we need
2271  * to know when the item dies so we can free that memory:
2272  * @until }
2273  *
2274  * And finally the callback that frees the memory we allocated for items created
2275  * in the @p _add_item callback:
2276  * @until }
2277  *
2278  * Our example will initially look like this:
2279  *
2280  * @image html screenshots/hoversel_example_01.png
2281  * @image latex screenshots/hoversel_example_01.eps width=\textwidth
2282  *
2283  * And when the hoversel is clicked it will look like this:
2284  *
2285  * @image html screenshots/hoversel_example_01_a.png
2286  * @image latex screenshots/hoversel_example_01_a.eps width=\textwidth
2287  *
2288  * @example hoversel_example_01.c
2289  */
2290
2291 /**
2292  * @page conformant_example Conformant Example.
2293  *
2294  * In this example we'll explain how to create applications to work
2295  * with illume, considering space required for virtual keyboards.
2296  *
2297  * Illume is a module for Enlightenment that modifies the user interface
2298  * to work cleanly and nicely on a mobile device. It has support for
2299  * virtual keyboard, among other nice features.
2300  *
2301  * Let's start creating a very simple window with a vertical box
2302  * with multi-line entry between two buttons.
2303  * This entry will expand filling all space on window not used by buttons.
2304  *
2305  * @dontinclude conformant_example_01.c
2306  * @skipline elm_main
2307  * @until }
2308  *
2309  * For information about how to create windows, boxes, buttons or entries,
2310  * look for documentation for these widgets.
2311  *
2312  * It will looks fine when you don't need a virtual keyboard, as you
2313  * can see on the following image:
2314  *
2315  * @image html screenshots/conformant_example_01.png
2316  * @image latex screenshots/conformant_example_01.eps width=\textwidth
2317  *
2318  * But if you call a virtual keyboard, the window will resize, changing
2319  * widgets size and position. All the content will shrink.
2320  * The window will look like this:
2321  *
2322  * @image html screenshots/conformant_example_02.png
2323  * @image latex screenshots/conformant_example_02.eps width=\textwidth
2324  *
2325  * If you don't want such behaviour, you
2326  * will need a conformant to account for space taken up by the indicator,
2327  * virtual keyboard and softkey windows.
2328  *
2329  * In this case, using the conformant in a proper way, you will have
2330  * a window like the following when the virtual keyboard is hidden:
2331  *
2332  * @image html screenshots/conformant_example_03.png
2333  * @image latex screenshots/conformant_example_03.eps width=\textwidth
2334  *
2335  * As you can see, it guess the space that will be required by the keyboard.
2336  * Verify how perfectly it fits when keyboard is visible:
2337  *
2338  * @image html screenshots/conformant_example_04.png
2339  * @image latex screenshots/conformant_example_04.eps width=\textwidth
2340  *
2341  * So, let's study each step required to transform our initial example on
2342  * the second one.
2343  *
2344  * First of all, we need to set the window as an illume conformant window:
2345  * @dontinclude conformant_example_02.c
2346  * @skipline elm_win_conformant_set
2347  *
2348  * Next, we'll add a conformant widget, and set it to resize with the window,
2349  * instead of the box.
2350  * @skipline conform
2351  * @until evas_object_show
2352  *
2353  * Finally, we'll set the box as conformant's content, just like this:
2354  * @skipline elm_conformant_content_set
2355  *
2356  * Compare both examples code:
2357  * @ref conformant_example_01.c "conformant_example_01.c"
2358  * @ref conformant_example_02.c "conformant_example_02.c"
2359  *
2360  * @example conformant_example_01.c
2361  * @example conformant_example_02.c
2362  */
2363
2364 /**
2365  * @page bg_example_01_c bg_example_01.c
2366  * @include bg_example_01.c
2367  * @example bg_example_01.c
2368  */
2369
2370 /**
2371  * @page bg_example_02_c bg_example_02.c
2372  * @include bg_example_02.c
2373  * @example bg_example_02.c
2374  */
2375
2376 /**
2377  * @page bg_example_03_c bg_example_03.c
2378  * @include bg_example_03.c
2379  * @example bg_example_03.c
2380  */
2381
2382 /**
2383  * @page actionslider_example_01 Actionslider example
2384  * @include actionslider_example_01.c
2385  * @example actionslider_example_01.c
2386  */
2387
2388 /**
2389  * @page animator_example_01_c Animator example 01
2390  * @include animator_example_01.c
2391  * @example animator_example_01.c
2392  */
2393
2394 /**
2395  * @page transit_example_01_c Transit example 1
2396  * @include transit_example_01.c
2397  * @example transit_example_01.c
2398  */
2399
2400 /**
2401  * @page transit_example_02_c Transit example 2
2402  * @include transit_example_02.c
2403  * @example transit_example_02.c
2404  */
2405
2406 /**
2407  * @page general_functions_example_c General (top-level) functions example
2408  * @include general_funcs_example.c
2409  * @example general_funcs_example.c
2410  */
2411
2412 /**
2413  * @page clock_example_c Clock example
2414  * @include clock_example.c
2415  * @example clock_example.c
2416  */
2417
2418 /**
2419  * @page flipselector_example_c Flipselector example
2420  * @include flipselector_example.c
2421  * @example flipselector_example.c
2422  */
2423
2424 /**
2425  * @page fileselector_example_c Fileselector example
2426  * @include fileselector_example.c
2427  * @example fileselector_example.c
2428  */
2429
2430 /**
2431  * @page fileselector_button_example_c Fileselector button example
2432  * @include fileselector_button_example.c
2433  * @example fileselector_button_example.c
2434  */
2435
2436 /**
2437  * @page fileselector_entry_example_c Fileselector entry example
2438  * @include fileselector_entry_example.c
2439  * @example fileselector_entry_example.c
2440  */