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