elementary/genlist - Explaining the examples.
[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 spinner_example
35  *
36  * @ref clock_example
37  *
38  * @ref diskselector_example_01
39  *
40  * @ref diskselector_example_02
41  *
42  * @ref list_example_01
43  *
44  * @ref list_example_02
45  *
46  * @ref list_example_03
47  *
48  * @ref flipselector_example
49  *
50  * @ref fileselector_example
51  *
52  * @ref fileselector_button_example
53  *
54  * @ref fileselector_entry_example
55  *
56  * @ref index_example_01
57  *
58  * @ref index_example_02
59  *
60  * @ref gengrid_example
61  *
62  * @ref genlist_example_01
63  *
64  * @ref genlist_example_02
65  */
66
67 /**
68  * @page bg_01_example_page elm_bg - Plain color background.
69  * @dontinclude bg_example_01.c
70  *
71  * The full code for this example can be found at @ref bg_example_01_c,
72  * in the function @c test_bg_plain. It's part of the @c elementar_test
73  * suite, and thus has the code for the three examples referenced by this
74  * documentation.
75  *
76  * This first example just sets a default background with a plain color. The
77  * first part consists of creating an Elementary window. It's the common
78  * piece of code that you'll see everywhere in Elementary: @skip elm_main
79  * @until autodel_set
80  *
81  * Now we really create our background object, using the window object as
82  * its parent:
83  *
84  * @skipline bg_add
85  *
86  * Then we set the size hints of the background object so that it will use
87  * all space available for it, and then add it as a resize object to the
88  * window, making it visible in the end:
89  *
90  * @skip size_hint_weight_set
91  * @until resize_object_add
92  *
93  * See @ref evas_object_size_hint_weight_set and elm_win_resize_object_add()
94  * for more detailed info about these functions.
95  *
96  * The end of the example is quite simple, just setting the minimum and
97  * maximum size of the background, so the Elementary window knows that it
98  * has to have at least the minimum size. The background also won't scale to
99  * a size above its maximum. Then we resize the window and show it in the
100  * end:
101  *
102  * @skip set size hints
103  * @until }
104  *
105  * And here we finish our very simple background object usage example.
106  */
107
108 /**
109  * @page bg_02_example_page elm_bg - Image background.
110  * @dontinclude bg_example_02.c
111  *
112  * The full code for this example can be found at @ref bg_example_02_c,
113  * in the function @c test_bg_image. It's part of the @c elementar_test
114  * suite, and thus has the code for the three examples referenced by this
115  * documentation.
116  *
117  * This is the second example, and shows how to use the Elementary
118  * background object to set an image as background of your application.
119  *
120  * We start this example exactly in the same way as the previous one, even
121  * when creating the background object:
122  *
123  * @skip elm_main
124  * @until bg_add
125  *
126  * Now it's the different part.
127  *
128  * Our background will have an image, that will be displayed over the
129  * background color. Before loading the image, we set the load size of the
130  * image. The load size is a hint about the size that we want the image
131  * displayed in the screen. It's not the exact size that the image will have,
132  * but usually a bit bigger. The background object can still be scaled to a
133  * size bigger than the one set here. Setting the image load size to
134  * something smaller than its real size will reduce the memory used to keep
135  * the pixmap representation of the image, and the time to load it. Here we
136  * set the load size to 20x20 pixels, but the image is loaded with a size
137  * bigger than that (since it's just a hint):
138  *
139  * @skipline load_size_set
140  *
141  * And set our background image to be centered, instead of stretched or
142  * scaled, so the effect of the elm_bg_load_size_set() can be easily
143  * understood:
144  *
145  * @skipline option_set
146  *
147  * We need a filename to set, so we get one from the previous installed
148  * images in the @c PACKAGE_DATA_DIR, and write its full path to a buffer.
149  * Then we use this buffer to set the filename in the background object:
150  *
151  * @skip snprintf
152  * @until bg_file_set
153  *
154  * Notice that the third argument of the elm_bg_file_set() function is @c
155  * NULL, since we are setting an image to this background. This function
156  * also supports setting an edje group as background, in which case the @c
157  * group parameter wouldn't be @c NULL, but be the name of the group
158  * instead.
159  *
160  * Finally, we can set the size hints, add the background as a resize
161  * object, and resize the window, exactly the same thing we do in the @ref
162  * bg_01_example_page example:
163  *
164  * @skip size_hint
165  * @until }
166  *
167  * And this is the end of this example.
168  *
169  * This example will look like this:
170  *
171  * @image html screenshots/bg_01.png
172  * @image latex screenshots/bg_01.eps width=\textwidth
173  */
174
175 /**
176  * @page bg_03_example_page elm_bg - Background properties.
177  * @dontinclude bg_example_03.c
178  *
179  * The full code for this example can be found at @ref bg_example_03_c, in the
180  * function @c test_bg_options, with the callbacks @c _cb_overlay_changed, @c
181  * _cb_color_changed and @c _cb_radio_changed defined in the beginning of the
182  * file. It's part of the @c elementar_test suite, and thus has the code for
183  * the three examples referenced by this documentation.
184  *
185  * This example will show the properties available for the background object,
186  * and will use of some more widgets to set them.
187  *
188  * In order to do this, we will set some callbacks for these widgets. The
189  * first is for the radio buttons that will be used to choose the option
190  * passed as argument to elm_bg_option_set():
191  *
192  * @skip _cb_radio_changed
193  * @until }
194  *
195  * The next callback will be used when setting the overlay (using
196  * elm_bg_overlay_set()):
197  *
198  * @skip _cb_overlay_changed
199  * @until }
200  * @until }
201  *
202  * And the last one, used to set the color (with elm_bg_color_set()):
203  *
204  * @skip _cb_color_changed
205  * @until }
206  *
207  * We will get back to what these functions do soon. If you want to know more
208  * about how to set these callbacks and what these widgets are, look for:
209  * @li elm_radio_add()
210  * @li elm_check_add()
211  * @li elm_spinner_add()
212  *
213  * Now going to the main function, @c test_bg_options, we have the common
214  * code with the other examples:
215  *
216  * @skip bg-options
217  * @until autodel_set
218  *
219  * We add a plain background to this window, so it will have the default
220  * background color behind everything:
221  *
222  * @skip bg = elm_bg_add
223  * @until evas_object_show(bg)
224  *
225  * Then we add a vertical box (elm_box_add()) that will hold the background
226  * object that we are going to play with, as well as a horizontal box that
227  * will hold widgets:
228  *
229  * @skip elm_box_add
230  * @until evas_object_show
231  *
232  * Now we add the background object that is going to be of use for our
233  * example. It is an image background, as used in @ref bg_02_example_page ,
234  * so the code should be familiar:
235  *
236  * @skip elm_bg_add
237  * @until evas_object_show
238  *
239  * Notice the call to elm_box_pack_end(): it will pack the background object
240  * in the end of the Elementary box declared above. Just refer to that
241  * documentation for more info.
242  *
243  * Since this Elementary background is already an image background, we are
244  * going to play with its other properties. We will change its option
245  * (CENTER, SCALE, STRETCH, TILE), its color (RGB), and add an overlay to it.
246  * For all of these properties, we are going to add widgets that will
247  * configure them.
248  *
249  * First, lets add the horizontal box that will hold these widgets:
250  * @skip hbox
251  * @until align_set
252  *
253  * For now, just consider this @c hbox as a rectangle that will contain the
254  * widgets, and will distribute them horizontally inside its content. Then we
255  * add radio buttons that will allow us to choose the property to use with
256  * this background:
257  *
258  * @skip radio_add
259  * @until evas_object_show
260  *
261  * Again, I won't give details about the use of these widgets, just look for
262  * their documentation if necessary. It's enough to know for now that we are
263  * packing them in the @c hbox, setting a label for them, and the most
264  * important parts: setting its value to @c ELM_BG_OPTION_CENTER and its
265  * callback to @c _cb_radio_changed (the function defined in the beginning of
266  * this example). We do this for the next 3 radio buttons added after this
267  * one, each of them with a different value.
268  *
269  * Now taking a look at the code of the callback @c _cb_radio_changed again,
270  * it will call elm_bg_option_set() with the value set from the checked radio
271  * button, thus setting the option for this background. The background is
272  * passed as argument to the @p data parameter of this callback, and is
273  * referenced here as @c o_bg.
274  *
275  * Later we set the default value for this radio button:
276  *
277  * @skipline elm_radio_value_set
278  *
279  * Then we add a checkbox for the elm_bg_overlay_set() function:
280  *
281  * @skip check_add
282  * @until evas_object_show
283  *
284  * Now look at the code of the @c _cb_overlay_changed again. If the checkbox
285  * state is checked, an overlay will be added to the background. It's done by
286  * creating an Edje object, and setting it with elm_bg_overlay_set() to the
287  * background object. For information about what are and how to set Edje
288  * object, look at the Edje documentation.
289  *
290  * Finally we add a spinner object (elm_spinner_add()) to be used to select
291  * the color of our background. In its callback it's possible to see the call
292  * to elm_bg_color_set(), which will change the color of this background.
293  * This color is used by the background to fill areas where the image doesn't
294  * cover (in this case, where we have an image background). The spinner is
295  * also packed into the @c hbox :
296  *
297  * @skip elm_spinner_add
298  * @until evas_object_show
299  *
300  * Then we just have to pack the @c hbox inside the @c box, set some size
301  * hints, and show our window:
302  *
303  * @skip pack_end
304  * @until }
305  *
306  * Now to see this code in action, open elementary_test, and go to the "Bg
307  * Options" test. It should demonstrate what was implemented here.
308  */
309
310 /**
311  * @page actionslider_example_page Actionslider usage
312  * @dontinclude actionslider_example_01.c
313  *
314  * For this example we are going to assume knowledge of evas smart callbacks
315  * and some basic evas object functions. Elementary is not meant to be used
316  * without evas, if you're not yet familiar with evas it probably is worth
317  * checking that out.
318  *
319  * And now to the example, when using Elementary we start by including
320  * Elementary.h:
321  * @skipline #include
322  *
323  * Next we define some callbacks, they all share the same signature because
324  * they are all to be used with evas_object_smart_callback_add().
325  * The first one just prints the selected label(in two different ways):
326  * @until }
327  *
328  * This next callback is a little more interesting, it makes the selected
329  * label magnetic(except if it's the center label):
330  * @until }
331  *
332  * This callback enables or disables the magnetic propertty of the center
333  * label:
334  * @until }
335  *
336  * And finally a callback to stop the main loop when the window is closed:
337  * @until }
338  *
339  * To be able to create our actionsliders we need to do some setup, but this
340  * isn't really relevant here, so if you want to know about that go @ref
341  * Win "here".
342  *
343  * With all that boring stuff out of the way we can proceed to creating some
344  * actionsliders.@n
345  * All actionsliders are created the same way:
346  * @skipline actionslider_add
347  * Next we must choose where the indicator starts, and for this one we choose
348  * the right, and set the right as magnetic:
349  * @skipline indicator_pos_set
350  * @until magnet_pos_set
351  *
352  * We then set the labels for the left and right, passing NULL as an argument
353  * to any of the labels makes that position have no label.
354  * @until Stop
355  *
356  * Furthermore we mark both left and right as enabled positions, if we didn't
357  * do this all three positions would be enabled:
358  * @until RIGHT
359  *
360  * Having the the enabled positions we now add a smart callback to change
361  * which position is magnetic, so that only the last selected position is
362  * magnetic:
363  * @until NULL
364  *
365  * And finally we set our printing callback and show the actionslider:
366  * @until object_show
367  * @skip pack_end
368  *
369  * For our next actionslider we are going to do much as we did for the
370  * previous except we are going to have the center as the magnet(and not
371  * change it):
372  * @skipline actionslider_add
373  * @skipline indicator_pos_set
374  * @until object_show
375  *
376  * And another actionslider, in this one the indicator starts on the left.
377  * It has labels only in the center and right, and both bositions are
378  * magnetic. Because the left doesn't have a label and is not magnetic once
379  * the indicator leaves it can't return:
380  * @skipline actionslider_add
381  * @skipline indicator_pos_set
382  * @until object_show
383  * @note The greyed out area is a @ref Styles "style".
384  *
385  * And now an actionslider with a label in the indicator, and whose magnet
386  * properties change based on what was last selected:
387  * @skipline actionslider_add
388  * @skipline indicator_pos_set
389  * @until object_show
390  * @note The greyed out area is a @ref Styles "style".
391  *
392  * We are almost done, this next one is just an actionslider with all
393  * positions magnetized and having every possible label:
394  * @skipline actionslider_add
395  * @skipline indicator_pos_set
396  * @until object_show
397  *
398  * And for our last actionslider we have one that turns the magnetic property
399  * on and off:
400  * @skipline actionslider_add
401  * @skipline indicator_pos_set
402  * @until object_show
403  *
404  * The example will look like this:
405  *
406  * @image html screenshots/actionslider_01.png
407  * @image latex screenshots/actionslider_01.eps width=\textwidth
408  *
409  * See the full source code @ref actionslider_example_01 "here"
410  */
411
412 /**
413  * @page elm_animator_example_page_01 Animator usage
414  * @dontinclude animator_example_01.c
415  *
416  * For this example we will be using a bit of evas, you could animate a
417  * elementary widget in much the same way, but to keep things simple we use
418  * an evas_object_rectangle.
419  *
420  * As every other example we start with our include and a simple callback to
421  * exit the app when the window is closed:
422  * @skipline #include
423  * @until }
424  *
425  * This next callback is the one that actually creates our animation, it
426  * changes the size, position and color of a rectangle given to it in @a
427  * data:
428  * @until }
429  *
430  * Next we have a callback that prints a string, nothing special:
431  * @until }
432  *
433  * This next callback is a little more interesting, it has a state variable
434  * to know if the animation is currently paused or running, and it toogles
435  * the state of the animation accordingly:
436  * @until }
437  * @until }
438  * @until }
439  *
440  * Finally we have a callback to stop the animation:
441  * @until }
442  *
443  * As with every example we need to do a bit of setup before we can actually
444  * use an animation, but for the purposes of this example that's not relevant
445  * so let's just skip to the good stuff, creating an animator:
446  * @skipline animator_add
447  * @note Since elm_animator is not a widget we can give it a NULL parent.
448  *
449  * Now that we have an elm_animator we set it's duration to 1 second:
450  * @line duration_set
451  *
452  * We would also like our animation to be reversible, so:
453  * @line reverse_set
454  *
455  * We also set our animation to repeat as many times as possible, which will
456  * mean that _end_cb will only be called after UINT_MAX * 2 seconds(UINT_MAX
457  * for the animation running forward and UNIT_MAX for the animation running
458  * backwards):
459  * @line repeat_set
460  *
461  * To add some fun to our animation we will use the IN_OUT curve style:
462  * @line curve_style
463  *
464  * To actually animate anything we need an operation callback:
465  * @line operation_callback
466  *
467  * Even though we set our animation to repeat for a very long time we are
468  * going to set a end callback to it:
469  * @line completion_callback
470  * @note Notice that stoping the animation with the stop button will not make
471  * _end_cb be called.
472  *
473  * Now that we have fully set up our animator we can tell it to start
474  * animating:
475  * @line animate
476  *
477  * There's a bit more of code that doesn't really matter to use so we skip
478  * right down to our last interesting point:
479  * @skipline animator_del
480  * @note Because we created our animator with no parent we need to delete it
481  * ourselves.
482  *
483  * The example should look like this:
484  *
485  * @image html screenshots/animator_example_01.png
486  * @image latex screenshots/animator_example_01.eps width=\textwidth
487  * @n
488  * @image html screenshots/animator_example_02.png
489  * @image latex screenshots/animator_example_02.eps width=\textwidth
490  * @n
491  * @image html screenshots/animator_example_03.png
492  * @image latex screenshots/animator_example_03.eps width=\textwidth
493  *
494  * The full source code for this example can be found @ref
495  * animator_example_01_c "here"
496  */
497
498 /**
499  * @page transit_example_03_c elm_transit - Combined effects and options.
500  *
501  * This example shows how to apply the following transition effects:
502  * @li translation
503  * @li color
504  * @li rotation
505  * @li wipe
506  * @li zoom
507  * @li resizing
508  *
509  * It allows you to apply more than one effect at once, and also allows to
510  * set properties like event_enabled, auto_reverse, repeat_times and
511  * tween_mode.
512  *
513  * @include transit_example_03.c
514  */
515
516 /**
517  * @page transit_example_04_c elm_transit - Combined effects over two objects.
518  *
519  * This example shows how to apply the transition effects:
520  * @li flip
521  * @li resizable_flip
522  * @li fade
523  * @li blend
524  * over two objects. This kind of transition effect is used to make one
525  * object disappear and another one appear on its place.
526  *
527  * You can mix more than one effect of this type on the same objects, and the
528  * transition will apply both.
529  *
530  * @include transit_example_04.c
531  */
532
533 /**
534  * @page transit_example_01_explained elm_transit - Basic transit usage.
535  * @dontinclude transit_example_01.c
536  *
537  * The full code for this example can be found at @ref transit_example_01_c.
538  *
539  * This example shows the simplest way of creating a transition and applying
540  * it to an object. Similarly to every other elementary example, we create a
541  * window, set its title, size, autodel property, and setup a callback to
542  * exit the program when finished:
543  *
544  * @skip on_done
545  * @until evas_object_resize
546  *
547  * We also add a resizeable white background to use behind our animation:
548  *
549  * @skip bg_add
550  * @until evas_object_show
551  *
552  * And then we add a button that we will use to demonstrate the effects of
553  * our animation:
554  *
555  * @skip button_add
556  * @until evas_object_show(win)
557  *
558  * Notice that we are not adding the button with elm_win_resize_object_add()
559  * because we don't want the window to control the size of the button. We
560  * will use the transition to change the button size, so it could conflict
561  * with something else trying to control that size.
562  *
563  * Now, the simplest code possible to create the resize animation:
564  *
565  * @skip transit_add
566  * @until transit_go
567  *
568  * As you can see, this code is very easy to understand. First, we create the
569  * transition itself with elm_transit_add(). Then we add the button to this
570  * transition with elm_transit_object_add(), which means that the transition
571  * will operate over this button. The effect that we want now is changing the
572  * object size from 100x50 to 300x150, and can be achieved by adding the
573  * resize effect with elm_transit_effect_resizing_add().
574  *
575  * Finally, we set the transition time to 5 seconds and start the transition
576  * with elm_transit_go(). If we wanted more effects applied to this
577  * button, we could add them to the same transition. See the
578  * @ref transit_example_03_c to watch many transitions being applied to an
579  * object.
580  */
581
582 /**
583  * @page transit_example_02_explained elm_transit - Chained transitions.
584  * @dontinclude transit_example_02.c
585  *
586  * The full code for this example can be found at @ref transit_example_02_c.
587  *
588  * This example shows how to implement a chain of transitions. This chain is
589  * used to start a transition just after another transition ended. Similarly
590  * to every other elementary example, we create a window, set its title,
591  * size, autodel property, and setup a callback to exit the program when
592  * finished:
593  *
594  * @skip on_done
595  * @until evas_object_resize
596  *
597  * We also add a resizeable white background to use behind our animation:
598  *
599  * @skip bg_add
600  * @until evas_object_show
601  *
602  * This example will have a chain of 4 transitions, each of them applied to
603  * one button. Thus we create 4 different buttons:
604  *
605  * @skip button_add
606  * @until evas_object_show(bt4)
607  *
608  * Now we create a simple translation transition that will be started as soon
609  * as the program loads. It will be our first transition, and the other
610  * transitions will be started just after this transition ends:
611  *
612  * @skip transit_add
613  * @until transit_go
614  *
615  * The code displayed until now has nothing different from what you have
616  * already seen in @ref transit_example_01_explained, but now comes the new
617  * part: instead of creating a second transition that will start later using
618  * a timer, we create the it normally, and use
619  * elm_transit_chain_transit_add() instead of elm_transit_go. Since we are
620  * adding it in a chain after the first transition, it will start as soon as
621  * the first transition ends:
622  *
623  * @skip transit_add
624  * @until transit_chain_transit_add
625  *
626  * Finally we add the 2 other transitions to the chain, and run our program.
627  * It will make one transition start after the other finish, and there is the
628  * transition chain.
629  */
630
631 /**
632  * @page general_functions_example_page General (top-level) functions example
633  * @dontinclude general_funcs_example.c
634  *
635  * As told in their documentation blocks, the
636  * elm_app_compile_*_dir_set() family of functions have to be called
637  * before elm_app_info_set():
638  * @skip tell elm about
639  * @until elm_app_info_set
640  *
641  * We are here setting the fallback paths to the compiling time target
642  * paths, naturally. If you're building the example out of the
643  * project's build system, we're assuming they are the canonical ones.
644  *
645  * After the program starts, elm_app_info_set() will actually run and
646  * then you'll see an intrincasy: Elementary does the prefix lookup @b
647  * twice. This is so because of the quicklaunch infrastructure in
648  * Elementary (@ref Start), which will register a predefined prefix
649  * for possible users of the launch schema. We're not hooking into a
650  * quick launch, so this first call can't be avoided.
651  *
652  * If you ran this example from your "bindir" installation
653  * directiory, no output will emerge from these both attempts -- it
654  * will find the "magic" file there registered and set the prefixes
655  * silently. Otherwise, you could get something like:
656  @verbatim
657  WARNING: Could not determine its installed prefix for 'ELM'
658        so am falling back on the compiled in default:
659          usr
660        implied by the following:
661          bindir    = usr/lib
662          libdir    = usr/lib
663          datadir   = usr/share/elementary
664          localedir = usr/share/locale
665        Try setting the following environment variables:
666          ELM_PREFIX     - points to the base prefix of install
667        or the next 4 variables
668          ELM_BIN_DIR    - provide a specific binary directory
669          ELM_LIB_DIR    - provide a specific library directory
670          ELM_DATA_DIR   - provide a specific data directory
671          ELM_LOCALE_DIR - provide a specific locale directory
672  @endverbatim
673  * if you also didn't change those environment variables (remember
674  * they are also a valid way of communicating your prefix to the
675  * binary) - this is the scenario where it fallbacks to the paths set
676  * for compile time.
677  *
678  * Then, you can check the prefixes set on the standard output:
679  * @skip prefix was set to
680  * @until locale directory is
681  *
682  * In the fragment
683  * @skip by using this policy
684  * @until elm_win_autodel_set
685  * we demonstrate the use of Elementary policies. The policy defining
686  * under which circunstances our application should quit automatically
687  * is set to when its last window is closed (this one has just one
688  * window, though). This will save us from having to set a callback
689  * ourselves on the window, like done in @ref bg_example_01_c "this"
690  * example. Note that we need to tell the window to delete itself's
691  * object on a request to destroy the canvas coming, with
692  * elm_win_autodel_set().
693  *
694  * What follows is some boilerplate code, creating a frame with a @b
695  * button, our object of interest, and, below, widgets to change the
696  * button's behavior and exemplify the group of functions in question.
697  *
698  * @dontinclude general_funcs_example.c
699  * We enabled the focus highlight object for this window, so that you
700  * can keep track of the current focused object better:
701  * @skip elm_win_focus_highlight_enabled_set
702  * @until evas_object_show
703  * Use the tab key to navigate through the focus chain.
704  *
705  * @dontinclude general_funcs_example.c
706  * While creating the button, we exemplify how to use Elementary's
707  * finger size information to scale our UI:
708  * @skip fprintf(stdout, "Elementary
709  * @until evas_object_show
710  *
711  * @dontinclude general_funcs_example.c
712  * The first checkbox's callback is:
713  * @skip static void
714  * @until }
715  * When unsetting the checkbox, we disable the button, which will get a new
716  * decoration (greyed out) and stop receiving events. The focus chain
717  * will also ignore it.
718  *
719  * Following, there are 2 more buttons whose actions are focus/unfocus
720  * the top button, respectively:
721  * @skip focus callback
722  * @until }
723  * and
724  * @skip unfocus callback
725  * @until }
726  * Note the situations in which they won't take effect:
727  * - the button is not allowed to get focus or
728  * - the button is disabled
729  *
730  * The first restriction above you'll get by a second checkbox, whose
731  * callback is:
732  * @skip focus allow callback
733  * @until }
734  * Note that the button will still get mouse events, though.
735  *
736  * Next, there's a slider controlling the button's scale:
737  * @skip scaling callback
738  * @until }
739  *
740  * Experiment with it, so you understand the effect better. If you
741  * change its value, it will mess with the button's original size,
742  * naturally.
743  *
744  * The full code for this example can be found
745  * @ref general_functions_example_c "here".
746  */
747
748 /**
749  * @page theme_example_01 Theme - Using extensions
750  *
751  * @dontinclude theme_example_01.c
752  *
753  * Using extensions is extremely easy, discarding the part where you have to
754  * write the theme for them.
755  *
756  * In the following example we'll be creating two buttons, one to load or
757  * unload our extension theme and one to cycle around three possible styles,
758  * one of which we created.
759  *
760  * After including our one and only header we'll jump to the callback for
761  * the buttons. First one takes care of loading or unloading our extension
762  * file, relative to the default theme set (thus the @c NULL in the
763  * functions first parameter).
764  * @skipline Elementary.h
765  * @skip static void
766  * @until }
767  * @until }
768  * @until }
769  *
770  * The second button, as we said before, will just switch around different
771  * styles. In this case we have three of them. The first one is our custom
772  * style, named after something very unlikely to find in the default theme.
773  * The other two styles are the standard and one more, anchor, which exists
774  * in the default and is similar to the default, except the button vanishes
775  * when the mouse is not over it.
776  * @skip static void
777  * @until }
778  * @until }
779  *
780  * So what happens if the style switches to our custom one when the
781  * extension is loaded? Elementary falls back to the default for the
782  * widget.
783  *
784  * And the main function, simply enough, will create the window, set the
785  * buttons and their callbacks, and just to begin with our button styled
786  * we're also loading our extension at the beginning.
787  * @skip int
788  * @until ELM_MAIN
789  *
790  * In this case we wanted to easily remove extensions, but all adding an
791  * extension does is tell Elementary where else it should look for themes
792  * when it can't find them in the default theme. Another way to do this
793  * is to set the theme search order using elm_theme_set(), but this requires
794  * that the developer is careful not to override any user configuration.
795  * That can be helped by adding our theme to the end of whatver is already
796  * set, like in the following snippet.
797  * @code
798  * char buf[4096];
799  * snprintf(buf, sizeof(buf), "%s:./theme_example.edj", elme_theme_get(NULL);
800  * elm_theme_set(NULL, buf);
801  * @endcode
802  *
803  * If we were using overlays instead of extensions, the same thing applies,
804  * but the custom theme must be added to the front of the search path.
805  *
806  * In the end, we should be looking at something like this:
807  *
808  * @image html screenshots/theme_example_01.png
809  * @image latex screenshots/theme_example_01.eps width=\textwidth
810  *
811  * That's all. Boringly simple, and the full code in one piece can be found
812  * @ref theme_example_01.c "here".
813  *
814  * And the code for our extension is @ref theme_example.edc "here".
815  *
816  * @example theme_example_01.c
817  * @example theme_example.edc
818  */
819
820 /**
821  * @page theme_example_02 Theme - Using overlays
822  *
823  * @dontinclude theme_example_02.c
824  *
825  * Overlays are like extensions in that you tell Elementary that some other
826  * theme contains the styles you need for your program. The difference is that
827  * they will be look in first, so they can override the default style of any
828  * widget.
829  *
830  * There's not much to say about them that hasn't been said in our previous
831  * example about @ref theme_example_01 "extensions", so going quickly through
832  * the code we have a function to load or unload the theme, which will be
833  * called when we click any button.
834  * @skipline Elementary.h
835  * @skip static void
836  * @until }
837  *
838  * And the main function, creating the window and adding some buttons to it.
839  * We load our theme as an overlay and nothing else. Notice there's no style
840  * set for any button there, which means they should be using the default
841  * that we override.
842  * @skip int
843  * @until ELM_MAIN
844  *
845  * That's pretty much it. The full code is @ref theme_example_02.c "here" and
846  * the definition of the theme is the same as before, and can be found in
847  * @ref theme_example.edc "here".
848  *
849  * @example theme_example_02.c
850  */
851
852  /**
853   * @page button_example_01 Button - Complete example
854   *
855   * @dontinclude button_example_01.c
856   *
857   * A button is simple, you click on it and something happens. That said,
858   * we'll go through an example to show in detail the button API less
859   * commonly used.
860   *
861   * In the end, we'll be presented with something that looks like this:
862   *
863   * @image html screenshots/button_01.png
864   * @image latex screenshots/button_01.eps width=\textwidth
865   *
866   * The full code of the example is @ref button_example_01.c "here" and we
867   * will follow here with a rundown of it.
868   *
869   * @skip Elementary.h
870   * @until Elementary.h
871   * @skip struct
872   * @until App_Data
873   *
874   * We have several buttons to set different times for the autorepeat timeouts
875   * of the buttons that use it and a few more that we keep track of in our
876   * data struct. The mid button doesn't do much, just moves around according
877   * to what other buttons the user presses. Then four more buttons to move the
878   * central one, and we're also keeping track of the icon set in the middle
879   * button, since when this one moves, we change the icon, and when movement
880   * is finished (by releasing one of the four arrow buttons), we set back the
881   * normal icon.
882   * @skip static void
883   * @until }
884   *
885   * Keeping any of those four buttons pressed will trigger their autorepeat
886   * callback, where we move the button doing some size hint magic. To
887   * understand how that works better, refer to the @ref Box documentation.
888   * Also, the first time the function is called, we change the icon in the
889   * middle button, using elm_button_icon_unset() first to keep the reference
890   * to the previous one, so we don't need to recreate it when we are done
891   * moving it.
892   * @skip static void
893   * @until }
894   * @until size_hint_align_set
895   * @until }
896   *
897   * One more callback for the option buttons, that just sets the timeouts for
898   * the different autorepeat options.
899   *
900   * @skip static void
901   * @until }
902   * @until }
903   * @until }
904   *
905   * And the main function, which does some setting up of the buttons in boxes
906   * to make things work. Here we'll go through some snippets only.
907   *
908   * For the option buttons, it's just the button with its label and callback.
909   * @skip elm_button_add
910   * @until smart_callback_add
911   *
912   * For the ones that move the central button, we have no labels. There are
913   * icons instead, and the autorepeat option is toggled.
914   * @skip Gap: 1.0
915   * @skip elm_button_add
916   * @until data.cursors.up
917   *
918   * And just to show the mid button, which doesn't have anything special.
919   * @skip data.cursors.left
920   * @skip elm_button_add
921   * @until data.mid
922   *
923   * And we are done.
924   *
925   * @example button_example_01.c
926   */
927
928 /**
929  * @page bubble_01_example_page elm_bubble - Simple use.
930  * @dontinclude bubble_example_01.c
931  *
932  * This example shows a bubble with all fields set(label, info, content and
933  * icon) and the selected corner changing when the bubble is clicked. To be
934  * able use a bubble we need to do some setup and create a window, for this
935  * example we are going to ignore that part of the code since it isn't
936  * relevant to the bubble.
937  *
938  * To have the selected corner change in a clockwise motion we are going to
939  * use the following callback:
940  * @skip static
941  * @until }
942  * @until }
943  *
944  * Here we are creating an elm_label that is going to be used as the content
945  * for our bubble:
946  * @skipline elm_label
947  * @until show
948  * @note You could use any evas_object for this, we are using an elm_label
949  * for simplicity.
950  *
951  * Despite it's name the bubble's icon doesn't have to be an icon, it can be
952  * any evas_object. For this example we are going to make the icon a simple
953  * blue rectangle:
954  * @until show
955  *
956  * And finally we have the actual bubble creation and the setting of it's
957  * label, info and content:
958  * @until content
959  * @skipline show
960  * @note Because we didn't set a corner, the default("top_left") will be
961  * used.
962  *
963  * Now that we have our bubble all that is left is connecting the "clicked"
964  * signals to our callback:
965  * @line smart_callback
966  *
967  * This last bubble we created was very complete, so it's pertinent to show
968  * that most of that stuff is optional a bubble can be created with nothing
969  * but content:
970  * @until content
971  * @skipline show
972  *
973  * Our example will look like this:
974  *
975  * @image html screenshots/bubble_example_01.png
976  * @image latex screenshots/bubble_example_01.eps width=\textwidth
977  *
978  * See the full source code @ref bubble_example_01.c here.
979  * @example bubble_example_01.c
980  */
981
982 /**
983  * @page box_example_01 Box - Basic API
984  *
985  * @dontinclude button_example_01.c
986  *
987  * As a special guest tonight, we have the @ref button_example_01 "simple
988  * button example". There are plenty of boxes in it, and to make the cursor
989  * buttons that moved a central one around when pressed, we had to use a
990  * variety of values for their hints.
991  *
992  * To start, let's take a look at the handling of the central button when
993  * we were moving it around. To achieve this effect without falling back to
994  * a complete manual positioning of the @c Evas_Object in our canvas, we just
995  * put it in a box and played with its alignment within it, as seen in the
996  * following snippet of the callback for the pressed buttons.
997  * @skip evas_object_size_hint_align_get
998  * @until evas_object_size_hint_align_set
999  *
1000  * Not much to it. We get the current alignment of the object and change it
1001  * by just a little, depending on which button was pressed, then set it
1002  * again, making sure we stay within the 0.0-1.0 range so the button moves
1003  * inside the space it has, instead of disappearing under the other objects.
1004  *
1005  * But as useful as an example as that may have been, the usual case with boxes
1006  * is to set everything at the moment they are created, like we did for
1007  * everything else in our main function.
1008  *
1009  * The entire layout of our program is made with boxes. We have one set as the
1010  * resize object for the window, which means it will always be resized with
1011  * the window. The weight hints set to @c EVAS_HINT_EXPAND will tell the
1012  * window that the box can grow past it's minimum size, which allows resizing
1013  * of it.
1014  * @skip elm_main
1015  * @skip elm_box_add
1016  * @until evas_object_show
1017  *
1018  * Two more boxes, set to horizontal, hold the buttons to change the autorepeat
1019  * configuration used by the buttons. We create each to take over all the
1020  * available space horizontally, but we don't want them to grow vertically,
1021  * so we keep that axis of the weight with 0.0. Then it gets packed in the
1022  * main box.
1023  * @skip box2
1024  * @until evas_object_show
1025  *
1026  * The buttons in each of those boxes have nothing special, they are just packed
1027  * in with their default values and the box will use their minimum size, as set
1028  * by Elementary itself based on the label, icon, finger size and theme.
1029  *
1030  * But the buttons used to move the central one have a special disposition.
1031  * The top one first, is placed right into the main box like our other smaller
1032  * boxes. Set to expand horizontally and not vertically, and in this case we
1033  * also tell it to fill that space, so it gets resized to take the entire
1034  * width of the window.
1035  * @skip Gap: 1.0
1036  * @skip elm_button_add
1037  * @until evas_object_show
1038  *
1039  * The bottom one will be the same, but for the other two we need to use a
1040  * second box set to take as much space as we have, so we can place our side
1041  * buttons in place and have the big empty space where the central button will
1042  * move.
1043  * @skip elm_box_add
1044  * @until evas_object_show
1045  *
1046  * Then the buttons will have their hints inverted to the other top and bottom
1047  * ones, to expand and fill vertically and keep their minimum size horizontally.
1048  * @skip elm_button_add
1049  * @until evas_object_show
1050  *
1051  * The central button takes every thing else. It will ask to be expanded in
1052  * both directions, but without filling its cell. Changing its alignment by
1053  * pressing the buttons will make it move around.
1054  * @skip elm_button_add
1055  * @until evas_object_show
1056  *
1057  * To end, the rightmost button is packed in the smaller box after the central
1058  * one, and back to the main box we have the bottom button at the end.
1059  */
1060
1061 /**
1062  * @page box_example_02 Box - Layout transitions
1063  *
1064  * @dontinclude box_example_02.c
1065  *
1066  * Setting a customized layout for a box is simple once you have the layout
1067  * function, which is just like the layout function for @c Evas_Box. The new
1068  * and fancier thing we can do with Elementary is animate the transition from
1069  * one layout to the next. We'll see now how to do that through a simple
1070  * example, while also taking a look at some of the API that was left
1071  * untouched in our @ref box_example_01 "previous example".
1072  *
1073  * @image html screenshots/box_example_02.png
1074  * @image latex screenshots/box_example_02.eps width=\textwidth
1075  *
1076  * @skipline Elementary.h
1077  *
1078  * Our application data consists of a list of layout functions, given by
1079  * @c transitions. We'll be animating through them throughout the entire run.
1080  * The box with the stuff to move around and the last layout that was set to
1081  * make things easier in the code.
1082  * @skip typedef
1083  * @until Transitions_Data
1084  *
1085  * The box starts with three buttons, clicking on any of them will take it
1086  * out of the box without deleting the object. There are also two more buttons
1087  * outside, one to add an object to the box and the other to clear it.
1088  * This is all to show how you can interact with the items in the box, add
1089  * things and even remove them, while the transitions occur.
1090  *
1091  * One of the callback we'll be using creates a new button, asks the box for
1092  * the list of its children and if it's not empty, we add the new object after
1093  * the first one, otherwise just place at the end as it will not make any
1094  * difference.
1095  * @skip static void
1096  * @until }
1097  * @until }
1098  *
1099  * The clear button is even simpler. Everything in the box will be deleted,
1100  * leaving it empty and ready to fill it up with more stuff.
1101  * @skip static void
1102  * @until }
1103  *
1104  * And a little function to remove buttons from the box without deleting them.
1105  * This one is set for the @c clicked callback of the original buttons,
1106  * unpacking them when clicked and placing it somewhere in the screen where
1107  * they will not disturb. Once we do this, the box no longer has any control
1108  * of it, so it will be left untouched until the program ends.
1109  * @skip static void
1110  * @until }
1111  *
1112  * If we wanted, we could just call @c evas_object_del() on the object to
1113  * destroy it. In this case, no unpack is really necessary, as the box would
1114  * be notified of a child being deleted and adjust its calculations accordingly.
1115  *
1116  * The core of the program is the following function. It takes whatever
1117  * function is first on our list of layouts and together with the
1118  * @c last_layout, it creates an ::Elm_Box_Transition to use with
1119  * elm_box_layout_transition(). In here, we tell it to start from whatever
1120  * layout we last set, end with the one that was at the top of the list and
1121  * when everything is finished, call us back so we can create another
1122  * transition. Finally, move the new layout to the end of the list so we
1123  * can continue running through them until the program ends.
1124  * @skip static void
1125  * @until }
1126  *
1127  * The main function doesn't have antyhing special. Creation of box, initial
1128  * buttons and some callback setting. The only part worth mentioning is the
1129  * initialization of our application data.
1130  * @skip tdata.box
1131  * @until evas_object_box_layout_stack
1132  *
1133  * We have a simple static variable, set the box, the first layout we are
1134  * using as last and create the list with the different functions to go
1135  * through.
1136  *
1137  * And in the end, we set the first layout and call the same function we went
1138  * through before to start the run of transitions.
1139  * @until _test_box_transition_change
1140  *
1141  * For the full code, follow @ref box_example_02.c "here".
1142  *
1143  * @example box_example_02.c
1144  */
1145
1146 /**
1147  * @page calendar_example_01 Calendar - Simple creation.
1148  * @dontinclude calendar_example_01.c
1149  *
1150  * As a first example, let's just display a calendar in our window,
1151  * explaining all steps required to do so.
1152  *
1153  * First you should declare objects we intend to use:
1154  * @skipline Evas_Object
1155  *
1156  * Then a window is created, a title is set and its set to be autodeleted.
1157  * More details can be found on windows examples:
1158  * @until elm_win_autodel
1159  *
1160  * Next a simple background is placed on our windows. More details on
1161  * @ref bg_01_example_page:
1162  * @until evas_object_show(bg)
1163  *
1164  * Now, the exciting part, let's add the calendar with elm_calendar_add(),
1165  * passing our window object as parent.
1166  * @until evas_object_show(cal);
1167  *
1168  * To conclude our example, we should show the window and run elm mainloop:
1169  * @until ELM_MAIN
1170  *
1171  * Our example will look like this:
1172  *
1173  * @image html screenshots/calendar_example_01.png
1174  * @image latex screenshots/calendar_example_01.eps width=\textwidth
1175  *
1176  * See the full source code @ref calendar_example_01.c here.
1177  * @example calendar_example_01.c
1178  */
1179
1180 /**
1181  * @page calendar_example_02 Calendar - Layout strings formatting.
1182  * @dontinclude calendar_example_02.c
1183  *
1184  * In this simple example, we'll explain how to format the label displaying
1185  * month and year, and also set weekday names.
1186  *
1187  * To format month and year label, we need to create a callback function
1188  * to create a string given the selected time, declared under a
1189  * <tt> struct tm </tt>.
1190  *
1191  * <tt> struct tm </tt>, declared on @c time.h, is a structure composed by
1192  * nine integers:
1193  * @li tm_sec   seconds [0,59]
1194  * @li tm_min   minutes [0,59]
1195  * @li tm_hour  hour [0,23]
1196  * @li tm_mday  day of month [1,31]
1197  * @li tm_mon   month of year [0,11]
1198  * @li tm_year  years since 1900
1199  * @li tm_wday  day of week [0,6] (Sunday = 0)
1200  * @li tm_yday  day of year [0,365]
1201  * @li tm_isdst daylight savings flag
1202  * @note glib version has 2 additional fields.
1203  *
1204  * For our function, only stuff that matters are tm_mon and tm_year.
1205  * But we don't need to access it directly, since there are nice functions
1206  * to format date and time, as @c strftime.
1207  * We will get abbreviated month (%b) and year (%y) (check strftime manpage
1208  * for more) in our example:
1209  * @skipline static char
1210  * @until }
1211  *
1212  * We need to alloc the string to be returned, and calendar widget will
1213  * free it when it's not needed, what is done by @c strdup.
1214  * So let's register our callback to calendar object:
1215  * @skipline elm_calendar_format_function_set
1216  *
1217  * To set weekday names, we should declare them as an array of strings:
1218  * @dontinclude calendar_example_02.c
1219  * @skipline weekdays
1220  * @until }
1221  *
1222  * And finally set them to calendar:
1223  * skipline weekdays_names_set
1224  *
1225  * Our example will look like this:
1226  *
1227  * @image html screenshots/calendar_example_02.png
1228  * @image latex screenshots/calendar_example_02.eps width=\textwidth
1229  *
1230  * See the full source code @ref calendar_example_02.c here.
1231  * @example calendar_example_02.c
1232  */
1233
1234 /**
1235  * @page calendar_example_03 Calendar - Years restrictions.
1236  * @dontinclude calendar_example_03.c
1237  *
1238  * This example explains how to set max and min year to be displayed
1239  * by a calendar object. This means that user won't be able to
1240  * see or select a date before and after selected years.
1241  * By default, limits are 1902 and maximun value will depends
1242  * on platform architecture (year 2037 for 32 bits); You can
1243  * read more about time functions on @c ctime manpage.
1244  *
1245  * Straigh to the point, to set it is enough to call
1246  * elm_calendar_min_max_year_set(). First value is minimun year, second
1247  * is maximum. If first value is negative, it won't apply limit for min
1248  * year, if the second one is negative, won't apply for max year.
1249  * Setting both to negative value will clear limits (default state):
1250  * @skipline elm_calendar_min_max_year_set
1251  *
1252  * Our example will look like this:
1253  *
1254  * @image html screenshots/calendar_example_03.png
1255  * @image latex screenshots/calendar_example_03.eps width=\textwidth
1256  *
1257  * See the full source code @ref calendar_example_03.c here.
1258  * @example calendar_example_03.c
1259  */
1260
1261 /**
1262  * @page calendar_example_04 Calendar - Days selection.
1263  * @dontinclude calendar_example_04.c
1264  *
1265  * It's possible to disable date selection and to select a date
1266  * from your program, and that's what we'll see on this example.
1267  *
1268  * If isn't required that users could select a day on calendar,
1269  * only interacting going through months, disabling days selection
1270  * could be a good idea to avoid confusion. For that:
1271  * @skipline elm_calendar_day_selection_enabled_set
1272  *
1273  * Also, regarding days selection, you could be interested to set a
1274  * date to be highlighted on calendar from your code, maybe when
1275  * a specific event happens, or after calendar creation. Let's select
1276  * two days from current day:
1277  * @dontinclude calendar_example_04.c
1278  * @skipline SECS_DAY
1279  * @skipline current_time
1280  * @until elm_calendar_selected_time_set
1281  *
1282  * Our example will look like this:
1283  *
1284  * @image html screenshots/calendar_example_04.png
1285  * @image latex screenshots/calendar_example_04.eps width=\textwidth
1286  *
1287  * See the full source code @ref calendar_example_04.c here.
1288  * @example calendar_example_04.c
1289  */
1290
1291 /**
1292  * @page calendar_example_05 Calendar - Signal callback and getters.
1293  * @dontinclude calendar_example_05.c
1294  *
1295  * Most of setters explained on previous examples have associated getters.
1296  * That's the subject of this example. We'll add a callback to display
1297  * all calendar information every time user interacts with the calendar.
1298  *
1299  * Let's check our callback function:
1300  * @skipline static void
1301  * @until double interval;
1302  *
1303  * To get selected day, we need to call elm_calendar_selected_time_get(),
1304  * but to assure nothing wrong happened, we must check for function return.
1305  * It'll return @c EINA_FALSE if fail. Otherwise we can use time set to
1306  * our structure @p stime.
1307  * @skipline elm_calendar_selected_time_get
1308  * @until return
1309  *
1310  * Next we'll get information from calendar and place on declared vars:
1311  * @skipline interval
1312  * @until elm_calendar_weekdays_names_get
1313  *
1314  * The only tricky part is that last line gets an array of strings
1315  * (char arrays), one for each weekday.
1316  *
1317  * Then we can simple print that to stdin:
1318  * @skipline printf
1319  * @until }
1320  *
1321  * <tt> struct tm </tt> is declared on @c time.h. You can check @c ctime
1322  * manpage to read about it.
1323  *
1324  * To register this callback, that will be called every time user selects
1325  * a day or goes to next or previous month, just add a callback for signal
1326  * @b changed.
1327  * @skipline evas_object_smart_callback_add
1328  *
1329  * Our example will look like this:
1330  *
1331  * @image html screenshots/calendar_example_05.png
1332  * @image latex screenshots/calendar_example_05.eps width=\textwidth
1333  *
1334  * See the full source code @ref calendar_example_05.c here.
1335  * @example calendar_example_05.c
1336  */
1337
1338 /**
1339  * @page calendar_example_06 Calendar - Calendar marks.
1340  * @dontinclude calendar_example_06.c
1341  *
1342  * On this example marks management will be explained. Functions
1343  * elm_calendar_mark_add(), elm_calendar_mark_del() and
1344  * elm_calendar_marks_clear() will be covered.
1345  *
1346  * To add a mark, will be required to choose three things:
1347  * @li mark style
1348  * @li mark date, or start date if it will be repeated
1349  * @li mark periodicity
1350  *
1351  * Style defines the kind of mark will be displayed over marked day,
1352  * on caledar. Default theme supports @b holiday and @b checked.
1353  * If more is required, is possible to set a new theme to calendar
1354  * widget using elm_object_style_set(), and use
1355  * the signal that will be used by such marks.
1356  *
1357  * Date is a <tt> struct tm </tt>, as defined by @c time.h. More can
1358  * be read on @c ctime manpage.
1359  * If a date relative from current is required, this struct can be set
1360  * as:
1361  * @skipline current_time
1362  * @until localtime_r
1363  *
1364  * Or if it's an absolute date, you can just declare the struct like:
1365  * @dontinclude calendar_example_06.c
1366  * @skipline sunday
1367  * @until christmas.tm_mon
1368  *
1369  * Periodicity is how frequently the mark will be displayed over the
1370  * calendar.  Can be a unique mark (that don't repeat), or it can repeat
1371  * daily, weekly, monthly or annually. It's enumerated by
1372  * @c Elm_Calendar_Mark_Repeat.
1373  *
1374  * So let's add some marks to our calendar. We will add christmas holiday,
1375  * set Sundays as holidays, and check current day and day after that.
1376  * @dontinclude calendar_example_06.c
1377  * @skipline sunday
1378  * @until christmas.tm_mon
1379  * @skipline current_time
1380  * @until ELM_CALENDAR_WEEKLY
1381  *
1382  * We kept the return of first mark add, because we don't really won't it
1383  * to be checked, so let's remove it:
1384  * @skipline elm_calendar_mark_del
1385  *
1386  * After all marks are added and removed, is required to draw them:
1387  * @skipline elm_calendar_marks_draw
1388  *
1389  * Finally, to clear all marks, let's set a callback for our button:
1390  * @skipline elm_button_add
1391  * @until evas_object_show(bt);
1392  *
1393  * This callback will receive our calendar object, and should clear it:
1394  * @dontinclude calendar_example_06.c
1395  * @skipline static
1396  * @until }
1397  * @note Remember to draw marks after clear the calendar.
1398  *
1399  * Our example will look like this:
1400  *
1401  * @image html screenshots/calendar_example_06.png
1402  * @image latex screenshots/calendar_example_06.eps width=\textwidth
1403  *
1404  * See the full source code @ref calendar_example_06.c here.
1405  * @example calendar_example_06.c
1406  */
1407
1408 /**
1409  * @page spinner_example Spinner widget example
1410  *
1411  * This code places seven Elementary spinner widgets on a window, each of
1412  * them exemplifying a part of the widget's API.
1413  *
1414  * The first of them is the default spinner:
1415  * @dontinclude spinner_example.c
1416  * @skipline elm_spinner_add
1417  * @until evas_object_show
1418  * As you see, the defaults for a spinner are:
1419  * @li no wrap
1420  * @li min value set to 0
1421  * @li max value set to 100
1422  * @li step value set to 1
1423  * @li label format set to "%0.f"
1424  *
1425  * If another format is required, see the second spinner. It will put a text
1426  * before and after the value, and also format value to display two decimals:
1427  * @skipline format_set
1428  *
1429  * The third one will use a customized step, define new minimum and maximum
1430  * values and enable wrap, so when value reaches minimum it jumps to maximum,
1431  * or jumps to minimum after maximum value is reached. Format is set to display
1432  * a decimal:
1433  * @skipline elm_spinner_add
1434  * @until evas_object_show
1435  *
1436  * The fourth uses @c vertical style, so instead of left and right arrows,
1437  * top and bottom are displayed. Also the change interval is reduced, so
1438  * user can change value faster.
1439  * @skipline style
1440  * @skipline interval
1441  *
1442  * In the fifth the user won't be allowed to set value directly, i.e., will
1443  * be obligate change value only using arrows:
1444  * @skipline editable
1445  *
1446  * The sixth widget will receive a lot of special values, so
1447  * instead of reading numeric values, user will see labels for each one.
1448  * Also direct edition is disabled, otherwise users would see the numeric
1449  * value on edition mode. User will be able to select a month in this widget:
1450  * @skipline elm_spinner_add
1451  * @until evas_object_show
1452  *
1453  * Finally the last widget will exemplify how to listen to widget's signals,
1454  * <tt> changed </tt> and <tt> delay,changed </tt>. First we need to
1455  * implement callback functions that will simply print spinner's value:
1456  * @dontinclude spinner_example.c
1457  * @skip static
1458  * @skip }
1459  * @skipline static
1460  * @until }
1461  * @until }
1462  *
1463  * The first callback function should be called everytime value changes,
1464  * the second one only after user stops to increment or decrement. Try
1465  * to keep arrows pressed and check the difference.
1466  * @skip smart_callback
1467  * @skipline smart_callback
1468  * @skipline smart_callback
1469  *
1470  * See the full @ref spinner_example.c "example", whose window should
1471  * look like this picture:
1472  *
1473  * @image html screenshots/spinner_example.png
1474  * @image latex screenshots/spinner_example.eps width=\textwidth
1475  *
1476  * See the full @ref spinner_example_c "source code" for this example.
1477  *
1478  * @example spinner_example.c
1479  */
1480
1481 /**
1482  * @page clock_example Clock widget example
1483  *
1484  * This code places five Elementary clock widgets on a window, each of
1485  * them exemplifying a part of the widget's API.
1486  *
1487  * The first of them is the pristine clock:
1488  * @dontinclude clock_example.c
1489  * @skip pristine
1490  * @until evas_object_show
1491  * As you see, the defaults for a clock are:
1492  * - military time
1493  * - no seconds shown
1494  *
1495  * For am/pm time, see the second clock:
1496  * @dontinclude clock_example.c
1497  * @skip am/pm
1498  * @until evas_object_show
1499  *
1500  * The third one will show the seconds digits, which will flip in
1501  * synchrony with system time. Note, besides, that the time itself is
1502  * @b different from the system's -- it was customly set with
1503  * elm_clock_time_set():
1504  * @dontinclude clock_example.c
1505  * @skip with seconds
1506  * @until evas_object_show
1507  *
1508  * In both fourth and fifth ones, we turn on the <b>edition
1509  * mode</b>. See how you can change each of the sheets on it, and be
1510  * sure to try holding the mouse pressed over one of the sheet
1511  * arrows. The forth one also starts with a custom time set:
1512  * @dontinclude clock_example.c
1513  * @skip in edition
1514  * @until evas_object_show
1515  *
1516  * The fifth, besides editable, has only the time @b units editable,
1517  * for hours, minutes and seconds. This exemplifies
1518  * elm_clock_digit_edit_set():
1519  * @dontinclude clock_example.c
1520  * @skip but only
1521  * @until evas_object_show
1522  *
1523  * See the full @ref clock_example.c "example", whose window should
1524  * look like this picture:
1525  *
1526  * @image html screenshots/clock_example.png
1527  * @image latex screenshots/clock_example.eps width=\textwidth
1528  *
1529  * See the full @ref clock_example_c "source code" for this example.
1530  *
1531  * @example clock_example.c
1532  */
1533
1534 /**
1535  * @page diskselector_example_01 Diskselector widget example
1536  *
1537  * This code places 4 Elementary diskselector widgets on a window, each of
1538  * them exemplifying a part of the widget's API.
1539  *
1540  * All of them will have weekdays as items, since we won't focus
1541  * on items management on this example. For an example about this subject,
1542  * check @ref diskselector_example_02.
1543  *
1544  * The first of them is a default diskselector.
1545  * @dontinclude diskselector_example_01.c
1546  * @skipline lbl
1547  * @until }
1548  * @skipline elm_diskselector_add
1549  * @until evas_object_show
1550  *
1551  * We are just adding the diskselector, so as you can see, defaults for it are:
1552  * @li Only 3 items visible each time.
1553  * @li Only 3 characters are displayed for labels on side positions.
1554  * @li The first added item remains centeres, i.e., it's the selected item.
1555  *
1556  * To add items, we are just appending it on a loop, using function
1557  * elm_diskselector_item_append(), that will be better exaplained on
1558  * items management example.
1559  *
1560  * For a circular diskselector, check the second widget. A circular
1561  * diskselector will display first item after last, and last previous to
1562  * the first one. So, as you can see, @b Sa will appears on left side
1563  * of selected @b Sunday. This property is set with
1564  * elm_diskselector_round_set().
1565  *
1566  * Also, we decide to display only 2 character for side labels, instead of 3.
1567  * For this we call elm_diskselector_side_label_length_set(). As result,
1568  * we'll see @b Mo displayed instead of @b Mon, when @b Monday is on a
1569  * side position.
1570  *
1571  * @skipline elm_diskselector_add
1572  * @until evas_object_show
1573  *
1574  * But so far, we are only displaying 3 items at once. If more are wanted,
1575  * is enough to call elm_diskselector_display_item_num_set(), as you can
1576  * see here:
1577  * @skipline elm_diskselector_add
1578  * @until evas_object_show
1579  *
1580  * @note You can't set less than 3 items to be displayed.
1581  *
1582  * Finally, if a bounce effect is required, or you would like to see
1583  * scrollbars, it is possible. But, for default theme, diskselector
1584  * scrollbars will be invisible anyway.
1585  * @skipline elm_diskselector_add
1586  * @until evas_object_show
1587  *
1588  * See the full @ref diskselector_example_01.c "diskselector_example_01.c"
1589  * code, whose window should look like this picture:
1590  *
1591  * @image html screenshots/diskselector_example_01.png
1592  * @image latex screenshots/diskselector_example_01.eps width=\textwidth
1593  *
1594  * @example diskselector_example_01.c
1595  */
1596
1597 /**
1598  * @page diskselector_example_02 Diskselector - Items management
1599  *
1600  * This code places a Elementary diskselector widgets on a window,
1601  * along with some buttons trigerring actions on it (though its API).
1602  * It covers most of Elm_Diskselector_Item functions.
1603  *
1604  * On our @c main function, we are adding a default diskselector with
1605  * 3 items. We are only setting their labels (second parameter of function
1606  * elm_diskselector_item_append):
1607  * @dontinclude diskselector_example_02.c
1608  * @skipline elm_diskselector_add
1609  * @until Item 2
1610  *
1611  * Next we are adding lots of buttons, each one for a callback function
1612  * that will realize a task covering part of diskselector items API.
1613  * Lets check the first one:
1614  * @skipline elm_button_add
1615  * @until evas_object_show
1616  *
1617  * We are labeling the button with a task description with
1618  * elm_object_text_set() and setting a callback
1619  * function evas_object_smart_callback_add().
1620  * Each callback function will have the signature:
1621  * <tt> static void _task_cb(void *data, Evas_Object *obj,
1622  * void *event_info)</tt> with the function name varying for each task.
1623  *
1624  * Now let's cover all of them.
1625  *
1626  * <b> Appending an item: </b>
1627  * @dontinclude diskselector_example_02.c
1628  * @skipline _add_cb
1629  * @until }
1630  *
1631  * All items are included on diskselector after last one. You @b can't
1632  * preprend items.
1633  *
1634  * The first parameter of elm_diskselector_item_append() is the diskselector
1635  * object, that we are receiving as data on our callback function.
1636  * The second one is a label, the string that will be placed in the center
1637  * of our item. As we don't wan't icons or callback functions, we can
1638  * send NULL as third, fourth and fifth parameters.
1639  *
1640  * <b> Appending an item with icon: </b>
1641  * @dontinclude diskselector_example_02.c
1642  * @skipline _add_ic_cb
1643  * @until }
1644  *
1645  * If an icon is required, you can pass it as third paramenter on our
1646  * elm_diskselector_item_append() function. It will be place on the
1647  * left side of item's label, that will be shifted to right a bit.
1648  *
1649  * For more details about how to create icons, look for elm_icon examples.
1650  *
1651  * <b> Appending an item with callback function for selected: </b>
1652  * @dontinclude diskselector_example_02.c
1653  * @skipline _sel_cb
1654  * @until }
1655  * @until }
1656  *
1657  * To set a callback function that will be called every time an item is
1658  * selected, i.e., everytime the diskselector stops with this item in
1659  * center position, just pass the function as fourth paramenter.
1660  *
1661  * <b> Appending an item with callback function for selected with data: </b>
1662  * @dontinclude diskselector_example_02.c
1663  * @skipline _sel_data_cb
1664  * @until }
1665  * @until }
1666  * @until }
1667  * @until }
1668  *
1669  * If the callback function request an extra data, it can be attached to our
1670  * item passing a pointer for data as fifth parameter.
1671  * Our function _sel_data_cb will receive it as <tt> void *data </tt>.
1672  *
1673  * If you want to free this data, or handle that the way you need when the
1674  * item is deleted, set a callback function for that, with
1675  * elm_diskselector_item_del_cb_set().
1676  *
1677  * As you can see we check if @c it is not @c NULL after appending it.
1678  * If an error happens, we won't try to set a function for it.
1679  *
1680  * <b> Deleting an item: </b>
1681  * @dontinclude diskselector_example_02.c
1682  * @skip _del_cb
1683  * @skipline _del_cb
1684  * @until }
1685  *
1686  * To delete an item we simple need to call elm_diskselector_item_del() with
1687  * a pointer for such item.
1688  *
1689  * If you need, you can get selected item with
1690  * elm_diskselector_selected_item_get(), that will return a pointer for it.
1691  *
1692  * <b> Unselecting an item: </b>
1693  * @dontinclude diskselector_example_02.c
1694  * @skipline _unselect_cb
1695  * @until }
1696  *
1697  * To select an item, you should call elm_diskselector_item_selected_set()
1698  * passing @c EINA_TRUE, and to unselect it, @c EINA_FALSE.
1699  *
1700  * If you unselect the selected item, diskselector will automatically select
1701  * the first item.
1702  *
1703  * <b> Printing all items: </b>
1704  * @dontinclude diskselector_example_02.c
1705  * @skipline _print_cb
1706  * @until }
1707  *
1708  * <b> Clearing the diskselector: </b>
1709  * @dontinclude diskselector_example_02.c
1710  * @skipline _clear_cb
1711  * @until }
1712  *
1713  * <b> Selecting the first item: </b>
1714  * @dontinclude diskselector_example_02.c
1715  * @skipline _select_first_cb
1716  * @until }
1717  *
1718  * <b> Selecting the last item: </b>
1719  * @dontinclude diskselector_example_02.c
1720  * @skipline _select_last_cb
1721  * @until }
1722  *
1723  * <b> Selecting the next item: </b>
1724  * @dontinclude diskselector_example_02.c
1725  * @skipline _select_next_cb
1726  * @until }
1727  *
1728  * <b> Selecting the previous item: </b>
1729  * @dontinclude diskselector_example_02.c
1730  * @skipline _select_prev_cb
1731  * @until }
1732  *
1733  * See the full @ref diskselector_example_02.c "diskselector_example_02.c"
1734  * code, whose window should look like this picture:
1735  *
1736  * @image html screenshots/diskselector_example_02.png
1737  * @image latex screenshots/diskselector_example_02.eps width=\textwidth
1738  *
1739  * @example diskselector_example_02.c
1740  */
1741
1742 /**
1743  * @page list_example_01 List widget example
1744  *
1745  * This code places a single Elementary list widgets on a window, just
1746  * to exemplify the more simple and common use case: a list will be created
1747  * and populated with a few items.
1748  *
1749  * To keep it simple, we won't show how to customize the list, for this check
1750  * @ref list_example_02. Also, we won't focus
1751  * on items management on this example. For an example about this subject,
1752  * check @ref list_example_03.
1753  *
1754  * To add a list widget.
1755  * @dontinclude list_example_01.c
1756  * @skipline elm_list_add
1757  *
1758  * We are just adding the list, so as you can see, defaults for it are:
1759  * @li Items are displayed vertically.
1760  * @li Only one item can be selected.
1761  * @li The list doesn't bouce.
1762  *
1763  * To add items, we are just appending it on a loop, using function
1764  * elm_list_item_append(), that will be better exaplained on
1765  * items management example.
1766  * @dontinclude list_example_01.c
1767  * @skipline lbl[]
1768  * @until };
1769  * @skipline for
1770  * @skipline elm_list_item_append
1771  *
1772  * After we just want to show the list. But first we need to start the widget.
1773  * It was done this way to improve widget's performance. So, always remember
1774  * that:
1775  * @warning Call elm_list_go before showing the object
1776  * @skipline elm_list_go
1777  * @skipline show
1778  *
1779  * See the full @ref list_example_01.c "list_example_01.c"
1780  * code, whose window should look like this picture:
1781  *
1782  * @image html screenshots/list_example_01.png
1783  * @image latex screenshots/list_example_01.eps width=\textwidth
1784  *
1785  * @example list_example_01.c
1786  */
1787
1788 /**
1789  * @page list_example_02 List widget example
1790  *
1791  * This code places a single Elementary list widgets on a window,
1792  * exemplifying a part of the widget's API.
1793  *
1794  * First, we will just create a simple list, as done on @ref list_example_01 :
1795  * @dontinclude list_example_02.c
1796  * @skipline lbl
1797  * @until }
1798  * @skipline elm_list_add
1799  * @until elm_list_item_append
1800  *
1801  * Now, let's customize this list a bit. First we will display items
1802  * horizontally:
1803  * @skipline horizontal_set
1804  *
1805  * Then we will choose another list mode. There are four of them, and
1806  * the default #Elm_List_Mode is #ELM_LIST_SCROLL. Let's set compress mode:
1807  * @skipline mode_set
1808  *
1809  * To enable multiple items selection, we need to enable it, since only one
1810  * selected item is allowed by default:
1811  * @skipline elm_list_multi_select_set
1812  *
1813  * We are not adding items with callback functions here,
1814  * since we'll explain it better on  @ref list_example_03. But if the callback
1815  * need to be called everytime user clicks an item, even if already selected,
1816  * it's required to enable this behavior:
1817  * @skipline elm_list_always_select_mode_set
1818  *
1819  * Finally, if a bounce effect is required, or you would like to see
1820  * scrollbars, it is possible. But, for default theme, list
1821  * scrollbars will be invisible anyway.
1822  * @skipline bounce_set
1823  * @until SCROLLER_POLICY_ON
1824  *
1825  * See the full @ref list_example_02.c "list_example_02.c"
1826  * code, whose window should look like this picture:
1827  *
1828  * @image html screenshots/list_example_02.png
1829  * @image latex screenshots/list_example_02.eps width=\textwidth
1830  *
1831  * @example list_example_02.c
1832  */
1833
1834 /**
1835  * @page list_example_03 List - Items management
1836  *
1837  * This code places a Elementary list widgets on a window,
1838  * along with some buttons trigerring actions on it (though its API).
1839  * It covers most of Elm_List_Item functions.
1840  *
1841  * On our @c main function, we are adding a default list with
1842  * 3 items. We are only setting their labels (second parameter of function
1843  * elm_list_item_append):
1844  * @dontinclude list_example_03.c
1845  * @skipline elm_list_add
1846  * @until Item 2
1847  *
1848  * Next we are adding lots of buttons, each one for a callback function
1849  * that will realize a task covering part of list items API.
1850  * Lets check the first one:
1851  * @skipline elm_button_add
1852  * @until evas_object_show
1853  *
1854  * We are labeling the button with a task description with
1855  * elm_object_text_set() and setting a callback
1856  * function evas_object_smart_callback_add().
1857  * Each callback function will have the signature:
1858  * <tt> static void _task_cb(void *data, Evas_Object *obj,
1859  * void *event_info)</tt> with the function name varying for each task.
1860  *
1861  * Now let's cover all of them.
1862  *
1863  * <b> Prepending an item: </b>
1864  * @dontinclude list_example_03.c
1865  * @skipline _prepend_cb
1866  * @until }
1867  *
1868  * The item will be placed on the begining of the list,
1869  * i.e. it will be the first one.
1870  *
1871  * The first parameter of elm_list_item_prepend() is the list
1872  * object, that we are receiving as data on our callback function.
1873  * The second one is a label, the string that will be placed in the center
1874  * of our item. As we don't wan't icons or callback functions, we can
1875  * send NULL as third, fourth, fifth and sixth parameters.
1876  *
1877  * <b> Appending an item: </b>
1878  * @dontinclude list_example_03.c
1879  * @skipline _add_cb
1880  * @until }
1881  *
1882  * Items included with append will be inserted inserted after the last one.
1883  *
1884  * <b> Appending an item with icon: </b>
1885  * @dontinclude list_example_03.c
1886  * @skipline _add_ic_cb
1887  * @until }
1888  *
1889  * If an icon is required, you can pass it as third paramenter on our
1890  * elm_list_item_append() function. It will be place on the
1891  * left side of item's label. If an icon is wanted on the right side,
1892  * it should be passed as fourth parameter.
1893  *
1894  * For more details about how to create icons, look for elm_icon examples
1895  * @ref tutorial_icon.
1896  *
1897  * <b> Appending an item with callback function for selected: </b>
1898  * @dontinclude list_example_03.c
1899  * @skipline _sel_cb
1900  * @until }
1901  * @until }
1902  *
1903  * To set a callback function that will be called every time an item is
1904  * selected, i.e., everytime the list stops with this item in
1905  * center position, just pass the function as fifth paramenter.
1906  *
1907  * <b> Appending an item with callback function for selected with data: </b>
1908  * @dontinclude list_example_03.c
1909  * @skipline _sel_data_cb
1910  * @until }
1911  * @until }
1912  * @until }
1913  * @until }
1914  *
1915  * If the callback function request an extra data, it can be attached to our
1916  * item passing a pointer for data as sixth parameter.
1917  * Our function _sel_data_cb will receive it as <tt> void *data </tt>.
1918  *
1919  * If you want to free this data, or handle that the way you need when the
1920  * item is deleted, set a callback function for that, with
1921  * elm_list_item_del_cb_set().
1922  *
1923  * As you can see we check if @c it is not @c NULL after appending it.
1924  * If an error happens, we won't try to set a function for it.
1925  *
1926  * <b> Deleting an item: </b>
1927  * @dontinclude list_example_03.c
1928  * @skipline _del_cb(
1929  * @until }
1930  *
1931  * To delete an item we simple need to call elm_list_item_del() with
1932  * a pointer for such item.
1933  *
1934  * If you need, you can get selected item with
1935  * elm_list_selected_item_get(), that will return a pointer for it.
1936  *
1937  * <b> Unselecting an item: </b>
1938  * @dontinclude list_example_03.c
1939  * @skipline _unselect_cb
1940  * @until }
1941  *
1942  * To select an item, you should call elm_list_item_selected_set()
1943  * passing @c EINA_TRUE, and to unselect it, @c EINA_FALSE.
1944  *
1945  * <b> Printing all items: </b>
1946  * @dontinclude list_example_03.c
1947  * @skipline _print_cb
1948  * @until }
1949  *
1950  * <b> Clearing the list: </b>
1951  * @dontinclude list_example_03.c
1952  * @skipline _clear_cb
1953  * @until }
1954  *
1955  * <b> Selecting the next item: </b>
1956  * @dontinclude list_example_03.c
1957  * @skipline _select_next_cb
1958  * @until }
1959  *
1960  * <b> Inserting after an item: </b>
1961  * @dontinclude list_example_03.c
1962  * @skipline _insert_after_cb
1963  * @until }
1964  *
1965  * <b> Selecting the previous item: </b>
1966  * @dontinclude list_example_03.c
1967  * @skipline _select_prev_cb
1968  * @until }
1969  *
1970  * <b> Inserting before an item: </b>
1971  * @dontinclude list_example_03.c
1972  * @skipline _insert_before_cb
1973  * @until }
1974  *
1975  * If a separator is required, just set an item as such:
1976  * @dontinclude list_example_03.c
1977  * @skipline _set_separator_cb
1978  * @until }
1979  *
1980  * Also an item can be disabled, and the user won't be allowed to (un)select it:
1981  * @dontinclude list_example_03.c
1982  * @skipline _disable_cb
1983  * @until }
1984  *
1985  * See the full @ref list_example_03.c "list_example_03.c"
1986  * code, whose window should look like this picture:
1987  *
1988  * @image html screenshots/list_example_03.png
1989  * @image latex screenshots/list_example_03.eps width=\textwidth
1990  *
1991  * @example list_example_03.c
1992  */
1993
1994 /**
1995  * @page flipselector_example Flip selector widget example
1996  *
1997  * This code places an Elementary flip selector widget on a window,
1998  * along with two buttons trigerring actions on it (though its API).
1999  *
2000  * The selector is being populated with the following items:
2001  * @dontinclude flipselector_example.c
2002  * @skip lbl[]
2003  * @until ;
2004  *
2005  * Next, we create it, populating it with those items and registering
2006  * two (smart) callbacks on it:
2007  * @dontinclude flipselector_example.c
2008  * @skip fp = elm_flipselector_add
2009  * @until object_show
2010  *
2011  * Those two callbacks will take place whenever one of those smart
2012  * events occur, and they will just print something to @c stdout:
2013  * @dontinclude flipselector_example.c
2014  * @skip underflow callback
2015  * @until static void
2016  * Flip the sheets on the widget while looking at the items list, in
2017  * the source code, and you'll get the idea of those events.
2018  *
2019  * The two buttons below the flip selector will take the actions
2020  * described in their labels:
2021  * @dontinclude flipselector_example.c
2022  * @skip bt = elm_button_add
2023  * @until callback_add(win
2024  *
2025  * @dontinclude flipselector_example.c
2026  * @skip unselect the item
2027  * @until underflow
2028  *
2029  * Click on them to exercise those flip selector API calls. To
2030  * interact with the other parts of this API, there's a command line
2031  * interface, whose help string can be asked for with the 'h' key:
2032  * @dontinclude flipselector_example.c
2033  * @skip commands
2034  * @until ;
2035  *
2036  * The 'n' and 'p' keys will exemplify elm_flipselector_flip_next()
2037  * and elm_flipselector_flip_prev(), respectively. 'f' and 'l' account
2038  * for elm_flipselector_first_item_get() and
2039  * elm_flipselector_last_item_get(), respectively. Finally, 's' will
2040  * issue elm_flipselector_selected_item_get() on our example flip
2041  * selector widget.
2042  *
2043  * See the full @ref flipselector_example.c "example", whose window should
2044  * look like this picture:
2045  *
2046  * @image html screenshots/flipselector_example.png
2047  * @image latex screenshots/flipselector_example.eps width=\textwidth
2048  *
2049  * See the full @ref flipselector_example_c "source code" for this example.
2050  *
2051  * @example flipselector_example.c
2052  */
2053
2054 /**
2055  * @page fileselector_example File selector widget example
2056  *
2057  * This code places two Elementary file selector widgets on a window.
2058  * The one on the left is layouting file system items in a @b list,
2059  * while the the other is layouting them in a @b grid.
2060  *
2061  * The one having the majority of hooks of interest is on the left,
2062  * which we create as follows:
2063  * @dontinclude fileselector_example.c
2064  * @skip first file selector
2065  * @until object_show
2066  *
2067  * Note that we enable custom edition of file/directory selection, via
2068  * the text entry it has on its bottom, via
2069  * elm_fileselector_is_save_set(). It starts with the list view, which
2070  * is the default, and we make it not expandable in place
2071  * (elm_fileselector_expandable_set()), so that it replaces its view's
2072  * contents with the current directory's entries each time one
2073  * navigates to a different folder.  For both of file selectors we are
2074  * starting to list the contents found in the @c "/tmp" directory
2075  * (elm_fileselector_path_set()).
2076  *
2077  * Note the code setting it to "grid mode" and observe the differences
2078  * in the file selector's views, in the example. We also hide the
2079  * second file selector's Ok/Cancel buttons -- since it's there just
2080  * to show the grid view (and navigation) -- via
2081  * elm_fileselector_buttons_ok_cancel_set().
2082  *
2083  * The @c "done" event, which triggers the callback below
2084  * @dontinclude fileselector_example.c
2085  * @skip 'done' cb
2086  * @until }
2087  * will be called at the time one clicks the "Ok"/"Cancel" buttons of
2088  * the file selector (on the left). Note that it will print the path
2089  * to the current selection, if any.
2090  *
2091  * The @c "selected" event, which triggers the callback below
2092  * @dontinclude fileselector_example.c
2093  * @skip bt = 'selected' cb
2094  * @until }
2095  * takes place when one selects a file (if the file selector is @b not
2096  * under folders-only mode) or when one selects a folder (when in
2097  * folders-only mode). Experiment it by selecting different file
2098  * system entries.
2099  *
2100  * What comes next is the code creating the three check boxes and two
2101  * buttons below the file selector in the right. They will exercise a
2102  * bunch of functions on the file selector's API, for the instance on
2103  * the left. Experiment with them, specially the buttons, to get the
2104  * difference between elm_fileselector_path_get() and
2105  * elm_fileselector_selected_get().
2106  *
2107  * Finally, there's the code adding the second file selector, on the
2108  * right:
2109  * @dontinclude fileselector_example.c
2110  * @skip second file selector
2111  * @until object_show
2112  *
2113  * Pay attention to the code setting it to "grid mode" and observe the
2114  * differences in the file selector's views, in the example. We also
2115  * hide the second file selector's Ok/Cancel buttons -- since it's
2116  * there just to show the grid view (and navigation) -- via
2117  * elm_fileselector_buttons_ok_cancel_set().
2118  *
2119  * See the full @ref fileselector_example.c "example", whose window
2120  * should look like this picture:
2121  *
2122  * @image html screenshots/fileselector_example.png
2123  * @image latex screenshots/fileselector_example.eps width=\textwidth
2124  *
2125  * See the full @ref fileselector_example_c "source code" for this example.
2126  *
2127  * @example fileselector_example.c
2128  */
2129
2130 /**
2131  * @page fileselector_button_example File selector button widget example
2132  *
2133  * This code places an Elementary file selector button widget on a
2134  * window, along with some other checkboxes and a text entry. Those
2135  * are there just as knobs on the file selector button's state and to
2136  * display information from it.
2137  *
2138  * Here's how we instantiate it:
2139  * @dontinclude fileselector_button_example.c
2140  * @skip ic = elm_icon_add
2141  * @until evas_object_show
2142  *
2143  * Note that we set on it both icon and label decorations. It's set to
2144  * list the contents of the @c "/tmp" directory, too, with
2145  * elm_fileselector_button_path_set(). What follows are checkboxes to
2146  * exercise some of its API funtions:
2147  * @dontinclude fileselector_button_example.c
2148  * @skip ck = elm_check_add
2149  * @until evas_object_show(en)
2150  *
2151  * The checkboxes will toggle whether the file selector button's
2152  * internal file selector:
2153  * - must have an editable text entry for file names (thus, be in
2154  *   "save dialog mode")
2155  * - is to be raised as an "inner window" (note it's the default
2156  *   behavior) or as a dedicated window
2157  * - is to populate its view with folders only
2158  * - is to expand its folders, in its view, <b>in place</b>, and not
2159  *   repainting it entirely just with the contents of a sole
2160  *   directory.
2161  *
2162  * The entry labeled @c "Last selection" will exercise the @c
2163  * "file,chosen" smart event coming from the file selector button:
2164  * @dontinclude fileselector_button_example.c
2165  * @skip hook on the
2166  * @until toggle inwin
2167  *
2168  * Whenever you dismiss or acknowledges the file selector, after it's
2169  * raised, the @c event_info string will contain the last selection on
2170  * it (if any was made).
2171  *
2172  * This is how the example, just after called, should look like:
2173  *
2174  * @image html screenshots/fileselector_button_example_00.png
2175  * @image latex screenshots/fileselector_button_example_00.eps width=\textwidth
2176  *
2177  * Click on the file selector button to raise its internal file
2178  * selector, which will be contained on an <b>"inner window"</b>:
2179  *
2180  * @image html screenshots/fileselector_button_example_01.png
2181  * @image latex screenshots/fileselector_button_example_01.eps width=\textwidth
2182  *
2183  * Toggle the "inwin mode" switch off and, if you click on the file
2184  * selector button again, you'll get @b two windows, the original one
2185  * (note the last selection there!)
2186  *
2187  * @image html screenshots/fileselector_button_example_02.png
2188  * @image latex screenshots/fileselector_button_example_02.eps width=\textwidth
2189  *
2190  * and the file selector's new one
2191  *
2192  * @image html screenshots/fileselector_button_example_03.png
2193  * @image latex screenshots/fileselector_button_example_03.eps width=\textwidth
2194  *
2195  * Play with the checkboxes to get the behavior changes on the file
2196  * selector button. The respective API calls on the widget coming from
2197  * those knobs where shown in the code already.
2198  *
2199  * See the full @ref fileselector_button_example_c "source code" for
2200  * this example.
2201  *
2202  * @example fileselector_button_example.c
2203  */
2204
2205 /**
2206  * @page fileselector_entry_example File selector entry widget example
2207  *
2208  * This code places an Elementary file selector entry widget on a
2209  * window, along with some other checkboxes. Those are there just as
2210  * knobs on the file selector entry's state.
2211  *
2212  * Here's how we instantiate it:
2213  * @dontinclude fileselector_entry_example.c
2214  * @skip ic = elm_icon_add
2215  * @until evas_object_show
2216  *
2217  * Note that we set on it's button both icon and label
2218  * decorations. It's set to exhibit the path of (and list the contents
2219  * of, when internal file selector is launched) the @c "/tmp"
2220  * directory, also, with elm_fileselector_entry_path_set(). What
2221  * follows are checkboxes to exercise some of its API funtions:
2222  * @dontinclude fileselector_entry_example.c
2223  * @skip ck = elm_check_add
2224  * @until callback_add(fs_entry
2225  *
2226  * The checkboxes will toggle whether the file selector entry's
2227  * internal file selector:
2228  * - must have an editable text entry for file names (thus, be in
2229  *   "save dialog mode")
2230  * - is to be raised as an "inner window" (note it's the default
2231  *   behavior) or as a dedicated window
2232  * - is to populate its view with folders only
2233  * - is to expand its folders, in its view, <b>in place</b>, and not
2234  *   repainting it entirely just with the contents of a sole
2235  *   directory.
2236  *
2237  * Observe how the entry's text will match the string coming from the
2238  * @c "file,chosen" smart event:
2239  * @dontinclude fileselector_entry_example.c
2240  * @skip hook on the
2241  * @until }
2242  * Whenever you dismiss or acknowledges the file selector, after it's
2243  * raised, the @c event_info string will contain the last selection on
2244  * it (if any was made).
2245  *
2246  * Try, also, to type in a valid system path and, then, open the file
2247  * selector's window: it will start the file browsing there, for you.
2248  *
2249  * This is how the example, just after called, should look like:
2250  *
2251  * @image html screenshots/fileselector_entry_example_00.png
2252  * @image latex screenshots/fileselector_entry_example_00.eps width=\textwidth
2253  *
2254  * Click on the file selector entry to raise its internal file
2255  * selector, which will be contained on an <b>"inner window"</b>:
2256  *
2257  * @image html screenshots/fileselector_entry_example_01.png
2258  * @image latex screenshots/fileselector_entry_example_01.eps width=\textwidth
2259  *
2260  * Toggle the "inwin mode" switch off and, if you click on the file
2261  * selector entry again, you'll get @b two windows, the original one
2262  * (note the last selection there!)
2263  *
2264  * @image html screenshots/fileselector_entry_example_02.png
2265  * @image latex screenshots/fileselector_entry_example_02.eps width=\textwidth
2266  *
2267  * and the file selector's new one
2268  *
2269  * @image html screenshots/fileselector_entry_example_03.png
2270  * @image latex screenshots/fileselector_entry_example_03.eps width=\textwidth
2271  *
2272  * Play with the checkboxes to get the behavior changes on the file
2273  * selector entry. The respective API calls on the widget coming from
2274  * those knobs where shown in the code already.
2275  *
2276  * See the full @ref fileselector_entry_example_c "source code" for
2277  * this example.
2278  *
2279  * @example fileselector_entry_example.c
2280  */
2281
2282 /**
2283  * @page layout_example_01 Layout - Content, Table and Box
2284  *
2285  * This example shows how one can use the @ref Layout widget to create a
2286  * customized distribution of widgets on the screen, controled by an Edje theme.
2287  * The full source code for this example can be found at @ref
2288  * layout_example_01_c.
2289  *
2290  * Our custom layout is defined by a file, @ref layout_example_edc, which is an
2291  * Edje theme file. Look for the Edje documentation to understand it. For now,
2292  * it's enough to know that we describe some specific parts on this layout
2293  * theme:
2294  * @li a title text field;
2295  * @li a box container;
2296  * @li a table container;
2297  * @li and a content container.
2298  *
2299  * Going straight to the code, the following snippet instantiates the layout
2300  * widget:
2301  *
2302  * @dontinclude layout_example_01.c
2303  * @skip elm_layout_add
2304  * @until evas_object_show(layout)
2305  *
2306  * As any other widget, we set some properties for the size calculation. But
2307  * notice on this piece of code the call to the function elm_layout_file_set().
2308  * Here is where the theme file is loaded, and particularly the specific group
2309  * from this theme file. Also notice that the theme file here is referenced as
2310  * an .edj, which is a .edc theme file compiled to its binary form. Again, look
2311  * for the Edje documentation for more information about theme files.
2312  *
2313  * Next, we fetch from our theme a data string referenced by the key "title".
2314  * This data was defined in the theme, and can be used as parameters which the
2315  * program get from the specific theme that it is using. In this case, we store
2316  * the title of this window and program in the theme, as a "data" entry, just
2317  * for demonstration purposes:
2318  *
2319  * @until }
2320  *
2321  * This call elm_layout_data_get() is used to fetch the string based on the key,
2322  * and elm_object_text_part_set() will set the part defined in the theme as
2323  * "example/title" to contain this string. This key "example/title" has nothing
2324  * special. It's just an arbitrary convention that we are using in this example.
2325  * Every string in this example referencing a part of this theme will be of the
2326  * form "example/<something>".
2327  *
2328  * Now let's start using our layout to distribute things on the window space.
2329  * Since the layout was added as a resize object to the elementary window, it
2330  * will always occupy the entire space available for this window.
2331  *
2332  * The theme already has a title, and it also defines a table element which is
2333  * positioned approximately between 50% and 70% of the height of this window,
2334  * and has 100% of the width. We create some widgets (two icons, a clock and a
2335  * button) and pack them inside the table, in a distribution similar to a HTML
2336  * table:
2337  *
2338  * @until evas_object_show(bt)
2339  *
2340  * Notice that we just set size hints for every object, and call the function
2341  * elm_layout_table_pack(), which does all the work. It will place the elements
2342  * in the specified row/column, with row and column span if required, and then
2343  * the object's size and position will be controled by the layout widget. It
2344  * will also respect size hints, alignments and weight properties set to these
2345  * widgets. The resulting distribution on the screen depends on the table
2346  * properties (described in the theme), the size hints set on each widget, and
2347  * on the cells of the table that are being used.
2348  *
2349  * For instance, we add the two icons and the clock on the first, second and
2350  * third cells of the first row, and add the button the second row, making it
2351  * span for 3 columns (thus having the size of the entire table width). This
2352  * will result in a table that has 2 rows and 3 columns.
2353  *
2354  * Now let's add some widgets to the box area of our layout. This box is around
2355  * 20% and 50% of the vertical size of the layout, and 100% of its width. The
2356  * theme defines that it will use an "horizontal flow" distribution to its
2357  * elements. Unlike the table, a box will distribute elements without knowing
2358  * about rows and columns, and the distribution function selected will take care
2359  * of putting them in row, column, both, or any other available layout. This is
2360  * also described in the Edje documentation.
2361  *
2362  * This box area is similar to the @ref Box widget of elementary, with the
2363  * difference that its position and properties are controled by the theme of the
2364  * layout. It also contains more than one API to add items to it, since the
2365  * items position now is defined in terms of a list of items, not a matrix.
2366  * There's the first position (can have items added to it with
2367  * elm_layout_box_prepend()), the last position (elm_layout_box_append()), the
2368  * nth position (elm_layout_box_insert_at()) and the position right before an
2369  * element (elm_layout_box_insert_before()). We use insert_at and prepend
2370  * functions to add the first two buttons to this box, and insert_before on the
2371  * callback of each button. The callback code will be shown later, but it
2372  * basically adds a button just before the clicked button using the
2373  * elm_layout_box_insert_before() function. Here's the code for adding the first
2374  * 2 buttons:
2375  *
2376  * @until evas_object_show(item)
2377  * @until evas_object_show(item)
2378  *
2379  * Finally, we have an area in this layout theme, in the bottom part of it,
2380  * reserved for adding an specific widget. Differently from the 2 parts
2381  * described until now, this one can only receive one widget with the call
2382  * elm_layout_content_set(). If there was already an item on this specific part,
2383  * it will be deleted (one can use elm_layout_content_unset() in order to remove
2384  * it without deleting). An example of removing it without deleting, but
2385  * manually deleting this widget just after that, can be seen on the callback
2386  * for this button. Actually, the callback defined for this button will clean
2387  * the two other parts (deleting all of their elements) and then remove and
2388  * delete this button.
2389  *
2390  * @until _swallow_btn_cb
2391  *
2392  * Also notice that, for this last added button, we don't have to call
2393  * evas_object_show() on it. This is a particularity of the theme for layouts,
2394  * that will have total control over the properties like size, position,
2395  * visibility and clipping of a widget added with elm_layout_content_set().
2396  * Again, read the Edje documentation to understand this better.
2397  *
2398  * Now we just put the code for the different callbacks specified for each kind
2399  * of button and make simple comments about them:
2400  *
2401  * @dontinclude layout_example_01.c
2402  * @skip static void
2403  * @until evas_object_del(item)
2404  * @until }
2405  *
2406  * The first callback is used for the button in the table, and will just remove
2407  * itself from the table with elm_layout_table_unpack(), which remove items
2408  * without deleting them, and then calling evas_object_del() on itself.
2409  *
2410  * The second callback is for buttons added to the box. When clicked, these
2411  * buttons will create a new button, and add them to the same box, in the
2412  * position just before the clicked button.
2413  *
2414  * And the last callback is for the button added to the "content" area. It will
2415  * clear both the table and the box, passing @c EINA_TRUE to their respective @c
2416  * clear parameters, which will imply on the items of these containers being
2417  * deleted.
2418  *
2419  * A screenshot of this example can be seen on:
2420  *
2421  * @image html screenshots/layout_example_01.png
2422  * @image latex screenshots/layout_example_01.eps width=\textwidth
2423  *
2424  */
2425
2426 /**
2427  * @page layout_example_02 Layout - Predefined Layout
2428  *
2429  * This example shows how one can use the @ref Layout with a predefined theme
2430  * layout to add a back and next button to a simple window. The full source code
2431  * for this example can be found at @ref layout_example_02_c.
2432  *
2433  * After setting up the window and background, we add the layout widget to the
2434  * window. But instead of using elm_layout_file_set() to load its theme from a
2435  * custom theme file, we can use elm_layout_theme_set() to load one of the
2436  * predefined layouts that come with elementary. Particularly on this example,
2437  * we load the them of class "layout", group "application" and style
2438  * "content-back-next" (since we want the back and next buttons).
2439  *
2440  * @dontinclude layout_example_02.c
2441  * @skip elm_layout_add
2442  * @until evas_object_show(layout)
2443  *
2444  * This default theme contains only a "content" area named
2445  * "elm.swallow.content", where we can add any widget (it can be even a
2446  * container widget, like a box, frame, list, or even another layout). Since we
2447  * just want to show the resulting layout, we add a simple icon to it:
2448  *
2449  * @until layout_content_set
2450  *
2451  * This default layout also provides some signals when the next and prev buttons
2452  * are clicked. We can register callbacks to them with the
2453  * elm_object_signal_callback_add() function:
2454  *
2455  * @until elm,action,next
2456  *
2457  * In the @ref layout_example_03 you can see how to send signals to the layout with
2458  * elm_object_signal_emit().
2459  *
2460  * Now our callback just changes the picture being displayed when one of the
2461  * buttons are clicked:
2462  *
2463  * @dontinclude layout_example_02.c
2464  * @skip images
2465  * @until standard_set
2466  * @until }
2467  *
2468  * It's possible to see that it gets the name of the image being shown from the
2469  * array of image names, going forward on this array when "next" is clicked and
2470  * backward when "back" is clicked.
2471  *
2472  * A screenshot of this example can be seen on:
2473  *
2474  * @image html screenshots/layout_example_02.png
2475  * @image latex screenshots/layout_example_02.eps width=\textwidth
2476  */
2477
2478 /**
2479  * @page layout_example_03 Layout - Signals and Size Changed
2480  *
2481  * This example shows how one can send and receive signals to/from the layout,
2482  * and what to do when the layout theme has its size changed. The full source
2483  * code for this example can be found at @ref layout_example_03_c.
2484  *
2485  * In this exmaple we will use another group from the same layout theme file
2486  * used in @ref layout_example_01. Its instanciation and loading happens in the
2487  * following lines:
2488  *
2489  * @dontinclude layout_example_03.c
2490  * @skip elm_layout_add
2491  * @until evas_object_show
2492  *
2493  * This time we register a callback to be called whenever we receive a signal
2494  * after the end of the animation that happens in this layout:
2495  *
2496  * @until signal_callback_add
2497  *
2498  * We also add a button that will send signals to the layout:
2499  *
2500  * @until callback_add
2501  *
2502  * The callback for this button will check what type of signal it should send,
2503  * and then emit it. The code for this callback follows:
2504  *
2505  * @dontinclude layout_exmaple_03.c
2506  * @skip static Eina_Bool
2507  * @until Enlarge
2508  * @until }
2509  * @until }
2510  *
2511  * As we said before, we are receiving a signal whenever the animation started
2512  * by the button click ends. This is the callback for that signal:
2513  *
2514  * @until }
2515  *
2516  * Notice from this callback that the elm_layout_sizing_eval() function must be
2517  * called if we want our widget to update its size after the layout theme having
2518  * changed its minimum size. This happens because the animation specified in the
2519  * theme increases the size of the content area to a value higher than the
2520  * widget size, thus requiring more space. But the elementary layout widget
2521  * has no way to know this, thus needing the elm_layout_sizing_eval() to
2522  * be called on the layout, informing that this size has changed.
2523  *
2524  * A screenshot of this example can be seen on:
2525  *
2526  * @image html screenshots/layout_example_03.png
2527  * @image latex screenshots/layout_example_03.eps width=\textwidth
2528  */
2529
2530 /**
2531  * @page tutorial_hover Hover example
2532  * @dontinclude hover_example_01.c
2533  *
2534  * On this example we are going to have a button that when clicked will show our
2535  * hover widget, this hover will have content set on it's left, top, right and
2536  * middle positions. In the middle position we are placing a button that when
2537  * clicked will hide the hover. We are also going to use a non-default theme
2538  * for our hover. We won't explain the functioning of button for that see @ref
2539  * Button.
2540  *
2541  * We start our example with a couple of callbacks that show and hide the data
2542  * they're given(which we'll see later on is the hover widget):
2543  * @skip static
2544  * @until }
2545  * @until }
2546  *
2547  * In our main function we'll do some initialization and then create 3
2548  * rectangles, one red, one green and one blue to use in our hover. We'll also
2549  * create the 2 buttons that will show and hide the hover:
2550  * @until show(bt2)
2551  *
2552  * With all of that squared away we can now get to the heart of the matter,
2553  * creating our hover widget, which is easy as pie:
2554  * @until hover
2555  *
2556  * Having created our hover we now need to set the parent and target. Which if
2557  * you recall from the function documentations are going to tell the hover which
2558  * area it should cover and where it should be centered:
2559  * @until bt
2560  *
2561  * Now we set the theme for our hover. We're using the popout theme which gives
2562  * our contents a white background and causes their appearance to be animated:
2563  * @until popout
2564  *
2565  * And finally we set the content for our positions:
2566  * @until bt2
2567  *
2568  * So far so good? Great 'cause that's all there is too it, what is left now is
2569  * just connecting our buttons to the callbacks we defined at the beginning of
2570  * the example and run the main loop:
2571  * @until ELM_MAIN
2572  *
2573  * Our example will initially look like this:
2574  *
2575  * @image html screenshots/hover_example_01.png
2576  * @image latex screenshots/hover_example_01.eps width=\textwidth
2577  *
2578  * And after you click the "Show hover" button it will look like this:
2579  *
2580  * @image html screenshots/hover_example_01_a.png
2581  * @image latex screenshots/hover_example_01_a.eps width=\textwidth
2582  *
2583  * @example hover_example_01.c
2584  */
2585
2586 /**
2587   * @page tutorial_flip Flip example
2588   * @dontinclude flip_example_01.c
2589   *
2590   * This example will show a flip with two rectangles on it(one blue, one
2591   * green). Our example will allow the user to choose the animation the flip
2592   * uses and to interact with it. To allow the user to choose the interaction
2593   * mode we use radio buttons, we will however not explain them, if you would
2594   * like to know more about radio buttons see @ref radio.
2595   *
2596   * We start our example with the usual setup and then create the 2 rectangles
2597   * we will use in our flip:
2598   * @until show(rect2)
2599   *
2600   * The next thing to do is to create our flip and set it's front and back
2601   * content:
2602   * @until show
2603   *
2604   * The next thing we do is set the interaction mode(which the user can later
2605   * change) to the page animation:
2606   * @until PAGE
2607   *
2608   * Setting a interaction mode however is not sufficient, we also need to
2609   * choose which directions we allow interaction from, for this example we
2610   * will use all of them:
2611   * @until RIGHT
2612   *
2613   * We are also going to set the hitsize to the entire flip(in all directions)
2614   * to make our flip very easy to interact with:
2615   * @until RIGHT
2616   *
2617   * After that we create our radio buttons and start the main loop:
2618   * @until ELM_MAIN()
2619   *
2620   * When the user clicks a radio button a function that changes the
2621   * interaction mode and animates the flip is called:
2622   * @until }
2623   * @note The elm_flip_go() call here serves no purpose other than to
2624   * ilustrate that it's possible to animate the flip programmatically.
2625   *
2626   * Our example will look like this:
2627   *
2628   * @image html screenshots/flip_example_01.png
2629   * @image latex screenshots/flip_example_01.eps width=\textwidth
2630   *
2631   * @note Since this is an animated example the screenshot doesn't do it
2632   * justice, it is a good idea to compile it and see the animations.
2633   *
2634   * @example flip_example_01.c
2635   */
2636
2637  /**
2638   * @page tutorial_label Label example
2639   * @dontinclude label_example_01.c
2640   *
2641   * In this example we are going to create 6 labels, set some properties on
2642   * them and see what changes in appearance those properties cause.
2643   *
2644   * We start with the setup code that by now you should be familiar with:
2645   * @until show(bg)
2646   *
2647   * For our first label we have a moderately long text(that doesn't fit in the
2648   * label's width) so we will make it a sliding label. Since the text isn't
2649   * too long we don't need the animation to be very long, 3 seconds should
2650   * give us a nice speed:
2651   * @until show(label
2652   *
2653   * For our second label we have the same text, but this time we aren't going
2654   * to have it slide, we're going to ellipsize it. Because we ask our label
2655   * widget to ellipsize the text it will first diminsh the fontsize so that it
2656   * can show as much of the text as possible:
2657   * @until show(label
2658   *
2659   * For the third label we are going to ellipsize the text again, however this
2660   * time to make sure the fontsize isn't diminshed we will set a line wrap.
2661   * The wrap won't actually cause a line break because we set the label to
2662   * ellipsize:
2663   * @until show(label
2664   *
2665   * For our fourth label we will set line wrapping but won't set ellipsis, so
2666   * that our text will indeed be wrapped instead of ellipsized. For this label
2667   * we choose character wrap:
2668   * @until show(label
2669   *
2670   * Just two more, for our fifth label we do the same as for the fourth
2671   * except we set the wrap to word:
2672   * @until show(label
2673   *
2674   * And last but not least for our sixth label we set the style to "marker" and
2675   * the color to red(the default color is white which would be hard to see on
2676   * our white background):
2677   * @until show(label
2678   *
2679   * Our example will look like this:
2680   *
2681   * @image html screenshots/label_example_01.png
2682   * @image latex screenshots/label_example_01.eps width=\textwidth
2683   *
2684   * @example label_example_01.c
2685   */
2686
2687  /**
2688   * @page tutorial_image Image example
2689   * @dontinclude image_example_01.c
2690   *
2691   * This example is as simple as possible. An image object will be added to the
2692   * window over a white background, and set to be resizeable together with the
2693   * window. All the options set through the example will affect the behavior of
2694   * this image.
2695   *
2696   * We start with the code for creating a window and its background, and also
2697   * add the code to write the path to the image that will be loaded:
2698   *
2699   * @skip int
2700   * @until snprintf
2701   *
2702   * Now we create the image object, and set that file to be loaded:
2703   *
2704   * @until }
2705   *
2706   * We can now go setting our options.
2707   *
2708   * elm_image_no_scale_set() is used just to set this value to true (we
2709   * don't want to scale our image anyway, just resize it).
2710   *
2711   * elm_image_scale_set() is used to allow the image to be resized to a size
2712   * smaller than the original one, but not to a size bigger than it.
2713   *
2714   * elm_elm_image_smooth_set() will disable the smooth scaling, so the scale
2715   * algorithm used to scale the image to the new object size is going to be
2716   * faster, but with a lower quality.
2717   *
2718   * elm_image_orient_set() is used to flip the image around the (1, 0) (0, 1)
2719   * diagonal.
2720   *
2721   * elm_image_aspect_ratio_retained_set() is used to keep the original aspect
2722   * ratio of the image, even when the window is resized to another aspect ratio.
2723   *
2724   * elm_image_fill_outside_set() is used to ensure that the image will fill the
2725   * entire area available to it, even if keeping the aspect ratio. The image
2726   * will overflow its width or height (any of them that is necessary) to the
2727   * object area, instead of resizing the image down until it can fit entirely in
2728   * this area.
2729   *
2730   * elm_image_editable_set() is used just to cover the API, but won't affect
2731   * this example since we are not using any copy & paste property.
2732   *
2733   * This is the code for setting these options:
2734   *
2735   * @until editable
2736   *
2737   * Now some last touches in our object size hints, window and background, to
2738   * display this image properly:
2739   *
2740   * @until ELM_MAIN
2741   *
2742   * This example will look like this:
2743   *
2744   * @image html screenshots/image_example_01.png
2745   * @image latex screenshots/image_example_01.eps width=\textwidth
2746   *
2747   * @example image_example_01.c
2748   */
2749
2750  /**
2751   * @page tutorial_icon Icon example
2752   * @dontinclude icon_example_01.c
2753   *
2754   * This example is as simple as possible. An icon object will be added to the
2755   * window over a white background, and set to be resizeable together with the
2756   * window. All the options set through the example will affect the behavior of
2757   * this icon.
2758   *
2759   * We start with the code for creating a window and its background:
2760   *
2761   * @skip int
2762   * @until show(bg)
2763   *
2764   * Now we create the icon object, and set lookup order of the icon, and choose
2765   * the "home" icon:
2766   *
2767   * @until home
2768   *
2769   * An intersting thing is that after setting this, it's possible to check where
2770   * in the filesystem is the theme used by this icon, and the name of the group
2771   * used:
2772   *
2773   * @until printf
2774   *
2775   * We can now go setting our options.
2776   *
2777   * elm_icon_no_scale_set() is used just to set this value to true (we
2778   * don't want to scale our icon anyway, just resize it).
2779   *
2780   * elm_icon_scale_set() is used to allow the icon to be resized to a size
2781   * smaller than the original one, but not to a size bigger than it.
2782   *
2783   * elm_elm_icon_smooth_set() will disable the smooth scaling, so the scale
2784   * algorithm used to scale the icon to the new object size is going to be
2785   * faster, but with a lower quality.
2786   *
2787   * elm_icon_fill_outside_set() is used to ensure that the icon will fill the
2788   * entire area available to it, even if keeping the aspect ratio. The icon
2789   * will overflow its width or height (any of them that is necessary) to the
2790   * object area, instead of resizing the icon down until it can fit entirely in
2791   * this area.
2792   *
2793   * This is the code for setting these options:
2794   *
2795   * @until fill_outside
2796   *
2797   * However, if you try this example you may notice that this image is not being
2798   * affected by all of these options. This happens because the used icon will be
2799   * from elementary theme, and thus it has its own set of options like smooth
2800   * scaling and fill_outside options. You can change the "home" icon to use some
2801   * image (from your system) and see that then those options will be respected.
2802   *
2803   * Now some last touches in our object size hints, window and background, to
2804   * display this icon properly:
2805   *
2806   * @until ELM_MAIN
2807   *
2808   * This example will look like this:
2809   *
2810   * @image html screenshots/icon_example_01.png
2811   * @image latex screenshots/icon_example_01.eps width=\textwidth
2812   *
2813   * @example icon_example_01.c
2814   */
2815
2816 /**
2817  * @page tutorial_hoversel Hoversel example
2818  * @dontinclude hoversel_example_01.c
2819  *
2820  * In this example we will create a hoversel with 3 items, one with a label but
2821  * no icon and two with both a label and an icon. Every item that is clicked
2822  * will be deleted, but everytime the hoversel is activated we will also add an
2823  * item. In addition our first item will print all items when clicked and our
2824  * third item will clear all items in the hoversel.
2825  *
2826  * We will start with the normal creation of window stuff:
2827  * @until show(bg)
2828  *
2829  * Next we will create a red rectangle to use as the icon of our hoversel:
2830  * @until show
2831  *
2832  * And now we create our hoversel and set some of it's properties. We set @p win
2833  * as its parent, ask it to not be horizontal(be vertical) and give it a label
2834  * and icon:
2835  * @until icon_set
2836  *
2837  * Next we will add our three items, setting a callback to be called for the
2838  * first and third:
2839  * @until _rm_items
2840  *
2841  * We also set a pair of callbacks to be called whenever any item is selected or
2842  * when the hoversel is activated:
2843  * @until clicked
2844  *
2845  * And then ask that our hoversel be shown and run the main loop:
2846  * @until ELM_MAIN
2847  *
2848  * We now have the callback for our first item which prints all items in the
2849  * hoversel:
2850  * @until }
2851  *
2852  * Next we have the callback for our third item which removes all items from the
2853  * hoversel:
2854  * @until }
2855  *
2856  * Next we have the callback that is called whenever an item is clicked and
2857  * deletes that item:
2858  * @until }
2859  *
2860  * And the callback that is called when the hoversel is activated and adds an
2861  * item to the hoversel. Note that since we allocate memory for the item we need
2862  * to know when the item dies so we can free that memory:
2863  * @until }
2864  *
2865  * And finally the callback that frees the memory we allocated for items created
2866  * in the @p _add_item callback:
2867  * @until }
2868  *
2869  * Our example will initially look like this:
2870  *
2871  * @image html screenshots/hoversel_example_01.png
2872  * @image latex screenshots/hoversel_example_01.eps width=\textwidth
2873  *
2874  * And when the hoversel is clicked it will look like this:
2875  *
2876  * @image html screenshots/hoversel_example_01_a.png
2877  * @image latex screenshots/hoversel_example_01_a.eps width=\textwidth
2878  *
2879  * @example hoversel_example_01.c
2880  */
2881
2882 /**
2883  * @page conformant_example Conformant Example.
2884  *
2885  * In this example we'll explain how to create applications to work
2886  * with illume, considering space required for virtual keyboards, indicator
2887  * and softkeys.
2888  *
2889  * Illume is a module for Enlightenment that modifies the user interface
2890  * to work cleanly and nicely on a mobile device. It has support for
2891  * virtual keyboard, among other nice features.
2892  *
2893  * Let's start creating a very simple window with a vertical box
2894  * with multi-line entry between two buttons.
2895  * This entry will expand filling all space on window not used by buttons.
2896  *
2897  * @dontinclude conformant_example_01.c
2898  * @skipline elm_main
2899  * @until }
2900  *
2901  * For information about how to create windows, boxes, buttons or entries,
2902  * look for documentation for these widgets.
2903  *
2904  * It will looks fine when you don't need a virtual keyboard, as you
2905  * can see on the following image:
2906  *
2907  * @image html screenshots/conformant_example_01.png
2908  * @image latex screenshots/conformant_example_01.eps width=\textwidth
2909  *
2910  * But if you call a virtual keyboard, the window will resize, changing
2911  * widgets size and position. All the content will shrink.
2912  *
2913  * If you don't want such behaviour, you
2914  * will need a conformant to account for space taken up by the indicator,
2915  * virtual keyboard and softkey.
2916  *
2917  * In this case, using the conformant in a proper way, you will have
2918  * a window like the following:
2919  *
2920  * @image html screenshots/conformant_example_02.png
2921  * @image latex screenshots/conformant_example_02.eps width=\textwidth
2922  *
2923  * As you can see, it guess the space that will be required by the keyboard,
2924  * indicator and softkey bars.
2925  *
2926  * So, let's study each step required to transform our initial example on
2927  * the second one.
2928  *
2929  * First of all, we need to set the window as an illume conformant window:
2930  * @dontinclude conformant_example_02.c
2931  * @skipline elm_win_conformant_set
2932  *
2933  * Next, we'll add a conformant widget, and set it to resize with the window,
2934  * instead of the box.
2935  * @skipline conform
2936  * @until evas_object_show
2937  *
2938  * Finally, we'll set the box as conformant's content, just like this:
2939  * @skipline elm_conformant_content_set
2940  *
2941  * Compare both examples code:
2942  * @ref conformant_example_01.c "conformant_example_01.c"
2943  * @ref conformant_example_02.c "conformant_example_02.c"
2944  *
2945  * @example conformant_example_01.c
2946  * @example conformant_example_02.c
2947  */
2948
2949 /**
2950  * @page index_example_01 Index widget example 1
2951  *
2952  * This code places an Elementary index widget on a window, which also
2953  * has a very long list of arbitrary strings on it.  The list is
2954  * sorted alphabetically and the index will be used to index the first
2955  * items of each set of strings beginning with an alphabet letter.
2956  *
2957  * Below the list are some buttons, which are there just to exercise
2958  * some index widget's API.
2959  *
2960  * Here's how we instantiate it:
2961  * @dontinclude index_example_01.c
2962  * @skip elm_list_add
2963  * @until evas_object_show(d.index)
2964  * where we're showing also the list being created. Note that we issue
2965  * elm_win_resize_object_add() on the index, so that it's set to have
2966  * the whole window as its container. Then, we have to populate both
2967  * list and index widgets:
2968  * @dontinclude index_example_01.c
2969  * @skip for (i = 0; i < (sizeof(dict) / sizeof(dict[0])); i++)
2970  * @until }
2971  * @until }
2972  *
2973  * The strings populating the list come from a file
2974  * @dontinclude index_example_01.c
2975  * @skip static const char *dict
2976  * @until }
2977  *
2978  * We use the @c curr char variable to hold the last initial letter
2979  * seen on that ordered list of strings, so that we're able to have an
2980  * index item pointing to each list item starting a new letter
2981  * "section". Note that our index item data pointers will be the list
2982  * item handles. We are also setting a callback function to index
2983  * items deletion events:
2984  * @dontinclude index_example_01.c
2985  * @skip static void
2986  * @until }
2987  *
2988  * There, we show you that the @c event_info pointer will contain the
2989  * item in question's data, i.e., a given list item's pointer. Because
2990  * item data is also returned in the @c data argument on
2991  * @c Evas_Smart_Cb functions, those two pointers must have the same
2992  * values. On this deletion callback, we're deleting the referred list
2993  * item too, just to exemplify that anything could be done there.
2994  *
2995  * Next, we hook to two smart events of the index object:
2996  * @dontinclude index_example_01.c
2997  * @skip smart_callback_add(d.index
2998  * @until _index_selected
2999  * @dontinclude index_example_01.c
3000  * @skip "delay,changed" hook
3001  * @until }
3002  * @until }
3003  *
3004  * Check that, whenever one holds the mouse pressed over a given index
3005  * letter for some time, the list beneath it will roll down to the
3006  * item pointed to by that index item. When one releases the mouse
3007  * button, the second callback takes place. There, we check that the
3008  * reported item data, on @c event_info, is the same reported by
3009  * elm_index_item_selected_get(), which gives the last selection's
3010  * data on the index widget.
3011  *
3012  * The first of the three buttons that follow will call
3013  * elm_index_active_set(), thus showing the index automatically for
3014  * you, if it's not already visible, what is checked with
3015  * elm_index_active_get(). The second button will exercise @b deletion
3016  * of index item objects, by the following code:
3017  * @dontinclude index_example_01.c
3018  * @skip delete an index item
3019  * @until }
3020  *
3021  * It will get the last index item selected's data and find the
3022  * respective #Elm_Index_Item handle with elm_index_item_find(). We
3023  * need the latter to query the indexing letter string from, with
3024  * elm_index_item_letter_get(). Next, comes the delition, itself,
3025  * which will also trigger the @c _index_item_del callback function,
3026  * as said above.
3027  *
3028  * The third button, finally, will exercise elm_index_item_clear(),
3029  * which will delete @b all of the index's items.
3030  *
3031  * This is how the example program's window looks like with the index
3032  * widget hidden:
3033  * @image html screenshots/index_example_00.png
3034  * @image latex screenshots/index_example_00.eps
3035  *
3036  * When it's shown, it's like the following figure:
3037  * @image html screenshots/index_example_01.png
3038  * @image latex screenshots/index_example_01.eps
3039  *
3040  * See the full @ref index_example_01_c "source code" for
3041  * this example.
3042  *
3043  * @example index_example_01.c
3044  */
3045
3046 /**
3047  * @page index_example_02 Index widget example 2
3048  *
3049  * This code places an Elementary index widget on a window, indexing
3050  * grid items. The items are placed so that their labels @b don't
3051  * follow any order, but the index itself is ordered (through
3052  * elm_index_item_sorted_insert()). This is a complement to to @ref
3053  * index_example_01 "the first example on indexes".
3054  *
3055  * Here's the list of item labels to be used on the grid (in that
3056  * order):
3057  * @dontinclude index_example_02.c
3058  * @skip static const char *items
3059  * @until };
3060  *
3061  * In the interesting part of the code, here, we first instantiate the
3062  * grid (more on grids on their examples) and, after creating our
3063  * index, for each grid item we also create an index one to reference
3064  * it:
3065  * @dontinclude index_example_02.c
3066  * @skip grid = elm_gengrid_add
3067  * @until }
3068  * @until smart_callback_add
3069  *
3070  * The order in which they'll appear in the index, though, is @b
3071  * alphabetical, becase of elm_index_item_sorted_insert() usage
3072  * together with the comparing function, where we take the letters of
3073  * each index item to base our ordering on. The parameters on
3074  * @c _index_cmp have to be declared as void pointers because of the
3075  * @c Eina_Compare_Cb prototype requisition, but in this case we know
3076  * they'll be #Elm_Index_Item's:
3077  * @dontinclude index_example_02.c
3078  * @skip ordering alphabetically
3079  * @until }
3080  *
3081  * The last interesting bit is the callback in the @c "delay,changed"
3082  * smart event, which will bring the given grid item to the grid's
3083  * visible area:
3084  * @dontinclude index_example_02.c
3085  * @skip static void
3086  * @until }
3087  *
3088  * Note how the grid will move kind of randomly while you move your
3089  * mouse pointer held over the index from top to bottom -- that's
3090  * because of the the random order the items have in the grid itself.
3091  *
3092  * This is how the example program's window looks like:
3093  * @image html screenshots/index_example_03.png
3094  * @image latex screenshots/index_example_03.eps
3095  *
3096  * See the full @ref index_example_c "source code" for
3097  * this example.
3098  *
3099  * @example index_example_02.c
3100  */
3101
3102 /**
3103  * @page tutorial_ctxpopup Ctxpopup example
3104  * @dontinclude ctxpopup_example_01.c
3105  *
3106  * In this example we have a list with two items, when either item is clicked
3107  * a ctxpopup for it will be shown. Our two ctxpopups are quite different, the
3108  * one for the first item is a vertical and it's items contain both labels and
3109  * icons, the one for the second item is horizontal and it's items have icons
3110  * but not labels.
3111  *
3112  * We will begin examining our example code by looking at the callback we'll use
3113  * when items in the ctxpopup are clicked. It's very simple, all it does is
3114  * print the label present in the ctxpopup item:
3115  * @until }
3116  *
3117  * Next we examine a function that creates ctxpopup items, it was created to
3118  * avoid repeating the same code whenever we needed to add an item to our
3119  * ctxpopup. Our function creates an icon from the standard set of icons, and
3120  * then creates the item, with the label received as an argument. We also set
3121  * the callback to be called when the item is clicked:
3122  * @until }
3123  *
3124  * Finally we have the function that will create the ctxpopup for the first item
3125  * in our list. This one is somewhat more complex though, so let's go through it
3126  * in parts. First we declare our variable and add the ctxpopup:
3127  * @until ctxpopup_add
3128  *
3129  * Next we create a bunch of items for our ctxpopup, marking two of them as
3130  * disabled just so we can see what that will look like:
3131  * @until disabled_set
3132  * @until disabled_set
3133  *
3134  * Then we ask evas where the mouse pointer was so that we can have our ctxpopup
3135  * appear in the right place, set a maximum size for the ctxpopup, move it and
3136  * show it:
3137  * @until show
3138  *
3139  * And last we mark the list item as not selected:
3140  * @until }
3141  *
3142  * Our next function is the callback that will create the ctxpopup for the
3143  * second list item, it is very similar to the previous function. A couple of
3144  * interesting things to note is that we ask our ctxpopup to be horizontal, and
3145  * that we pass NULL as the label for every item:
3146  * @until }
3147  *
3148  * And with all of that in place we can now get to our main function where we
3149  * create the window, the list, the list items and run the main loop:
3150  * @until ELM_MAIN()
3151  *
3152  * The example will initially look like this:
3153  *
3154  * @image html screenshots/ctxpopup_example_01.png
3155  * @image latex screenshots/ctxpopup_example_01.eps width=\textwidth
3156  *
3157  * @note This doesn't show the ctxpopup tough, since it will only appear when
3158  * we click one of the list items.
3159  *
3160  * Here is what our first ctxpopup will look like:
3161  *
3162  * @image html screenshots/ctxpopup_example_01_a.png
3163  * @image latex screenshots/ctxpopup_example_01_a.eps width=\textwidth
3164  *
3165  * And here the second ctxpopup:
3166  *
3167  * @image html screenshots/ctxpopup_example_01_b.png
3168  * @image latex screenshots/ctxpopup_example_01_b.eps width=\textwidth
3169  *
3170  * @example ctxpopup_example_01.c
3171  */
3172
3173 /**
3174  * @page tutorial_pager
3175  * @dontinclude pager_example_01.c
3176  *
3177  * In this example we'll have a pager with 3 rectangles on it, one blue, one
3178  * green and one blue, we'll also have 1 button for each rectangle. Pressing a
3179  * button will bring the associated rectangle to the front of the pager(promote
3180  * it).
3181  *
3182  * We start our example with some run of the mill code that you've seen in other
3183  * examples:
3184  * @until show
3185  *
3186  * And then we get right to creating our pager, setting a style and some basic
3187  * properties to it:
3188  * @until show
3189  *
3190  * Well a pager without any content is not of much use, so let's create the
3191  * first of our rectangles, add it to the pager and create the button for it:
3192  * @until smart_callback
3193  * @note The only line of above code that directly relates to our pager is the
3194  * call to elm_pager_content_push().
3195  *
3196  * And now we will do the same thing again twice for our next two rectangles:
3197  * @until smart_callback
3198  * @until smart_callback
3199  *
3200  * Now that we haver our widgets create we can get to running the main loop:
3201  * @until ELM_MAIN
3202  *
3203  * We also have the callback that is called when any of the buttons is pressed,
3204  * this callback is receiving the rectangle in it's @p data argument, so we
3205  * check if it's already on top and if not move it there:
3206  * @until }
3207  *
3208  * Our example will look like this:
3209  *
3210  * @image html screenshots/pager_example_01.png
3211  * @image latex screenshots/pager_example_01.eps width=\textwidth
3212  * @note Like all examples that involve animations the screenshot doesn't do it
3213  * justice, seeing it in action is a must.
3214  *
3215  * @example pager_example_01.c
3216  */
3217
3218 /**
3219  * @page tutorial_separator Separator example
3220  * @dontinclude separator_example_01.c
3221  *
3222  * In this example we are going to pack two rectangles in a box, and have a
3223  * separator in the middle.
3224  *
3225  * So we start we the window, background, box and rectangle creation, all pretty
3226  * normal stuff:
3227  * @until pack_end
3228  *
3229  * Once we have our first rectangle in the box we create and add our separator:
3230  * @until pack_end
3231  * @note Since our box is in horizontal mode it's a good idea to set the
3232  * separator to be horizontal too.
3233  *
3234  * And now we add our second rectangle and run the main loop:
3235  * @until ELM_MAIN
3236  *
3237  * This example will look like this:
3238  *
3239  * @image html screenshots/separator_example_01.png
3240  * @image eps screenshots/separator_example_01.eps width=\textwidth
3241  *
3242  * @example separator_example_01.c
3243  */
3244
3245 /**
3246  * @page tutorial_radio Radio example
3247  * @dontinclude radio_example_01.c
3248  *
3249  * In this example we will create 4 radio buttons, three of them in a group and
3250  * another one not in the group. We will also have the radios in the group
3251  * change the value of a variable directly and have then print it when the value
3252  * changes. The fourth button is in the example just to make clear that radios
3253  * outside the group don't affect the group.
3254  *
3255  * We'll start with the usual includes:
3256  * @until #endif
3257  *
3258  * And move right to declaring a static variable(the one whose value the radios
3259  * will change):
3260  * @until static
3261  *
3262  * We now need to have a window and all that good stuff to be able to place our
3263  * radios in:
3264  * @until show(bx)
3265  *
3266  * And now we create a radio button, since this is the first button in our group
3267  * we set the group to be the radio(so we can set the other radios in the same
3268  * group). We also set the state value of this radio to 1 and the value pointer
3269  * to @p val, since val is @p 1 this has the additional effect of setting the
3270  * radio value to @p 1. For this radio we choose the default home icon:
3271  * @until show
3272  *
3273  * To check that our radio buttons are working we'll add a callback to the
3274  * "changed" signal of the radio:
3275  * @until smart_callback
3276  *
3277  * The creation of our second radio button is almost identical, the 2
3278  * differences worth noting are, the value of this radio 2 and that we add this
3279  * radio to the group of the first radio:
3280  * @until smart_callback
3281  *
3282  * For our third callback we'll omit the icon and set the value to 3, we'll also
3283  * add it to the group of the first radio:
3284  * @until smart_callback
3285  *
3286  * Our fourth callback has a value of 4, no icon and most relevantly is not a
3287  * member of the same group as the other radios:
3288  * @until show
3289  *
3290  * We finally run the main loop:
3291  * @until ELM_MAIN
3292  *
3293  * And the last detail in our example is the callback that prints @p val so that
3294  * we can see that the radios are indeed changing its value:
3295  * @until }
3296  *
3297  * The example will look like this:
3298  *
3299  * @image html screenshots/radio_example_01.png
3300  * @image latex screenshots/radio_example_01.epx width=\textwidth
3301  *
3302  * @example radio_example_01.c
3303  */
3304
3305 /**
3306  * @page tutorial_toggle Toggle example
3307  * @dontinclude toggle_example_01.c
3308  *
3309  * In this example we'll create 2 toggle widgets. The first will have an icon
3310  * and the state names will be the default "on"/"off", it will also change the
3311  * value of a variable directly. The second won't have a icon, the state names
3312  * will be "Enabled"/"Disabled", it will  start "Enabled" and it won't set the
3313  * value of a variable.
3314  *
3315  * We start with the usual includes and prototype for callback which will be
3316  * implemented and detailed later on:
3317  * @until _cb2
3318  *
3319  * We then declare a static global variable(the one whose value will be changed
3320  * by the first toggle):
3321  * @until static
3322  *
3323  * We now have to create our window and all that usual stuff:
3324  * @until show(bx)
3325  *
3326  * The creation of a toggle is no more complicated than that of any other
3327  * widget:
3328  * @until add
3329  *
3330  * For our first toggle we don't set the states labels so they will stay the
3331  * default, however we do set a label for the toggle, an icon and the variable
3332  * whose value it should change:
3333  * @until show
3334  *
3335  * We also set the callback that will be called when the toggles value changes:
3336  * @until smart_callback
3337  *
3338  * For our second toggle it important to note that we set the states labels,
3339  * don't set an icon or variable, but set the initial state to
3340  * EINA_TRUE("Enabled"):
3341  * @until show
3342  *
3343  * For the second toggle we will use a different callback:
3344  * @until smart_callback
3345  *
3346  * We then ask the main loop to start:
3347  * @until ELM_MAIN
3348  *
3349  * The callback for our first toggle will look the value of @p val and print it:
3350  * @until }
3351  *
3352  * For our second callback we need to do a little bit more, since the second
3353  * toggle doesn't change the value of a variable we have to ask it what its
3354  * state is:
3355  * @until }
3356  *
3357  * This example will look like this:
3358  *
3359  * @image html screenshots/toggle_example_01.png
3360  * @image latex screenshots/toggle_example_01.eps width=\textwidth
3361  *
3362  * @example toggle_example_01.c
3363  */
3364
3365 /**
3366  * @page tutorial_panel Panel example
3367  * @dontinclude panel_example_01.c
3368  *
3369  * In this example will have 3 panels, one for each possible orientation. Two of
3370  * our panels will start out hidden, the third will start out expanded. For each
3371  * of the panels we will use a label as the content, it's however possible to
3372  * have any widget(including containers) as the content of panels.
3373  *
3374  * We start by doing some setup, code you should be familiar with from other
3375  * examples:
3376  * @until show(bx)
3377  *
3378  * And move right to creating our first panel, for this panel we are going to
3379  * choose the orientation as TOP and toggle it(tell it to hide itself):
3380  * @until pack_end
3381  *
3382  * For the second panel we choose the RIGHT orientation and explicitly set the
3383  * state as hidden:
3384  * @until pack_end
3385  *
3386  * For our third and last panel we won't set the orientation(which means it will
3387  * use the default: LEFT):
3388  * @until pack_end
3389  *
3390  * All that is left is running the main loop:
3391  * @until ELM_MAIN
3392  *
3393  * This example will look like this;
3394  *
3395  * @image html screenshots/panel_example_01.png
3396  * @image latex screenshots/panel_example_01.epx width=\textwidth
3397  * @note The buttons with arrow allow the user to hide/show the panels.
3398  *
3399  * @example panel_example_01.c
3400  */
3401
3402 /**
3403  * @page gengrid_example Gengrid widget example
3404  *
3405  * This application is a thorough exercise on the gengrid widget's
3406  * API. We place an Elementary gengrid widget on a window, with
3407  * various knobs below its viewport, each one acting on it somehow.
3408  *
3409  * The code's relevant part begins at the grid's creation. After
3410  * instantiating it, we set its items sizes, so that we don't end with
3411  * items one finger size wide, only. We're setting them to fat, 150
3412  * pixel wide ones, for this example. We give it some size hints, not
3413  * to be discussed in this context and, than, we register a callback
3414  * on one of its smart events -- the one coming each time an item gets
3415  * doubly clicked. There, we just print the item handle's value.
3416  * @dontinclude gengrid_example.c
3417  * @skip grid = elm_gengrid_add
3418  * @until evas_object_sho
3419  * @dontinclude gengrid_example.c
3420  * @skip item double click callback
3421  * @until }
3422  *
3423  * Before we actually start to deal with the items API, let's show
3424  * some things items will be using throughout all the code. The first
3425  * of them is a struct to be used as item data, for all of them:
3426  * @dontinclude gengrid_example.c
3427  * @skip typedef struct
3428  * @until Item;
3429  *
3430  * That path will be used to index an image, to be swallowed into one
3431  * of the item's icon spots. The imagens themselves are distributed
3432  * with Elementary:
3433  * @dontinclude gengrid_example.c
3434  * @skip static const char *imgs
3435  * @until ;
3436  *
3437  * We also have an (unique) gengrid item class we'll be using for
3438  * items in the example:
3439  * @dontinclude gengrid_example.c
3440  * @skip static Elm_Gengrid_Item_Class
3441  * @until static Elm_Gengrid_Item_Class
3442  * @dontinclude gengrid_example.c
3443  * @skip item_style =
3444  * @until _grid_del
3445  *
3446  * As you see, our items will follow the default theme on gengrid
3447  * items. For the label fetching code, we return a string composed of
3448  * the item's image path:
3449  * @dontinclude gengrid_example.c
3450  * @skip label fetching callback
3451  * @until }
3452  *
3453  * For item icons, we'll be populating the item default theme's two
3454  * icon spots, @c "elm.swallow.icon" and @c "elm.swallow.end". The
3455  * former will receive one of the images in our list (in the form of
3456  * a @ref bg_02_example_page "background"), while the latter will be
3457  * a check widget. Note that we prevent the check to propagate click
3458  * events, so that the user can toggle its state without messing with
3459  * the respective item's selection in the grid:
3460  * @dontinclude gengrid_example.c
3461  * @skip icon fetching callback
3462  * @until return NULL
3463  * @until }
3464  *
3465  * As the default gengrid item's theme does not have parts
3466  * implementing item states, we'll be just returning false for every
3467  * item state:
3468  * @dontinclude gengrid_example.c
3469  * @skip state fetching callback
3470  * @until }
3471  *
3472  * Finally, the deletion callback on gengrid items takes care of
3473  * freeing the item's label string and its data struct:
3474  * @dontinclude gengrid_example.c
3475  * @skip deletion callback
3476  * @until }
3477  *
3478  * Let's move to item insertion/deletion knobs, them. They are four
3479  * buttons, above the grid's viewport, namely
3480  * - "Append" (to append an item to the grid),
3481  * - "Prepend" (to prepend an item to the grid),
3482  * - "Insert before" (to insert an item before the selection, on the
3483  *   grid),
3484  * - "Insert after" (to insert an item after the selection, on the
3485  *   grid),
3486  * - "Clear" (to delete all items in the grid),
3487  * - "Bring in 1st" (to make the 1st item visible, by scrolling),
3488  * - "Show last" (to directly show the last item),
3489  * .
3490  * which are displaced and declared in that order. We're not dealing
3491  * with the buttons' creation code (see @ref button_example_01
3492  * "a button example", for more details on it), but with their @c
3493  * "clicked" registered callbacks.  For all of them, the grid's handle
3494  * is passed as @c data. The ones creating new items use a common
3495  * code, which just gives a new @c Example_Item struct, with @c path
3496  * filled with a random image in our images list:
3497  * @dontinclude gengrid_example.c
3498  * @skip new item with random path
3499  * @until }
3500  *
3501  * Moreover, that ones will set a common function to be issued on the
3502  * selection of the items. There, we print the item handle's value,
3503  * along with the callback function data. The latter will be @c NULL,
3504  * always, because it's what we pass when adding all icons. By using
3505  * elm_gengrid_item_data_get(), we can have the item data back and,
3506  * with that, we're priting the item's path string. Finally, we
3507  * exemplify elm_gengrid_item_pos_get(), printing the item's position
3508  * in the grid:
3509  * @dontinclude gengrid_example.c
3510  * @skip item selection callback
3511  * @until }
3512  *
3513  * The appending button will exercise elm_gengrid_item_append(), simply:
3514  * @dontinclude gengrid_example.c
3515  * @skip append an item
3516  * @until }
3517  *
3518  * The prepending, naturally, is analogous, but exercising
3519  * elm_gengrid_item_prepend(), on its turn. The "Insert before" one
3520  * will expect an item to be selected in the grid, so that it will
3521  * insert a new item just before it:
3522  * @dontinclude gengrid_example.c
3523  * @skip "insert before" callback
3524  * @until }
3525  *
3526  * The "Insert after" is analogous, just using
3527  * elm_gengrid_item_insert_after(), instead. The "Clear" button will,
3528  * as expected, just issue elm_gengrid_clear():
3529  * @dontinclude gengrid_example.c
3530  * @skip delete items
3531  * @until }
3532  *
3533  * The "Bring in 1st" button is there exercise two gengrid functions
3534  * -- elm_gengrid_first_item_get() and elm_gengrid_item_bring_in().
3535  * With the former, we get a handle to the first item and, with the
3536  * latter, you'll see that the widget animatedly scrolls its view
3537  * until we can see that item:
3538  * @dontinclude gengrid_example.c
3539  * @skip bring in 1st item
3540  * @until }
3541  *
3542  * The "Show last", in its turn, will use elm_gengrid_last_item_get()
3543  * and elm_gengrid_item_show(). The latter differs from
3544  * elm_gengrid_item_bring_in() in that it immediately replaces the
3545  * contents of the grid's viewport with the region containing the item
3546  * in question:
3547  * @dontinclude gengrid_example.c
3548  * @skip show last item
3549  * @until }
3550  *
3551  * To change the grid's cell (items) size, we've placed a spinner,
3552  * which has the following @c "changed" smart callback:
3553  * @dontinclude gengrid_example.c
3554  * @skip change items' size
3555  * @until }
3556  *
3557  * Experiment with it and see how the items are affected. The "Disable
3558  * item" button will, as the name says, disable the currently selected
3559  * item:
3560  * @dontinclude gengrid_example.c
3561  * @skip disable selected item
3562  * @until }
3563  * Note that we also make use of elm_gengrid_item_selected_set(),
3564  * there, thus making the item unselected before we actually disable
3565  * it.
3566  *
3567  * To toggle between horizontal and vertical layouting modes on the
3568  * grid, use the "Horizontal mode" check, which will call the
3569  * respective API function on the grid:
3570  * @dontinclude gengrid_example.c
3571  * @skip change layouting mode
3572  * @until }
3573  *
3574  * If you toggle the check right after that one, "Always select",
3575  * you'll notice all subsequent clicks on the @b same grid item will
3576  * still issue the selection callback on it, what is different from
3577  * when it's not checked. This is the
3578  * elm_gengrid_always_select_mode_set() behavior:
3579  * @dontinclude gengrid_example.c
3580  * @skip "always select" callback
3581  * @until }
3582  *
3583  * One more check follows, "Bouncing", which will turn on/off the
3584  * bouncing animations on the grid, when one scrolls past its
3585  * borders. Experiment with scrolling the grid to get the idea, having
3586  * it turned on and off:
3587  * @dontinclude gengrid_example.c
3588  * @skip "bouncing mode" callback
3589  * @until }
3590  *
3591  * The next two checks will affect items selection on the grid. The
3592  * first, "Multi-selection", will make it possible to select more the
3593  * one item on the grid. Because it wouldn't make sense to fetch for
3594  * an unique selected item on this case, we also disable two of the
3595  * buttons, which insert items relatively, if multi-selection is on:
3596  * @dontinclude gengrid_example.c
3597  * @skip multi-selection callback
3598  * @until }
3599  *
3600  * Note that we also @b unselect all items in the grid, when returning
3601  * from multi-selection mode, making use of
3602  * elm_gengrid_item_selected_set().
3603  *
3604  * The second check acting on selection, "No selection", is just what
3605  * its name depicts -- no selection will be allowed anymore, on the
3606  * grid, while it's on. Check it out for yourself, interacting with
3607  * the program:
3608  * @dontinclude gengrid_example.c
3609  * @skip no selection callback
3610  * @until }
3611  *
3612  * We have, finally, one more line of knobs, now sliders, to change
3613  * the grids behavior. The two first will change the horizontal @b
3614  * alignment of the whole actual grid of items within the gengrid's
3615  * viewport:
3616  * @dontinclude gengrid_example.c
3617  * @skip items grid horizontal alignment change
3618  * @until }
3619  *
3620  * Naturally, the vertical counterpart just issues
3621  * elm_gengrid_align_set() changing the second alignment component,
3622  * instead.
3623  *
3624  * The last slider will change the grid's <b>page size</b>, relative
3625  * to its own one. Try to change those values and, one manner of
3626  * observing the paging behavior, is to scroll softly and release the
3627  * mouse button, with different page sizes, at different grid
3628  * positions, while having lots of items in it -- you'll see it
3629  * snapping to page boundaries differenty, for each configuration:
3630  * @dontinclude gengrid_example.c
3631  * @skip page relative size change
3632  * @until }
3633  *
3634  * This is how the example program's window looks like:
3635  * @image html screenshots/gengrid_example.png
3636  * @image latex screenshots/gengrid_example.eps
3637  *
3638  * Note that it starts with three items which we included at will:
3639  * @dontinclude gengrid_example.c
3640  * @skip _clicked(grid,
3641  * @until _clicked(grid,
3642  * @until _clicked(grid,
3643  * @until _clicked(grid,
3644  *
3645  * See the full @ref gengrid_example_c "source code" for
3646  * this example.
3647  *
3648  * @example gengrid_example.c
3649  */
3650
3651 /**
3652  * @page genlist_example_01
3653  *
3654  * This example creates a simple genlist with a small number of items and
3655  * a callback that is called whenever an item is selected. All the properties of
3656  * this genlist are the default ones. The full code for this example can be seen
3657  * at @ref genlist_example_01_c.
3658  *
3659  * For the simplest list that you plan to create, it's necessary to define some
3660  * of the basic functions that are used for creating each list item, and
3661  * associating them with the "item class" for that list. The item class is just
3662  * an struct that contains pointers to the specific list item functions that are
3663  * common to all the items of the list.
3664  *
3665  * Let's show it by example. Our item class is declared globally and static as
3666  * it will be the only item class that we need (we are just creating one list):
3667  *
3668  * @dontinclude genlist_example_01.c
3669  * @skip static Elm_Genlist
3670  * @until static Elm_Genlist
3671  *
3672  * This item class will be used for every item that we create. The only
3673  * functions that we are going to set are @c label_get and @c icon_get. As the
3674  * name suggests, they are used by the genlist to generate the label for the
3675  * respective item, and to generate icon(s) to it too. Both the label and icon
3676  * get functions can be called more than once for each item, with different @c
3677  * part parameters, which represent where in the theme of the item that label or
3678  * icon is going to be set.
3679  *
3680  * The default theme for the genlist contains only one area for label, and two
3681  * areas for icon ("elm.swallow.icon" and "elm.swallow.end"). Since we just want
3682  * to set the first icon (that will be at the left side of the label), we
3683  * compare the part name given with "elm.swallow.icon". Notice that the
3684  * @c label_get function must return a strduped string, that will be freed later
3685  * automatically by the list. Here's the code for @c label_get and @c icon_get:
3686  *
3687  * @until static void
3688  *
3689  * We will also provide a function that will be called whenever an item is
3690  * selected in the genlist. However, this function is not part of the item
3691  * class, it will be passed for each item being added to the genlist explicitly.
3692  * Notice the similarity of the function signature with those used by @c
3693  * evas_object_smart_callback_add:
3694  *
3695  * @until }
3696  *
3697  * Now let's show the code used for really creating the list. Skipping
3698  * boilerplate code used for creating a window and background, the first piece
3699  * of code specific to our genlist example is setting the pointer functions of
3700  * the item class to our above defined functions:
3701  *
3702  * @skip _itc
3703  * @until func.del
3704  *
3705  * Notice that we also choose to use the "default" style for our genlist items.
3706  * Another interesting point is that @c state_get and @c del are set to @c NULL,
3707  * since we don't need these functions now. @c del doesn't need to be used
3708  * because we don't add any data that must be freed to our items, and @c
3709  * state_get is also not used since all of our items are the same and don't need
3710  * to have different states to be used for each item. Finally we create our
3711  * list:
3712  *
3713  * @until genlist_add
3714  *
3715  * Now we append several items to the list, and for all of them we need to give
3716  * the list pointer, a pointer to the item class, the data that will be used
3717  * with that item, a pointer to the parent of this item if it is in a group type
3718  * list (this is not the case so we pass @c NULL), possible flags for this item,
3719  * the callback for when the item is selected, and the data pointer that will be
3720  * given to the selected callback.
3721  *
3722  * @until }
3723  *
3724  * The rest of the code is also common to all the other examples, so it will be
3725  * omitted here (look at the full source code link above if you need it).
3726  *
3727  * You can try to play with this example, and see the selected callback being
3728  * called whenever an item is clicked. It also already has some features enabled
3729  * by default, like vertical bounce animation when reaching the end of the list,
3730  * automatically visible/invisible scrollbar, etc. Look at the @ref
3731  * genlist_example_02 to see an example of setting these properties to the list.
3732  *
3733  * The current example will look like this when running:
3734  *
3735  * @image html screenshots/genlist_example_01.png
3736  * @image latex screenshots/genlistexample_01.eps width=\textwidth
3737  */
3738
3739 /**
3740  * @page genlist_example_02
3741  *
3742  * This example is very similar to the @ref genlist_example_01, but it fetch
3743  * most of the properties of the genlist and displays them on startup (thus
3744  * getting the default value for them) and then set them to some other values,
3745  * to show how to use that API. The full source code is at @ref
3746  * genlist_example_02_c.
3747  *
3748  * Considering that the base code for instantiating a genlist was already
3749  * described in the previous example, we are going to focus on the new code.
3750  *
3751  * Just a small difference for the @c _item_label_get function, we are going to
3752  * store the time that this function was called. This is the "realized" time,
3753  * the time when the visual representation of this item was created. This is the
3754  * code for the @c label_get function:
3755  *
3756  * @dontinclude genlist_example_02.c
3757  * @skip static char
3758  * @until return strdup
3759  *
3760  * Now let's go to the list creation and setup. First, just after creating the
3761  * list, we get most of the default properties from it, and print them on the
3762  * console:
3763  *
3764  * @skip genlist_add
3765  * @until printf("\n")
3766  *
3767  * We are going to change some of the properties of our list.
3768  *
3769  * There's no need to call the selected callback at every click, just when the
3770  * selected item changes, thus we call elm_genlist_always_select_mode_set() with
3771  * false.
3772  *
3773  * For this list we don't want bounce animations at all, so we set both the
3774  * horizontal bounce and the vertical bounce to false with
3775  * elm_genlist_bounce_set().
3776  *
3777  * We also want our list to compress items if they are wider than the list
3778  * width (thus we call elm_genlist_compress_mode_set().
3779  *
3780  * The items have different width, so they are not homogeneous:
3781  * elm_genlist_homogeneous_set() is set to false.
3782  *
3783  * Since the compress mode is active, the call to
3784  * elm_genlist_horizontal_mode_set() doesn't make difference, but the current
3785  * option would make the list to have at least the width of the largest item.
3786  *
3787  * This list will support multiple selection, so we call
3788  * elm_genlist_multi_select_set() on it.
3789  *
3790  * The option elm_genlist_height_for_width_mode_set() would allow text block to
3791  * wrap lines if the Edje part is configured with "text.min: 0 1", for example.
3792  * But since we are compressing the elements to the width of the list, this
3793  * option wouldn't take any effect.
3794  *
3795  * We want the vertical scrollbar to be always displayed, and the orizontal one
3796  * to never be displayed, and set this with elm_genlist_scroller_policy_set().
3797  *
3798  * The timeout to consider a longpress is set to half of a second with
3799  * elm_genlist_longpress_timeout_set().
3800  *
3801  * We also change the block count to a smaller value, but that should have not
3802  * impact on performance since the number of visible items is too small. We just
3803  * increase the granularity of the block count (setting it to have at most 4
3804  * items).
3805  *
3806  * @until block_count_set
3807  *
3808  * Now let's add elements to the list:
3809  *
3810  * @until item_append
3811  * @until }
3812  *
3813  * It's exactly the same as the previous example. The difference is on the
3814  * behavior of the list, if you try to scroll, select items and so.
3815  *
3816  * In this example we also need two buttons. One of them, when clicked, will
3817  * display several status info about the current selection, the "realized"
3818  * items, the item in the middle of the screen, and the current mode and active
3819  * item of that mode for the genlist.
3820  *
3821  * The other button will ask the genlist to "realize" again the items already
3822  * "realized", so their respective label_get and icon_get functions will be
3823  * called again.
3824  *
3825  * These are the callbacks for both of these buttons:
3826  *
3827  * @dontinclude genlist_example_02.c
3828  * @skip item_sel_cb
3829  * @skip static
3830  * @until }
3831  * @until }
3832  *
3833  * Try to scroll, select some items and click on the "Show status" button.
3834  * You'll notice that not all items of the list are "realized", thus consuming
3835  * just a small amount of memory. The selected items are listed in the order
3836  * that they were selected, and the current selected item printed using
3837  * elm_genlist_selected_item_get() is the first selected item of the multiple
3838  * selection.
3839  *
3840  * Now resize the window so that you can see the "realized time" of some items.
3841  * This is the time of when the label_get function was called. If you click on
3842  * the "Realize" button, all the already realized items will be rebuilt, so the
3843  * time will be updated for all of them.
3844  *
3845  * The current example will look like this when running:
3846  *
3847  * @image html screenshots/genlist_example_02.png
3848  * @image latex screenshots/genlistexample_02.eps width=\textwidth
3849  */
3850
3851 /**
3852  * @page bg_example_01_c bg_example_01.c
3853  * @include bg_example_01.c
3854  * @example bg_example_01.c
3855  */
3856
3857 /**
3858  * @page bg_example_02_c bg_example_02.c
3859  * @include bg_example_02.c
3860  * @example bg_example_02.c
3861  */
3862
3863 /**
3864  * @page bg_example_03_c bg_example_03.c
3865  * @include bg_example_03.c
3866  * @example bg_example_03.c
3867  */
3868
3869 /**
3870  * @page actionslider_example_01 Actionslider example
3871  * @include actionslider_example_01.c
3872  * @example actionslider_example_01.c
3873  */
3874
3875 /**
3876  * @page animator_example_01_c Animator example 01
3877  * @include animator_example_01.c
3878  * @example animator_example_01.c
3879  */
3880
3881 /**
3882  * @page transit_example_01_c Transit example 1
3883  * @include transit_example_01.c
3884  * @example transit_example_01.c
3885  */
3886
3887 /**
3888  * @page transit_example_02_c Transit example 2
3889  * @include transit_example_02.c
3890  * @example transit_example_02.c
3891  */
3892
3893 /**
3894  * @page general_functions_example_c General (top-level) functions example
3895  * @include general_funcs_example.c
3896  * @example general_funcs_example.c
3897  */
3898
3899 /**
3900  * @page clock_example_c Clock example
3901  * @include clock_example.c
3902  * @example clock_example.c
3903  */
3904
3905 /**
3906  * @page flipselector_example_c Flipselector example
3907  * @include flipselector_example.c
3908  * @example flipselector_example.c
3909  */
3910
3911 /**
3912  * @page fileselector_example_c Fileselector example
3913  * @include fileselector_example.c
3914  * @example fileselector_example.c
3915  */
3916
3917 /**
3918  * @page fileselector_button_example_c Fileselector button example
3919  * @include fileselector_button_example.c
3920  * @example fileselector_button_example.c
3921  */
3922
3923 /**
3924  * @page fileselector_entry_example_c Fileselector entry example
3925  * @include fileselector_entry_example.c
3926  * @example fileselector_entry_example.c
3927  */
3928
3929 /**
3930  * @page index_example_01_c Index example
3931  * @include index_example_01.c
3932  * @example index_example_01.c
3933  */
3934
3935 /**
3936  * @page index_example_02_c Index example
3937  * @include index_example_02.c
3938  * @example index_example_02.c
3939  */
3940
3941 /**
3942  * @page layout_example_01_c layout_example_01.c
3943  * @include layout_example_01.c
3944  * @example layout_example_01.c
3945  */
3946
3947 /**
3948  * @page layout_example_02_c layout_example_02.c
3949  * @include layout_example_02.c
3950  * @example layout_example_02.c
3951  */
3952
3953 /**
3954  * @page layout_example_03_c layout_example_03.c
3955  * @include layout_example_03.c
3956  * @example layout_example_03.c
3957  */
3958
3959 /**
3960  * @page layout_example_edc An example of layout theme file
3961  *
3962  * This theme file contains two groups. Each of them is a different theme, and
3963  * can be used by an Elementary Layout widget. A theme can be used more than
3964  * once by many different Elementary Layout widgets too.
3965  *
3966  * @include layout_example.edc
3967  * @example layout_example.edc
3968
3969 /**
3970  * @page gengrid_example_c Gengrid example
3971  * @include gengrid_example.c
3972  * @example gengrid_example.c
3973  */
3974
3975 /**
3976  * @page genlist_example_01_c genlist_example_01.c
3977  * @include genlist_example_01.c
3978  * @example genlist_example_01.c
3979  */
3980
3981 /**
3982  * @page genlist_example_02_c genlist_example_02.c
3983  * @include genlist_example_02.c
3984  * @example genlist_example_02.c
3985  */