Elementary: Map 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 slider_example
37  *
38  * @ref panes_example
39  *
40  * @ref clock_example
41  *
42  * @ref mapbuf_example
43
44  * @ref map_example_01
45  *
46  * @ref map_example_02
47  *
48  * @ref map_example_03
49  *
50  * @ref diskselector_example_01
51  *
52  * @ref diskselector_example_02
53  *
54  * @ref list_example_01
55  *
56  * @ref list_example_02
57  *
58  * @ref list_example_03
59  *
60  * @ref toolbar_example_01
61  *
62  * @ref toolbar_example_02
63  *
64  * @ref toolbar_example_03
65  *
66  * @ref segment_control_example
67  *
68  * @ref flipselector_example
69  *
70  * @ref fileselector_example
71  *
72  * @ref fileselector_button_example
73  *
74  * @ref fileselector_entry_example
75  *
76  * @ref index_example_01
77  *
78  * @ref index_example_02
79  *
80  * @ref gengrid_example
81  *
82  * @ref genlist_example_01
83  *
84  * @ref genlist_example_02
85  *
86  * @ref genlist_example_03
87  *
88  * @ref genlist_example_04
89  *
90  * @ref genlist_example_05
91  *
92  * @ref thumb_example_01
93  *
94  * @ref progressbar_example
95  *
96  * @ref slideshow_example
97  */
98
99 /**
100  * @page bg_01_example_page elm_bg - Plain color background.
101  * @dontinclude bg_example_01.c
102  *
103  * The full code for this example can be found at @ref bg_example_01_c,
104  * in the function @c test_bg_plain. It's part of the @c elementar_test
105  * suite, and thus has the code for the three examples referenced by this
106  * documentation.
107  *
108  * This first example just sets a default background with a plain color. The
109  * first part consists of creating an Elementary window. It's the common
110  * piece of code that you'll see everywhere in Elementary: @skip elm_main
111  * @until autodel_set
112  *
113  * Now we really create our background object, using the window object as
114  * its parent:
115  *
116  * @skipline bg_add
117  *
118  * Then we set the size hints of the background object so that it will use
119  * all space available for it, and then add it as a resize object to the
120  * window, making it visible in the end:
121  *
122  * @skip size_hint_weight_set
123  * @until resize_object_add
124  *
125  * See @ref evas_object_size_hint_weight_set and elm_win_resize_object_add()
126  * for more detailed info about these functions.
127  *
128  * The end of the example is quite simple, just setting the minimum and
129  * maximum size of the background, so the Elementary window knows that it
130  * has to have at least the minimum size. The background also won't scale to
131  * a size above its maximum. Then we resize the window and show it in the
132  * end:
133  *
134  * @skip set size hints
135  * @until }
136  *
137  * And here we finish our very simple background object usage example.
138  */
139
140 /**
141  * @page bg_02_example_page elm_bg - Image background.
142  * @dontinclude bg_example_02.c
143  *
144  * The full code for this example can be found at @ref bg_example_02_c,
145  * in the function @c test_bg_image. It's part of the @c elementar_test
146  * suite, and thus has the code for the three examples referenced by this
147  * documentation.
148  *
149  * This is the second example, and shows how to use the Elementary
150  * background object to set an image as background of your application.
151  *
152  * We start this example exactly in the same way as the previous one, even
153  * when creating the background object:
154  *
155  * @skip elm_main
156  * @until bg_add
157  *
158  * Now it's the different part.
159  *
160  * Our background will have an image, that will be displayed over the
161  * background color. Before loading the image, we set the load size of the
162  * image. The load size is a hint about the size that we want the image
163  * displayed in the screen. It's not the exact size that the image will have,
164  * but usually a bit bigger. The background object can still be scaled to a
165  * size bigger than the one set here. Setting the image load size to
166  * something smaller than its real size will reduce the memory used to keep
167  * the pixmap representation of the image, and the time to load it. Here we
168  * set the load size to 20x20 pixels, but the image is loaded with a size
169  * bigger than that (since it's just a hint):
170  *
171  * @skipline load_size_set
172  *
173  * And set our background image to be centered, instead of stretched or
174  * scaled, so the effect of the elm_bg_load_size_set() can be easily
175  * understood:
176  *
177  * @skipline option_set
178  *
179  * We need a filename to set, so we get one from the previous installed
180  * images in the @c PACKAGE_DATA_DIR, and write its full path to a buffer.
181  * Then we use this buffer to set the filename in the background object:
182  *
183  * @skip snprintf
184  * @until bg_file_set
185  *
186  * Notice that the third argument of the elm_bg_file_set() function is @c
187  * NULL, since we are setting an image to this background. This function
188  * also supports setting an edje group as background, in which case the @c
189  * group parameter wouldn't be @c NULL, but be the name of the group
190  * instead.
191  *
192  * Finally, we can set the size hints, add the background as a resize
193  * object, and resize the window, exactly the same thing we do in the @ref
194  * bg_01_example_page example:
195  *
196  * @skip size_hint
197  * @until }
198  *
199  * And this is the end of this example.
200  *
201  * This example will look like this:
202  *
203  * @image html screenshots/bg_01.png
204  * @image latex screenshots/bg_01.eps width=\textwidth
205  */
206
207 /**
208  * @page bg_03_example_page elm_bg - Background properties.
209  * @dontinclude bg_example_03.c
210  *
211  * The full code for this example can be found at @ref bg_example_03_c, in the
212  * function @c test_bg_options, with the callbacks @c _cb_overlay_changed, @c
213  * _cb_color_changed and @c _cb_radio_changed defined in the beginning of the
214  * file. It's part of the @c elementar_test suite, and thus has the code for
215  * the three examples referenced by this documentation.
216  *
217  * This example will show the properties available for the background object,
218  * and will use of some more widgets to set them.
219  *
220  * In order to do this, we will set some callbacks for these widgets. The
221  * first is for the radio buttons that will be used to choose the option
222  * passed as argument to elm_bg_option_set():
223  *
224  * @skip _cb_radio_changed
225  * @until }
226  *
227  * The next callback will be used when setting the overlay (using
228  * elm_bg_overlay_set()):
229  *
230  * @skip _cb_overlay_changed
231  * @until }
232  * @until }
233  *
234  * And the last one, used to set the color (with elm_bg_color_set()):
235  *
236  * @skip _cb_color_changed
237  * @until }
238  *
239  * We will get back to what these functions do soon. If you want to know more
240  * about how to set these callbacks and what these widgets are, look for:
241  * @li elm_radio_add()
242  * @li elm_check_add()
243  * @li elm_spinner_add()
244  *
245  * Now going to the main function, @c test_bg_options, we have the common
246  * code with the other examples:
247  *
248  * @skip bg-options
249  * @until autodel_set
250  *
251  * We add a plain background to this window, so it will have the default
252  * background color behind everything:
253  *
254  * @skip bg = elm_bg_add
255  * @until evas_object_show(bg)
256  *
257  * Then we add a vertical box (elm_box_add()) that will hold the background
258  * object that we are going to play with, as well as a horizontal box that
259  * will hold widgets:
260  *
261  * @skip elm_box_add
262  * @until evas_object_show
263  *
264  * Now we add the background object that is going to be of use for our
265  * example. It is an image background, as used in @ref bg_02_example_page ,
266  * so the code should be familiar:
267  *
268  * @skip elm_bg_add
269  * @until evas_object_show
270  *
271  * Notice the call to elm_box_pack_end(): it will pack the background object
272  * in the end of the Elementary box declared above. Just refer to that
273  * documentation for more info.
274  *
275  * Since this Elementary background is already an image background, we are
276  * going to play with its other properties. We will change its option
277  * (CENTER, SCALE, STRETCH, TILE), its color (RGB), and add an overlay to it.
278  * For all of these properties, we are going to add widgets that will
279  * configure them.
280  *
281  * First, lets add the horizontal box that will hold these widgets:
282  * @skip hbox
283  * @until align_set
284  *
285  * For now, just consider this @c hbox as a rectangle that will contain the
286  * widgets, and will distribute them horizontally inside its content. Then we
287  * add radio buttons that will allow us to choose the property to use with
288  * this background:
289  *
290  * @skip radio_add
291  * @until evas_object_show
292  *
293  * Again, I won't give details about the use of these widgets, just look for
294  * their documentation if necessary. It's enough to know for now that we are
295  * packing them in the @c hbox, setting a label for them, and the most
296  * important parts: setting its value to @c ELM_BG_OPTION_CENTER and its
297  * callback to @c _cb_radio_changed (the function defined in the beginning of
298  * this example). We do this for the next 3 radio buttons added after this
299  * one, each of them with a different value.
300  *
301  * Now taking a look at the code of the callback @c _cb_radio_changed again,
302  * it will call elm_bg_option_set() with the value set from the checked radio
303  * button, thus setting the option for this background. The background is
304  * passed as argument to the @p data parameter of this callback, and is
305  * referenced here as @c o_bg.
306  *
307  * Later we set the default value for this radio button:
308  *
309  * @skipline elm_radio_value_set
310  *
311  * Then we add a checkbox for the elm_bg_overlay_set() function:
312  *
313  * @skip check_add
314  * @until evas_object_show
315  *
316  * Now look at the code of the @c _cb_overlay_changed again. If the checkbox
317  * state is checked, an overlay will be added to the background. It's done by
318  * creating an Edje object, and setting it with elm_bg_overlay_set() to the
319  * background object. For information about what are and how to set Edje
320  * object, look at the Edje documentation.
321  *
322  * Finally we add a spinner object (elm_spinner_add()) to be used to select
323  * the color of our background. In its callback it's possible to see the call
324  * to elm_bg_color_set(), which will change the color of this background.
325  * This color is used by the background to fill areas where the image doesn't
326  * cover (in this case, where we have an image background). The spinner is
327  * also packed into the @c hbox :
328  *
329  * @skip elm_spinner_add
330  * @until evas_object_show
331  *
332  * Then we just have to pack the @c hbox inside the @c box, set some size
333  * hints, and show our window:
334  *
335  * @skip pack_end
336  * @until }
337  *
338  * Now to see this code in action, open elementary_test, and go to the "Bg
339  * Options" test. It should demonstrate what was implemented here.
340  */
341
342 /**
343  * @page actionslider_example_page Actionslider usage
344  * @dontinclude actionslider_example_01.c
345  *
346  * For this example we are going to assume knowledge of evas smart callbacks
347  * and some basic evas object functions. Elementary is not meant to be used
348  * without evas, if you're not yet familiar with evas it probably is worth
349  * checking that out.
350  *
351  * And now to the example, when using Elementary we start by including
352  * Elementary.h:
353  * @skipline #include
354  *
355  * Next we define some callbacks, they all share the same signature because
356  * they are all to be used with evas_object_smart_callback_add().
357  * The first one just prints the selected label(in two different ways):
358  * @until }
359  *
360  * This next callback is a little more interesting, it makes the selected
361  * label magnetic(except if it's the center label):
362  * @until }
363  *
364  * This callback enables or disables the magnetic propertty of the center
365  * label:
366  * @until }
367  *
368  * And finally a callback to stop the main loop when the window is closed:
369  * @until }
370  *
371  * To be able to create our actionsliders we need to do some setup, but this
372  * isn't really relevant here, so if you want to know about that go @ref
373  * Win "here".
374  *
375  * With all that boring stuff out of the way we can proceed to creating some
376  * actionsliders.@n
377  * All actionsliders are created the same way:
378  * @skipline actionslider_add
379  * Next we must choose where the indicator starts, and for this one we choose
380  * the right, and set the right as magnetic:
381  * @skipline indicator_pos_set
382  * @until magnet_pos_set
383  *
384  * We then set the labels for the left and right, passing NULL as an argument
385  * to any of the labels makes that position have no label.
386  * @until Stop
387  *
388  * Furthermore we mark both left and right as enabled positions, if we didn't
389  * do this all three positions would be enabled:
390  * @until RIGHT
391  *
392  * Having the the enabled positions we now add a smart callback to change
393  * which position is magnetic, so that only the last selected position is
394  * magnetic:
395  * @until NULL
396  *
397  * And finally we set our printing callback and show the actionslider:
398  * @until object_show
399  * @skip pack_end
400  *
401  * For our next actionslider we are going to do much as we did for the
402  * previous except we are going to have the center as the magnet(and not
403  * change it):
404  * @skipline actionslider_add
405  * @skipline indicator_pos_set
406  * @until object_show
407  *
408  * And another actionslider, in this one the indicator starts on the left.
409  * It has labels only in the center and right, and both bositions are
410  * magnetic. Because the left doesn't have a label and is not magnetic once
411  * the indicator leaves it can't return:
412  * @skipline actionslider_add
413  * @skipline indicator_pos_set
414  * @until object_show
415  * @note The greyed out area is a @ref Styles "style".
416  *
417  * And now an actionslider with a label in the indicator, and whose magnet
418  * properties change based on what was last selected:
419  * @skipline actionslider_add
420  * @skipline indicator_pos_set
421  * @until object_show
422  * @note The greyed out area is a @ref Styles "style".
423  *
424  * We are almost done, this next one is just an actionslider with all
425  * positions magnetized and having every possible label:
426  * @skipline actionslider_add
427  * @skipline indicator_pos_set
428  * @until object_show
429  *
430  * And for our last actionslider we have one that turns the magnetic property
431  * on and off:
432  * @skipline actionslider_add
433  * @skipline indicator_pos_set
434  * @until object_show
435  *
436  * The example will look like this:
437  *
438  * @image html screenshots/actionslider_01.png
439  * @image latex screenshots/actionslider_01.eps width=\textwidth
440  *
441  * See the full source code @ref actionslider_example_01 "here"
442  */
443
444 /**
445  * @page elm_animator_example_page_01 Animator usage
446  * @dontinclude animator_example_01.c
447  *
448  * For this example we will be using a bit of evas, you could animate a
449  * elementary widget in much the same way, but to keep things simple we use
450  * an evas_object_rectangle.
451  *
452  * As every other example we start with our include and a simple callback to
453  * exit the app when the window is closed:
454  * @skipline #include
455  * @until }
456  *
457  * This next callback is the one that actually creates our animation, it
458  * changes the size, position and color of a rectangle given to it in @a
459  * data:
460  * @until }
461  *
462  * Next we have a callback that prints a string, nothing special:
463  * @until }
464  *
465  * This next callback is a little more interesting, it has a state variable
466  * to know if the animation is currently paused or running, and it toogles
467  * the state of the animation accordingly:
468  * @until }
469  * @until }
470  * @until }
471  *
472  * Finally we have a callback to stop the animation:
473  * @until }
474  *
475  * As with every example we need to do a bit of setup before we can actually
476  * use an animation, but for the purposes of this example that's not relevant
477  * so let's just skip to the good stuff, creating an animator:
478  * @skipline animator_add
479  * @note Since elm_animator is not a widget we can give it a NULL parent.
480  *
481  * Now that we have an elm_animator we set it's duration to 1 second:
482  * @line duration_set
483  *
484  * We would also like our animation to be reversible, so:
485  * @line reverse_set
486  *
487  * We also set our animation to repeat as many times as possible, which will
488  * mean that _end_cb will only be called after UINT_MAX * 2 seconds(UINT_MAX
489  * for the animation running forward and UNIT_MAX for the animation running
490  * backwards):
491  * @line repeat_set
492  *
493  * To add some fun to our animation we will use the IN_OUT curve style:
494  * @line curve_style
495  *
496  * To actually animate anything we need an operation callback:
497  * @line operation_callback
498  *
499  * Even though we set our animation to repeat for a very long time we are
500  * going to set a end callback to it:
501  * @line completion_callback
502  * @note Notice that stoping the animation with the stop button will not make
503  * _end_cb be called.
504  *
505  * Now that we have fully set up our animator we can tell it to start
506  * animating:
507  * @line animate
508  *
509  * There's a bit more of code that doesn't really matter to use so we skip
510  * right down to our last interesting point:
511  * @skipline animator_del
512  * @note Because we created our animator with no parent we need to delete it
513  * ourselves.
514  *
515  * The example should look like this:
516  *
517  * @image html screenshots/animator_example_01.png
518  * @image latex screenshots/animator_example_01.eps width=\textwidth
519  * @n
520  * @image html screenshots/animator_example_02.png
521  * @image latex screenshots/animator_example_02.eps width=\textwidth
522  * @n
523  * @image html screenshots/animator_example_03.png
524  * @image latex screenshots/animator_example_03.eps width=\textwidth
525  *
526  * The full source code for this example can be found @ref
527  * animator_example_01_c "here"
528  */
529
530 /**
531  * @page transit_example_03_c elm_transit - Combined effects and options.
532  *
533  * This example shows how to apply the following transition effects:
534  * @li translation
535  * @li color
536  * @li rotation
537  * @li wipe
538  * @li zoom
539  * @li resizing
540  *
541  * It allows you to apply more than one effect at once, and also allows to
542  * set properties like event_enabled, auto_reverse, repeat_times and
543  * tween_mode.
544  *
545  * @include transit_example_03.c
546  */
547
548 /**
549  * @page transit_example_04_c elm_transit - Combined effects over two objects.
550  *
551  * This example shows how to apply the transition effects:
552  * @li flip
553  * @li resizable_flip
554  * @li fade
555  * @li blend
556  * over two objects. This kind of transition effect is used to make one
557  * object disappear and another one appear on its place.
558  *
559  * You can mix more than one effect of this type on the same objects, and the
560  * transition will apply both.
561  *
562  * @include transit_example_04.c
563  */
564
565 /**
566  * @page transit_example_01_explained elm_transit - Basic transit usage.
567  * @dontinclude transit_example_01.c
568  *
569  * The full code for this example can be found at @ref transit_example_01_c.
570  *
571  * This example shows the simplest way of creating a transition and applying
572  * it to an object. Similarly to every other elementary example, we create a
573  * window, set its title, size, autodel property, and setup a callback to
574  * exit the program when finished:
575  *
576  * @skip on_done
577  * @until evas_object_resize
578  *
579  * We also add a resizeable white background to use behind our animation:
580  *
581  * @skip bg_add
582  * @until evas_object_show
583  *
584  * And then we add a button that we will use to demonstrate the effects of
585  * our animation:
586  *
587  * @skip button_add
588  * @until evas_object_show(win)
589  *
590  * Notice that we are not adding the button with elm_win_resize_object_add()
591  * because we don't want the window to control the size of the button. We
592  * will use the transition to change the button size, so it could conflict
593  * with something else trying to control that size.
594  *
595  * Now, the simplest code possible to create the resize animation:
596  *
597  * @skip transit_add
598  * @until transit_go
599  *
600  * As you can see, this code is very easy to understand. First, we create the
601  * transition itself with elm_transit_add(). Then we add the button to this
602  * transition with elm_transit_object_add(), which means that the transition
603  * will operate over this button. The effect that we want now is changing the
604  * object size from 100x50 to 300x150, and can be achieved by adding the
605  * resize effect with elm_transit_effect_resizing_add().
606  *
607  * Finally, we set the transition time to 5 seconds and start the transition
608  * with elm_transit_go(). If we wanted more effects applied to this
609  * button, we could add them to the same transition. See the
610  * @ref transit_example_03_c to watch many transitions being applied to an
611  * object.
612  */
613
614 /**
615  * @page transit_example_02_explained elm_transit - Chained transitions.
616  * @dontinclude transit_example_02.c
617  *
618  * The full code for this example can be found at @ref transit_example_02_c.
619  *
620  * This example shows how to implement a chain of transitions. This chain is
621  * used to start a transition just after another transition ended. Similarly
622  * to every other elementary example, we create a window, set its title,
623  * size, autodel property, and setup a callback to exit the program when
624  * finished:
625  *
626  * @skip on_done
627  * @until evas_object_resize
628  *
629  * We also add a resizeable white background to use behind our animation:
630  *
631  * @skip bg_add
632  * @until evas_object_show
633  *
634  * This example will have a chain of 4 transitions, each of them applied to
635  * one button. Thus we create 4 different buttons:
636  *
637  * @skip button_add
638  * @until evas_object_show(bt4)
639  *
640  * Now we create a simple translation transition that will be started as soon
641  * as the program loads. It will be our first transition, and the other
642  * transitions will be started just after this transition ends:
643  *
644  * @skip transit_add
645  * @until transit_go
646  *
647  * The code displayed until now has nothing different from what you have
648  * already seen in @ref transit_example_01_explained, but now comes the new
649  * part: instead of creating a second transition that will start later using
650  * a timer, we create the it normally, and use
651  * elm_transit_chain_transit_add() instead of elm_transit_go. Since we are
652  * adding it in a chain after the first transition, it will start as soon as
653  * the first transition ends:
654  *
655  * @skip transit_add
656  * @until transit_chain_transit_add
657  *
658  * Finally we add the 2 other transitions to the chain, and run our program.
659  * It will make one transition start after the other finish, and there is the
660  * transition chain.
661  */
662
663 /**
664  * @page general_functions_example_page General (top-level) functions example
665  * @dontinclude general_funcs_example.c
666  *
667  * As told in their documentation blocks, the
668  * elm_app_compile_*_dir_set() family of functions have to be called
669  * before elm_app_info_set():
670  * @skip tell elm about
671  * @until elm_app_info_set
672  *
673  * We are here setting the fallback paths to the compiling time target
674  * paths, naturally. If you're building the example out of the
675  * project's build system, we're assuming they are the canonical ones.
676  *
677  * After the program starts, elm_app_info_set() will actually run and
678  * then you'll see an intrincasy: Elementary does the prefix lookup @b
679  * twice. This is so because of the quicklaunch infrastructure in
680  * Elementary (@ref Start), which will register a predefined prefix
681  * for possible users of the launch schema. We're not hooking into a
682  * quick launch, so this first call can't be avoided.
683  *
684  * If you ran this example from your "bindir" installation
685  * directiory, no output will emerge from these both attempts -- it
686  * will find the "magic" file there registered and set the prefixes
687  * silently. Otherwise, you could get something like:
688  @verbatim
689  WARNING: Could not determine its installed prefix for 'ELM'
690        so am falling back on the compiled in default:
691          usr
692        implied by the following:
693          bindir    = usr/lib
694          libdir    = usr/lib
695          datadir   = usr/share/elementary
696          localedir = usr/share/locale
697        Try setting the following environment variables:
698          ELM_PREFIX     - points to the base prefix of install
699        or the next 4 variables
700          ELM_BIN_DIR    - provide a specific binary directory
701          ELM_LIB_DIR    - provide a specific library directory
702          ELM_DATA_DIR   - provide a specific data directory
703          ELM_LOCALE_DIR - provide a specific locale directory
704  @endverbatim
705  * if you also didn't change those environment variables (remember
706  * they are also a valid way of communicating your prefix to the
707  * binary) - this is the scenario where it fallbacks to the paths set
708  * for compile time.
709  *
710  * Then, you can check the prefixes set on the standard output:
711  * @skip prefix was set to
712  * @until locale directory is
713  *
714  * In the fragment
715  * @skip by using this policy
716  * @until elm_win_autodel_set
717  * we demonstrate the use of Elementary policies. The policy defining
718  * under which circunstances our application should quit automatically
719  * is set to when its last window is closed (this one has just one
720  * window, though). This will save us from having to set a callback
721  * ourselves on the window, like done in @ref bg_example_01_c "this"
722  * example. Note that we need to tell the window to delete itself's
723  * object on a request to destroy the canvas coming, with
724  * elm_win_autodel_set().
725  *
726  * What follows is some boilerplate code, creating a frame with a @b
727  * button, our object of interest, and, below, widgets to change the
728  * button's behavior and exemplify the group of functions in question.
729  *
730  * @dontinclude general_funcs_example.c
731  * We enabled the focus highlight object for this window, so that you
732  * can keep track of the current focused object better:
733  * @skip elm_win_focus_highlight_enabled_set
734  * @until evas_object_show
735  * Use the tab key to navigate through the focus chain.
736  *
737  * @dontinclude general_funcs_example.c
738  * While creating the button, we exemplify how to use Elementary's
739  * finger size information to scale our UI:
740  * @skip fprintf(stdout, "Elementary
741  * @until evas_object_show
742  *
743  * @dontinclude general_funcs_example.c
744  * The first checkbox's callback is:
745  * @skip static void
746  * @until }
747  * When unsetting the checkbox, we disable the button, which will get a new
748  * decoration (greyed out) and stop receiving events. The focus chain
749  * will also ignore it.
750  *
751  * Following, there are 2 more buttons whose actions are focus/unfocus
752  * the top button, respectively:
753  * @skip focus callback
754  * @until }
755  * and
756  * @skip unfocus callback
757  * @until }
758  * Note the situations in which they won't take effect:
759  * - the button is not allowed to get focus or
760  * - the button is disabled
761  *
762  * The first restriction above you'll get by a second checkbox, whose
763  * callback is:
764  * @skip focus allow callback
765  * @until }
766  * Note that the button will still get mouse events, though.
767  *
768  * Next, there's a slider controlling the button's scale:
769  * @skip scaling callback
770  * @until }
771  *
772  * Experiment with it, so you understand the effect better. If you
773  * change its value, it will mess with the button's original size,
774  * naturally.
775  *
776  * The full code for this example can be found
777  * @ref general_functions_example_c "here".
778  */
779
780 /**
781  * @page theme_example_01 Theme - Using extensions
782  *
783  * @dontinclude theme_example_01.c
784  *
785  * Using extensions is extremely easy, discarding the part where you have to
786  * write the theme for them.
787  *
788  * In the following example we'll be creating two buttons, one to load or
789  * unload our extension theme and one to cycle around three possible styles,
790  * one of which we created.
791  *
792  * After including our one and only header we'll jump to the callback for
793  * the buttons. First one takes care of loading or unloading our extension
794  * file, relative to the default theme set (thus the @c NULL in the
795  * functions first parameter).
796  * @skipline Elementary.h
797  * @skip static void
798  * @until }
799  * @until }
800  * @until }
801  *
802  * The second button, as we said before, will just switch around different
803  * styles. In this case we have three of them. The first one is our custom
804  * style, named after something very unlikely to find in the default theme.
805  * The other two styles are the standard and one more, anchor, which exists
806  * in the default and is similar to the default, except the button vanishes
807  * when the mouse is not over it.
808  * @skip static void
809  * @until }
810  * @until }
811  *
812  * So what happens if the style switches to our custom one when the
813  * extension is loaded? Elementary falls back to the default for the
814  * widget.
815  *
816  * And the main function, simply enough, will create the window, set the
817  * buttons and their callbacks, and just to begin with our button styled
818  * we're also loading our extension at the beginning.
819  * @skip int
820  * @until ELM_MAIN
821  *
822  * In this case we wanted to easily remove extensions, but all adding an
823  * extension does is tell Elementary where else it should look for themes
824  * when it can't find them in the default theme. Another way to do this
825  * is to set the theme search order using elm_theme_set(), but this requires
826  * that the developer is careful not to override any user configuration.
827  * That can be helped by adding our theme to the end of whatver is already
828  * set, like in the following snippet.
829  * @code
830  * char buf[4096];
831  * snprintf(buf, sizeof(buf), "%s:./theme_example.edj", elme_theme_get(NULL);
832  * elm_theme_set(NULL, buf);
833  * @endcode
834  *
835  * If we were using overlays instead of extensions, the same thing applies,
836  * but the custom theme must be added to the front of the search path.
837  *
838  * In the end, we should be looking at something like this:
839  *
840  * @image html screenshots/theme_example_01.png
841  * @image latex screenshots/theme_example_01.eps width=\textwidth
842  *
843  * That's all. Boringly simple, and the full code in one piece can be found
844  * @ref theme_example_01.c "here".
845  *
846  * And the code for our extension is @ref theme_example.edc "here".
847  *
848  * @example theme_example_01.c
849  * @example theme_example.edc
850  */
851
852 /**
853  * @page theme_example_02 Theme - Using overlays
854  *
855  * @dontinclude theme_example_02.c
856  *
857  * Overlays are like extensions in that you tell Elementary that some other
858  * theme contains the styles you need for your program. The difference is that
859  * they will be look in first, so they can override the default style of any
860  * widget.
861  *
862  * There's not much to say about them that hasn't been said in our previous
863  * example about @ref theme_example_01 "extensions", so going quickly through
864  * the code we have a function to load or unload the theme, which will be
865  * called when we click any button.
866  * @skipline Elementary.h
867  * @skip static void
868  * @until }
869  *
870  * And the main function, creating the window and adding some buttons to it.
871  * We load our theme as an overlay and nothing else. Notice there's no style
872  * set for any button there, which means they should be using the default
873  * that we override.
874  * @skip int
875  * @until ELM_MAIN
876  *
877  * That's pretty much it. The full code is @ref theme_example_02.c "here" and
878  * the definition of the theme is the same as before, and can be found in
879  * @ref theme_example.edc "here".
880  *
881  * @example theme_example_02.c
882  */
883
884  /**
885   * @page button_example_01 Button - Complete example
886   *
887   * @dontinclude button_example_01.c
888   *
889   * A button is simple, you click on it and something happens. That said,
890   * we'll go through an example to show in detail the button API less
891   * commonly used.
892   *
893   * In the end, we'll be presented with something that looks like this:
894   *
895   * @image html screenshots/button_01.png
896   * @image latex screenshots/button_01.eps width=\textwidth
897   *
898   * The full code of the example is @ref button_example_01.c "here" and we
899   * will follow here with a rundown of it.
900   *
901   * @skip Elementary.h
902   * @until Elementary.h
903   * @skip struct
904   * @until App_Data
905   *
906   * We have several buttons to set different times for the autorepeat timeouts
907   * of the buttons that use it and a few more that we keep track of in our
908   * data struct. The mid button doesn't do much, just moves around according
909   * to what other buttons the user presses. Then four more buttons to move the
910   * central one, and we're also keeping track of the icon set in the middle
911   * button, since when this one moves, we change the icon, and when movement
912   * is finished (by releasing one of the four arrow buttons), we set back the
913   * normal icon.
914   * @skip static void
915   * @until }
916   *
917   * Keeping any of those four buttons pressed will trigger their autorepeat
918   * callback, where we move the button doing some size hint magic. To
919   * understand how that works better, refer to the @ref Box documentation.
920   * Also, the first time the function is called, we change the icon in the
921   * middle button, using elm_button_icon_unset() first to keep the reference
922   * to the previous one, so we don't need to recreate it when we are done
923   * moving it.
924   * @skip static void
925   * @until }
926   * @until size_hint_align_set
927   * @until }
928   *
929   * One more callback for the option buttons, that just sets the timeouts for
930   * the different autorepeat options.
931   *
932   * @skip static void
933   * @until }
934   * @until }
935   * @until }
936   *
937   * And the main function, which does some setting up of the buttons in boxes
938   * to make things work. Here we'll go through some snippets only.
939   *
940   * For the option buttons, it's just the button with its label and callback.
941   * @skip elm_button_add
942   * @until smart_callback_add
943   *
944   * For the ones that move the central button, we have no labels. There are
945   * icons instead, and the autorepeat option is toggled.
946   * @skip Gap: 1.0
947   * @skip elm_button_add
948   * @until data.cursors.up
949   *
950   * And just to show the mid button, which doesn't have anything special.
951   * @skip data.cursors.left
952   * @skip elm_button_add
953   * @until data.mid
954   *
955   * And we are done.
956   *
957   * @example button_example_01.c
958   */
959
960 /**
961  * @page bubble_01_example_page elm_bubble - Simple use.
962  * @dontinclude bubble_example_01.c
963  *
964  * This example shows a bubble with all fields set(label, info, content and
965  * icon) and the selected corner changing when the bubble is clicked. To be
966  * able use a bubble we need to do some setup and create a window, for this
967  * example we are going to ignore that part of the code since it isn't
968  * relevant to the bubble.
969  *
970  * To have the selected corner change in a clockwise motion we are going to
971  * use the following callback:
972  * @skip static
973  * @until }
974  * @until }
975  *
976  * Here we are creating an elm_label that is going to be used as the content
977  * for our bubble:
978  * @skipline elm_label
979  * @until show
980  * @note You could use any evas_object for this, we are using an elm_label
981  * for simplicity.
982  *
983  * Despite it's name the bubble's icon doesn't have to be an icon, it can be
984  * any evas_object. For this example we are going to make the icon a simple
985  * blue rectangle:
986  * @until show
987  *
988  * And finally we have the actual bubble creation and the setting of it's
989  * label, info and content:
990  * @until content
991  * @skipline show
992  * @note Because we didn't set a corner, the default("top_left") will be
993  * used.
994  *
995  * Now that we have our bubble all that is left is connecting the "clicked"
996  * signals to our callback:
997  * @line smart_callback
998  *
999  * This last bubble we created was very complete, so it's pertinent to show
1000  * that most of that stuff is optional a bubble can be created with nothing
1001  * but content:
1002  * @until content
1003  * @skipline show
1004  *
1005  * Our example will look like this:
1006  *
1007  * @image html screenshots/bubble_example_01.png
1008  * @image latex screenshots/bubble_example_01.eps width=\textwidth
1009  *
1010  * See the full source code @ref bubble_example_01.c here.
1011  * @example bubble_example_01.c
1012  */
1013
1014 /**
1015  * @page box_example_01 Box - Basic API
1016  *
1017  * @dontinclude button_example_01.c
1018  *
1019  * As a special guest tonight, we have the @ref button_example_01 "simple
1020  * button example". There are plenty of boxes in it, and to make the cursor
1021  * buttons that moved a central one around when pressed, we had to use a
1022  * variety of values for their hints.
1023  *
1024  * To start, let's take a look at the handling of the central button when
1025  * we were moving it around. To achieve this effect without falling back to
1026  * a complete manual positioning of the @c Evas_Object in our canvas, we just
1027  * put it in a box and played with its alignment within it, as seen in the
1028  * following snippet of the callback for the pressed buttons.
1029  * @skip evas_object_size_hint_align_get
1030  * @until evas_object_size_hint_align_set
1031  *
1032  * Not much to it. We get the current alignment of the object and change it
1033  * by just a little, depending on which button was pressed, then set it
1034  * again, making sure we stay within the 0.0-1.0 range so the button moves
1035  * inside the space it has, instead of disappearing under the other objects.
1036  *
1037  * But as useful as an example as that may have been, the usual case with boxes
1038  * is to set everything at the moment they are created, like we did for
1039  * everything else in our main function.
1040  *
1041  * The entire layout of our program is made with boxes. We have one set as the
1042  * resize object for the window, which means it will always be resized with
1043  * the window. The weight hints set to @c EVAS_HINT_EXPAND will tell the
1044  * window that the box can grow past it's minimum size, which allows resizing
1045  * of it.
1046  * @skip elm_main
1047  * @skip elm_box_add
1048  * @until evas_object_show
1049  *
1050  * Two more boxes, set to horizontal, hold the buttons to change the autorepeat
1051  * configuration used by the buttons. We create each to take over all the
1052  * available space horizontally, but we don't want them to grow vertically,
1053  * so we keep that axis of the weight with 0.0. Then it gets packed in the
1054  * main box.
1055  * @skip box2
1056  * @until evas_object_show
1057  *
1058  * The buttons in each of those boxes have nothing special, they are just packed
1059  * in with their default values and the box will use their minimum size, as set
1060  * by Elementary itself based on the label, icon, finger size and theme.
1061  *
1062  * But the buttons used to move the central one have a special disposition.
1063  * The top one first, is placed right into the main box like our other smaller
1064  * boxes. Set to expand horizontally and not vertically, and in this case we
1065  * also tell it to fill that space, so it gets resized to take the entire
1066  * width of the window.
1067  * @skip Gap: 1.0
1068  * @skip elm_button_add
1069  * @until evas_object_show
1070  *
1071  * The bottom one will be the same, but for the other two we need to use a
1072  * second box set to take as much space as we have, so we can place our side
1073  * buttons in place and have the big empty space where the central button will
1074  * move.
1075  * @skip elm_box_add
1076  * @until evas_object_show
1077  *
1078  * Then the buttons will have their hints inverted to the other top and bottom
1079  * ones, to expand and fill vertically and keep their minimum size horizontally.
1080  * @skip elm_button_add
1081  * @until evas_object_show
1082  *
1083  * The central button takes every thing else. It will ask to be expanded in
1084  * both directions, but without filling its cell. Changing its alignment by
1085  * pressing the buttons will make it move around.
1086  * @skip elm_button_add
1087  * @until evas_object_show
1088  *
1089  * To end, the rightmost button is packed in the smaller box after the central
1090  * one, and back to the main box we have the bottom button at the end.
1091  */
1092
1093 /**
1094  * @page box_example_02 Box - Layout transitions
1095  *
1096  * @dontinclude box_example_02.c
1097  *
1098  * Setting a customized layout for a box is simple once you have the layout
1099  * function, which is just like the layout function for @c Evas_Box. The new
1100  * and fancier thing we can do with Elementary is animate the transition from
1101  * one layout to the next. We'll see now how to do that through a simple
1102  * example, while also taking a look at some of the API that was left
1103  * untouched in our @ref box_example_01 "previous example".
1104  *
1105  * @image html screenshots/box_example_02.png
1106  * @image latex screenshots/box_example_02.eps width=\textwidth
1107  *
1108  * @skipline Elementary.h
1109  *
1110  * Our application data consists of a list of layout functions, given by
1111  * @c transitions. We'll be animating through them throughout the entire run.
1112  * The box with the stuff to move around and the last layout that was set to
1113  * make things easier in the code.
1114  * @skip typedef
1115  * @until Transitions_Data
1116  *
1117  * The box starts with three buttons, clicking on any of them will take it
1118  * out of the box without deleting the object. There are also two more buttons
1119  * outside, one to add an object to the box and the other to clear it.
1120  * This is all to show how you can interact with the items in the box, add
1121  * things and even remove them, while the transitions occur.
1122  *
1123  * One of the callback we'll be using creates a new button, asks the box for
1124  * the list of its children and if it's not empty, we add the new object after
1125  * the first one, otherwise just place at the end as it will not make any
1126  * difference.
1127  * @skip static void
1128  * @until }
1129  * @until }
1130  *
1131  * The clear button is even simpler. Everything in the box will be deleted,
1132  * leaving it empty and ready to fill it up with more stuff.
1133  * @skip static void
1134  * @until }
1135  *
1136  * And a little function to remove buttons from the box without deleting them.
1137  * This one is set for the @c clicked callback of the original buttons,
1138  * unpacking them when clicked and placing it somewhere in the screen where
1139  * they will not disturb. Once we do this, the box no longer has any control
1140  * of it, so it will be left untouched until the program ends.
1141  * @skip static void
1142  * @until }
1143  *
1144  * If we wanted, we could just call @c evas_object_del() on the object to
1145  * destroy it. In this case, no unpack is really necessary, as the box would
1146  * be notified of a child being deleted and adjust its calculations accordingly.
1147  *
1148  * The core of the program is the following function. It takes whatever
1149  * function is first on our list of layouts and together with the
1150  * @c last_layout, it creates an ::Elm_Box_Transition to use with
1151  * elm_box_layout_transition(). In here, we tell it to start from whatever
1152  * layout we last set, end with the one that was at the top of the list and
1153  * when everything is finished, call us back so we can create another
1154  * transition. Finally, move the new layout to the end of the list so we
1155  * can continue running through them until the program ends.
1156  * @skip static void
1157  * @until }
1158  *
1159  * The main function doesn't have antyhing special. Creation of box, initial
1160  * buttons and some callback setting. The only part worth mentioning is the
1161  * initialization of our application data.
1162  * @skip tdata.box
1163  * @until evas_object_box_layout_stack
1164  *
1165  * We have a simple static variable, set the box, the first layout we are
1166  * using as last and create the list with the different functions to go
1167  * through.
1168  *
1169  * And in the end, we set the first layout and call the same function we went
1170  * through before to start the run of transitions.
1171  * @until _test_box_transition_change
1172  *
1173  * For the full code, follow @ref box_example_02.c "here".
1174  *
1175  * @example box_example_02.c
1176  */
1177
1178 /**
1179  * @page calendar_example_01 Calendar - Simple creation.
1180  * @dontinclude calendar_example_01.c
1181  *
1182  * As a first example, let's just display a calendar in our window,
1183  * explaining all steps required to do so.
1184  *
1185  * First you should declare objects we intend to use:
1186  * @skipline Evas_Object
1187  *
1188  * Then a window is created, a title is set and its set to be autodeleted.
1189  * More details can be found on windows examples:
1190  * @until elm_win_autodel
1191  *
1192  * Next a simple background is placed on our windows. More details on
1193  * @ref bg_01_example_page :
1194  * @until evas_object_show(bg)
1195  *
1196  * Now, the exciting part, let's add the calendar with elm_calendar_add(),
1197  * passing our window object as parent.
1198  * @until evas_object_show(cal);
1199  *
1200  * To conclude our example, we should show the window and run elm mainloop:
1201  * @until ELM_MAIN
1202  *
1203  * Our example will look like this:
1204  *
1205  * @image html screenshots/calendar_example_01.png
1206  * @image latex screenshots/calendar_example_01.eps width=\textwidth
1207  *
1208  * See the full source code @ref calendar_example_01.c here.
1209  * @example calendar_example_01.c
1210  */
1211
1212 /**
1213  * @page calendar_example_02 Calendar - Layout strings formatting.
1214  * @dontinclude calendar_example_02.c
1215  *
1216  * In this simple example, we'll explain how to format the label displaying
1217  * month and year, and also set weekday names.
1218  *
1219  * To format month and year label, we need to create a callback function
1220  * to create a string given the selected time, declared under a
1221  * <tt> struct tm </tt>.
1222  *
1223  * <tt> struct tm </tt>, declared on @c time.h, is a structure composed by
1224  * nine integers:
1225  * @li tm_sec   seconds [0,59]
1226  * @li tm_min   minutes [0,59]
1227  * @li tm_hour  hour [0,23]
1228  * @li tm_mday  day of month [1,31]
1229  * @li tm_mon   month of year [0,11]
1230  * @li tm_year  years since 1900
1231  * @li tm_wday  day of week [0,6] (Sunday = 0)
1232  * @li tm_yday  day of year [0,365]
1233  * @li tm_isdst daylight savings flag
1234  * @note glib version has 2 additional fields.
1235  *
1236  * For our function, only stuff that matters are tm_mon and tm_year.
1237  * But we don't need to access it directly, since there are nice functions
1238  * to format date and time, as @c strftime.
1239  * We will get abbreviated month (%b) and year (%y) (check strftime manpage
1240  * for more) in our example:
1241  * @skipline static char
1242  * @until }
1243  *
1244  * We need to alloc the string to be returned, and calendar widget will
1245  * free it when it's not needed, what is done by @c strdup.
1246  * So let's register our callback to calendar object:
1247  * @skipline elm_calendar_format_function_set
1248  *
1249  * To set weekday names, we should declare them as an array of strings:
1250  * @dontinclude calendar_example_02.c
1251  * @skipline weekdays
1252  * @until }
1253  *
1254  * And finally set them to calendar:
1255  * skipline weekdays_names_set
1256  *
1257  * Our example will look like this:
1258  *
1259  * @image html screenshots/calendar_example_02.png
1260  * @image latex screenshots/calendar_example_02.eps width=\textwidth
1261  *
1262  * See the full source code @ref calendar_example_02.c here.
1263  * @example calendar_example_02.c
1264  */
1265
1266 /**
1267  * @page calendar_example_03 Calendar - Years restrictions.
1268  * @dontinclude calendar_example_03.c
1269  *
1270  * This example explains how to set max and min year to be displayed
1271  * by a calendar object. This means that user won't be able to
1272  * see or select a date before and after selected years.
1273  * By default, limits are 1902 and maximun value will depends
1274  * on platform architecture (year 2037 for 32 bits); You can
1275  * read more about time functions on @c ctime manpage.
1276  *
1277  * Straigh to the point, to set it is enough to call
1278  * elm_calendar_min_max_year_set(). First value is minimun year, second
1279  * is maximum. If first value is negative, it won't apply limit for min
1280  * year, if the second one is negative, won't apply for max year.
1281  * Setting both to negative value will clear limits (default state):
1282  * @skipline elm_calendar_min_max_year_set
1283  *
1284  * Our example will look like this:
1285  *
1286  * @image html screenshots/calendar_example_03.png
1287  * @image latex screenshots/calendar_example_03.eps width=\textwidth
1288  *
1289  * See the full source code @ref calendar_example_03.c here.
1290  * @example calendar_example_03.c
1291  */
1292
1293 /**
1294  * @page calendar_example_04 Calendar - Days selection.
1295  * @dontinclude calendar_example_04.c
1296  *
1297  * It's possible to disable date selection and to select a date
1298  * from your program, and that's what we'll see on this example.
1299  *
1300  * If isn't required that users could select a day on calendar,
1301  * only interacting going through months, disabling days selection
1302  * could be a good idea to avoid confusion. For that:
1303  * @skipline elm_calendar_day_selection_enabled_set
1304  *
1305  * Also, regarding days selection, you could be interested to set a
1306  * date to be highlighted on calendar from your code, maybe when
1307  * a specific event happens, or after calendar creation. Let's select
1308  * two days from current day:
1309  * @dontinclude calendar_example_04.c
1310  * @skipline SECS_DAY
1311  * @skipline current_time
1312  * @until elm_calendar_selected_time_set
1313  *
1314  * Our example will look like this:
1315  *
1316  * @image html screenshots/calendar_example_04.png
1317  * @image latex screenshots/calendar_example_04.eps width=\textwidth
1318  *
1319  * See the full source code @ref calendar_example_04.c here.
1320  * @example calendar_example_04.c
1321  */
1322
1323 /**
1324  * @page calendar_example_05 Calendar - Signal callback and getters.
1325  * @dontinclude calendar_example_05.c
1326  *
1327  * Most of setters explained on previous examples have associated getters.
1328  * That's the subject of this example. We'll add a callback to display
1329  * all calendar information every time user interacts with the calendar.
1330  *
1331  * Let's check our callback function:
1332  * @skipline static void
1333  * @until double interval;
1334  *
1335  * To get selected day, we need to call elm_calendar_selected_time_get(),
1336  * but to assure nothing wrong happened, we must check for function return.
1337  * It'll return @c EINA_FALSE if fail. Otherwise we can use time set to
1338  * our structure @p stime.
1339  * @skipline elm_calendar_selected_time_get
1340  * @until return
1341  *
1342  * Next we'll get information from calendar and place on declared vars:
1343  * @skipline interval
1344  * @until elm_calendar_weekdays_names_get
1345  *
1346  * The only tricky part is that last line gets an array of strings
1347  * (char arrays), one for each weekday.
1348  *
1349  * Then we can simple print that to stdin:
1350  * @skipline printf
1351  * @until }
1352  *
1353  * <tt> struct tm </tt> is declared on @c time.h. You can check @c ctime
1354  * manpage to read about it.
1355  *
1356  * To register this callback, that will be called every time user selects
1357  * a day or goes to next or previous month, just add a callback for signal
1358  * @b changed.
1359  * @skipline evas_object_smart_callback_add
1360  *
1361  * Our example will look like this:
1362  *
1363  * @image html screenshots/calendar_example_05.png
1364  * @image latex screenshots/calendar_example_05.eps width=\textwidth
1365  *
1366  * See the full source code @ref calendar_example_05.c here.
1367  * @example calendar_example_05.c
1368  */
1369
1370 /**
1371  * @page calendar_example_06 Calendar - Calendar marks.
1372  * @dontinclude calendar_example_06.c
1373  *
1374  * On this example marks management will be explained. Functions
1375  * elm_calendar_mark_add(), elm_calendar_mark_del() and
1376  * elm_calendar_marks_clear() will be covered.
1377  *
1378  * To add a mark, will be required to choose three things:
1379  * @li mark style
1380  * @li mark date, or start date if it will be repeated
1381  * @li mark periodicity
1382  *
1383  * Style defines the kind of mark will be displayed over marked day,
1384  * on caledar. Default theme supports @b holiday and @b checked.
1385  * If more is required, is possible to set a new theme to calendar
1386  * widget using elm_object_style_set(), and use
1387  * the signal that will be used by such marks.
1388  *
1389  * Date is a <tt> struct tm </tt>, as defined by @c time.h. More can
1390  * be read on @c ctime manpage.
1391  * If a date relative from current is required, this struct can be set
1392  * as:
1393  * @skipline current_time
1394  * @until localtime_r
1395  *
1396  * Or if it's an absolute date, you can just declare the struct like:
1397  * @dontinclude calendar_example_06.c
1398  * @skipline sunday
1399  * @until christmas.tm_mon
1400  *
1401  * Periodicity is how frequently the mark will be displayed over the
1402  * calendar.  Can be a unique mark (that don't repeat), or it can repeat
1403  * daily, weekly, monthly or annually. It's enumerated by
1404  * @c Elm_Calendar_Mark_Repeat.
1405  *
1406  * So let's add some marks to our calendar. We will add christmas holiday,
1407  * set Sundays as holidays, and check current day and day after that.
1408  * @dontinclude calendar_example_06.c
1409  * @skipline sunday
1410  * @until christmas.tm_mon
1411  * @skipline current_time
1412  * @until ELM_CALENDAR_WEEKLY
1413  *
1414  * We kept the return of first mark add, because we don't really won't it
1415  * to be checked, so let's remove it:
1416  * @skipline elm_calendar_mark_del
1417  *
1418  * After all marks are added and removed, is required to draw them:
1419  * @skipline elm_calendar_marks_draw
1420  *
1421  * Finally, to clear all marks, let's set a callback for our button:
1422  * @skipline elm_button_add
1423  * @until evas_object_show(bt);
1424  *
1425  * This callback will receive our calendar object, and should clear it:
1426  * @dontinclude calendar_example_06.c
1427  * @skipline static
1428  * @until }
1429  * @note Remember to draw marks after clear the calendar.
1430  *
1431  * Our example will look like this:
1432  *
1433  * @image html screenshots/calendar_example_06.png
1434  * @image latex screenshots/calendar_example_06.eps width=\textwidth
1435  *
1436  * See the full source code @ref calendar_example_06.c here.
1437  * @example calendar_example_06.c
1438  */
1439
1440 /**
1441  * @page spinner_example Spinner widget example
1442  *
1443  * This code places seven Elementary spinner widgets on a window, each of
1444  * them exemplifying a part of the widget's API.
1445  *
1446  * The first of them is the default spinner:
1447  * @dontinclude spinner_example.c
1448  * @skipline elm_spinner_add
1449  * @until evas_object_show
1450  * As you see, the defaults for a spinner are:
1451  * @li no wrap
1452  * @li min value set to 0
1453  * @li max value set to 100
1454  * @li step value set to 1
1455  * @li label format set to "%0.f"
1456  *
1457  * If another format is required, see the second spinner. It will put a text
1458  * before and after the value, and also format value to display two decimals:
1459  * @skipline format_set
1460  *
1461  * The third one will use a customized step, define new minimum and maximum
1462  * values and enable wrap, so when value reaches minimum it jumps to maximum,
1463  * or jumps to minimum after maximum value is reached. Format is set to display
1464  * a decimal:
1465  * @skipline elm_spinner_add
1466  * @until evas_object_show
1467  *
1468  * The fourth uses @c vertical style, so instead of left and right arrows,
1469  * top and bottom are displayed. Also the change interval is reduced, so
1470  * user can change value faster.
1471  * @skipline style
1472  * @skipline interval
1473  *
1474  * In the fifth the user won't be allowed to set value directly, i.e., will
1475  * be obligate change value only using arrows:
1476  * @skipline editable
1477  *
1478  * The sixth widget will receive a lot of special values, so
1479  * instead of reading numeric values, user will see labels for each one.
1480  * Also direct edition is disabled, otherwise users would see the numeric
1481  * value on edition mode. User will be able to select a month in this widget:
1482  * @skipline elm_spinner_add
1483  * @until evas_object_show
1484  *
1485  * Finally the last widget will exemplify how to listen to widget's signals,
1486  * <tt> changed </tt> and <tt> delay,changed </tt>. First we need to
1487  * implement callback functions that will simply print spinner's value:
1488  * @dontinclude spinner_example.c
1489  * @skip static
1490  * @skip }
1491  * @skipline static
1492  * @until }
1493  * @until }
1494  *
1495  * The first callback function should be called everytime value changes,
1496  * the second one only after user stops to increment or decrement. Try
1497  * to keep arrows pressed and check the difference.
1498  * @skip smart_callback
1499  * @skipline smart_callback
1500  * @skipline smart_callback
1501  *
1502  * See the full @ref spinner_example.c "example", whose window should
1503  * look like this picture:
1504  *
1505  * @image html screenshots/spinner_example.png
1506  * @image latex screenshots/spinner_example.eps width=\textwidth
1507  *
1508  * See the full @ref spinner_example.c "source code" for this example.
1509  *
1510  * @example spinner_example.c
1511  */
1512
1513 /**
1514  * @page slider_example Slider widget example
1515  *
1516  * This code places seven Elementary slider widgets on a window, each of
1517  * them exemplifying a part of the widget's API.
1518  *
1519  * The first of them is the default slider:
1520  * @dontinclude slider_example.c
1521  * @skipline elm_slider_add
1522  * @until evas_object_show
1523  *
1524  * As you see, the defaults for a slider are:
1525  * @li horizontal
1526  * @li no label
1527  * @li no values (on indicator or unit labels)
1528  *
1529  * Actually it's pretty useless this way. So let's learn how to improve it.
1530  *
1531  * If some decoration is required, a label can be set, and icon before and
1532  * after the bar as well. On the second slider will add a @c home icon
1533  * and a @c folder icon at @c end.
1534  * @skipline text_set
1535  * @until end_set
1536  *
1537  * If the bar size need to be changed, it can be done with span set function,
1538  * that doesn't accounts other widget's parts size. Also the bar can starts
1539  * with a not default value (0.0), as we done on third slider:
1540  * @skipline value_set
1541  * @skipline span_size_set
1542  *
1543  * So far, users won't be able to see the slider value. If it's required,
1544  * it can be displayed in two different areas, units label or above
1545  * the indicator.
1546  *
1547  * Let's place a units label on our widget, and also let's set minimum and
1548  * maximum value (uses 0.0 and 1.0 by default):
1549  * @skipline unit_format_set
1550  * @skipline min_max_set
1551  *
1552  * If above the indicator is the place to display the value, just set it.
1553  * Also, is possible to invert a bar, as you can see:
1554  * @skipline indicator_format_set
1555  * @skipline inverted_set
1556  *
1557  * But if you require to use a function a bit more customized to show the value,
1558  * is possible to registry a callback function that will be called
1559  * to display unit or indicator label. Only the value will be passed to this
1560  * function, that should return a string.
1561  * In this case, a function to free this string will be required.
1562  *
1563  * Let's exemplify with indicator label on our sixth slider:
1564  * @dontinclude slider_example.c
1565  * @skip static
1566  * @skip }
1567  * @skip static
1568  * @skip }
1569  * @skip static
1570  * @skip }
1571  * @skipline static
1572  * @until }
1573  * @until }
1574  *
1575  * Setting callback functions:
1576  * @skipline indicator_format_function_set
1577  * @skipline _indicator_free
1578  *
1579  * Also, a slider can be displayed vertically:
1580  * @dontinclude slider_example.c
1581  * @skipline elm_slider_horizontal_set
1582  *
1583  * Finally the last widget will exemplify how to listen to widget's signals,
1584  * <tt> changed </tt> and <tt> delay,changed </tt>. First we need to
1585  * implement callback functions that will simply print slider's value:
1586  * @dontinclude slider_example.c
1587  * @skip static
1588  * @skip }
1589  * @skipline static
1590  * @until }
1591  * @until }
1592  *
1593  * The first callback function should be called everytime value changes,
1594  * the second one only after user stops to increment or decrement. Try
1595  * to keep arrows pressed and check the difference.
1596  * @skip smart_callback
1597  * @skipline smart_callback
1598  * @skipline smart_callback
1599  *
1600  * See the full @ref slider_example.c "example", whose window should
1601  * look like this picture:
1602  *
1603  * @image html screenshots/slider_example.png
1604  * @image latex screenshots/slider_example.eps width=\textwidth
1605  *
1606  * See the full @ref slider_example.c "source code" for this example.
1607  *
1608  * @example slider_example.c
1609  */
1610
1611 /**
1612  * @page panes_example Panes widget example
1613  *
1614  * This code places two Elementary panes widgets on a window, one of them
1615  * displayed vertically and the other horizontally, to exemplify
1616  * a part of the widget's API. Also, all the signals emitted by this
1617  * widget will be covered.
1618  *
1619  * Let's start adding a panes to our window:
1620  * @dontinclude panes_example.c
1621  * @skipline elm_panes_add
1622  * @until evas_object_show
1623  *
1624  * Now we will set a content (a simple button) to the left side of our
1625  * panes widget:
1626  * @skipline elm_button_add
1627  * @until content_left_set
1628  *
1629  * The content of the right side will be something a bit more elaborated, we'll
1630  * place another panes, displayed vertically (it's displayed horizontally
1631  * by default):
1632  * @skipline elm_panes_add
1633  * @until content_right_set
1634  *
1635  * When populating a panes displayed vertically, remember that left content
1636  * will be placed at top, and right content will place at bottom. Next
1637  * we will add two buttons to exemplify that:
1638  * @skipline elm_button_add
1639  * @until content_right_set
1640  *
1641  * Panes widgets emits 4 different signals, depending on users interaction
1642  * with the draggable bar. We'll add a callback function for each of them.
1643  *
1644  * <tt> "clicked" signal </tt>:
1645  *
1646  * Callback function that just print "Clicked" to stdin:
1647  * @dontinclude panes_example.c
1648  * @skip static void
1649  * @skip }
1650  * @skip static void
1651  * @skip }
1652  * @skip static void
1653  * @skip }
1654  * @skipline static void
1655  * @until }
1656  *
1657  * Also, add callback function to the panes:
1658  * @skipline "clicked"
1659  *
1660  * <tt> "press" signal </tt>:
1661  *
1662  * Callback function that just print "Pressed" to stdin:
1663  * @dontinclude panes_example.c
1664  * @skip static void
1665  * @skip }
1666  * @skipline static void
1667  * @until }
1668  *
1669  * Also, add callback function to the panes:
1670  * @skipline "press"
1671  *
1672  * Now, let's try to make our callback functions a bit more useful:
1673  *
1674  * <tt> "unpress" signal </tt>:
1675  *
1676  * Suppose we want to know the size proportion of left content after
1677  * user drags the bar. We need to listen for @c unpress signal, and
1678  * get this size from our panes widget. It's done on the following
1679  * function:
1680  * @dontinclude panes_example.c
1681  * @skip static void
1682  * @skip }
1683  * @skip static void
1684  * @skip }
1685  * @skipline static void
1686  * @until }
1687  *
1688  * Adding the callback function to the panes:
1689  * @skipline "unpress"
1690
1691  * <tt> "clicked,double" signal </tt>:
1692  *
1693  * Now, a interesting feature that could be addded to panes widget.
1694  * Hide a content when user double click the draggable bar. It's done
1695  * using a variable to store size and content left size getter and setter
1696  * on the following function:
1697  * @dontinclude panes_example.c
1698  * @skipline static double
1699  * @skip static void
1700  * @skip }
1701  * @skip static void
1702  * @skip }
1703  * @skip static void
1704  * @skip }
1705  * @skipline static void
1706  * @until }
1707  * @until }
1708  * @until }
1709  *
1710  * Adding the callback function to the panes:
1711  * @skipline "clicked,double"
1712  * @until panes);
1713  *
1714  * See the full @ref panes_example.c "example", whose window should
1715  * look like this picture:
1716  *
1717  * @image html screenshots/panes_example.png
1718  * @image latex screenshots/panes_example.eps width=\textwidth
1719  *
1720  * @example panes_example.c
1721  */
1722
1723 /**
1724  * @page clock_example Clock widget example
1725  *
1726  * This code places five Elementary clock widgets on a window, each of
1727  * them exemplifying a part of the widget's API.
1728  *
1729  * The first of them is the pristine clock:
1730  * @dontinclude clock_example.c
1731  * @skip pristine
1732  * @until evas_object_show
1733  * As you see, the defaults for a clock are:
1734  * - military time
1735  * - no seconds shown
1736  *
1737  * For am/pm time, see the second clock:
1738  * @dontinclude clock_example.c
1739  * @skip am/pm
1740  * @until evas_object_show
1741  *
1742  * The third one will show the seconds digits, which will flip in
1743  * synchrony with system time. Note, besides, that the time itself is
1744  * @b different from the system's -- it was customly set with
1745  * elm_clock_time_set():
1746  * @dontinclude clock_example.c
1747  * @skip with seconds
1748  * @until evas_object_show
1749  *
1750  * In both fourth and fifth ones, we turn on the <b>edition
1751  * mode</b>. See how you can change each of the sheets on it, and be
1752  * sure to try holding the mouse pressed over one of the sheet
1753  * arrows. The forth one also starts with a custom time set:
1754  * @dontinclude clock_example.c
1755  * @skip in edition
1756  * @until evas_object_show
1757  *
1758  * The fifth, besides editable, has only the time @b units editable,
1759  * for hours, minutes and seconds. This exemplifies
1760  * elm_clock_digit_edit_set():
1761  * @dontinclude clock_example.c
1762  * @skip but only
1763  * @until evas_object_show
1764  *
1765  * See the full @ref clock_example.c "example", whose window should
1766  * look like this picture:
1767  *
1768  * @image html screenshots/clock_example.png
1769  * @image latex screenshots/clock_example.eps width=\textwidth
1770  *
1771  * See the full @ref clock_example_c "source code" for this example.
1772  *
1773  * @example clock_example.c
1774  */
1775
1776 /**
1777  * @page mapbuf_example Mapbuf Widget Example
1778  *
1779  * This code places a Elementary mapbuf widget on a window,
1780  * to exemplify part of the widget's API.
1781  *
1782  * First we'll add an window with a background and a vertical box to
1783  * pack our interface elements:
1784  * @dontinclude mapbuf_example.c
1785  * @skipline win_add
1786  * @until show(bx)
1787  *
1788  * Next we'll simply add the mapbuf widget to the box:
1789  * @skipline mapbuf_add
1790  * @until pack_end
1791  *
1792  * But mapbuf is a container widget, it won't do anything alone. So let's
1793  * create a table full of icons. For that we'll loop to fill each line of each
1794  * column. See @ref tutorial_table_01 "tutorial_table_01"
1795  * if you don't know how to use tables:
1796  * @skipline table_add
1797  * @until }
1798  * @until }
1799  *
1800  * Finally, setting mapbuf content:
1801  * @skipline content_set
1802  * @skipline show
1803  *
1804  * Also, would be good a horizontal box with some controls to change mapbuf
1805  * behavior:
1806  * @skipline box_add
1807  * @until show
1808  *
1809  * By default map is disabled. So just setting content isn't enough.
1810  * Alpha and smooth settings will be applied when map is enabled.
1811  * So we'll add a toggle for that. Everytime the map properties
1812  * are changed, map will need to be enabled again. So if you
1813  * want to play a bit with our example, remember to always enable
1814  * map again after concluding your changes.
1815  * @skipline toggle_add
1816  * @until show
1817  *
1818  * We have added a callback function to this toggle, so it will enable
1819  * or disable map:
1820  * @dontinclude mapbuf_example.c
1821  * @skip static
1822  * @skip }
1823  * @skipline static
1824  * @until }
1825  *
1826  * Let's add check boxes for alpha blending and smooth rendering:
1827  * @skipline check_add
1828  * @until show
1829  * @until show
1830  *
1831  * By default, mapbuf would enable alpha blending and smooth rendering,
1832  * so we need to check boxes to be consistent with its behavior.
1833  *
1834  * Callback functions look like the one added to the toggle. This way we
1835  * could enable or disable the both properties:
1836  * @dontinclude mapbuf_example.c
1837  * @skip static
1838  * @skip }
1839  * @skip static
1840  * @skip }
1841  * @skipline static
1842  * @until }
1843  * @until }
1844  *
1845  * You'll see that disabling alpha blending will set a black rectangle below
1846  * the icons. That's the reason you only should enable that when you're sure
1847  * the mapbuf content is 100% solid.
1848  *
1849  * See @ref mapbuf_example.c "mapbuf_example.c", whose window should
1850  * look like this picture:
1851  *
1852  * @image html screenshots/mapbuf_example.png
1853  * @image latex screenshots/mapbuf_example.eps width=\textwidth
1854  *
1855  * @example mapbuf_example.c
1856  */
1857
1858 /**
1859  * @page map_example_01 Map Example - Creation and Zoom
1860  *
1861  * This code places a Elementary map widget on a window,
1862  * to exemplify part of the widget's API.
1863  *
1864  * Let's start adding a map to our window:
1865  * @dontinclude map_example_01.c
1866  * @skipline elm_map_add
1867  * @until evas_object_show
1868  *
1869  * It's enough to display a world map inside our window. But usually you'll
1870  * need to let user interact with the map. We need to place some buttons,
1871  * so the user could control the map. It's done on the followin code.
1872  * If you don't know about boxes, or buttons, check their examples,
1873  * @ref box_example_01 "Box Example 1" and
1874  * @ref button_example_01 "Button Example 1".
1875  * @skipline elm_box_add
1876  * @until _bt_zoom_fill
1877  *
1878  * We are adding callback functions that will be called when the user clicks
1879  * over these buttons. Let's study such functions, starting from the function
1880  * that will zoom in the map:
1881  * @dontinclude map_example_01.c
1882  * @skipline static void
1883  * @until }
1884  *
1885  * First thing done is assure zoom mode is set to manual. It's the default
1886  * mode, but the other buttons will change this, so before setting a new
1887  * zoom value, we need to change the zoom mode.
1888  *
1889  * Then, we get the current zoom value, increment that, and set the new
1890  * value to the map. If it's bigger than max zoom value allowed, it will
1891  * remain on the maximum allowed, nothing bad will happen. This way we
1892  * don't need to check first if it won't be bigger than max.
1893  *
1894  * Zoom out function is basically the same thing, but zoom will be decremented
1895  * instead of incremented:
1896  * @skipline static void
1897  * @until }
1898  *
1899  * The "X" button, when pressed, will call a function that will
1900  * zoom the map until it fits
1901  * inside the scroll frame with no pixels outside this area:
1902  * @skipline static void
1903  * @until }
1904  *
1905  * And the "#" button, will call a function that will zoom until map fills
1906  * scroll, ensuring no pixels are left unfilled:
1907  * @skipline static void
1908  * @until }
1909  *
1910  * But we can also set map to show something different from default
1911  * world map, changing the zoom level and region shown. Let's pick a
1912  * wonderful city coordinates, one placed at <tt> 43 20 S, 22 90 W </tt>.
1913  * Since map uses double variables to represent latitude and longitude,
1914  * to represent north or east, we should represent it as positive values,
1915  * and south or west as negative. Also, the value will be represented as
1916  * degree.min. So, for example, our longitude <tt> 43 20 S </tt> will
1917  * be represented
1918  * by the value <tt> -43.20 </tt>. A zoom set to @c 12 should be enough
1919  * to show a city.
1920  * @skipline region_show
1921  * @until zoom_set
1922  *
1923  * See @ref map_example_01.c "map_example_01.c" for full source,
1924  * whose window should
1925  * look like this picture:
1926  *
1927  * @image html screenshots/map_example_01.png
1928  * @image latex screenshots/map_example_01.eps width=\textwidth
1929  *
1930  * @example map_example_01.c
1931  */
1932
1933 /**
1934  * @page map_example_02 Map Example - Markers Usage
1935  *
1936  * This code places a Elementary map widget on a window,
1937  * to exemplify part of the widget's API, related to markers.
1938  *
1939  * We'll start this example the same way
1940  * @ref map_example_01 "Map Example 1". Adding a map with buttons to control
1941  * zoom, so if you didn't read it yet, just do it now.
1942  * @dontinclude map_example_02.c
1943  * @skipline elm_map_add
1944  * @until zoom_fill
1945  *
1946  * Markers can be placed over the map to represent anything we want. Let's
1947  * say we want to represent some countries and cities with markers. To add
1948  * a mark we need a marker class and also a group class.
1949  *
1950  * A marker class can be created as the following code does:
1951  * @skipline marker_class_new
1952  * @until style_set
1953  *
1954  * These lines create a new class, set a function to return the object
1955  * to be displayed inside the bubble that opens when a user clicks over
1956  * the mark, set the function to retrieve an icon to be placed inside
1957  * the marker, and defines the style of this marker. It can be @c empty
1958  * that will just show the icon, @c radio, that will place a blue circle,
1959  * and @c radio2 that will place a green circle.
1960  *
1961  * The group classes can be created in a very similar way, but you won't
1962  * set callback functions to get stuff to be placed inside the bubble,
1963  * since clicking over a group marker will just get the content
1964  * of all the markers composing the group and place on this bubble.
1965  * The limit of markers to get can be set with function
1966  * elm_map_max_marker_per_group_set() but we won't need on this example.
1967  * But we can set the zoom required to display the marks that belongs
1968  * to this group class, so if the zoom is less than this value, nothing
1969  * will be show. The group marker style will be used when markers are
1970  * near each other, and the count of markers grouped will be placed
1971  * inside the group marker.
1972  * @skipline group_class_new
1973  * @until displayed_set
1974  *
1975  * For marker and group classes to represent a country, the same is done:
1976  * @skipline marker_class_new
1977  * @until displayed_set
1978  *
1979  * Next we'll create some markers representing cities and coutries.
1980  * We'll append them in a list, to close up them later. To create a marker
1981  * we need to pass the coordinates, marker class, group class and optionally,
1982  * data:
1983  * @skipline marker_add
1984  * @until data_chile
1985  * @until append
1986  *
1987  * We have created a specific structure for this example to store the name
1988  * of the place and a path to a image file to represent it.
1989  * @dontinclude map_example_02.c
1990  * @skipline typedef
1991  * @until Marker_Data;
1992  *
1993  * We'll create instances for each place:
1994  * @skipline argentina
1995  * @until sky_03
1996  *
1997  * Finally, on our @c main function, we ask the map to show all the markers
1998  * with the biggest zoom possible, passing the list of markers added:
1999  * @skipline list_show
2000  *
2001  * Actually the zoom is not what we want, so after the download of the map
2002  * is concluded, let's set another zoom level. For this we add a callback
2003  * for @c "downloaded" signal:
2004  * @skipline callback_add
2005  *
2006  * The callback function will simply set the zoom level we want and remove
2007  * the callback, otherwise it would be called all the time, after the map
2008  * is downloaded:
2009  * @dontinclude map_example_02.c
2010  * @skipline _map_downloaded
2011  * @until }
2012  *
2013  * We added two kinds of callback functions when we added the markers.
2014  * One will return the content of the bubbles, and other the icon to be
2015  * placed inside the marker.
2016  *
2017  * To return an icon, all we need to do is add a elm_icon and return it:
2018  * @dontinclude map_example_02.c
2019  * @skip static Evas_Object
2020  * @skip }
2021  * @skipline static Evas_Object
2022  * @until }
2023  *
2024  * For the content, let's return something more elaboreate. We will return
2025  * a box with an image representing the place, and the name of this place:
2026  * @skipline static Evas_Object
2027  * @until }
2028  *
2029  * See @ref map_example_02.c "map_example_02.c" for full source,
2030  * whose window should
2031  * look like this picture:
2032  *
2033  * @image html screenshots/map_example_02.png
2034  * @image latex screenshots/map_example_02.eps width=\textwidth
2035  *
2036  * @example map_example_02.c
2037  */
2038
2039 /**
2040  * @page map_example_03 Map Example - Route and Name Usage
2041  *
2042  * This code places a Elementary map widget on a window,
2043  * to exemplify part of the widget's API, related routes and names.
2044  *
2045  * In this example, we will suppose we need to set a route for the user
2046  * from his current point (a gps could provide us this information)
2047  * to somewhere else. So we would have coordinates of this
2048  * start point, and would like that he enters the address of his
2049  * destination in a entry, and we'll trace a route on the map.
2050  *
2051  * We'll start this example the same way
2052  * @ref map_example_01 "Map Example 1". Adding a map with buttons to control
2053  * zoom, so if you didn't read it yet, just do it now. Actually there is
2054  * a change, that we're aligning buttons to the top, since we wan't a
2055  * vertical control box this time.
2056  * @dontinclude map_example_03.c
2057  * @skipline elm_map_add
2058  * @until zoom_fill
2059  * @until align_set
2060  *
2061  * Next we set the box to be vertical and change it's size, weight
2062  * and alignment, so it will occupy the top of the window, from left
2063  * to right:
2064  * @skipline horizontal_set
2065  * @until align_set
2066  *
2067  * We'll add an entry with a preliminar address, that I know will
2068  * find a coordinate, to examplify names work. But you can try
2069  * lots of addresses. From city or country names to pubs, or whatever
2070  * you want. To try is enough to run the example, type the address and
2071  * press "Route" button. This button will call a function that will
2072  * get the typed address and find the route.
2073  * @skipline entry_add
2074  * @until align_set
2075  * @until align_set
2076  *
2077  * The button pass an structure
2078  * instance we make for this example, with all the fields we'll need.
2079  * @dontinclude map_example_03.c
2080  * @skipline _Example_Data
2081  * @until example_data;
2082  *
2083  * Let's initialize it's fields:
2084  * @skipline example_data.map
2085  * @until example_data.start_lat
2086  *
2087  * @c map and @c entry are our elementary objects, @c route is set to @c NULL,
2088  * since we don't have one yet, and the coordinates of the start point is set
2089  * (longitude and latitude).
2090  *
2091  * Also, let's show this start point at the center of the map, and set a zoom
2092  * nice enough to close it:
2093  * @skipline region_show
2094  * @until zoom_set
2095  *
2096  * These lines were already explained on @ref map_example_02 "Map Example 2".
2097  *
2098  * Now we'll see the "Route" button callback function:
2099  * @dontinclude map_example_03.c
2100  * @skip static void
2101  * @skip }
2102  * @skipline static void
2103  * @until }
2104  *
2105  * First we get the address string from our entry. Then we use @c name
2106  * conversion
2107  * util functions, so we could get coordinates for this address. These
2108  * functions return an #Elm_Map_Name handle for us.
2109  * Function elm_map_utils_convert_name_into_coord() will do this job for us,
2110  * but it's an assyncronous function, since it requires this
2111  * information from the server.
2112  *
2113  * That's the reason we need to wait for
2114  * <tt> "name,loaded" </tt> signal. We add a callback function for this:
2115  * @dontinclude map_example_03.c
2116  * @skipline static void
2117  * @until }
2118  *
2119  * This function will check if a previous route was traced, and if it was,
2120  * it will remove it. Next we'll get destination coordinates from our
2121  * @c name, and use them to add a new route.
2122  *
2123  * To trace a route we need to know how the user will go through the path.
2124  * Let's suppose he'll be walking, but doesn't like to walk, so we
2125  * need to choose the shortest path intead of the route that would
2126  * made him spend less time. Coordinates of the point from where he will
2127  * start and of the destination point need to be passed as well.
2128  *
2129  * Finally we'll set a color different from solid red (default), to show
2130  * our route. We set it green.
2131  *
2132  * See @ref map_example_03.c "map_example_03.c" for full source,
2133  * whose window should
2134  * look like this picture:
2135  *
2136  * @image html screenshots/map_example_03.png
2137  * @image latex screenshots/map_example_03.eps width=\textwidth
2138  *
2139  * @example map_example_03.c
2140  */
2141
2142 /**
2143  * @page diskselector_example_01 Diskselector widget example
2144  *
2145  * This code places 4 Elementary diskselector widgets on a window, each of
2146  * them exemplifying a part of the widget's API.
2147  *
2148  * All of them will have weekdays as items, since we won't focus
2149  * on items management on this example. For an example about this subject,
2150  * check @ref diskselector_example_02.
2151  *
2152  * The first of them is a default diskselector.
2153  * @dontinclude diskselector_example_01.c
2154  * @skipline lbl
2155  * @until }
2156  * @skipline elm_diskselector_add
2157  * @until evas_object_show
2158  *
2159  * We are just adding the diskselector, so as you can see, defaults for it are:
2160  * @li Only 3 items visible each time.
2161  * @li Only 3 characters are displayed for labels on side positions.
2162  * @li The first added item remains centeres, i.e., it's the selected item.
2163  *
2164  * To add items, we are just appending it on a loop, using function
2165  * elm_diskselector_item_append(), that will be better exaplained on
2166  * items management example.
2167  *
2168  * For a circular diskselector, check the second widget. A circular
2169  * diskselector will display first item after last, and last previous to
2170  * the first one. So, as you can see, @b Sa will appears on left side
2171  * of selected @b Sunday. This property is set with
2172  * elm_diskselector_round_set().
2173  *
2174  * Also, we decide to display only 2 character for side labels, instead of 3.
2175  * For this we call elm_diskselector_side_label_length_set(). As result,
2176  * we'll see @b Mo displayed instead of @b Mon, when @b Monday is on a
2177  * side position.
2178  *
2179  * @skipline elm_diskselector_add
2180  * @until evas_object_show
2181  *
2182  * But so far, we are only displaying 3 items at once. If more are wanted,
2183  * is enough to call elm_diskselector_display_item_num_set(), as you can
2184  * see here:
2185  * @skipline elm_diskselector_add
2186  * @until evas_object_show
2187  *
2188  * @note You can't set less than 3 items to be displayed.
2189  *
2190  * Finally, if a bounce effect is required, or you would like to see
2191  * scrollbars, it is possible. But, for default theme, diskselector
2192  * scrollbars will be invisible anyway.
2193  * @skipline elm_diskselector_add
2194  * @until evas_object_show
2195  *
2196  * See the full @ref diskselector_example_01.c "diskselector_example_01.c"
2197  * code, whose window should look like this picture:
2198  *
2199  * @image html screenshots/diskselector_example_01.png
2200  * @image latex screenshots/diskselector_example_01.eps width=\textwidth
2201  *
2202  * @example diskselector_example_01.c
2203  */
2204
2205 /**
2206  * @page diskselector_example_02 Diskselector - Items management
2207  *
2208  * This code places a Elementary diskselector widgets on a window,
2209  * along with some buttons trigerring actions on it (though its API).
2210  * It covers most of Elm_Diskselector_Item functions.
2211  *
2212  * On our @c main function, we are adding a default diskselector with
2213  * 3 items. We are only setting their labels (second parameter of function
2214  * elm_diskselector_item_append):
2215  * @dontinclude diskselector_example_02.c
2216  * @skipline elm_diskselector_add
2217  * @until Item 2
2218  *
2219  * Next we are adding lots of buttons, each one for a callback function
2220  * that will realize a task covering part of diskselector items API.
2221  * Lets check the first one:
2222  * @skipline elm_button_add
2223  * @until evas_object_show
2224  *
2225  * We are labeling the button with a task description with
2226  * elm_object_text_set() and setting a callback
2227  * function evas_object_smart_callback_add().
2228  * Each callback function will have the signature:
2229  * <tt> static void _task_cb(void *data, Evas_Object *obj,
2230  * void *event_info)</tt> with the function name varying for each task.
2231  *
2232  * Now let's cover all of them.
2233  *
2234  * <b> Appending an item: </b>
2235  * @dontinclude diskselector_example_02.c
2236  * @skipline _add_cb
2237  * @until }
2238  *
2239  * All items are included on diskselector after last one. You @b can't
2240  * preprend items.
2241  *
2242  * The first parameter of elm_diskselector_item_append() is the diskselector
2243  * object, that we are receiving as data on our callback function.
2244  * The second one is a label, the string that will be placed in the center
2245  * of our item. As we don't wan't icons or callback functions, we can
2246  * send NULL as third, fourth and fifth parameters.
2247  *
2248  * <b> Appending an item with icon: </b>
2249  * @dontinclude diskselector_example_02.c
2250  * @skipline _add_ic_cb
2251  * @until }
2252  *
2253  * If an icon is required, you can pass it as third paramenter on our
2254  * elm_diskselector_item_append() function. It will be place on the
2255  * left side of item's label, that will be shifted to right a bit.
2256  *
2257  * For more details about how to create icons, look for elm_icon examples.
2258  *
2259  * <b> Appending an item with callback function for selected: </b>
2260  * @dontinclude diskselector_example_02.c
2261  * @skipline _sel_cb
2262  * @until }
2263  * @until }
2264  *
2265  * To set a callback function that will be called every time an item is
2266  * selected, i.e., everytime the diskselector stops with this item in
2267  * center position, just pass the function as fourth paramenter.
2268  *
2269  * <b> Appending an item with callback function for selected with data: </b>
2270  * @dontinclude diskselector_example_02.c
2271  * @skipline _sel_data_cb
2272  * @until }
2273  * @until }
2274  * @until }
2275  * @until }
2276  *
2277  * If the callback function request an extra data, it can be attached to our
2278  * item passing a pointer for data as fifth parameter.
2279  * Our function _sel_data_cb will receive it as <tt> void *data </tt>.
2280  *
2281  * If you want to free this data, or handle that the way you need when the
2282  * item is deleted, set a callback function for that, with
2283  * elm_diskselector_item_del_cb_set().
2284  *
2285  * As you can see we check if @c it is not @c NULL after appending it.
2286  * If an error happens, we won't try to set a function for it.
2287  *
2288  * <b> Deleting an item: </b>
2289  * @dontinclude diskselector_example_02.c
2290  * @skip _del_cb
2291  * @skipline _del_cb
2292  * @until }
2293  *
2294  * To delete an item we simple need to call elm_diskselector_item_del() with
2295  * a pointer for such item.
2296  *
2297  * If you need, you can get selected item with
2298  * elm_diskselector_selected_item_get(), that will return a pointer for it.
2299  *
2300  * <b> Unselecting an item: </b>
2301  * @dontinclude diskselector_example_02.c
2302  * @skipline _unselect_cb
2303  * @until }
2304  *
2305  * To select an item, you should call elm_diskselector_item_selected_set()
2306  * passing @c EINA_TRUE, and to unselect it, @c EINA_FALSE.
2307  *
2308  * If you unselect the selected item, diskselector will automatically select
2309  * the first item.
2310  *
2311  * <b> Printing all items: </b>
2312  * @dontinclude diskselector_example_02.c
2313  * @skipline _print_cb
2314  * @until }
2315  *
2316  * <b> Clearing the diskselector: </b>
2317  * @dontinclude diskselector_example_02.c
2318  * @skipline _clear_cb
2319  * @until }
2320  *
2321  * <b> Selecting the first item: </b>
2322  * @dontinclude diskselector_example_02.c
2323  * @skipline _select_first_cb
2324  * @until }
2325  *
2326  * <b> Selecting the last item: </b>
2327  * @dontinclude diskselector_example_02.c
2328  * @skipline _select_last_cb
2329  * @until }
2330  *
2331  * <b> Selecting the next item: </b>
2332  * @dontinclude diskselector_example_02.c
2333  * @skipline _select_next_cb
2334  * @until }
2335  *
2336  * <b> Selecting the previous item: </b>
2337  * @dontinclude diskselector_example_02.c
2338  * @skipline _select_prev_cb
2339  * @until }
2340  *
2341  * See the full @ref diskselector_example_02.c "diskselector_example_02.c"
2342  * code, whose window should look like this picture:
2343  *
2344  * @image html screenshots/diskselector_example_02.png
2345  * @image latex screenshots/diskselector_example_02.eps width=\textwidth
2346  *
2347  * @example diskselector_example_02.c
2348  */
2349
2350 /**
2351  * @page list_example_01 List widget example
2352  *
2353  * This code places a single Elementary list widgets on a window, just
2354  * to exemplify the more simple and common use case: a list will be created
2355  * and populated with a few items.
2356  *
2357  * To keep it simple, we won't show how to customize the list, for this check
2358  * @ref list_example_02. Also, we won't focus
2359  * on items management on this example. For an example about this subject,
2360  * check @ref list_example_03.
2361  *
2362  * To add a list widget.
2363  * @dontinclude list_example_01.c
2364  * @skipline elm_list_add
2365  *
2366  * We are just adding the list, so as you can see, defaults for it are:
2367  * @li Items are displayed vertically.
2368  * @li Only one item can be selected.
2369  * @li The list doesn't bouce.
2370  *
2371  * To add items, we are just appending it on a loop, using function
2372  * elm_list_item_append(), that will be better exaplained on
2373  * items management example.
2374  * @dontinclude list_example_01.c
2375  * @skipline lbl[]
2376  * @until };
2377  * @skipline for
2378  * @skipline elm_list_item_append
2379  *
2380  * After we just want to show the list. But first we need to start the widget.
2381  * It was done this way to improve widget's performance. So, always remember
2382  * that:
2383  * @warning Call elm_list_go before showing the object
2384  * @skipline elm_list_go
2385  * @skipline show
2386  *
2387  * See the full @ref list_example_01.c "list_example_01.c"
2388  * code, whose window should look like this picture:
2389  *
2390  * @image html screenshots/list_example_01.png
2391  * @image latex screenshots/list_example_01.eps width=\textwidth
2392  *
2393  * @example list_example_01.c
2394  */
2395
2396 /**
2397  * @page list_example_02 List widget example
2398  *
2399  * This code places a single Elementary list widgets on a window,
2400  * exemplifying a part of the widget's API.
2401  *
2402  * First, we will just create a simple list, as done on @ref list_example_01 :
2403  * @dontinclude list_example_02.c
2404  * @skipline lbl
2405  * @until }
2406  * @skipline elm_list_add
2407  * @until elm_list_item_append
2408  *
2409  * Now, let's customize this list a bit. First we will display items
2410  * horizontally:
2411  * @skipline horizontal_set
2412  *
2413  * Then we will choose another list mode. There are four of them, and
2414  * the default #Elm_List_Mode is #ELM_LIST_SCROLL. Let's set compress mode:
2415  * @skipline mode_set
2416  *
2417  * To enable multiple items selection, we need to enable it, since only one
2418  * selected item is allowed by default:
2419  * @skipline elm_list_multi_select_set
2420  *
2421  * We are not adding items with callback functions here,
2422  * since we'll explain it better on  @ref list_example_03. But if the callback
2423  * need to be called everytime user clicks an item, even if already selected,
2424  * it's required to enable this behavior:
2425  * @skipline elm_list_always_select_mode_set
2426  *
2427  * Finally, if a bounce effect is required, or you would like to see
2428  * scrollbars, it is possible. But, for default theme, list
2429  * scrollbars will be invisible anyway.
2430  * @skipline bounce_set
2431  * @until SCROLLER_POLICY_ON
2432  *
2433  * See the full @ref list_example_02.c "list_example_02.c"
2434  * code, whose window should look like this picture:
2435  *
2436  * @image html screenshots/list_example_02.png
2437  * @image latex screenshots/list_example_02.eps width=\textwidth
2438  *
2439  * @example list_example_02.c
2440  */
2441
2442 /**
2443  * @page list_example_03 List - Items management
2444  *
2445  * This code places a Elementary list widgets on a window,
2446  * along with some buttons trigerring actions on it (though its API).
2447  * It covers most of Elm_List_Item functions.
2448  *
2449  * On our @c main function, we are adding a default list with
2450  * 3 items. We are only setting their labels (second parameter of function
2451  * elm_list_item_append):
2452  * @dontinclude list_example_03.c
2453  * @skipline elm_list_add
2454  * @until Item 2
2455  *
2456  * Next we are adding lots of buttons, each one for a callback function
2457  * that will realize a task covering part of list items API.
2458  * Lets check the first one:
2459  * @skipline elm_button_add
2460  * @until evas_object_show
2461  *
2462  * We are labeling the button with a task description with
2463  * elm_object_text_set() and setting a callback
2464  * function evas_object_smart_callback_add().
2465  * Each callback function will have the signature:
2466  * <tt> static void _task_cb(void *data, Evas_Object *obj,
2467  * void *event_info)</tt> with the function name varying for each task.
2468  *
2469  * Now let's cover all of them.
2470  *
2471  * <b> Prepending an item: </b>
2472  * @dontinclude list_example_03.c
2473  * @skipline _prepend_cb
2474  * @until }
2475  *
2476  * The item will be placed on the begining of the list,
2477  * i.e. it will be the first one.
2478  *
2479  * The first parameter of elm_list_item_prepend() is the list
2480  * object, that we are receiving as data on our callback function.
2481  * The second one is a label, the string that will be placed in the center
2482  * of our item. As we don't wan't icons or callback functions, we can
2483  * send NULL as third, fourth, fifth and sixth parameters.
2484  *
2485  * <b> Appending an item: </b>
2486  * @dontinclude list_example_03.c
2487  * @skipline _add_cb
2488  * @until }
2489  *
2490  * Items included with append will be inserted inserted after the last one.
2491  *
2492  * <b> Appending an item with icon: </b>
2493  * @dontinclude list_example_03.c
2494  * @skipline _add_ic_cb
2495  * @until }
2496  *
2497  * If an icon is required, you can pass it as third paramenter on our
2498  * elm_list_item_append() function. It will be place on the
2499  * left side of item's label. If an icon is wanted on the right side,
2500  * it should be passed as fourth parameter.
2501  *
2502  * For more details about how to create icons, look for elm_icon examples
2503  * @ref tutorial_icon.
2504  *
2505  * <b> Appending an item with callback function for selected: </b>
2506  * @dontinclude list_example_03.c
2507  * @skipline _sel_cb
2508  * @until }
2509  * @until }
2510  *
2511  * To set a callback function that will be called every time an item is
2512  * selected, i.e., everytime the list stops with this item in
2513  * center position, just pass the function as fifth paramenter.
2514  *
2515  * <b> Appending an item with callback function for selected with data: </b>
2516  * @dontinclude list_example_03.c
2517  * @skipline _sel_data_cb
2518  * @until }
2519  * @until }
2520  * @until }
2521  * @until }
2522  *
2523  * If the callback function request an extra data, it can be attached to our
2524  * item passing a pointer for data as sixth parameter.
2525  * Our function _sel_data_cb will receive it as <tt> void *data </tt>.
2526  *
2527  * If you want to free this data, or handle that the way you need when the
2528  * item is deleted, set a callback function for that, with
2529  * elm_list_item_del_cb_set().
2530  *
2531  * As you can see we check if @c it is not @c NULL after appending it.
2532  * If an error happens, we won't try to set a function for it.
2533  *
2534  * <b> Deleting an item: </b>
2535  * @dontinclude list_example_03.c
2536  * @skipline _del_cb(
2537  * @until }
2538  *
2539  * To delete an item we simple need to call elm_list_item_del() with
2540  * a pointer for such item.
2541  *
2542  * If you need, you can get selected item with
2543  * elm_list_selected_item_get(), that will return a pointer for it.
2544  *
2545  * <b> Unselecting an item: </b>
2546  * @dontinclude list_example_03.c
2547  * @skipline _unselect_cb
2548  * @until }
2549  *
2550  * To select an item, you should call elm_list_item_selected_set()
2551  * passing @c EINA_TRUE, and to unselect it, @c EINA_FALSE.
2552  *
2553  * <b> Printing all items: </b>
2554  * @dontinclude list_example_03.c
2555  * @skipline _print_cb
2556  * @until }
2557  *
2558  * <b> Clearing the list: </b>
2559  * @dontinclude list_example_03.c
2560  * @skipline _clear_cb
2561  * @until }
2562  *
2563  * <b> Selecting the next item: </b>
2564  * @dontinclude list_example_03.c
2565  * @skipline _select_next_cb
2566  * @until }
2567  *
2568  * <b> Inserting after an item: </b>
2569  * @dontinclude list_example_03.c
2570  * @skipline _insert_after_cb
2571  * @until }
2572  *
2573  * <b> Selecting the previous item: </b>
2574  * @dontinclude list_example_03.c
2575  * @skipline _select_prev_cb
2576  * @until }
2577  *
2578  * <b> Inserting before an item: </b>
2579  * @dontinclude list_example_03.c
2580  * @skipline _insert_before_cb
2581  * @until }
2582  *
2583  * If a separator is required, just set an item as such:
2584  * @dontinclude list_example_03.c
2585  * @skipline _set_separator_cb
2586  * @until }
2587  *
2588  * Also an item can be disabled, and the user won't be allowed to (un)select it:
2589  * @dontinclude list_example_03.c
2590  * @skipline _disable_cb
2591  * @until }
2592  *
2593  * See the full @ref list_example_03.c "list_example_03.c"
2594  * code, whose window should look like this picture:
2595  *
2596  * @image html screenshots/list_example_03.png
2597  * @image latex screenshots/list_example_03.eps width=\textwidth
2598  *
2599  * @example list_example_03.c
2600  */
2601
2602 /**
2603  * @page toolbar_example_01 Toolbar Example - Simple Items
2604  *
2605  * This code places a Elementary toolbar widget on a window,
2606  * to exemplify part of the widget's API.
2607  *
2608  * Let's start adding a button to our window, that will have its text
2609  * modified depending on which item is selected. It's used just to exemplify
2610  * how to change a window content from the toolbar.
2611  * @dontinclude toolbar_example_01.c
2612  * @skipline elm_button_add
2613  * @until evas_object_show
2614  *
2615  * Also, we'll need a toolbar widget, obviously:
2616  * @skipline elm_toolbar_add
2617  * @until evas_object_show
2618  *
2619  * When appending an item is possible to set an icon, label, and a callback
2620  * function that will receive passed data.
2621  * @skipline _item_append
2622  * @until Folder
2623  *
2624  * It's possible to disable items, so the user can't select then. We will
2625  * disable the third item:
2626  * @skipline _item_append
2627  * @until disable
2628  *
2629  * Our callbacks will just set button's label:
2630  * @dontinclude toolbar_example_01.c
2631  * @skip static
2632  * @skip }
2633  * @skipline static
2634  * @until }
2635  * @until }
2636  * @until }
2637  *
2638  * By default, toolbars would display items homogeneously, so item with
2639  * long labels, like the third, will make all of them occupy a lot of space.
2640  * To avoid that, we can disable it:
2641  * @dontinclude toolbar_example_01.c
2642  * @skipline homogeneous
2643  *
2644  * Another default behavior, is to add an menu item if we have more items
2645  * that would fit on toolbar size. To simply enable scroll, without menus,
2646  * it's required to change toolbar's shrink mode:
2647  * @dontinclude toolbar_example_01.c
2648  * @skipline shrink
2649  *
2650  * See @ref toolbar_example_01.c "toolbar_example_01.c", whose window should
2651  * look like this picture:
2652  *
2653  * @image html screenshots/toolbar_example_01.png
2654  * @image latex screenshots/toolbar_example_01.eps width=\textwidth
2655  *
2656  * @example toolbar_example_01.c
2657  */
2658
2659 /**
2660  * @page toolbar_example_02 Toolbar Example - Items with States
2661  *
2662  * This code places a Elementary toolbar widget on a window,
2663  * to exemplify part of the widget's API.
2664  *
2665  * Toolbar widgets has support to items with states. Each state
2666  * can have it's own label, icon, and callback function.
2667  *
2668  * Let's start populating a toolbar with some regular items.
2669  * If you don't know how to do that, see
2670  * @ref toolbar_example_01 "Toolbar Example 1".
2671  * @dontinclude toolbar_example_02.c
2672  * @skipline elm_toolbar_add
2673  * @until Update
2674  *
2675  * The only difference here is that we set shrink mode to #ELM_SHRINK_MODE_HIDE,
2676  * that won't display items that doesn't fit to the window.
2677  *
2678  * Now, let's add an item with states. First, add the item just as any other.
2679  * @skipline elm_toolbar_item_append
2680  * @until _item_pressed
2681  *
2682  * After that states can be added to this item:
2683  * @skipline state_add
2684  * @until Full
2685  * @until _item_pressed
2686  *
2687  * The both states and the item are using the same callback function,
2688  * that will cycle between states and unselect the item. Unseleting
2689  * is required because it won't call the callback if an user clicks
2690  * over an item already selected:
2691  * @dontinclude toolbar_example_02.c
2692  * @skip static
2693  * @skip }
2694  * @skipline static
2695  * @until }
2696  *
2697  * On our example, some items are hidden
2698  * because we set the window to be small. But if an item should be displayed
2699  * anyway, is needed to set its priority to be higher than others.
2700  * Any positive value will be enough in our case. Let's force the item
2701  * with multiple states to be displayed.
2702  * @skipline priority
2703  *
2704  * See @ref toolbar_example_02.c "toolbar_example_02.c", whose window should
2705  * look like this picture:
2706  *
2707  * @image html screenshots/toolbar_example_02.png
2708  * @image latex screenshots/toolbar_example_02.eps width=\textwidth
2709  *
2710  * @example toolbar_example_02.c
2711  */
2712
2713 /**
2714  * @page toolbar_example_03 Toolbar Example - Items with Menus
2715  *
2716  * Toolbar widgets have support to items with menus. This kind
2717  * of item will display a menu when selected by the user.
2718  *
2719  * Let's start populating a toolbar with some regular items, the same
2720  * way we started @ref toolbar_example_02 "Toolbar Example 2".
2721  * @dontinclude toolbar_example_03.c
2722  * @skipline elm_toolbar_add
2723  * @until Update
2724  *
2725  * The only difference is that we'll keep the default shrink mode, that
2726  * adds an item with a menu of hidden items.
2727  *
2728  * So, a important thing to do is to set a parent for toolbar menus, or they
2729  * will use the toolbar as parent, and its size will be restricted to that.
2730  * @skipline parent_set
2731  *
2732  * Not only items' menus will respect this parent, but also the own toolbar
2733  * menu, used to show hidden items.
2734  *
2735  * Next, let's add an item set to display a menu:
2736  * @skipline elm_toolbar_item_append
2737  * @until _menu_set
2738  *
2739  * Now, to add two options to this item, we can get the menu object and use
2740  * it as a regular elm_menu. See @ref tutorial_menu "Menu example" for more
2741  * about menu widget.
2742  * @skipline _menu_get
2743  * @until Full
2744  *
2745  * See @ref toolbar_example_03.c "toolbar_example_03.c", whose window should
2746  * look like this picture:
2747  *
2748  * @image html screenshots/toolbar_example_03.png
2749  * @image latex screenshots/toolbar_example_03.eps width=\textwidth
2750  *
2751  * @example toolbar_example_03.c
2752  */
2753
2754 /**
2755  * @page segment_control_example Segment Control Example
2756  *
2757  * This code places a Elementary segment control widgets on a window,
2758  * to exemplify part of the widget's API.
2759  *
2760  * Let's start adding a segment control to our window:
2761  * @dontinclude segment_control_example.c
2762  * @skipline elm_segment_control_add
2763  * @until evas_object_show
2764  *
2765  * Now will add an item only with label:
2766  * @skipline item_add
2767  *
2768  * Really simple. To add an item with only an icon, the icon needs to be created
2769  * first, them added with this same function:
2770  * @skipline icon_add
2771  * @until item_add
2772  *
2773  * If an item with label and icon is required, it can be done as well. In this
2774  * case, instead of a label (or icon) centered, the item will display an icon
2775  * at left and the label at right:
2776  * @skipline icon_add
2777  * @until item_add
2778  *
2779  * But, if you need to add some items that can have or not a label, but
2780  * want that all of them looks the same way, with icon at left, just add
2781  * an empty string label. It's done on our example to ilustrate that:
2782  * @skipline icon_add
2783  * @until item_add
2784  *
2785  * So far, all the item were added to the last position of the widget,
2786  * but if something different is required, it can be done using another
2787  * insertion function. Let's suppose we want to put an item just before
2788  * the last item:
2789  * @skipline count
2790  * @until insert_at
2791  *
2792  * There are two ways to delete items. Using the item handle, like:
2793  * @skipline insert_at
2794  * @until del
2795  *
2796  * Or using item's index:
2797  * @skipline insert_at
2798  * @until del_at
2799  *
2800  * To set properties of an item already added to the widget, you just need
2801  * to get the item and set icon or label, as the following code shows:
2802  * @skipline item_get
2803  * @until label_set
2804  *
2805  * Finally, it's possible to select an item from the code, and also get
2806  * the selected item. We will select the item at the center of the widget
2807  * and print its position.
2808  * @skipline count_get
2809  * @until printf
2810  *
2811  * See the full @ref segment_control_example.c "example", whose window should
2812  * look like this picture:
2813  *
2814  * @image html screenshots/segment_control_example.png
2815  * @image latex screenshots/segment_control_example.eps width=\textwidth
2816  *
2817  * @example segment_control_example.c
2818  */
2819
2820 /**
2821  * @page flipselector_example Flip selector widget example
2822  *
2823  * This code places an Elementary flip selector widget on a window,
2824  * along with two buttons trigerring actions on it (though its API).
2825  *
2826  * The selector is being populated with the following items:
2827  * @dontinclude flipselector_example.c
2828  * @skip lbl[]
2829  * @until ;
2830  *
2831  * Next, we create it, populating it with those items and registering
2832  * two (smart) callbacks on it:
2833  * @dontinclude flipselector_example.c
2834  * @skip fp = elm_flipselector_add
2835  * @until object_show
2836  *
2837  * Those two callbacks will take place whenever one of those smart
2838  * events occur, and they will just print something to @c stdout:
2839  * @dontinclude flipselector_example.c
2840  * @skip underflow callback
2841  * @until static void
2842  * Flip the sheets on the widget while looking at the items list, in
2843  * the source code, and you'll get the idea of those events.
2844  *
2845  * The two buttons below the flip selector will take the actions
2846  * described in their labels:
2847  * @dontinclude flipselector_example.c
2848  * @skip bt = elm_button_add
2849  * @until callback_add(win
2850  *
2851  * @dontinclude flipselector_example.c
2852  * @skip unselect the item
2853  * @until underflow
2854  *
2855  * Click on them to exercise those flip selector API calls. To
2856  * interact with the other parts of this API, there's a command line
2857  * interface, whose help string can be asked for with the 'h' key:
2858  * @dontinclude flipselector_example.c
2859  * @skip commands
2860  * @until ;
2861  *
2862  * The 'n' and 'p' keys will exemplify elm_flipselector_flip_next()
2863  * and elm_flipselector_flip_prev(), respectively. 'f' and 'l' account
2864  * for elm_flipselector_first_item_get() and
2865  * elm_flipselector_last_item_get(), respectively. Finally, 's' will
2866  * issue elm_flipselector_selected_item_get() on our example flip
2867  * selector widget.
2868  *
2869  * See the full @ref flipselector_example.c "example", whose window should
2870  * look like this picture:
2871  *
2872  * @image html screenshots/flipselector_example.png
2873  * @image latex screenshots/flipselector_example.eps width=\textwidth
2874  *
2875  * See the full @ref flipselector_example_c "source code" for this example.
2876  *
2877  * @example flipselector_example.c
2878  */
2879
2880 /**
2881  * @page fileselector_example File selector widget example
2882  *
2883  * This code places two Elementary file selector widgets on a window.
2884  * The one on the left is layouting file system items in a @b list,
2885  * while the the other is layouting them in a @b grid.
2886  *
2887  * The one having the majority of hooks of interest is on the left,
2888  * which we create as follows:
2889  * @dontinclude fileselector_example.c
2890  * @skip first file selector
2891  * @until object_show
2892  *
2893  * Note that we enable custom edition of file/directory selection, via
2894  * the text entry it has on its bottom, via
2895  * elm_fileselector_is_save_set(). It starts with the list view, which
2896  * is the default, and we make it not expandable in place
2897  * (elm_fileselector_expandable_set()), so that it replaces its view's
2898  * contents with the current directory's entries each time one
2899  * navigates to a different folder.  For both of file selectors we are
2900  * starting to list the contents found in the @c "/tmp" directory
2901  * (elm_fileselector_path_set()).
2902  *
2903  * Note the code setting it to "grid mode" and observe the differences
2904  * in the file selector's views, in the example. We also hide the
2905  * second file selector's Ok/Cancel buttons -- since it's there just
2906  * to show the grid view (and navigation) -- via
2907  * elm_fileselector_buttons_ok_cancel_set().
2908  *
2909  * The @c "done" event, which triggers the callback below
2910  * @dontinclude fileselector_example.c
2911  * @skip 'done' cb
2912  * @until }
2913  * will be called at the time one clicks the "Ok"/"Cancel" buttons of
2914  * the file selector (on the left). Note that it will print the path
2915  * to the current selection, if any.
2916  *
2917  * The @c "selected" event, which triggers the callback below
2918  * @dontinclude fileselector_example.c
2919  * @skip bt = 'selected' cb
2920  * @until }
2921  * takes place when one selects a file (if the file selector is @b not
2922  * under folders-only mode) or when one selects a folder (when in
2923  * folders-only mode). Experiment it by selecting different file
2924  * system entries.
2925  *
2926  * What comes next is the code creating the three check boxes and two
2927  * buttons below the file selector in the right. They will exercise a
2928  * bunch of functions on the file selector's API, for the instance on
2929  * the left. Experiment with them, specially the buttons, to get the
2930  * difference between elm_fileselector_path_get() and
2931  * elm_fileselector_selected_get().
2932  *
2933  * Finally, there's the code adding the second file selector, on the
2934  * right:
2935  * @dontinclude fileselector_example.c
2936  * @skip second file selector
2937  * @until object_show
2938  *
2939  * Pay attention to the code setting it to "grid mode" and observe the
2940  * differences in the file selector's views, in the example. We also
2941  * hide the second file selector's Ok/Cancel buttons -- since it's
2942  * there just to show the grid view (and navigation) -- via
2943  * elm_fileselector_buttons_ok_cancel_set().
2944  *
2945  * See the full @ref fileselector_example.c "example", whose window
2946  * should look like this picture:
2947  *
2948  * @image html screenshots/fileselector_example.png
2949  * @image latex screenshots/fileselector_example.eps width=\textwidth
2950  *
2951  * See the full @ref fileselector_example_c "source code" for this example.
2952  *
2953  * @example fileselector_example.c
2954  */
2955
2956 /**
2957  * @page fileselector_button_example File selector button widget example
2958  *
2959  * This code places an Elementary file selector button widget on a
2960  * window, along with some other checkboxes and a text entry. Those
2961  * are there just as knobs on the file selector button's state and to
2962  * display information from it.
2963  *
2964  * Here's how we instantiate it:
2965  * @dontinclude fileselector_button_example.c
2966  * @skip ic = elm_icon_add
2967  * @until evas_object_show
2968  *
2969  * Note that we set on it both icon and label decorations. It's set to
2970  * list the contents of the @c "/tmp" directory, too, with
2971  * elm_fileselector_button_path_set(). What follows are checkboxes to
2972  * exercise some of its API funtions:
2973  * @dontinclude fileselector_button_example.c
2974  * @skip ck = elm_check_add
2975  * @until evas_object_show(en)
2976  *
2977  * The checkboxes will toggle whether the file selector button's
2978  * internal file selector:
2979  * - must have an editable text entry for file names (thus, be in
2980  *   "save dialog mode")
2981  * - is to be raised as an "inner window" (note it's the default
2982  *   behavior) or as a dedicated window
2983  * - is to populate its view with folders only
2984  * - is to expand its folders, in its view, <b>in place</b>, and not
2985  *   repainting it entirely just with the contents of a sole
2986  *   directory.
2987  *
2988  * The entry labeled @c "Last selection" will exercise the @c
2989  * "file,chosen" smart event coming from the file selector button:
2990  * @dontinclude fileselector_button_example.c
2991  * @skip hook on the
2992  * @until toggle inwin
2993  *
2994  * Whenever you dismiss or acknowledges the file selector, after it's
2995  * raised, the @c event_info string will contain the last selection on
2996  * it (if any was made).
2997  *
2998  * This is how the example, just after called, should look like:
2999  *
3000  * @image html screenshots/fileselector_button_example_00.png
3001  * @image latex screenshots/fileselector_button_example_00.eps width=\textwidth
3002  *
3003  * Click on the file selector button to raise its internal file
3004  * selector, which will be contained on an <b>"inner window"</b>:
3005  *
3006  * @image html screenshots/fileselector_button_example_01.png
3007  * @image latex screenshots/fileselector_button_example_01.eps width=\textwidth
3008  *
3009  * Toggle the "inwin mode" switch off and, if you click on the file
3010  * selector button again, you'll get @b two windows, the original one
3011  * (note the last selection there!)
3012  *
3013  * @image html screenshots/fileselector_button_example_02.png
3014  * @image latex screenshots/fileselector_button_example_02.eps width=\textwidth
3015  *
3016  * and the file selector's new one
3017  *
3018  * @image html screenshots/fileselector_button_example_03.png
3019  * @image latex screenshots/fileselector_button_example_03.eps width=\textwidth
3020  *
3021  * Play with the checkboxes to get the behavior changes on the file
3022  * selector button. The respective API calls on the widget coming from
3023  * those knobs where shown in the code already.
3024  *
3025  * See the full @ref fileselector_button_example_c "source code" for
3026  * this example.
3027  *
3028  * @example fileselector_button_example.c
3029  */
3030
3031 /**
3032  * @page fileselector_entry_example File selector entry widget example
3033  *
3034  * This code places an Elementary file selector entry widget on a
3035  * window, along with some other checkboxes. Those are there just as
3036  * knobs on the file selector entry's state.
3037  *
3038  * Here's how we instantiate it:
3039  * @dontinclude fileselector_entry_example.c
3040  * @skip ic = elm_icon_add
3041  * @until evas_object_show
3042  *
3043  * Note that we set on it's button both icon and label
3044  * decorations. It's set to exhibit the path of (and list the contents
3045  * of, when internal file selector is launched) the @c "/tmp"
3046  * directory, also, with elm_fileselector_entry_path_set(). What
3047  * follows are checkboxes to exercise some of its API funtions:
3048  * @dontinclude fileselector_entry_example.c
3049  * @skip ck = elm_check_add
3050  * @until callback_add(fs_entry
3051  *
3052  * The checkboxes will toggle whether the file selector entry's
3053  * internal file selector:
3054  * - must have an editable text entry for file names (thus, be in
3055  *   "save dialog mode")
3056  * - is to be raised as an "inner window" (note it's the default
3057  *   behavior) or as a dedicated window
3058  * - is to populate its view with folders only
3059  * - is to expand its folders, in its view, <b>in place</b>, and not
3060  *   repainting it entirely just with the contents of a sole
3061  *   directory.
3062  *
3063  * Observe how the entry's text will match the string coming from the
3064  * @c "file,chosen" smart event:
3065  * @dontinclude fileselector_entry_example.c
3066  * @skip hook on the
3067  * @until }
3068  * Whenever you dismiss or acknowledges the file selector, after it's
3069  * raised, the @c event_info string will contain the last selection on
3070  * it (if any was made).
3071  *
3072  * Try, also, to type in a valid system path and, then, open the file
3073  * selector's window: it will start the file browsing there, for you.
3074  *
3075  * This is how the example, just after called, should look like:
3076  *
3077  * @image html screenshots/fileselector_entry_example_00.png
3078  * @image latex screenshots/fileselector_entry_example_00.eps width=\textwidth
3079  *
3080  * Click on the file selector entry to raise its internal file
3081  * selector, which will be contained on an <b>"inner window"</b>:
3082  *
3083  * @image html screenshots/fileselector_entry_example_01.png
3084  * @image latex screenshots/fileselector_entry_example_01.eps width=\textwidth
3085  *
3086  * Toggle the "inwin mode" switch off and, if you click on the file
3087  * selector entry again, you'll get @b two windows, the original one
3088  * (note the last selection there!)
3089  *
3090  * @image html screenshots/fileselector_entry_example_02.png
3091  * @image latex screenshots/fileselector_entry_example_02.eps width=\textwidth
3092  *
3093  * and the file selector's new one
3094  *
3095  * @image html screenshots/fileselector_entry_example_03.png
3096  * @image latex screenshots/fileselector_entry_example_03.eps width=\textwidth
3097  *
3098  * Play with the checkboxes to get the behavior changes on the file
3099  * selector entry. The respective API calls on the widget coming from
3100  * those knobs where shown in the code already.
3101  *
3102  * See the full @ref fileselector_entry_example_c "source code" for
3103  * this example.
3104  *
3105  * @example fileselector_entry_example.c
3106  */
3107
3108 /**
3109  * @page layout_example_01 Layout - Content, Table and Box
3110  *
3111  * This example shows how one can use the @ref Layout widget to create a
3112  * customized distribution of widgets on the screen, controled by an Edje theme.
3113  * The full source code for this example can be found at @ref
3114  * layout_example_01_c.
3115  *
3116  * Our custom layout is defined by a file, @ref layout_example_edc, which is an
3117  * Edje theme file. Look for the Edje documentation to understand it. For now,
3118  * it's enough to know that we describe some specific parts on this layout
3119  * theme:
3120  * @li a title text field;
3121  * @li a box container;
3122  * @li a table container;
3123  * @li and a content container.
3124  *
3125  * Going straight to the code, the following snippet instantiates the layout
3126  * widget:
3127  *
3128  * @dontinclude layout_example_01.c
3129  * @skip elm_layout_add
3130  * @until evas_object_show(layout)
3131  *
3132  * As any other widget, we set some properties for the size calculation. But
3133  * notice on this piece of code the call to the function elm_layout_file_set().
3134  * Here is where the theme file is loaded, and particularly the specific group
3135  * from this theme file. Also notice that the theme file here is referenced as
3136  * an .edj, which is a .edc theme file compiled to its binary form. Again, look
3137  * for the Edje documentation for more information about theme files.
3138  *
3139  * Next, we fetch from our theme a data string referenced by the key "title".
3140  * This data was defined in the theme, and can be used as parameters which the
3141  * program get from the specific theme that it is using. In this case, we store
3142  * the title of this window and program in the theme, as a "data" entry, just
3143  * for demonstration purposes:
3144  *
3145  * @until }
3146  *
3147  * This call elm_layout_data_get() is used to fetch the string based on the key,
3148  * and elm_object_text_part_set() will set the part defined in the theme as
3149  * "example/title" to contain this string. This key "example/title" has nothing
3150  * special. It's just an arbitrary convention that we are using in this example.
3151  * Every string in this example referencing a part of this theme will be of the
3152  * form "example/<something>".
3153  *
3154  * Now let's start using our layout to distribute things on the window space.
3155  * Since the layout was added as a resize object to the elementary window, it
3156  * will always occupy the entire space available for this window.
3157  *
3158  * The theme already has a title, and it also defines a table element which is
3159  * positioned approximately between 50% and 70% of the height of this window,
3160  * and has 100% of the width. We create some widgets (two icons, a clock and a
3161  * button) and pack them inside the table, in a distribution similar to a HTML
3162  * table:
3163  *
3164  * @until evas_object_show(bt)
3165  *
3166  * Notice that we just set size hints for every object, and call the function
3167  * elm_layout_table_pack(), which does all the work. It will place the elements
3168  * in the specified row/column, with row and column span if required, and then
3169  * the object's size and position will be controled by the layout widget. It
3170  * will also respect size hints, alignments and weight properties set to these
3171  * widgets. The resulting distribution on the screen depends on the table
3172  * properties (described in the theme), the size hints set on each widget, and
3173  * on the cells of the table that are being used.
3174  *
3175  * For instance, we add the two icons and the clock on the first, second and
3176  * third cells of the first row, and add the button the second row, making it
3177  * span for 3 columns (thus having the size of the entire table width). This
3178  * will result in a table that has 2 rows and 3 columns.
3179  *
3180  * Now let's add some widgets to the box area of our layout. This box is around
3181  * 20% and 50% of the vertical size of the layout, and 100% of its width. The
3182  * theme defines that it will use an "horizontal flow" distribution to its
3183  * elements. Unlike the table, a box will distribute elements without knowing
3184  * about rows and columns, and the distribution function selected will take care
3185  * of putting them in row, column, both, or any other available layout. This is
3186  * also described in the Edje documentation.
3187  *
3188  * This box area is similar to the @ref Box widget of elementary, with the
3189  * difference that its position and properties are controled by the theme of the
3190  * layout. It also contains more than one API to add items to it, since the
3191  * items position now is defined in terms of a list of items, not a matrix.
3192  * There's the first position (can have items added to it with
3193  * elm_layout_box_prepend()), the last position (elm_layout_box_append()), the
3194  * nth position (elm_layout_box_insert_at()) and the position right before an
3195  * element (elm_layout_box_insert_before()). We use insert_at and prepend
3196  * functions to add the first two buttons to this box, and insert_before on the
3197  * callback of each button. The callback code will be shown later, but it
3198  * basically adds a button just before the clicked button using the
3199  * elm_layout_box_insert_before() function. Here's the code for adding the first
3200  * 2 buttons:
3201  *
3202  * @until evas_object_show(item)
3203  * @until evas_object_show(item)
3204  *
3205  * Finally, we have an area in this layout theme, in the bottom part of it,
3206  * reserved for adding an specific widget. Differently from the 2 parts
3207  * described until now, this one can only receive one widget with the call
3208  * elm_layout_content_set(). If there was already an item on this specific part,
3209  * it will be deleted (one can use elm_layout_content_unset() in order to remove
3210  * it without deleting). An example of removing it without deleting, but
3211  * manually deleting this widget just after that, can be seen on the callback
3212  * for this button. Actually, the callback defined for this button will clean
3213  * the two other parts (deleting all of their elements) and then remove and
3214  * delete this button.
3215  *
3216  * @until _swallow_btn_cb
3217  *
3218  * Also notice that, for this last added button, we don't have to call
3219  * evas_object_show() on it. This is a particularity of the theme for layouts,
3220  * that will have total control over the properties like size, position,
3221  * visibility and clipping of a widget added with elm_layout_content_set().
3222  * Again, read the Edje documentation to understand this better.
3223  *
3224  * Now we just put the code for the different callbacks specified for each kind
3225  * of button and make simple comments about them:
3226  *
3227  * @dontinclude layout_example_01.c
3228  * @skip static void
3229  * @until evas_object_del(item)
3230  * @until }
3231  *
3232  * The first callback is used for the button in the table, and will just remove
3233  * itself from the table with elm_layout_table_unpack(), which remove items
3234  * without deleting them, and then calling evas_object_del() on itself.
3235  *
3236  * The second callback is for buttons added to the box. When clicked, these
3237  * buttons will create a new button, and add them to the same box, in the
3238  * position just before the clicked button.
3239  *
3240  * And the last callback is for the button added to the "content" area. It will
3241  * clear both the table and the box, passing @c EINA_TRUE to their respective @c
3242  * clear parameters, which will imply on the items of these containers being
3243  * deleted.
3244  *
3245  * A screenshot of this example can be seen on:
3246  *
3247  * @image html screenshots/layout_example_01.png
3248  * @image latex screenshots/layout_example_01.eps width=\textwidth
3249  *
3250  */
3251
3252 /**
3253  * @page layout_example_02 Layout - Predefined Layout
3254  *
3255  * This example shows how one can use the @ref Layout with a predefined theme
3256  * layout to add a back and next button to a simple window. The full source code
3257  * for this example can be found at @ref layout_example_02_c.
3258  *
3259  * After setting up the window and background, we add the layout widget to the
3260  * window. But instead of using elm_layout_file_set() to load its theme from a
3261  * custom theme file, we can use elm_layout_theme_set() to load one of the
3262  * predefined layouts that come with elementary. Particularly on this example,
3263  * we load the them of class "layout", group "application" and style
3264  * "content-back-next" (since we want the back and next buttons).
3265  *
3266  * @dontinclude layout_example_02.c
3267  * @skip elm_layout_add
3268  * @until evas_object_show(layout)
3269  *
3270  * This default theme contains only a "content" area named
3271  * "elm.swallow.content", where we can add any widget (it can be even a
3272  * container widget, like a box, frame, list, or even another layout). Since we
3273  * just want to show the resulting layout, we add a simple icon to it:
3274  *
3275  * @until layout_content_set
3276  *
3277  * This default layout also provides some signals when the next and prev buttons
3278  * are clicked. We can register callbacks to them with the
3279  * elm_object_signal_callback_add() function:
3280  *
3281  * @until elm,action,next
3282  *
3283  * In the @ref layout_example_03 you can see how to send signals to the layout with
3284  * elm_object_signal_emit().
3285  *
3286  * Now our callback just changes the picture being displayed when one of the
3287  * buttons are clicked:
3288  *
3289  * @dontinclude layout_example_02.c
3290  * @skip images
3291  * @until standard_set
3292  * @until }
3293  *
3294  * It's possible to see that it gets the name of the image being shown from the
3295  * array of image names, going forward on this array when "next" is clicked and
3296  * backward when "back" is clicked.
3297  *
3298  * A screenshot of this example can be seen on:
3299  *
3300  * @image html screenshots/layout_example_02.png
3301  * @image latex screenshots/layout_example_02.eps width=\textwidth
3302  */
3303
3304 /**
3305  * @page layout_example_03 Layout - Signals and Size Changed
3306  *
3307  * This example shows how one can send and receive signals to/from the layout,
3308  * and what to do when the layout theme has its size changed. The full source
3309  * code for this example can be found at @ref layout_example_03_c.
3310  *
3311  * In this exmaple we will use another group from the same layout theme file
3312  * used in @ref layout_example_01. Its instanciation and loading happens in the
3313  * following lines:
3314  *
3315  * @dontinclude layout_example_03.c
3316  * @skip elm_layout_add
3317  * @until evas_object_show
3318  *
3319  * This time we register a callback to be called whenever we receive a signal
3320  * after the end of the animation that happens in this layout:
3321  *
3322  * @until signal_callback_add
3323  *
3324  * We also add a button that will send signals to the layout:
3325  *
3326  * @until callback_add
3327  *
3328  * The callback for this button will check what type of signal it should send,
3329  * and then emit it. The code for this callback follows:
3330  *
3331  * @dontinclude layout_example_03.c
3332  * @skip static Eina_Bool
3333  * @until Enlarge
3334  * @until }
3335  * @until }
3336  *
3337  * As we said before, we are receiving a signal whenever the animation started
3338  * by the button click ends. This is the callback for that signal:
3339  *
3340  * @until }
3341  *
3342  * Notice from this callback that the elm_layout_sizing_eval() function must be
3343  * called if we want our widget to update its size after the layout theme having
3344  * changed its minimum size. This happens because the animation specified in the
3345  * theme increases the size of the content area to a value higher than the
3346  * widget size, thus requiring more space. But the elementary layout widget
3347  * has no way to know this, thus needing the elm_layout_sizing_eval() to
3348  * be called on the layout, informing that this size has changed.
3349  *
3350  * A screenshot of this example can be seen on:
3351  *
3352  * @image html screenshots/layout_example_03.png
3353  * @image latex screenshots/layout_example_03.eps width=\textwidth
3354  */
3355
3356 /**
3357  * @page tutorial_hover Hover example
3358  * @dontinclude hover_example_01.c
3359  *
3360  * On this example we are going to have a button that when clicked will show our
3361  * hover widget, this hover will have content set on it's left, top, right and
3362  * middle positions. In the middle position we are placing a button that when
3363  * clicked will hide the hover. We are also going to use a non-default theme
3364  * for our hover. We won't explain the functioning of button for that see @ref
3365  * Button.
3366  *
3367  * We start our example with a couple of callbacks that show and hide the data
3368  * they're given(which we'll see later on is the hover widget):
3369  * @skip static
3370  * @until }
3371  * @until }
3372  *
3373  * In our main function we'll do some initialization and then create 3
3374  * rectangles, one red, one green and one blue to use in our hover. We'll also
3375  * create the 2 buttons that will show and hide the hover:
3376  * @until show(bt2)
3377  *
3378  * With all of that squared away we can now get to the heart of the matter,
3379  * creating our hover widget, which is easy as pie:
3380  * @until hover
3381  *
3382  * Having created our hover we now need to set the parent and target. Which if
3383  * you recall from the function documentations are going to tell the hover which
3384  * area it should cover and where it should be centered:
3385  * @until bt
3386  *
3387  * Now we set the theme for our hover. We're using the popout theme which gives
3388  * our contents a white background and causes their appearance to be animated:
3389  * @until popout
3390  *
3391  * And finally we set the content for our positions:
3392  * @until bt2
3393  *
3394  * So far so good? Great 'cause that's all there is too it, what is left now is
3395  * just connecting our buttons to the callbacks we defined at the beginning of
3396  * the example and run the main loop:
3397  * @until ELM_MAIN
3398  *
3399  * Our example will initially look like this:
3400  *
3401  * @image html screenshots/hover_example_01.png
3402  * @image latex screenshots/hover_example_01.eps width=\textwidth
3403  *
3404  * And after you click the "Show hover" button it will look like this:
3405  *
3406  * @image html screenshots/hover_example_01_a.png
3407  * @image latex screenshots/hover_example_01_a.eps width=\textwidth
3408  *
3409  * @example hover_example_01.c
3410  */
3411
3412 /**
3413   * @page tutorial_flip Flip example
3414   * @dontinclude flip_example_01.c
3415   *
3416   * This example will show a flip with two rectangles on it(one blue, one
3417   * green). Our example will allow the user to choose the animation the flip
3418   * uses and to interact with it. To allow the user to choose the interaction
3419   * mode we use radio buttons, we will however not explain them, if you would
3420   * like to know more about radio buttons see @ref Radio.
3421   *
3422   * We start our example with the usual setup and then create the 2 rectangles
3423   * we will use in our flip:
3424   * @until show(rect2)
3425   *
3426   * The next thing to do is to create our flip and set it's front and back
3427   * content:
3428   * @until show
3429   *
3430   * The next thing we do is set the interaction mode(which the user can later
3431   * change) to the page animation:
3432   * @until PAGE
3433   *
3434   * Setting a interaction mode however is not sufficient, we also need to
3435   * choose which directions we allow interaction from, for this example we
3436   * will use all of them:
3437   * @until RIGHT
3438   *
3439   * We are also going to set the hitsize to the entire flip(in all directions)
3440   * to make our flip very easy to interact with:
3441   * @until RIGHT
3442   *
3443   * After that we create our radio buttons and start the main loop:
3444   * @until ELM_MAIN()
3445   *
3446   * When the user clicks a radio button a function that changes the
3447   * interaction mode and animates the flip is called:
3448   * @until }
3449   * @note The elm_flip_go() call here serves no purpose other than to
3450   * ilustrate that it's possible to animate the flip programmatically.
3451   *
3452   * Our example will look like this:
3453   *
3454   * @image html screenshots/flip_example_01.png
3455   * @image latex screenshots/flip_example_01.eps width=\textwidth
3456   *
3457   * @note Since this is an animated example the screenshot doesn't do it
3458   * justice, it is a good idea to compile it and see the animations.
3459   *
3460   * @example flip_example_01.c
3461   */
3462
3463  /**
3464   * @page tutorial_label Label example
3465   * @dontinclude label_example_01.c
3466   *
3467   * In this example we are going to create 6 labels, set some properties on
3468   * them and see what changes in appearance those properties cause.
3469   *
3470   * We start with the setup code that by now you should be familiar with:
3471   * @until show(bg)
3472   *
3473   * For our first label we have a moderately long text(that doesn't fit in the
3474   * label's width) so we will make it a sliding label. Since the text isn't
3475   * too long we don't need the animation to be very long, 3 seconds should
3476   * give us a nice speed:
3477   * @until show(label
3478   *
3479   * For our second label we have the same text, but this time we aren't going
3480   * to have it slide, we're going to ellipsize it. Because we ask our label
3481   * widget to ellipsize the text it will first diminsh the fontsize so that it
3482   * can show as much of the text as possible:
3483   * @until show(label
3484   *
3485   * For the third label we are going to ellipsize the text again, however this
3486   * time to make sure the fontsize isn't diminshed we will set a line wrap.
3487   * The wrap won't actually cause a line break because we set the label to
3488   * ellipsize:
3489   * @until show(label
3490   *
3491   * For our fourth label we will set line wrapping but won't set ellipsis, so
3492   * that our text will indeed be wrapped instead of ellipsized. For this label
3493   * we choose character wrap:
3494   * @until show(label
3495   *
3496   * Just two more, for our fifth label we do the same as for the fourth
3497   * except we set the wrap to word:
3498   * @until show(label
3499   *
3500   * And last but not least for our sixth label we set the style to "marker" and
3501   * the color to red(the default color is white which would be hard to see on
3502   * our white background):
3503   * @until show(label
3504   *
3505   * Our example will look like this:
3506   *
3507   * @image html screenshots/label_example_01.png
3508   * @image latex screenshots/label_example_01.eps width=\textwidth
3509   *
3510   * @example label_example_01.c
3511   */
3512
3513  /**
3514   * @page tutorial_image Image example
3515   * @dontinclude image_example_01.c
3516   *
3517   * This example is as simple as possible. An image object will be added to the
3518   * window over a white background, and set to be resizeable together with the
3519   * window. All the options set through the example will affect the behavior of
3520   * this image.
3521   *
3522   * We start with the code for creating a window and its background, and also
3523   * add the code to write the path to the image that will be loaded:
3524   *
3525   * @skip int
3526   * @until snprintf
3527   *
3528   * Now we create the image object, and set that file to be loaded:
3529   *
3530   * @until }
3531   *
3532   * We can now go setting our options.
3533   *
3534   * elm_image_no_scale_set() is used just to set this value to true (we
3535   * don't want to scale our image anyway, just resize it).
3536   *
3537   * elm_image_scale_set() is used to allow the image to be resized to a size
3538   * smaller than the original one, but not to a size bigger than it.
3539   *
3540   * elm_elm_image_smooth_set() will disable the smooth scaling, so the scale
3541   * algorithm used to scale the image to the new object size is going to be
3542   * faster, but with a lower quality.
3543   *
3544   * elm_image_orient_set() is used to flip the image around the (1, 0) (0, 1)
3545   * diagonal.
3546   *
3547   * elm_image_aspect_ratio_retained_set() is used to keep the original aspect
3548   * ratio of the image, even when the window is resized to another aspect ratio.
3549   *
3550   * elm_image_fill_outside_set() is used to ensure that the image will fill the
3551   * entire area available to it, even if keeping the aspect ratio. The image
3552   * will overflow its width or height (any of them that is necessary) to the
3553   * object area, instead of resizing the image down until it can fit entirely in
3554   * this area.
3555   *
3556   * elm_image_editable_set() is used just to cover the API, but won't affect
3557   * this example since we are not using any copy & paste property.
3558   *
3559   * This is the code for setting these options:
3560   *
3561   * @until editable
3562   *
3563   * Now some last touches in our object size hints, window and background, to
3564   * display this image properly:
3565   *
3566   * @until ELM_MAIN
3567   *
3568   * This example will look like this:
3569   *
3570   * @image html screenshots/image_example_01.png
3571   * @image latex screenshots/image_example_01.eps width=\textwidth
3572   *
3573   * @example image_example_01.c
3574   */
3575
3576  /**
3577   * @page tutorial_icon Icon example
3578   * @dontinclude icon_example_01.c
3579   *
3580   * This example is as simple as possible. An icon object will be added to the
3581   * window over a white background, and set to be resizeable together with the
3582   * window. All the options set through the example will affect the behavior of
3583   * this icon.
3584   *
3585   * We start with the code for creating a window and its background:
3586   *
3587   * @skip int
3588   * @until show(bg)
3589   *
3590   * Now we create the icon object, and set lookup order of the icon, and choose
3591   * the "home" icon:
3592   *
3593   * @until home
3594   *
3595   * An intersting thing is that after setting this, it's possible to check where
3596   * in the filesystem is the theme used by this icon, and the name of the group
3597   * used:
3598   *
3599   * @until printf
3600   *
3601   * We can now go setting our options.
3602   *
3603   * elm_icon_no_scale_set() is used just to set this value to true (we
3604   * don't want to scale our icon anyway, just resize it).
3605   *
3606   * elm_icon_scale_set() is used to allow the icon to be resized to a size
3607   * smaller than the original one, but not to a size bigger than it.
3608   *
3609   * elm_elm_icon_smooth_set() will disable the smooth scaling, so the scale
3610   * algorithm used to scale the icon to the new object size is going to be
3611   * faster, but with a lower quality.
3612   *
3613   * elm_icon_fill_outside_set() is used to ensure that the icon will fill the
3614   * entire area available to it, even if keeping the aspect ratio. The icon
3615   * will overflow its width or height (any of them that is necessary) to the
3616   * object area, instead of resizing the icon down until it can fit entirely in
3617   * this area.
3618   *
3619   * This is the code for setting these options:
3620   *
3621   * @until fill_outside
3622   *
3623   * However, if you try this example you may notice that this image is not being
3624   * affected by all of these options. This happens because the used icon will be
3625   * from elementary theme, and thus it has its own set of options like smooth
3626   * scaling and fill_outside options. You can change the "home" icon to use some
3627   * image (from your system) and see that then those options will be respected.
3628   *
3629   * Now some last touches in our object size hints, window and background, to
3630   * display this icon properly:
3631   *
3632   * @until ELM_MAIN
3633   *
3634   * This example will look like this:
3635   *
3636   * @image html screenshots/icon_example_01.png
3637   * @image latex screenshots/icon_example_01.eps width=\textwidth
3638   *
3639   * @example icon_example_01.c
3640   */
3641
3642 /**
3643  * @page tutorial_hoversel Hoversel example
3644  * @dontinclude hoversel_example_01.c
3645  *
3646  * In this example we will create a hoversel with 3 items, one with a label but
3647  * no icon and two with both a label and an icon. Every item that is clicked
3648  * will be deleted, but everytime the hoversel is activated we will also add an
3649  * item. In addition our first item will print all items when clicked and our
3650  * third item will clear all items in the hoversel.
3651  *
3652  * We will start with the normal creation of window stuff:
3653  * @until show(bg)
3654  *
3655  * Next we will create a red rectangle to use as the icon of our hoversel:
3656  * @until show
3657  *
3658  * And now we create our hoversel and set some of it's properties. We set @p win
3659  * as its parent, ask it to not be horizontal(be vertical) and give it a label
3660  * and icon:
3661  * @until icon_set
3662  *
3663  * Next we will add our three items, setting a callback to be called for the
3664  * first and third:
3665  * @until _rm_items
3666  *
3667  * We also set a pair of callbacks to be called whenever any item is selected or
3668  * when the hoversel is activated:
3669  * @until clicked
3670  *
3671  * And then ask that our hoversel be shown and run the main loop:
3672  * @until ELM_MAIN
3673  *
3674  * We now have the callback for our first item which prints all items in the
3675  * hoversel:
3676  * @until }
3677  *
3678  * Next we have the callback for our third item which removes all items from the
3679  * hoversel:
3680  * @until }
3681  *
3682  * Next we have the callback that is called whenever an item is clicked and
3683  * deletes that item:
3684  * @until }
3685  *
3686  * And the callback that is called when the hoversel is activated and adds an
3687  * item to the hoversel. Note that since we allocate memory for the item we need
3688  * to know when the item dies so we can free that memory:
3689  * @until }
3690  *
3691  * And finally the callback that frees the memory we allocated for items created
3692  * in the @p _add_item callback:
3693  * @until }
3694  *
3695  * Our example will initially look like this:
3696  *
3697  * @image html screenshots/hoversel_example_01.png
3698  * @image latex screenshots/hoversel_example_01.eps width=\textwidth
3699  *
3700  * And when the hoversel is clicked it will look like this:
3701  *
3702  * @image html screenshots/hoversel_example_01_a.png
3703  * @image latex screenshots/hoversel_example_01_a.eps width=\textwidth
3704  *
3705  * @example hoversel_example_01.c
3706  */
3707
3708 /**
3709  * @page conformant_example Conformant Example.
3710  *
3711  * In this example we'll explain how to create applications to work
3712  * with illume, considering space required for virtual keyboards, indicator
3713  * and softkeys.
3714  *
3715  * Illume is a module for Enlightenment that modifies the user interface
3716  * to work cleanly and nicely on a mobile device. It has support for
3717  * virtual keyboard, among other nice features.
3718  *
3719  * Let's start creating a very simple window with a vertical box
3720  * with multi-line entry between two buttons.
3721  * This entry will expand filling all space on window not used by buttons.
3722  *
3723  * @dontinclude conformant_example_01.c
3724  * @skipline elm_main
3725  * @until }
3726  *
3727  * For information about how to create windows, boxes, buttons or entries,
3728  * look for documentation for these widgets.
3729  *
3730  * It will looks fine when you don't need a virtual keyboard, as you
3731  * can see on the following image:
3732  *
3733  * @image html screenshots/conformant_example_01.png
3734  * @image latex screenshots/conformant_example_01.eps width=\textwidth
3735  *
3736  * But if you call a virtual keyboard, the window will resize, changing
3737  * widgets size and position. All the content will shrink.
3738  *
3739  * If you don't want such behaviour, you
3740  * will need a conformant to account for space taken up by the indicator,
3741  * virtual keyboard and softkey.
3742  *
3743  * In this case, using the conformant in a proper way, you will have
3744  * a window like the following:
3745  *
3746  * @image html screenshots/conformant_example_02.png
3747  * @image latex screenshots/conformant_example_02.eps width=\textwidth
3748  *
3749  * As you can see, it guess the space that will be required by the keyboard,
3750  * indicator and softkey bars.
3751  *
3752  * So, let's study each step required to transform our initial example on
3753  * the second one.
3754  *
3755  * First of all, we need to set the window as an illume conformant window:
3756  * @dontinclude conformant_example_02.c
3757  * @skipline elm_win_conformant_set
3758  *
3759  * Next, we'll add a conformant widget, and set it to resize with the window,
3760  * instead of the box.
3761  * @skipline conform
3762  * @until evas_object_show
3763  *
3764  * Finally, we'll set the box as conformant's content, just like this:
3765  * @skipline elm_conformant_content_set
3766  *
3767  * Compare both examples code:
3768  * @ref conformant_example_01.c "conformant_example_01.c"
3769  * @ref conformant_example_02.c "conformant_example_02.c"
3770  *
3771  * @example conformant_example_01.c
3772  * @example conformant_example_02.c
3773  */
3774
3775 /**
3776  * @page index_example_01 Index widget example 1
3777  *
3778  * This code places an Elementary index widget on a window, which also
3779  * has a very long list of arbitrary strings on it.  The list is
3780  * sorted alphabetically and the index will be used to index the first
3781  * items of each set of strings beginning with an alphabet letter.
3782  *
3783  * Below the list are some buttons, which are there just to exercise
3784  * some index widget's API.
3785  *
3786  * Here's how we instantiate it:
3787  * @dontinclude index_example_01.c
3788  * @skip elm_list_add
3789  * @until evas_object_show(d.index)
3790  * where we're showing also the list being created. Note that we issue
3791  * elm_win_resize_object_add() on the index, so that it's set to have
3792  * the whole window as its container. Then, we have to populate both
3793  * list and index widgets:
3794  * @dontinclude index_example_01.c
3795  * @skip for (i = 0; i < (sizeof(dict) / sizeof(dict[0])); i++)
3796  * @until }
3797  * @until }
3798  *
3799  * The strings populating the list come from a file
3800  * @dontinclude index_example_01.c
3801  * @skip static const char *dict
3802  * @until }
3803  *
3804  * We use the @c curr char variable to hold the last initial letter
3805  * seen on that ordered list of strings, so that we're able to have an
3806  * index item pointing to each list item starting a new letter
3807  * "section". Note that our index item data pointers will be the list
3808  * item handles. We are also setting a callback function to index
3809  * items deletion events:
3810  * @dontinclude index_example_01.c
3811  * @skip static void
3812  * @until }
3813  *
3814  * There, we show you that the @c event_info pointer will contain the
3815  * item in question's data, i.e., a given list item's pointer. Because
3816  * item data is also returned in the @c data argument on
3817  * @c Evas_Smart_Cb functions, those two pointers must have the same
3818  * values. On this deletion callback, we're deleting the referred list
3819  * item too, just to exemplify that anything could be done there.
3820  *
3821  * Next, we hook to two smart events of the index object:
3822  * @dontinclude index_example_01.c
3823  * @skip smart_callback_add(d.index
3824  * @until _index_selected
3825  * @dontinclude index_example_01.c
3826  * @skip "delay,changed" hook
3827  * @until }
3828  * @until }
3829  *
3830  * Check that, whenever one holds the mouse pressed over a given index
3831  * letter for some time, the list beneath it will roll down to the
3832  * item pointed to by that index item. When one releases the mouse
3833  * button, the second callback takes place. There, we check that the
3834  * reported item data, on @c event_info, is the same reported by
3835  * elm_index_item_selected_get(), which gives the last selection's
3836  * data on the index widget.
3837  *
3838  * The first of the three buttons that follow will call
3839  * elm_index_active_set(), thus showing the index automatically for
3840  * you, if it's not already visible, what is checked with
3841  * elm_index_active_get(). The second button will exercise @b deletion
3842  * of index item objects, by the following code:
3843  * @dontinclude index_example_01.c
3844  * @skip delete an index item
3845  * @until }
3846  *
3847  * It will get the last index item selected's data and find the
3848  * respective #Elm_Index_Item handle with elm_index_item_find(). We
3849  * need the latter to query the indexing letter string from, with
3850  * elm_index_item_letter_get(). Next, comes the delition, itself,
3851  * which will also trigger the @c _index_item_del callback function,
3852  * as said above.
3853  *
3854  * The third button, finally, will exercise elm_index_item_clear(),
3855  * which will delete @b all of the index's items.
3856  *
3857  * This is how the example program's window looks like with the index
3858  * widget hidden:
3859  * @image html screenshots/index_example_00.png
3860  * @image latex screenshots/index_example_00.eps
3861  *
3862  * When it's shown, it's like the following figure:
3863  * @image html screenshots/index_example_01.png
3864  * @image latex screenshots/index_example_01.eps
3865  *
3866  * See the full @ref index_example_01_c "source code" for
3867  * this example.
3868  *
3869  * @example index_example_01.c
3870  */
3871
3872 /**
3873  * @page index_example_02 Index widget example 2
3874  *
3875  * This code places an Elementary index widget on a window, indexing
3876  * grid items. The items are placed so that their labels @b don't
3877  * follow any order, but the index itself is ordered (through
3878  * elm_index_item_sorted_insert()). This is a complement to to @ref
3879  * index_example_01 "the first example on indexes".
3880  *
3881  * Here's the list of item labels to be used on the grid (in that
3882  * order):
3883  * @dontinclude index_example_02.c
3884  * @skip static const char *items
3885  * @until };
3886  *
3887  * In the interesting part of the code, here, we first instantiate the
3888  * grid (more on grids on their examples) and, after creating our
3889  * index, for each grid item we also create an index one to reference
3890  * it:
3891  * @dontinclude index_example_02.c
3892  * @skip grid = elm_gengrid_add
3893  * @until }
3894  * @until smart_callback_add
3895  *
3896  * The order in which they'll appear in the index, though, is @b
3897  * alphabetical, becase of elm_index_item_sorted_insert() usage
3898  * together with the comparing function, where we take the letters of
3899  * each index item to base our ordering on. The parameters on
3900  * @c _index_cmp have to be declared as void pointers because of the
3901  * @c Eina_Compare_Cb prototype requisition, but in this case we know
3902  * they'll be #Elm_Index_Item's:
3903  * @dontinclude index_example_02.c
3904  * @skip ordering alphabetically
3905  * @until }
3906  *
3907  * The last interesting bit is the callback in the @c "delay,changed"
3908  * smart event, which will bring the given grid item to the grid's
3909  * visible area:
3910  * @dontinclude index_example_02.c
3911  * @skip static void
3912  * @until }
3913  *
3914  * Note how the grid will move kind of randomly while you move your
3915  * mouse pointer held over the index from top to bottom -- that's
3916  * because of the the random order the items have in the grid itself.
3917  *
3918  * This is how the example program's window looks like:
3919  * @image html screenshots/index_example_03.png
3920  * @image latex screenshots/index_example_03.eps
3921  *
3922  * See the full @ref index_example.c "source code" for
3923  * this example.
3924  *
3925  * @example index_example_02.c
3926  */
3927
3928 /**
3929  * @page tutorial_ctxpopup Ctxpopup example
3930  * @dontinclude ctxpopup_example_01.c
3931  *
3932  * In this example we have a list with two items, when either item is clicked
3933  * a ctxpopup for it will be shown. Our two ctxpopups are quite different, the
3934  * one for the first item is a vertical and it's items contain both labels and
3935  * icons, the one for the second item is horizontal and it's items have icons
3936  * but not labels.
3937  *
3938  * We will begin examining our example code by looking at the callback we'll use
3939  * when items in the ctxpopup are clicked. It's very simple, all it does is
3940  * print the label present in the ctxpopup item:
3941  * @until }
3942  *
3943  * Next we examine a function that creates ctxpopup items, it was created to
3944  * avoid repeating the same code whenever we needed to add an item to our
3945  * ctxpopup. Our function creates an icon from the standard set of icons, and
3946  * then creates the item, with the label received as an argument. We also set
3947  * the callback to be called when the item is clicked:
3948  * @until }
3949  *
3950  * Finally we have the function that will create the ctxpopup for the first item
3951  * in our list. This one is somewhat more complex though, so let's go through it
3952  * in parts. First we declare our variable and add the ctxpopup:
3953  * @until ctxpopup_add
3954  *
3955  * Next we create a bunch of items for our ctxpopup, marking two of them as
3956  * disabled just so we can see what that will look like:
3957  * @until disabled_set
3958  * @until disabled_set
3959  *
3960  * Then we ask evas where the mouse pointer was so that we can have our ctxpopup
3961  * appear in the right place, set a maximum size for the ctxpopup, move it and
3962  * show it:
3963  * @until show
3964  *
3965  * And last we mark the list item as not selected:
3966  * @until }
3967  *
3968  * Our next function is the callback that will create the ctxpopup for the
3969  * second list item, it is very similar to the previous function. A couple of
3970  * interesting things to note is that we ask our ctxpopup to be horizontal, and
3971  * that we pass NULL as the label for every item:
3972  * @until }
3973  *
3974  * And with all of that in place we can now get to our main function where we
3975  * create the window, the list, the list items and run the main loop:
3976  * @until ELM_MAIN()
3977  *
3978  * The example will initially look like this:
3979  *
3980  * @image html screenshots/ctxpopup_example_01.png
3981  * @image latex screenshots/ctxpopup_example_01.eps width=\textwidth
3982  *
3983  * @note This doesn't show the ctxpopup tough, since it will only appear when
3984  * we click one of the list items.
3985  *
3986  * Here is what our first ctxpopup will look like:
3987  *
3988  * @image html screenshots/ctxpopup_example_01_a.png
3989  * @image latex screenshots/ctxpopup_example_01_a.eps width=\textwidth
3990  *
3991  * And here the second ctxpopup:
3992  *
3993  * @image html screenshots/ctxpopup_example_01_b.png
3994  * @image latex screenshots/ctxpopup_example_01_b.eps width=\textwidth
3995  *
3996  * @example ctxpopup_example_01.c
3997  */
3998
3999 /**
4000  * @page tutorial_pager
4001  * @dontinclude pager_example_01.c
4002  *
4003  * In this example we'll have a pager with 3 rectangles on it, one blue, one
4004  * green and one blue, we'll also have 1 button for each rectangle. Pressing a
4005  * button will bring the associated rectangle to the front of the pager(promote
4006  * it).
4007  *
4008  * We start our example with some run of the mill code that you've seen in other
4009  * examples:
4010  * @until show
4011  *
4012  * And then we get right to creating our pager, setting a style and some basic
4013  * properties to it:
4014  * @until show
4015  *
4016  * Well a pager without any content is not of much use, so let's create the
4017  * first of our rectangles, add it to the pager and create the button for it:
4018  * @until smart_callback
4019  * @note The only line of above code that directly relates to our pager is the
4020  * call to elm_pager_content_push().
4021  *
4022  * And now we will do the same thing again twice for our next two rectangles:
4023  * @until smart_callback
4024  * @until smart_callback
4025  *
4026  * Now that we haver our widgets create we can get to running the main loop:
4027  * @until ELM_MAIN
4028  *
4029  * We also have the callback that is called when any of the buttons is pressed,
4030  * this callback is receiving the rectangle in it's @p data argument, so we
4031  * check if it's already on top and if not move it there:
4032  * @until }
4033  *
4034  * Our example will look like this:
4035  *
4036  * @image html screenshots/pager_example_01.png
4037  * @image latex screenshots/pager_example_01.eps width=\textwidth
4038  * @note Like all examples that involve animations the screenshot doesn't do it
4039  * justice, seeing it in action is a must.
4040  *
4041  * @example pager_example_01.c
4042  */
4043
4044 /**
4045  * @page tutorial_separator Separator example
4046  * @dontinclude separator_example_01.c
4047  *
4048  * In this example we are going to pack two rectangles in a box, and have a
4049  * separator in the middle.
4050  *
4051  * So we start we the window, background, box and rectangle creation, all pretty
4052  * normal stuff:
4053  * @until pack_end
4054  *
4055  * Once we have our first rectangle in the box we create and add our separator:
4056  * @until pack_end
4057  * @note Since our box is in horizontal mode it's a good idea to set the
4058  * separator to be horizontal too.
4059  *
4060  * And now we add our second rectangle and run the main loop:
4061  * @until ELM_MAIN
4062  *
4063  * This example will look like this:
4064  *
4065  * @image html screenshots/separator_example_01.png
4066  * @image latex screenshots/separator_example_01.eps width=\textwidth
4067  *
4068  * @example separator_example_01.c
4069  */
4070
4071 /**
4072  * @page tutorial_radio Radio example
4073  * @dontinclude radio_example_01.c
4074  *
4075  * In this example we will create 4 radio buttons, three of them in a group and
4076  * another one not in the group. We will also have the radios in the group
4077  * change the value of a variable directly and have then print it when the value
4078  * changes. The fourth button is in the example just to make clear that radios
4079  * outside the group don't affect the group.
4080  *
4081  * We'll start with the usual includes:
4082  * @until #endif
4083  *
4084  * And move right to declaring a static variable(the one whose value the radios
4085  * will change):
4086  * @until static
4087  *
4088  * We now need to have a window and all that good stuff to be able to place our
4089  * radios in:
4090  * @until show(bx)
4091  *
4092  * And now we create a radio button, since this is the first button in our group
4093  * we set the group to be the radio(so we can set the other radios in the same
4094  * group). We also set the state value of this radio to 1 and the value pointer
4095  * to @p val, since val is @p 1 this has the additional effect of setting the
4096  * radio value to @p 1. For this radio we choose the default home icon:
4097  * @until show
4098  *
4099  * To check that our radio buttons are working we'll add a callback to the
4100  * "changed" signal of the radio:
4101  * @until smart_callback
4102  *
4103  * The creation of our second radio button is almost identical, the 2
4104  * differences worth noting are, the value of this radio 2 and that we add this
4105  * radio to the group of the first radio:
4106  * @until smart_callback
4107  *
4108  * For our third callback we'll omit the icon and set the value to 3, we'll also
4109  * add it to the group of the first radio:
4110  * @until smart_callback
4111  *
4112  * Our fourth callback has a value of 4, no icon and most relevantly is not a
4113  * member of the same group as the other radios:
4114  * @until show
4115  *
4116  * We finally run the main loop:
4117  * @until ELM_MAIN
4118  *
4119  * And the last detail in our example is the callback that prints @p val so that
4120  * we can see that the radios are indeed changing its value:
4121  * @until }
4122  *
4123  * The example will look like this:
4124  *
4125  * @image html screenshots/radio_example_01.png
4126  * @image latex screenshots/radio_example_01.eps width=\textwidth
4127  *
4128  * @example radio_example_01.c
4129  */
4130
4131 /**
4132  * @page tutorial_toggle Toggle example
4133  * @dontinclude toggle_example_01.c
4134  *
4135  * In this example we'll create 2 toggle widgets. The first will have an icon
4136  * and the state names will be the default "on"/"off", it will also change the
4137  * value of a variable directly. The second won't have a icon, the state names
4138  * will be "Enabled"/"Disabled", it will  start "Enabled" and it won't set the
4139  * value of a variable.
4140  *
4141  * We start with the usual includes and prototype for callback which will be
4142  * implemented and detailed later on:
4143  * @until _cb2
4144  *
4145  * We then declare a static global variable(the one whose value will be changed
4146  * by the first toggle):
4147  * @until static
4148  *
4149  * We now have to create our window and all that usual stuff:
4150  * @until show(bx)
4151  *
4152  * The creation of a toggle is no more complicated than that of any other
4153  * widget:
4154  * @until add
4155  *
4156  * For our first toggle we don't set the states labels so they will stay the
4157  * default, however we do set a label for the toggle, an icon and the variable
4158  * whose value it should change:
4159  * @until show
4160  *
4161  * We also set the callback that will be called when the toggles value changes:
4162  * @until smart_callback
4163  *
4164  * For our second toggle it important to note that we set the states labels,
4165  * don't set an icon or variable, but set the initial state to
4166  * EINA_TRUE("Enabled"):
4167  * @until show
4168  *
4169  * For the second toggle we will use a different callback:
4170  * @until smart_callback
4171  *
4172  * We then ask the main loop to start:
4173  * @until ELM_MAIN
4174  *
4175  * The callback for our first toggle will look the value of @p val and print it:
4176  * @until }
4177  *
4178  * For our second callback we need to do a little bit more, since the second
4179  * toggle doesn't change the value of a variable we have to ask it what its
4180  * state is:
4181  * @until }
4182  *
4183  * This example will look like this:
4184  *
4185  * @image html screenshots/toggle_example_01.png
4186  * @image latex screenshots/toggle_example_01.eps width=\textwidth
4187  *
4188  * @example toggle_example_01.c
4189  */
4190
4191 /**
4192  * @page tutorial_panel Panel example
4193  * @dontinclude panel_example_01.c
4194  *
4195  * In this example will have 3 panels, one for each possible orientation. Two of
4196  * our panels will start out hidden, the third will start out expanded. For each
4197  * of the panels we will use a label as the content, it's however possible to
4198  * have any widget(including containers) as the content of panels.
4199  *
4200  * We start by doing some setup, code you should be familiar with from other
4201  * examples:
4202  * @until show(bx)
4203  *
4204  * And move right to creating our first panel, for this panel we are going to
4205  * choose the orientation as TOP and toggle it(tell it to hide itself):
4206  * @until pack_end
4207  *
4208  * For the second panel we choose the RIGHT orientation and explicitly set the
4209  * state as hidden:
4210  * @until pack_end
4211  *
4212  * For our third and last panel we won't set the orientation(which means it will
4213  * use the default: LEFT):
4214  * @until pack_end
4215  *
4216  * All that is left is running the main loop:
4217  * @until ELM_MAIN
4218  *
4219  * This example will look like this;
4220  *
4221  * @image html screenshots/panel_example_01.png
4222  * @image latex screenshots/panel_example_01.eps width=\textwidth
4223  * @note The buttons with arrow allow the user to hide/show the panels.
4224  *
4225  * @example panel_example_01.c
4226  */
4227
4228 /**
4229  * @page gengrid_example Gengrid widget example
4230  *
4231  * This application is a thorough exercise on the gengrid widget's
4232  * API. We place an Elementary gengrid widget on a window, with
4233  * various knobs below its viewport, each one acting on it somehow.
4234  *
4235  * The code's relevant part begins at the grid's creation. After
4236  * instantiating it, we set its items sizes, so that we don't end with
4237  * items one finger size wide, only. We're setting them to fat, 150
4238  * pixel wide ones, for this example. We give it some size hints, not
4239  * to be discussed in this context and, than, we register a callback
4240  * on one of its smart events -- the one coming each time an item gets
4241  * doubly clicked. There, we just print the item handle's value.
4242  * @dontinclude gengrid_example.c
4243  * @skip grid = elm_gengrid_add
4244  * @until evas_object_sho
4245  * @dontinclude gengrid_example.c
4246  * @skip item double click callback
4247  * @until }
4248  *
4249  * Before we actually start to deal with the items API, let's show
4250  * some things items will be using throughout all the code. The first
4251  * of them is a struct to be used as item data, for all of them:
4252  * @dontinclude gengrid_example.c
4253  * @skip typedef struct
4254  * @until Item;
4255  *
4256  * That path will be used to index an image, to be swallowed into one
4257  * of the item's icon spots. The imagens themselves are distributed
4258  * with Elementary:
4259  * @dontinclude gengrid_example.c
4260  * @skip static const char *imgs
4261  * @until ;
4262  *
4263  * We also have an (unique) gengrid item class we'll be using for
4264  * items in the example:
4265  * @dontinclude gengrid_example.c
4266  * @skip static Elm_Gengrid_Item_Class
4267  * @until static Elm_Gengrid_Item_Class
4268  * @dontinclude gengrid_example.c
4269  * @skip item_style =
4270  * @until _grid_del
4271  *
4272  * As you see, our items will follow the default theme on gengrid
4273  * items. For the label fetching code, we return a string composed of
4274  * the item's image path:
4275  * @dontinclude gengrid_example.c
4276  * @skip label fetching callback
4277  * @until }
4278  *
4279  * For item icons, we'll be populating the item default theme's two
4280  * icon spots, @c "elm.swallow.icon" and @c "elm.swallow.end". The
4281  * former will receive one of the images in our list (in the form of
4282  * a @ref bg_02_example_page "background"), while the latter will be
4283  * a check widget. Note that we prevent the check to propagate click
4284  * events, so that the user can toggle its state without messing with
4285  * the respective item's selection in the grid:
4286  * @dontinclude gengrid_example.c
4287  * @skip icon fetching callback
4288  * @until return NULL
4289  * @until }
4290  *
4291  * As the default gengrid item's theme does not have parts
4292  * implementing item states, we'll be just returning false for every
4293  * item state:
4294  * @dontinclude gengrid_example.c
4295  * @skip state fetching callback
4296  * @until }
4297  *
4298  * Finally, the deletion callback on gengrid items takes care of
4299  * freeing the item's label string and its data struct:
4300  * @dontinclude gengrid_example.c
4301  * @skip deletion callback
4302  * @until }
4303  *
4304  * Let's move to item insertion/deletion knobs, them. They are four
4305  * buttons, above the grid's viewport, namely
4306  * - "Append" (to append an item to the grid),
4307  * - "Prepend" (to prepend an item to the grid),
4308  * - "Insert before" (to insert an item before the selection, on the
4309  *   grid),
4310  * - "Insert after" (to insert an item after the selection, on the
4311  *   grid),
4312  * - "Clear" (to delete all items in the grid),
4313  * - "Bring in 1st" (to make the 1st item visible, by scrolling),
4314  * - "Show last" (to directly show the last item),
4315  * .
4316  * which are displaced and declared in that order. We're not dealing
4317  * with the buttons' creation code (see @ref button_example_01
4318  * "a button example", for more details on it), but with their @c
4319  * "clicked" registered callbacks.  For all of them, the grid's handle
4320  * is passed as @c data. The ones creating new items use a common
4321  * code, which just gives a new @c Example_Item struct, with @c path
4322  * filled with a random image in our images list:
4323  * @dontinclude gengrid_example.c
4324  * @skip new item with random path
4325  * @until }
4326  *
4327  * Moreover, that ones will set a common function to be issued on the
4328  * selection of the items. There, we print the item handle's value,
4329  * along with the callback function data. The latter will be @c NULL,
4330  * always, because it's what we pass when adding all icons. By using
4331  * elm_gengrid_item_data_get(), we can have the item data back and,
4332  * with that, we're priting the item's path string. Finally, we
4333  * exemplify elm_gengrid_item_pos_get(), printing the item's position
4334  * in the grid:
4335  * @dontinclude gengrid_example.c
4336  * @skip item selection callback
4337  * @until }
4338  *
4339  * The appending button will exercise elm_gengrid_item_append(), simply:
4340  * @dontinclude gengrid_example.c
4341  * @skip append an item
4342  * @until }
4343  *
4344  * The prepending, naturally, is analogous, but exercising
4345  * elm_gengrid_item_prepend(), on its turn. The "Insert before" one
4346  * will expect an item to be selected in the grid, so that it will
4347  * insert a new item just before it:
4348  * @dontinclude gengrid_example.c
4349  * @skip "insert before" callback
4350  * @until }
4351  *
4352  * The "Insert after" is analogous, just using
4353  * elm_gengrid_item_insert_after(), instead. The "Clear" button will,
4354  * as expected, just issue elm_gengrid_clear():
4355  * @dontinclude gengrid_example.c
4356  * @skip delete items
4357  * @until }
4358  *
4359  * The "Bring in 1st" button is there exercise two gengrid functions
4360  * -- elm_gengrid_first_item_get() and elm_gengrid_item_bring_in().
4361  * With the former, we get a handle to the first item and, with the
4362  * latter, you'll see that the widget animatedly scrolls its view
4363  * until we can see that item:
4364  * @dontinclude gengrid_example.c
4365  * @skip bring in 1st item
4366  * @until }
4367  *
4368  * The "Show last", in its turn, will use elm_gengrid_last_item_get()
4369  * and elm_gengrid_item_show(). The latter differs from
4370  * elm_gengrid_item_bring_in() in that it immediately replaces the
4371  * contents of the grid's viewport with the region containing the item
4372  * in question:
4373  * @dontinclude gengrid_example.c
4374  * @skip show last item
4375  * @until }
4376  *
4377  * To change the grid's cell (items) size, we've placed a spinner,
4378  * which has the following @c "changed" smart callback:
4379  * @dontinclude gengrid_example.c
4380  * @skip change items' size
4381  * @until }
4382  *
4383  * Experiment with it and see how the items are affected. The "Disable
4384  * item" button will, as the name says, disable the currently selected
4385  * item:
4386  * @dontinclude gengrid_example.c
4387  * @skip disable selected item
4388  * @until }
4389  * Note that we also make use of elm_gengrid_item_selected_set(),
4390  * there, thus making the item unselected before we actually disable
4391  * it.
4392  *
4393  * To toggle between horizontal and vertical layouting modes on the
4394  * grid, use the "Horizontal mode" check, which will call the
4395  * respective API function on the grid:
4396  * @dontinclude gengrid_example.c
4397  * @skip change layouting mode
4398  * @until }
4399  *
4400  * If you toggle the check right after that one, "Always select",
4401  * you'll notice all subsequent clicks on the @b same grid item will
4402  * still issue the selection callback on it, what is different from
4403  * when it's not checked. This is the
4404  * elm_gengrid_always_select_mode_set() behavior:
4405  * @dontinclude gengrid_example.c
4406  * @skip "always select" callback
4407  * @until }
4408  *
4409  * One more check follows, "Bouncing", which will turn on/off the
4410  * bouncing animations on the grid, when one scrolls past its
4411  * borders. Experiment with scrolling the grid to get the idea, having
4412  * it turned on and off:
4413  * @dontinclude gengrid_example.c
4414  * @skip "bouncing mode" callback
4415  * @until }
4416  *
4417  * The next two checks will affect items selection on the grid. The
4418  * first, "Multi-selection", will make it possible to select more the
4419  * one item on the grid. Because it wouldn't make sense to fetch for
4420  * an unique selected item on this case, we also disable two of the
4421  * buttons, which insert items relatively, if multi-selection is on:
4422  * @dontinclude gengrid_example.c
4423  * @skip multi-selection callback
4424  * @until }
4425  *
4426  * Note that we also @b unselect all items in the grid, when returning
4427  * from multi-selection mode, making use of
4428  * elm_gengrid_item_selected_set().
4429  *
4430  * The second check acting on selection, "No selection", is just what
4431  * its name depicts -- no selection will be allowed anymore, on the
4432  * grid, while it's on. Check it out for yourself, interacting with
4433  * the program:
4434  * @dontinclude gengrid_example.c
4435  * @skip no selection callback
4436  * @until }
4437  *
4438  * We have, finally, one more line of knobs, now sliders, to change
4439  * the grids behavior. The two first will change the horizontal @b
4440  * alignment of the whole actual grid of items within the gengrid's
4441  * viewport:
4442  * @dontinclude gengrid_example.c
4443  * @skip items grid horizontal alignment change
4444  * @until }
4445  *
4446  * Naturally, the vertical counterpart just issues
4447  * elm_gengrid_align_set() changing the second alignment component,
4448  * instead.
4449  *
4450  * The last slider will change the grid's <b>page size</b>, relative
4451  * to its own one. Try to change those values and, one manner of
4452  * observing the paging behavior, is to scroll softly and release the
4453  * mouse button, with different page sizes, at different grid
4454  * positions, while having lots of items in it -- you'll see it
4455  * snapping to page boundaries differenty, for each configuration:
4456  * @dontinclude gengrid_example.c
4457  * @skip page relative size change
4458  * @until }
4459  *
4460  * This is how the example program's window looks like:
4461  * @image html screenshots/gengrid_example.png
4462  * @image latex screenshots/gengrid_example.eps width=\textwidth
4463  *
4464  * Note that it starts with three items which we included at will:
4465  * @dontinclude gengrid_example.c
4466  * @skip _clicked(grid,
4467  * @until _clicked(grid,
4468  * @until _clicked(grid,
4469  * @until _clicked(grid,
4470  *
4471  * See the full @ref gengrid_example_c "source code" for
4472  * this example.
4473  *
4474  * @example gengrid_example.c
4475  */
4476 /**
4477  * @page entry_example_01 Entry - Example of simple editing
4478  *
4479  * As a general overview of @ref Entry we are going to write an, albeit simple,
4480  * functional editor. Although intended to show how elm_entry works, this
4481  * example also makes extensive use of several other widgets. The full code
4482  * can be found in @ref entry_example.c "entry_example.c" and in the following
4483  * lines we'll go through the parts especific to the @ref Entry widget.
4484  *
4485  * The program itself is a simple editor, with a file already set to it, that
4486  * can be set to autosave or not and allows insertion of emoticons and some
4487  * formatted text. As of this writing, the capabilities of format edition in
4488  * the entry are very limited, so a lot of manual work is required to change
4489  * the current text.
4490  *
4491  * In any case, the program allows some changes by using the buttons on the
4492  * top of the window and returning focus back to the main entry afterwards.
4493  *
4494  * @image html screenshots/entry_example.png
4495  * @image latex screenshots/entry_example.eps width=\textwidth
4496  *
4497  * We'll begin by showing a few structures used throught the program. First,
4498  * the application owns data that holds the main window and the main entry
4499  * where the editting happens. Then, an auxiliar structure we'll use later
4500  * when inserting icons in our text.
4501  * @dontinclude entry_example.c
4502  * @skip typedef
4503  * @until App_Inwin_Data
4504  *
4505  * A little convenience function will insert whatever text we need in the
4506  * buffer at the current cursor's position and set focus back to this entry.
4507  * This is done mostly because clicking on any button will make them steal
4508  * focus, which makes writing text more cumbersome.
4509  * @skip static void
4510  * @until }
4511  *
4512  * One of the buttons on the top will trigger an @ref Inwin to open and show
4513  * us several icons we can insert into the text. We'll jump over most of these
4514  * functions, but when all the options are chosen, we insert the special
4515  * markup text that will show the chosen icon in place.
4516  * @skip edje_file_collection_list_free(emos)
4517  * @skip static void
4518  * @until evas_object_del
4519  * @until }
4520  *
4521  * As can be seen in that function, the program lets us add icons to our entry
4522  * using all the possible configurations for them. That should help to
4523  * clarify how the different combinations work out by actually seeing them
4524  * in action.
4525  *
4526  * The same popup window has a page to set the settings of the chosen icon,
4527  * that is, the size and how the item will be placed within the line.
4528  *
4529  * The size is done with two entries, limitted to accept numbers and a fixed
4530  * size of characters. Changing the value in this entries will update the icon
4531  * size in our struct as seen in the next two callbacks.
4532  * @skip static void
4533  * @until }
4534  * @until }
4535  *
4536  * The rest of the options are handled with radio buttons, since only one type
4537  * of size can be used (@c size, @c absize or @c relsize) and for the vertical
4538  * sizing it needs to choose between @c ascent and @c full. Depending on which
4539  * is chosen, the @c item tag is formed accordingly as seen before.
4540  * @skip static Evas_Object
4541  * @until evas_object_show(rvascent)
4542  *
4543  * The first of our entries is here. There's something worth mentioning about
4544  * the way we'll create this one. Normally, any entry regardless of whether is
4545  * single line or not, will be set to scrollable, but in this case, since we
4546  * are limitting how many characters can fit in them and we know we don't need
4547  * scrolling, we are not setting this flag. This makes the entry have virtually
4548  * no appearance on screen, other than its text. This is because an entry is
4549  * just that, a box that holds text, and in order to have some frame around it
4550  * or a background color, another widget needs to provide this. When an entry
4551  * is scrollable, the same scroller used internally does this.
4552  * We are using @ref Frame "frames" here to provide some decoration around,
4553  * then creating our entries, set them to single line, add our two filters and
4554  * the callback for when their value change.
4555  * @until _height_changed_cb
4556  *
4557  * This function ends with the button that will finally call the item
4558  * into our editting string.
4559  * @until }
4560  *
4561  * Then we get to the format edition. Here we can add the @c bold and
4562  * @c emphasis tags to parts of our text. There's a lot of manual work to
4563  * know what to do here, since we are not implementing an entire state manager
4564  * and the entry itself doesn't, yet, support all the needed capabilities to
4565  * make this simpler. We begin by getting the format we are using in our
4566  * function from the button pressed.
4567  * @skip aid->pager = pager;
4568  * @until sizeof(fmt_close)
4569  *
4570  * Next we need to find out if we need to insert an opening or a closing tag.
4571  * For this, we store the current cursor position and create a selection
4572  * from this point until the beginning of our text, and then get the selected
4573  * text to look for any existing format tags in it. This is currently the only
4574  * way in which we can find out what formats is being used in the entry.
4575  * @until }
4576  * @until }
4577  *
4578  * Once we know what tag to insert, we need a second check in the case it was
4579  * a closing tag. This is because any other closing tag that comes after would
4580  * be left dangling alone, so we need to remove it to keep the text consistent.
4581  * @until }
4582  * @until }
4583  * Finally, we clear our fake selections and return the cursor back to the
4584  * position it had at first, since there is where we want to insert our format.
4585  * @until cursor_pos_set
4586  *
4587  * And finish by calling our convenience function from before, to insert the
4588  * text at the current cursor and give focus back to the entry.
4589  * @until }
4590  *
4591  * A checkbox on the top of our program tells us if the text we are editing
4592  * will autosave or not. In it's @c "changed" callback we get the value from
4593  * the checkbox and call the elm_entry_autosave_set() function with it. If
4594  * autosave is set, we also call elm_entry_file_save(). This is so the internal
4595  * timer used to periodically store to disk our changes is started.
4596  * @skip static void
4597  * @until }
4598  *
4599  * Two more functions to show some cursor playing. Whenever we double click
4600  * anywhere on our entry, we'll find what word is the cursor placed at and
4601  * select it. Likewise, for triple clicking, we select the entire line.
4602  * @skip static void
4603  * @until _edit_tplclick_cb
4604  * @until }
4605  *
4606  * And finally, the main window of the program contains the entry where we
4607  * do all the edition and some helping widgets to change format, add icons
4608  * or change the autosave flag.
4609  * @skip elm_exit
4610  * @skip int
4611  * @until _image_insert_cb
4612  *
4613  * And the main entry of the program. Set to scroll, by default we disable
4614  * autosave and we'll begin with a file set to it because no file selector
4615  * is being used here. The file is loaded with #ELM_TEXT_FORMAT_MARKUP_UTF8
4616  * so that any format contained in it is interpreted, otherwise the entry
4617  * would load it as just text, escaping any tags found and no format or icons
4618  * would be shown. Then we connect to the double and triple click signals
4619  * and set focus on the entry so we can start typing right away.
4620  * @until ELM_MAIN
4621  *
4622  * @example entry_example.c
4623  */
4624
4625 /**
4626  * @page genlist_example_01 Genlist - basic usage
4627  *
4628  * This example creates a simple genlist with a small number of items and
4629  * a callback that is called whenever an item is selected. All the properties of
4630  * this genlist are the default ones. The full code for this example can be seen
4631  * at @ref genlist_example_01_c.
4632  *
4633  * For the simplest list that you plan to create, it's necessary to define some
4634  * of the basic functions that are used for creating each list item, and
4635  * associating them with the "item class" for that list. The item class is just
4636  * an struct that contains pointers to the specific list item functions that are
4637  * common to all the items of the list.
4638  *
4639  * Let's show it by example. Our item class is declared globally and static as
4640  * it will be the only item class that we need (we are just creating one list):
4641  *
4642  * @dontinclude genlist_example_01.c
4643  * @skip static Elm_Genlist
4644  * @until static Elm_Genlist
4645  *
4646  * This item class will be used for every item that we create. The only
4647  * functions that we are going to set are @c label_get and @c icon_get. As the
4648  * name suggests, they are used by the genlist to generate the label for the
4649  * respective item, and to generate icon(s) to it too. Both the label and icon
4650  * get functions can be called more than once for each item, with different @c
4651  * part parameters, which represent where in the theme of the item that label or
4652  * icon is going to be set.
4653  *
4654  * The default theme for the genlist contains only one area for label, and two
4655  * areas for icon ("elm.swallow.icon" and "elm.swallow.end"). Since we just want
4656  * to set the first icon (that will be at the left side of the label), we
4657  * compare the part name given with "elm.swallow.icon". Notice that the
4658  * @c label_get function must return a strduped string, that will be freed later
4659  * automatically by the list. Here's the code for @c label_get and @c icon_get:
4660  *
4661  * @until static void
4662  *
4663  * We will also provide a function that will be called whenever an item is
4664  * selected in the genlist. However, this function is not part of the item
4665  * class, it will be passed for each item being added to the genlist explicitly.
4666  * Notice the similarity of the function signature with those used by @c
4667  * evas_object_smart_callback_add:
4668  *
4669  * @until }
4670  *
4671  * Now let's show the code used for really creating the list. Skipping
4672  * boilerplate code used for creating a window and background, the first piece
4673  * of code specific to our genlist example is setting the pointer functions of
4674  * the item class to our above defined functions:
4675  *
4676  * @skip _itc
4677  * @until func.del
4678  *
4679  * Notice that we also choose to use the "default" style for our genlist items.
4680  * Another interesting point is that @c state_get and @c del are set to @c NULL,
4681  * since we don't need these functions now. @c del doesn't need to be used
4682  * because we don't add any data that must be freed to our items, and @c
4683  * state_get is also not used since all of our items are the same and don't need
4684  * to have different states to be used for each item. Finally we create our
4685  * list:
4686  *
4687  * @until genlist_add
4688  *
4689  * Now we append several items to the list, and for all of them we need to give
4690  * the list pointer, a pointer to the item class, the data that will be used
4691  * with that item, a pointer to the parent of this item if it is in a group type
4692  * list (this is not the case so we pass @c NULL), possible flags for this item,
4693  * the callback for when the item is selected, and the data pointer that will be
4694  * given to the selected callback.
4695  *
4696  * @until }
4697  *
4698  * The rest of the code is also common to all the other examples, so it will be
4699  * omitted here (look at the full source code link above if you need it).
4700  *
4701  * You can try to play with this example, and see the selected callback being
4702  * called whenever an item is clicked. It also already has some features enabled
4703  * by default, like vertical bounce animation when reaching the end of the list,
4704  * automatically visible/invisible scrollbar, etc. Look at the @ref
4705  * genlist_example_02 to see an example of setting these properties to the list.
4706  *
4707  * The current example will look like this when running:
4708  *
4709  * @image html screenshots/genlist_example_01.png
4710  * @image latex screenshots/genlist_example_01.eps width=\textwidth
4711  */
4712
4713 /**
4714  * @page genlist_example_02 Genlist - list setup functions
4715  *
4716  * This example is very similar to the @ref genlist_example_01, but it fetch
4717  * most of the properties of the genlist and displays them on startup (thus
4718  * getting the default value for them) and then set them to some other values,
4719  * to show how to use that API. The full source code is at @ref
4720  * genlist_example_02_c.
4721  *
4722  * Considering that the base code for instantiating a genlist was already
4723  * described in the previous example, we are going to focus on the new code.
4724  *
4725  * Just a small difference for the @c _item_label_get function, we are going to
4726  * store the time that this function was called. This is the "realized" time,
4727  * the time when the visual representation of this item was created. This is the
4728  * code for the @c label_get function:
4729  *
4730  * @dontinclude genlist_example_02.c
4731  * @skip static char
4732  * @until return strdup
4733  *
4734  * Now let's go to the list creation and setup. First, just after creating the
4735  * list, we get most of the default properties from it, and print them on the
4736  * console:
4737  *
4738  * @skip genlist_add
4739  * @until printf("\n")
4740  *
4741  * We are going to change some of the properties of our list.
4742  *
4743  * There's no need to call the selected callback at every click, just when the
4744  * selected item changes, thus we call elm_genlist_always_select_mode_set() with
4745  * false.
4746  *
4747  * For this list we don't want bounce animations at all, so we set both the
4748  * horizontal bounce and the vertical bounce to false with
4749  * elm_genlist_bounce_set().
4750  *
4751  * We also want our list to compress items if they are wider than the list
4752  * width (thus we call elm_genlist_compress_mode_set().
4753  *
4754  * The items have different width, so they are not homogeneous:
4755  * elm_genlist_homogeneous_set() is set to false.
4756  *
4757  * Since the compress mode is active, the call to
4758  * elm_genlist_horizontal_mode_set() doesn't make difference, but the current
4759  * option would make the list to have at least the width of the largest item.
4760  *
4761  * This list will support multiple selection, so we call
4762  * elm_genlist_multi_select_set() on it.
4763  *
4764  * The option elm_genlist_height_for_width_mode_set() would allow text block to
4765  * wrap lines if the Edje part is configured with "text.min: 0 1", for example.
4766  * But since we are compressing the elements to the width of the list, this
4767  * option wouldn't take any effect.
4768  *
4769  * We want the vertical scrollbar to be always displayed, and the orizontal one
4770  * to never be displayed, and set this with elm_genlist_scroller_policy_set().
4771  *
4772  * The timeout to consider a longpress is set to half of a second with
4773  * elm_genlist_longpress_timeout_set().
4774  *
4775  * We also change the block count to a smaller value, but that should have not
4776  * impact on performance since the number of visible items is too small. We just
4777  * increase the granularity of the block count (setting it to have at most 4
4778  * items).
4779  *
4780  * @until block_count_set
4781  *
4782  * Now let's add elements to the list:
4783  *
4784  * @until item_append
4785  * @until }
4786  *
4787  * It's exactly the same as the previous example. The difference is on the
4788  * behavior of the list, if you try to scroll, select items and so.
4789  *
4790  * In this example we also need two buttons. One of them, when clicked, will
4791  * display several status info about the current selection, the "realized"
4792  * items, the item in the middle of the screen, and the current mode and active
4793  * item of that mode for the genlist.
4794  *
4795  * The other button will ask the genlist to "realize" again the items already
4796  * "realized", so their respective label_get and icon_get functions will be
4797  * called again.
4798  *
4799  * These are the callbacks for both of these buttons:
4800  *
4801  * @dontinclude genlist_example_02.c
4802  * @skip item_sel_cb
4803  * @skip static
4804  * @until }
4805  * @until }
4806  *
4807  * Try to scroll, select some items and click on the "Show status" button.
4808  * You'll notice that not all items of the list are "realized", thus consuming
4809  * just a small amount of memory. The selected items are listed in the order
4810  * that they were selected, and the current selected item printed using
4811  * elm_genlist_selected_item_get() is the first selected item of the multiple
4812  * selection.
4813  *
4814  * Now resize the window so that you can see the "realized time" of some items.
4815  * This is the time of when the label_get function was called. If you click on
4816  * the "Realize" button, all the already realized items will be rebuilt, so the
4817  * time will be updated for all of them.
4818  *
4819  * The current example will look like this when running:
4820  *
4821  * @image html screenshots/genlist_example_02.png
4822  * @image latex screenshots/genlist_example_02.eps width=\textwidth
4823  */
4824
4825 /**
4826  * @page genlist_example_03 Genlist - different width options
4827  *
4828  * This example doesn't present any other feature that is not already present in
4829  * the other examples, but visually shows the difference between using the
4830  * default list options (first list of the example), setting the horizontal mode
4831  * to #ELM_LIST_LIMIT (second list), enabling compress mode (third list) and
4832  * using height_for_width option (fourth list).
4833  *
4834  * The full code for this example is listed below:
4835  *
4836  * @include genlist_example_03.c
4837  *
4838  * And the screenshot of the running example:
4839  *
4840  * @image html screenshots/genlist_example_03.png
4841  * @image latex screenshots/genlist_example_03.eps width=\textwidth
4842  *
4843  * @example genlist_example_03.c
4844  */
4845
4846 /**
4847  * @page genlist_example_04 Genlist - items manipulation
4848  *
4849  * This example is also similar ot the @ref genlist_example_01, but it
4850  * demonstrates most of the item manipulation functions. See the full source
4851  * code at @ref genlist_example_04_c.
4852  *
4853  * In this example, we also will use the concept of creating groups of items in
4854  * the genlist. Each group of items is composed by a parent item (which will be
4855  * the index of the group) and several children of this item. Thus, for the
4856  * children, we declare a normal item class. But we also are going to declare a
4857  * different item class for the group index (which in practice is another type
4858  * of item in the genlist):
4859  *
4860  * @dontinclude genlist_example_04.c
4861  * @skip _item_sel_cb
4862  * @skip static
4863  * @until }
4864  * @until }
4865  *
4866  * We will add buttons to the window, where each button provides one
4867  * functionality of the genlist item API. Each button will have a callback
4868  * attached, that will really execute this functionality. An example of these
4869  * callbacks is the next one, for the elm_genlist_item_insert_after() function:
4870  *
4871  * @skip insert_before_cb
4872  * @skip static
4873  * @until }
4874  *
4875  * If you want ot see the other button functions, look at the full source code
4876  * link above.
4877  *
4878  * Each button will be created with a function that already creates the button,
4879  * add it to an elementary box, and attach the specified callback. This is the
4880  * function that does it:
4881  *
4882  * @skip genlist_item_update
4883  * @skip static
4884  * @until }
4885  *
4886  * In our @c elm_main function, besides the code for setting up the window, box
4887  * and background, we also initialize our two item classes:
4888  *
4889  * @skip _itc.item_style
4890  * @until _itc_group.func.del
4891  *
4892  * This example uses a different style for the items, the @a double_label, which
4893  * provides a text field for the item text, and another text field for a subtext.
4894  *
4895  * For the group index we use the @a group_index style, which provides a
4896  * different appearance, helping to identify the end of a group and beginning of
4897  * another one.
4898  *
4899  * Now, after the code for creating the list, setting up the box and other
4900  * stuff, let's add the buttons with their respective callbacks:
4901  *
4902  * @skip _button_add
4903  * @until bt_top_show
4904  *
4905  * The main code for adding items to the list is a bit more complex than the one
4906  * from the previous examples. We check if each item is multiple of 7, and if
4907  * so, they are group indexes (thus each group has 6 elements by default, in
4908  * this example):
4909  *
4910  * @skip for
4911  * @until }
4912  * @until }
4913  *
4914  * Then we also check for specific items, and add callbacks to them on the
4915  * respective buttons, so we can show, bring in, etc.:
4916  *
4917  * @until }
4918  * @until }
4919  *
4920  * Once you understand the code from the @ref genlist_example_01, it should be
4921  * easy to understand this one too. Look at the full code, and also try to play
4922  * a bit with the buttons, adding items, bringing them to the viewport, and so.
4923  *
4924  * The example will look like this when running:
4925  *
4926  * @image html screenshots/genlist_example_04.png
4927  * @image latex screenshots/genlist_example_04.eps width=\textwidth
4928  */
4929
4930 /**
4931  * @page genlist_example_05 Genlist - working with subitems
4932  *
4933  * This is probably the most complex example of elementary @ref Genlist. We
4934  * create a tree of items, using the subitems properties of the items, and keep
4935  * it in memory to be able to expand/hide subitems of an item. The full source
4936  * code can be found at @ref genlist_example_05_c
4937  *
4938  * The main point is the way that Genlist manages subitems. Clicking on an
4939  * item's button to expand it won't really show its children. It will only
4940  * generate the "expand,request" signal, and the expansion must be done
4941  * manually.
4942  *
4943  * In this example we want to be able to add items as subitems of another item.
4944  * If an item has any child, it must be displayed using a parent class,
4945  * otherwise it will use the normal item class.
4946  *
4947  * It will be possible to delete items too. Once a tree is constructed (with
4948  * subitems of subitems), and the user clicks on the first parent (root of the
4949  * tree), the entire subtree must be hidden. However, just calling
4950  * elm_genlist_item_expanded_set(item, EINA_FALSE) won't hide them. The only
4951  * thing that happens is that the parent item will change its appearance to
4952  * represent that it's contracted. And the signal "contracted" will be emitted
4953  * from the genlist. Thus, we must call elm_genlist_item_subitems_clear() to
4954  * delete all its subitems, but still keep a way to recreate them when expanding
4955  * the parent again. That's why we are going to keep a node struct for each
4956  * item, that will be the data of the item, with the following information:
4957  *
4958  * @dontinclude genlist_example_05.c
4959  * @skip typedef
4960  * @until }
4961  *
4962  * This @c Node_Data contains the value for the item, a number indicating its
4963  * level under the tree, a list of children (to be able to expand it later) and
4964  * a boolean indicating if it's a favorite item or not.
4965  *
4966  * We use 3 different item classes in this example:
4967  *
4968  * One for items that don't have children:
4969  *
4970  * @skip nitems
4971  * @skip static
4972  * @until }
4973  * @until }
4974  *
4975  * One for items that have children:
4976  *
4977  * @skip item_sel
4978  * @skip static
4979  * @until }
4980  * @until }
4981  *
4982  * And one for items that were favorited:
4983  *
4984  * @skip static
4985  * @until }
4986  * @until }
4987  *
4988  * The favorite item class is there just to demonstrate the
4989  * elm_genlist_item_item_class_update() function in action. It would be much
4990  * simpler to implement the favorite behavior by just changing the icon inside
4991  * the icon_get functions when the @c favorite boolean is activated.
4992  *
4993  * Now we are going to declare the callbacks for the buttons that add, delete
4994  * and change items.
4995  *
4996  * First, a button for appending items to the list:
4997  *
4998  * @until item_append
4999  * @until }
5000  *
5001  * If an item is selected, a new item will be appended to the same level of that
5002  * item, but using the selected item's parent as its parent too. If no item is
5003  * selected, the new item will be appended to the root of the tree.
5004  *
5005  * Then the callback for marking an item as favorite:
5006  *
5007  * @until elm_genlist_item_update
5008  * @until }
5009  *
5010  * This callback is very simple, it just changes the item class of the selected
5011  * item for the "favorite" one, or go back to the "item" or "parent" class
5012  * depending on that item having children or not.
5013  *
5014  * Now, the most complex operation (adding a child to an item):
5015  *
5016  * @until elm_genlist_item_update
5017  * @until }
5018  *
5019  * This function gets the data of the selected item, create a new data (for the
5020  * item being added), and appends it to the children list of the selected item.
5021  *
5022  * Then we must check if the selected item (let's call it @c item1 now) to which
5023  * the new item (called @c item2 from now on) was already a parent item too
5024  * (using the parent item class) or just a normal item (using the default item
5025  * class). In the first case, we just have to append the item to the end of the
5026  * @c item1 children list.
5027  *
5028  * However, if the @c item1 didn't have any child previously, we have to change
5029  * it to a parent item now. It would be easy to just change its item class to
5030  * the parent type, but there's no way to change the item flags and make it be
5031  * of the type #ELM_GENLIST_ITEM_SUBITEMS. Thus, we have to delete it and create
5032  * a new item, and add this new item to the same position that the deleted one
5033  * was. That's the reason of the checks inside the bigger @c if.
5034  *
5035  * After adding the item to the newly converted parent, we set it to not
5036  * expanded (since we don't want to show the added item immediately) and select
5037  * it again, since the original item was deleted and no item is selected at the
5038  * moment.
5039  *
5040  * Finally, let's show the callback for deleting items:
5041  *
5042  * @until elm_genlist_item_update
5043  * @until }
5044  *
5045  * Since we have an iternal list representing each element of our tree, once we
5046  * delete an item we have to go deleting each child of that item, in our
5047  * internal list. That's why we have the function @c _clear_list, which
5048  * recursively goes freeing all the item data.
5049  *
5050  * This is necessary because only when we really want to delete the item is when
5051  * we need to delete the item data. When we are just contracting the item, we
5052  * need to hide the children by deleting them, but keeping the item data.
5053  *
5054  * Now there are two callbacks that will be called whenever the user clicks on
5055  * the expand/contract icon of the item. They will just request to items to be
5056  * contracted or expanded:
5057  *
5058  * @until elm_genlist_item_expanded_set(
5059  * @until elm_genlist_item_expanded_set(
5060  * @until }
5061  *
5062  * When the elm_genlist_item_expanded_set() function is called with @c
5063  * EINA_TRUE, the @c _expanded_cb will be called. And when this happens, the
5064  * subtree of that item must be recreated again. This is done using the internal
5065  * list stored as item data for each item. The function code follows:
5066  *
5067  * @until }
5068  *
5069  * Each appended item is set to contracted, so we don't have to deal with
5070  * checking if the item was contracted or expanded before its parent being
5071  * contracted. It could be easily implemented, though, by adding a flag expanded
5072  * inside the item data.
5073  *
5074  * Now, the @c _contracted_cb, which is much simpler:
5075  *
5076  * @until }
5077  *
5078  * We just have to call elm_genlist_item_subitems_clear(), that will take care
5079  * of deleting every item, and keep the item data still stored (since we don't
5080  * have any del function set on any of our item classes).
5081  *
5082  * Finally, the code inside @c elm_main is very similar to the other examples:
5083  *
5084  * @skip elm_main
5085  * @until ELM_MAIN
5086  *
5087  * The example will look like this when running:
5088  *
5089  * @image html screenshots/genlist_example_05.png
5090  * @image latex screenshots/genlist_example_05.eps width=\textwidth
5091  */
5092
5093 /**
5094  * @page thumb_example_01 Thumb - generating thumbnails.
5095  *
5096  * This example shows how to create a simple thumbnail object with Elementary.
5097  * The full source code can be found at @ref thumb_example_01_c
5098  *
5099  * Everything is very simple. First we need to tell elementary that we need
5100  * Ethumb to generate the thumbnails:
5101  *
5102  * @dontinclude thumb_example_01.c
5103  * @skipline elm_need_ethumb
5104  *
5105  * Then, after creating the window and background, we setup our client to
5106  * generate images of 160x160:
5107  *
5108  * @skip client_get
5109  * @until size_set
5110  *
5111  * After that, we can start creating thumbnail objects. They are very similar to
5112  * image or icon objects:
5113  *
5114  * @until thumb_reload
5115  *
5116  * As you can see, the main different function here is elm_thumb_reload(), which
5117  * will check if the options of the Ethumb client have changed. If so, it will
5118  * re-generate the thumbnail, and show the new one.
5119  *
5120  * Notice in this example that the thumbnail object is displayed on the size of
5121  * the window (320x320 pixels), but the thumbnail generated and stored has size
5122  * 160x160 pixels. That's why the picture seems upscaled.
5123  *
5124  * Ideally, you will be generating thumbnails with the size that you will be
5125  * using them.
5126  *
5127  * The example will look like this when running:
5128  *
5129  * @image html screenshots/thumb_example_01.png
5130  * @image latex screenshots/thumb_example_01.eps width=\textwidth
5131  */
5132
5133 /**
5134  * @page progressbar_example Progress bar widget example
5135  *
5136  * This application is a thorough example of the progress bar widget,
5137  * consisting of a window with varios progress bars, each with a given
5138  * look/style one can give to those widgets. With two auxiliary
5139  * buttons, one can start or stop a timer which will fill in the bars
5140  * in synchrony, simulating an underlying task being completed.
5141  *
5142  * We create @b seven progress bars, being three of them horizontal,
5143  * three vertical and a final one under the "wheel" alternate style.
5144  *
5145  * For the first one, we add a progress bar on total pristine state,
5146  * with no other call than the elm_progressbar_add() one:
5147  * @dontinclude progressbar_example.c
5148  * @skip pb with no label
5149  * @until pb1
5150  * See, than, that the defaults of a progress bar are:
5151  * - no primary label shown,
5152  * - unit label set to @c "%.0f %%",
5153  * - no icon set
5154  *
5155  * The second progress bar is given a primary label, <c>"Infinite
5156  * bounce"</c>, and, besides, it's set to @b pulse. See how, after one
5157  * starts the progress timer, with the "Start" button, it animates
5158  * differently than the previous one. It won't account for the
5159  * progress, itself, and just dumbly animate a small bar within its
5160  * bar region.
5161  * @dontinclude progressbar_example.c
5162  * @skip pb with label
5163  * @until pb2
5164  *
5165  * Next, comes a progress bar with an @b icon, a primary label and a
5166  * @b custom unit label set. It's also made to grow its bar in an
5167  * @b inverted manner, so check that out during the timer's progression:
5168  * @dontinclude progressbar_example.c
5169  * @skip ic1 =
5170  * @until pb3
5171  * Another important thing in this one is the call to
5172  * elm_progressbar_span_size_set() -- this is how we forcefully set a
5173  * minimum horizontal size to our whole window! We're not resizing it
5174  * manually, as you can see in the @ref progressbar_example_c
5175  * "complete code".
5176  *
5177  * The next three progress bars are just variants on the ones already
5178  * shown, but now all being @b vertical. Another time we use one of
5179  * than to give the window a minimum vertical size, with
5180  * elm_progressbar_span_size_set().  To demonstrate this trick once
5181  * more, the fifth one, which is also set to pulse, has a smaller
5182  * hardcoded span size:
5183  * @dontinclude progressbar_example.c
5184  * @skip vertical pb, with pulse
5185  * @until pb5
5186  *
5187  * We end the widget demonstration by showing a progress bar with the
5188  * special @b "wheel" progress bar style. One does @b not need to set
5189  * it to pulse, with elm_progressbar_pulse_set(), explicitly, because
5190  * its theme does not take it in account:
5191  * @dontinclude progressbar_example.c
5192  * @skip "wheel"
5193  * @until pb7
5194  *
5195  * The two buttons exercising the bars, the facto, follow:
5196  * @dontinclude progressbar_example.c
5197  * @skip elm_button_add
5198  * @until evas_object_show(bt)
5199  * @until evas_object_show(bt)
5200  *
5201  * The first of the callbacks will, for the progress bars set to
5202  * pulse, start the pulsing animation at that time. For the others, a
5203  * timer callback will take care of updating the values:
5204  * @dontinclude progressbar_example.c
5205  * @skip static Eina_Bool
5206  * @until }
5207  * @until }
5208  * @until }
5209  *
5210  * Finally, the callback to stop the progress timer will stop the
5211  * pulsing on the pulsing progress bars and, for the others, to delete
5212  * the timer which was acting on their values:
5213  * @dontinclude progressbar_example.c
5214  * @skip end of show
5215  * @until }
5216  * @until }
5217  *
5218  * This is how the example program's window looks like:
5219  * @image html screenshots/progressbar_example.png
5220  * @image latex screenshots/progressbar_example.eps width=\textwidth
5221  *
5222  * See the full @ref progressbar_example_c "source code" for
5223  * this example.
5224  *
5225  * @example progressbar_example.c
5226  */
5227
5228 /**
5229  * @page tutorial_notify Notify example
5230  * @dontinclude notify_example_01.c
5231  *
5232  * In this example we will have 3 notifys in 3 different positions. The first of
5233  * which will dissapear after 5 seconds or when a click outside it occurs, the
5234  * second and third will not dissapear and differ from each other only in
5235  * position.
5236  *
5237  * We start our example with the usual stuff you've seen in other examples:
5238  * @until show(bx)
5239  *
5240  * We now create a label to use as the content of our first notify:
5241  * @until show
5242  *
5243  * Having the label we move to creating our notify, telling it to block events,
5244  * setting its timeout(to autohide it):
5245  * @until pack_end
5246  *
5247  * To have the notify dissapear when a click outside its area occur we have to
5248  * listen to its "block,clicked" signal:
5249  * @until smart_callback
5250  *
5251  * Our callback will look like this:
5252  * @skip static
5253  * @until }
5254  * @dontinclude notify_example_01.c
5255  *
5256  * Next we create another label and another notify. Note, however, that this
5257  * time we don't set a timeout and don't have it block events. What we do is set
5258  * the orient so that this notify will appear in the bottom of its parent:
5259  * @skip smart_callback
5260  * @skip content
5261  * @until pack_end
5262  *
5263  * For our third notify the only change is the orient which is now center:
5264  * @until pack_end
5265  *
5266  * Now we tell the main loop to run:
5267  * @until ELM_MAIN
5268  *
5269  * Our example will initially look like this:
5270  *
5271  * @image html screenshots/notify_example_01.png
5272  * @image latex screenshots/notify_example_01.eps width=\textwidth
5273  *
5274  * Once the first notify is hidden:
5275  *
5276  * @image html screenshots/notify_example_01_a.png
5277  * @image latex screenshots/notify_example_01_a.eps width=\textwidth
5278  *
5279  * @example notify_example_01.c
5280  */
5281
5282 /**
5283  * @page tutorial_frame Frame example
5284  * @dontinclude frame_example_01.c
5285  *
5286  * In this example we are going to create 4 Frames with different styles and
5287  * add a rectangle of different color in each.
5288  *
5289  * We start we the usual setup code:
5290  * @until show(bg)
5291  *
5292  * And then create one rectangle:
5293  * @until show
5294  *
5295  * To add it in our first frame, which since it doesn't have it's style
5296  * specifically set uses the default style:
5297  * @until show
5298  *
5299  * And then create another rectangle:
5300  * @until show
5301  *
5302  * To add it in our second frame, which uses the "pad_small" style, note that
5303  * even tough we are setting a text for this frame it won't be show, only the
5304  * default style shows the Frame's title:
5305  * @until show
5306  * @note The "pad_small", "pad_medium", "pad_large" and "pad_huge" styles are
5307  * very similar, their only difference is the size of the empty area around
5308  * the content of the frame.
5309  *
5310  * And then create yet another rectangle:
5311  * @until show
5312  *
5313  * To add it in our third frame, which uses the "outdent_top" style, note
5314  * that even tough we are setting a text for this frame it won't be show,
5315  * only the default style shows the Frame's title:
5316  * @until show
5317  *
5318  * And then create one last rectangle:
5319  * @until show
5320  *
5321  * To add it in our fourth and final frame, which uses the "outdent_bottom"
5322  * style, note that even tough we are setting a text for this frame it won't
5323  * be show, only the default style shows the Frame's title:
5324  * @until show
5325  *
5326  * And now we are left with just some more setup code:
5327  * @until ELM_MAIN()
5328  *
5329  * Our example will look like this:
5330  *
5331  * @image html screenshots/frame_example_01.png
5332  * @image latex screenshots/frame_example_01.eps width=\textwidth
5333  *
5334  * @example frame_example_01.c
5335  */
5336
5337 /**
5338  * @page tutorial_anchorblock_example Anchorblock/Anchorview example
5339  * This example will show both Anchorblock and @ref Anchorview,
5340  * since both are very similar and it's easier to show them once and side
5341  * by side, so the difference is more clear.
5342  *
5343  * We'll show the relevant snippets of the code here, but the full example
5344  * can be found here... sorry, @ref anchorblock_example_01.c "here".
5345  *
5346  * As for the actual example, it's just a simple window with an anchorblock
5347  * and an anchorview, both containing the same text. After including
5348  * Elementary.h and declaring some functions we'll need, we jump to our
5349  * elm_main (see ELM_MAIN) and create our window.
5350  * @dontinclude anchorblock_example_01.c
5351  * @skip int
5352  * @until const char
5353  * @until ;
5354  *
5355  * With the needed variables declared, we'll create the window and a box to
5356  * hold our widgets, but we don't need to go through that here.
5357  *
5358  * In order to make clear where the anchorblock ends and the anchorview
5359  * begins, they'll be each inside a @ref Frame. After creating the frame,
5360  * the anchorblock follows.
5361  * @skip elm_frame_add
5362  * @until elm_frame_content_set
5363  *
5364  * Nothing out of the ordinary there. What's worth mentioning is the call
5365  * to elm_anchorblock_hover_parent_set(). We are telling our widget that
5366  * when an anchor is clicked, the hover for the popup will cover the entire
5367  * window. This affects the area that will be obscured by the hover and
5368  * where clicking will dismiss it, as well as the calculations it does to
5369  * inform the best locations where to insert the popups content.
5370  * Other than that, the code is pretty standard. We also need to set our
5371  * callback for when an anchor is clicked, since it's our task to populate
5372  * the popup. There's no default for it.
5373  *
5374  * The anchorview is no different, we only change a few things so it looks
5375  * different.
5376  * @until elm_frame_content_set
5377  *
5378  * Then we run, so stuff works and close our main function in the usual way.
5379  * @until ELM_MAIN
5380  *
5381  * Now, a little note. Normally you would use either one of anchorblock or
5382  * anchorview, set your one callback to clicks and do your stuff in there.
5383  * In this example, however, there are a few tricks to make it easier to
5384  * show both widgets in one go (and to save me some typing). So we have
5385  * two callbacks, one per widget, that will call a common function to do
5386  * the rest. The trick is using ::Elm_Entry_Anchorblock_Info for the
5387  * anchorview too, since both are equal, and passing a callback to use
5388  * for our buttons to end the hover, because each widget has a different
5389  * function for it.
5390  * @until _anchorview_clicked_cb
5391  * @until }
5392  *
5393  * The meat of our popup is in the following function. We check what kind
5394  * of menu we need to show, based on the name set to the anchor in the
5395  * markup text. If there's no type (something went wrong, no valid contact
5396  * in the address list) we are just putting a button that does nothing, but
5397  * it's perfectly reasonable to just end the hover and call it quits.
5398  *
5399  * Our popup will consist of one main button in the middle of our hover,
5400  * and possibly a secondary button and a list of other options. We'll create
5401  * first our main button and check what kind of popup we need afterwards.
5402  * @skip static void
5403  * @skip static void
5404  * @until eina_stringshare_add
5405  * @until }
5406  *
5407  * Each button has two callbacks, one is our hack to close the hover
5408  * properly based on which widget it belongs to, the other a simple
5409  * printf that will show the action with the anchors own data. This is
5410  * not how you would usually do it. Instead, the common case is to have
5411  * one callback for the button that will know which function to call to end
5412  * things, but since we are doing it this way it's worth noting that
5413  * smart callbacks will be called in reverse in respect to the order they
5414  * were added, and since our @c btn_end_cb will close the hover, and thus
5415  * delete our buttons, the other callback wouldn't be called if we had
5416  * added it before.
5417  *
5418  * After our telephone popup, there are a few others that are practically
5419  * the same, so they won't be shown here.
5420  *
5421  * Once we are done with that, it's time to place our actions into our
5422  * hover. Main button goes in the middle without much questioning, and then
5423  * we see if we have a secondary button and a box of extra options.
5424  * Because I said so, secondary button goes on either side and box of
5425  * options either on top or below the main one, but to choose which
5426  * exactly, we use the hints our callback info has, which saves us from
5427  * having to do the math and see which side has more space available, with
5428  * a little special case where we delete our extra stuff if there's nowhere
5429  * to place it.
5430  * @skip url:
5431  * @skip }
5432  * @skip evas_object_smart
5433  * @until evas_object_del(box)
5434  * @until }
5435  * @until }
5436  *
5437  * The example will look like this:
5438  *
5439  * @image html screenshots/anchorblock_01.png
5440  * @image latex screenshots/anchorblock_01.eps width=\textwidth
5441  *
5442  * @example anchorblock_example_01.c
5443  */
5444
5445 /**
5446  * @page tutorial_check Check example
5447  * @dontinclude check_example_01.c
5448  *
5449  * This example will show 2 checkboxes, one with just a label and the second
5450  * one with both a label and an icon. This example also ilustrates how to
5451  * have the checkbox change the value of a variable and how to react to those
5452  * changes.
5453  *
5454  * We will start with the usual setup code:
5455  * @until show(bg)
5456  *
5457  * And now we create our first checkbox, set its label, tell it to change
5458  * the value of @p value when the checkbox stats is changed and ask to be
5459  * notified of state changes:
5460  * @until show
5461  *
5462  * For our second checkbox we are going to set an icon so we need to create
5463  * and icon:
5464  * @until show
5465  * @note For simplicity we are using a rectangle as icon, but any evas object
5466  * can be used.
5467  *
5468  * And for our second checkbox we set the label, icon and state to true:
5469  * @until show
5470  *
5471  * We now do some more setup:
5472  * @until ELM_MAIN
5473  *
5474  * And finally implement the callback that will be called when the first
5475  * checkbox's state changes. This callback will use @p data to print a
5476  * message:
5477  * @until }
5478  * @note This work because @p data is @p value(from the main function) and @p
5479  * value is changed when the checkbox is changed.
5480  *
5481  * Our example will look like this:
5482  *
5483  * @image html screenshots/check_example_01.png
5484  * @image latex screenshots/check_example_01.eps width=\textwidth
5485  *
5486  * @example check_example_01.c
5487  */
5488
5489 /**
5490  * @page tutorial_colorselector Color selector example
5491  * @dontinclude colorselector_example_01.c
5492  *
5493  * This example shows how to change the color of a rectangle using a color
5494  * selector. We aren't going to explain a lot of the code since it's the
5495  * usual setup code:
5496  * @until show(rect)
5497  *
5498  * Now that we have a window with background and a rectangle we can create
5499  * our color_selector and set it's initial color to fully opaque blue:
5500  * @until show
5501  *
5502  * Next we tell ask to be notified whenever the color changes:
5503  * @until changed
5504  *
5505  * We follow that we some more run of the mill setup code:
5506  * @until ELM_MAIN()
5507  *
5508  * And now get to the callback that sets the color of the rectangle:
5509  * @until }
5510  *
5511  * This example will look like this:
5512  *
5513  * @image html screenshots/colorselector_example_01.png
5514  * @image latex screenshots/colorselector_example_01.eps width=\textwidth
5515  *
5516  * @example colorselector_example_01.c
5517  */
5518
5519 /**
5520  * @page slideshow_example Slideshow widget example
5521  *
5522  * This application is aimed to exemplify the slideshow widget. It
5523  * consists of a window with a slideshow widget set as "resize
5524  * object", along with a control bar, in the form of a notify. Those
5525  * controls will exercise most of the slideshow's API functions.
5526  *
5527  * We create the slideshow, itself, first, making it @b loop on its
5528  * image itens, when in slideshow mode:
5529  * @dontinclude slideshow_example.c
5530  * @skip slideshow = elm_slideshow_add
5531  * @until evas_object_show
5532  *
5533  * Next, we define the <b>item class</b> for our slideshow
5534  * items. Slideshow images are going to be Elementary @ref Photo "photo"
5535  * widgets, here, as pointed by our @c get class
5536  * function. We'll let the Elementary infrastructure to delete those
5537  * objects for us, and, as there's no additional data attached to our
5538  * slideshow items, the @c del class function can be left undefined:
5539  * @dontinclude slideshow_example.c
5540  * @skip itc
5541  * @until ;
5542  * @dontinclude slideshow_example.c
5543  * @skip itc.func
5544  * @until = NULL
5545  * @dontinclude slideshow_example.c
5546  * @skip get our images to make slideshow items
5547  * @until }
5548  *
5549  * We now get to populate the slideshow widget with items. Our images
5550  * are going to be some randomly chosen from the Elementary package,
5551  * nine of them. For the first eight, we insert them ordered in the
5552  * widget, by using elm_slideshow_item_sorted_insert(). The comparing
5553  * function will use the image names to sort items. The last item is
5554  * inserted at the end of the slideshow's items list, with
5555  * elm_slideshow_item_add(). We check out how that list ends with
5556  * elm_slideshow_items_get(), than:
5557  * @dontinclude slideshow_example.c
5558  * @skip static const char *img
5559  * @until _2
5560  * @dontinclude slideshow_example.c
5561  * @skip first =
5562  * @until data_get
5563  *
5564  * Note that we save the pointers to the first and last items in the
5565  * slideshow, for future use.
5566  *
5567  * What follows is the code creating a notify, to be shown over the
5568  * slideshow's viewport, with knobs to act on it. We're not showing
5569  * that boilerplate code, but only the callbacks attached to the
5570  * interesting smart events of those knobs. The first four are
5571  * buttons, which will:
5572  * - Select the @b next item in the slideshow
5573  * - Select the @b previous item in the slideshow
5574  * - Select the @b first item in the slideshow
5575  * - Select the @b last item in the slideshow
5576  *
5577  * Check out the code for those four actions, being the two last @c
5578  * data pointers the same @c first and @c last pointers we save
5579  * before, respectively:
5580  * @dontinclude slideshow_example.c
5581  * @skip jump to next
5582  * @until }
5583  * @until }
5584  * @until }
5585  * @until }
5586  *
5587  * What follow are two hoversels, meant for one to change the
5588  * slideshow's @b transition and @b layout styles, respectively. We
5589  * fetch all the available transition and layout names to populate
5590  * those widgets and, when one selects any of them, we apply the
5591  * corresponding setters on the slideshow:
5592  * @dontinclude slideshow_example.c
5593  * @skip hv = elm_hoversel_add
5594  * @until show(hv)
5595  * @until show(hv)
5596  * @dontinclude slideshow_example.c
5597  * @skip transition changed
5598  * @until }
5599  * @until }
5600  *
5601  * For one to change the transition @b time on the slideshow widget,
5602  * we use a spinner widget. We set it to the initial value of 3
5603  * (seconds), which will be probed by the next knob -- a button
5604  * starting the slideshow, de facto. Note that changing the transition
5605  * time while a slideshow is already happening will ajust its
5606  * transition time:
5607  * @dontinclude slideshow_example.c
5608  * @skip spin = elm_spinner_add
5609  * @until evas_object_show
5610  * @dontinclude slideshow_example.c
5611  * @skip slideshow transition time has
5612  * @until }
5613  *
5614  * Finally, we have two buttons which will, respectively, start and
5615  * stop the slideshow on our widget. Here are their "clicked"
5616  * callbacks:
5617  * @dontinclude slideshow_example.c
5618  * @skip start the show
5619  * @until }
5620  * @until }
5621  *
5622  * This is how the example program's window looks like:
5623  * @image html screenshots/slideshow_example.png
5624  * @image latex screenshots/slideshow_example.eps width=\textwidth
5625  *
5626  * See the full @ref slideshow_example_c "source code" for
5627  * this example.
5628  *
5629  * @example slideshow_example.c
5630  */
5631
5632 /**
5633  * @page tutorial_photocam Photocam example
5634  * @dontinclude photocam_example_01.c
5635  *
5636  * In this example we will have a photocam and a couple of buttons and slider to
5637  * control the photocam. To avoid cluttering we'll only show the parts of the
5638  * example that relate to the photocam, the full source code can be seen @ref
5639  * photocam_example_01.c "here".
5640  *
5641  * Creating a photocam is as easy as creating any other widget:
5642  * @skipline elm_photocam_add
5643  *
5644  * A photocam is only useful if we have a image on it, so lets set a file for it
5645  * to work with:
5646  * @until file_set
5647  *
5648  * We now set the photocam to not bounce horizontally:
5649  * @until bounce_set
5650  *
5651  * And we want to know when the photocam has finished loading the image so:
5652  * @until smart_callback
5653  *
5654  * The reason to know when the image is loaded is so that we can bring the
5655  * center of the image into view:
5656  * @skip static
5657  * @until }
5658  *
5659  * As mentioned we have 2 buttons in this example, the "Fit" one will cause
5660  * the photocam to go in to a zoom mode that makes the image fit inside the
5661  * photocam. Tough this has no effect on the image we also print what region was
5662  * being viewed before setting the zoom mode:
5663  * @until }
5664  * @note When in fit mode our slider(explained below) won't work.
5665  *
5666  * The second button("Unfit") will bring the photocam back into manual zoom
5667  * mode:
5668  * @until }
5669  *
5670  * Our slider controls the level of zoom of the photocam:
5671  * @until }
5672  * @note It is important to note that this only works when in manual zoom mode.
5673  *
5674  * Our example will initially look like this:
5675  *
5676  * @image html screenshots/photocam_example_01.png
5677  * @image latex screenshots/photocam_example_01.eps width=\textwidth
5678  *
5679  * @example photocam_example_01.c
5680  */
5681
5682 /**
5683  * @page inwin_example_01 Inwin - General overview
5684  *
5685  * Inwin is a very simple widget to show, so this example will be a very simple
5686  * one, just using all of the available API.
5687  *
5688  * The program is nothing but a window with a lonely button, as shown here.
5689  *
5690  * @image html screenshots/inwin_example.png
5691  * @image latex screenshots/inwin_example.eps width=\textwidth
5692  *
5693  * And pressing the button makes an inwin appear.
5694  *
5695  * @image html screenshots/inwin_example_a.png
5696  * @image latex screenshots/inwin_example_a.eps width=\textwidth
5697  *
5698  * And the code is just as simple. We being with some global variables to keep
5699  * track of our Inwin.
5700  * @dontinclude inwin_example.c
5701  * @skip static
5702  * @until current_style
5703  *
5704  * And two callbacks used by the buttons the above screenshot showed. In these,
5705  * we check if @c inwin exists and execute the proper action on it. If it's not
5706  * there anymore, then we were abandoned to our luck, so we disabled ourselves.
5707  * @until _inwin_destroy
5708  * @until }
5709  * @until }
5710  *
5711  * The lonely button from the beginning, when clicked, will call the following
5712  * function, which begins by checking if an inwin exists, and if it's there,
5713  * we bring it back to the front and exit from our function without any further
5714  * ado.
5715  * @until }
5716  *
5717  * But if no inwin is there to show, we need to create one. First we need the
5718  * top-most window for the program, as no inwin can be created using other
5719  * objects as parents. Then we create our popup, set the next style in the list
5720  * and show it.
5721  * @until current_style =
5722  *
5723  * As for the content of our inwin, it's just a box with a label and some
5724  * buttons inside.
5725  * @until _inwin_destroy
5726  * @until }
5727  *
5728  * Now, all the code above shows how every object must always be set as content
5729  * for some other object, be it by setting the full content, packing it in a
5730  * box or table or working as icon for some other widget. But we didn't do
5731  * anything like that for the inwin, this one is just created and shown and
5732  * everything works. Other widgets can be used this way, but they would need
5733  * to be placed and resized manually or nothing would be shown correctly. The
5734  * inwin, however, sets itself as a children of the top-level window and will
5735  * be resized as the parent window changes too.
5736  *
5737  * Another characteristic of Inwin is that when it's shown above everyone else,
5738  * it will work kind of like a modal window, blocking any other widget from
5739  * receiving events until the window is manually dismissed by pressing some
5740  * button to close it or having blocking task signalling its completion so
5741  * normal operations can be resumed. This is unlike the @ref Hover widget,
5742  * that would show its content on top of the designated target, but clicking
5743  * anywhere else would dismiss it automatically.
5744  *
5745  * To illustrate that last point, when we close the main window and an inwin
5746  * is still there, we'll take out the content from the inwin and place it in
5747  * a hover.
5748  * @until }
5749  * @until }
5750  *
5751  * And the rest of the program doesn't have anything else related to inwin,
5752  * so it won't be shown here, but you can find it in
5753  * @ref inwin_example.c "inwin_example.c".
5754  *
5755  * @example inwin_example.c
5756  */
5757
5758 /**
5759  * @page tutorial_scroller Scroller example
5760  * @dontinclude scroller_example_01.c
5761  *
5762  * This example is very short and will illustrate one way to use a scroller.
5763  * We'll omit the declaration of the @p text variable because it's a very long
5764  * @htmlonly<a href="http://lipsum.com/">@endhtmlonly ipsum lorem
5765  * @htmlonly</a>@endhtmlonly. If you really want to see the full code, it's @ref
5766  * scroller_example_01.c "scroller_example_01.c".
5767  *
5768  * We start our example by creating our window and background:
5769  * @skip EAPI
5770  * @until show(bg)
5771  *
5772  * Next we create a label and set it's text to @p text(very long ipsum lorem):
5773  * @until show(label)
5774  *
5775  * We then create our scroller, ask that it have the same size as the window and
5776  * set its content:
5777  * @until content_set
5778  *
5779  * We are now going to set a number of properties in our scroller:
5780  * @li We make it bounce horizontally but not vertically.
5781  * @li We make both scrollbars always be visible.
5782  * @li We have the events be propagated from the content to the scroller.
5783  * @li We enforce a page policy vertically(having a page be the size of the
5784  * viewport) and leave horizontal scrolling free.
5785  * @li And finally we ask the scroller to show us a region starting at 50,50 and
5786  * having a width and height of 200px.
5787  * @until region_show
5788  * @note Observant reader will note that the elm_scroller_region_show() didn't
5789  * scroll the view vertically, this is because we told the scroller to only
5790  * accept vertical scrolling in pages.
5791  *
5792  * And now we're done:
5793  * @until ELM_MAIN
5794  *
5795  * Our example will look like this:
5796  *
5797  * @image html screenshots/scroller_example_01.png
5798  * @image latex screenshots/scroller_example_01.eps width=\textwidth
5799  *
5800  * @example scroller_example_01.c
5801  */
5802
5803 /**
5804  * @page tutorial_table_01
5805  *
5806  * In this example we add four labels to a homogeneous table that has a padding
5807  * of 5px between cells.
5808  *
5809  * The interesting bits from this example are:
5810  * @li Where we set the table as homogeneous and the padding:
5811  * @dontinclude table_example_01.c
5812  * @skip padding_set
5813  * @until homogeneous_set
5814  * @li Where we add each label to the table:
5815  * @skipline elm_table_pack
5816  * @skipline elm_table_pack
5817  * @skipline elm_table_pack
5818  * @skipline elm_table_pack
5819  *
5820  * Here you can see the full source:
5821  * @include table_example_01.c
5822  *
5823  * Our example will look like this:
5824  *
5825  * @image html screenshots/table_example_01.png
5826  * @image latex screenshots/table_example_01.eps width=\textwidth
5827  *
5828  * @example table_example_01.c
5829  */
5830
5831 /**
5832  * @page tutorial_table_02
5833  *
5834  * For our second example we'll create a table with 4 rectangles in it. Since
5835  * our rectangles are of different sizes our table won't be homogeneous.
5836  *
5837  * The interesting bits from this example are:
5838  * @li Where we set the table as not homogeneous:
5839  * @dontinclude table_example_02.c
5840  * @skipline homogeneous_set
5841  * @li Where we add each rectangle to the table:
5842  * @skipline elm_table_pack
5843  * @skipline elm_table_pack
5844  * @skipline elm_table_pack
5845  * @skipline elm_table_pack
5846  *
5847  * Here you can see the full source:
5848  * @include table_example_02.c
5849  *
5850  * Our example will look like this:
5851  *
5852  * @image html screenshots/table_example_02.png
5853  * @image latex screenshots/table_example_02.eps width=\textwidth
5854  *
5855  * @example table_example_02.c
5856  */
5857
5858 /**
5859  * @page tutorial_menu Menu Example
5860  * @dontinclude menu_example_01.c
5861  *
5862  * This example shows how to create a menu with regular items, object items,
5863  * submenus and how to delete items from a menu. The full source for this
5864  * example is @ref menu_example_01.c "menu_example_01.c".
5865  *
5866  * We'll start looking at the menu creation and how to create a very simple
5867  * item:
5868  * @skip menu_add
5869  * @until item_add
5870  *
5871  * For our next item we are going to add an icon:
5872  * @until item_add
5873  *
5874  * Now we are going to add more items, but these icons are going to have a
5875  * parent, which will put them in a sub-menu. First just another item with an
5876  * icon:
5877  * @until item_add
5878  *
5879  * Next we are going to add a button to our menu(any elm widget can be added to
5880  * a menu):
5881  * @until item_add
5882  *
5883  * We are also going to have the button delete the first item of our
5884  * sub-menu when clicked:
5885  * @until smart_callback
5886  * @dontinclude menu_example_01.c
5887  * @skip static
5888  * @until }
5889  *
5890  * We now add a separator and three more regular items:
5891  * @until item_add
5892  * @until item_add
5893  * @until item_add
5894  *
5895  * We now add another item, however this time it won't go the sub-menu and it'll
5896  * be disabled:
5897  * @until disabled_set
5898  *
5899  * To make sure that our menu is shown whenever the window is clicked(and where
5900  * clicked) we use the following callback:
5901  * @dontinclude menu_example_01.c
5902  * @skip static
5903  * @skipline static
5904  * @until }
5905  *
5906  * Our example will look like this:
5907  *
5908  * @image html screenshots/menu_example_01.png
5909  * @image latex screenshots/menu_example_01.eps width=\textwidth
5910  *
5911  * @example menu_example_01.c
5912  */
5913
5914 /**
5915  * @page win_example_01 Win - General API overview
5916  *
5917  * For most users of the Elementary API, the @ref Win widget has a lot more
5918  * functions than what they need.
5919  *
5920  * In general, a developer will create a window, set some content on it and
5921  * forget about it for the rest of its program's life, letting whatever
5922  * Window Manager is there to handle the window. Here, however, we are going
5923  * to show how to generally manage a window.
5924  *
5925  * We'll have a bit more than the usual includes here, since part of the
5926  * example requires some low level fiddling.
5927  * @dontinclude win_example.c
5928  * @skip Elementary.h
5929  * @until Ecore_X.h
5930  *
5931  * The program then, consists of one window with two lists of buttons, each
5932  * of which operates on another two windows. One of them is a normal window,
5933  * the other has the @c override flag set so the Window Manager ignores it.
5934  *
5935  * Pressing each button will call the corresponding function to act on the
5936  * corresponding window. These are pretty self explanatory, so we'll show
5937  * them in one batch.
5938  * @skip static void
5939  * @until elm_win_sticky_set
5940  * @until }
5941  *
5942  * Next, we handle the main window closing. We have a @c "delete,request"
5943  * callback set to ask if really want to quit. If so, we end the main loop,
5944  * otherwise just delete the popup message and continue running normally.
5945  * @until _no_quit_cb
5946  * @until _no_quit_cb
5947  * @until }
5948  *
5949  * The non-managed window, being completely ignored by the Window Manager,
5950  * is likely to never receive keyboard focus, even if we click on its entry
5951  * to write something. So we have a button on it that will forcefully focus
5952  * it by using some lower level functions to act directly on the X window.
5953  * Then, each time one of the window is focused, we print some message on a
5954  * console to show this more clearly.
5955  * @until _win_focused_cb
5956  * @until }
5957  *
5958  * And to finalize, the main function creates a window to hold all the action
5959  * buttons and another two to show how (and what) works on each of them.
5960  *
5961  * First, the main window will be a normal window, we'll enable the focus
5962  * highlight regardless of how it is configured so it's easier to navigate
5963  * the window with the keyboard. Then we hook our focus and delete callbacks
5964  * and set up the rest of the window's content.
5965  * @until evas_object_show(box)
5966  *
5967  * The first of our sub-windows is the managed one. We'll create it as a
5968  * dialog, which should make the Window Manager treat it as a non-resizable
5969  * window. We are also setting the window to be auto-deleted when the close
5970  * button in the titlebar is pressed.
5971  * @until evas_object_show(o)
5972  *
5973  * Now, we added an icon to the window as a resize object. We also set this
5974  * icon to not scale, and no weight size hints have been set for it. This way,
5975  * even if we hadn't created the window as a dialog, it would still not be
5976  * resizable. The window size is defined by its content, so it would never be
5977  * smaller than the smallest of its resize objects, and for it to be resizable,
5978  * all of those objects have to allow it.
5979  *
5980  * Next, we add the buttons with the actions to perform on this window. Using
5981  * a macro saves us typing and makes the world a happier place.
5982  * @until WIN_ACTION(sticky)
5983  *
5984  * The maximize one is likely to not work, because the Window Manager will
5985  * probably not enforce it upon a window that states its maximum size, much
5986  * less a dialog. But that can be changed by editting the example to use
5987  * #ELM_WIN_BASIC when creating the window and adding the following line to
5988  * the icon set as content
5989  * @code
5990  * evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
5991  * @endcode
5992  *
5993  * Lastly, the second sub-window will have it's override flag set. In it we
5994  * have a label with some text, and entry and a button. The entry can be
5995  * clicked normally to set focus on it, but whether it actually gets keyboard
5996  * input will also depend on the window getting focus, and since the window
5997  * is an override one, it will probably not gain it by normal means. The
5998  * button is there to force the focus at the X level to go to our window.
5999  * And to finish, another list of buttons with actions to perform on this
6000  * last window. Remember that most of them are requests or hints for the
6001  * Window Manager, so they are likely to do nothing on this window.
6002  * Similarly, there won't be any way to move it or resize it, because we
6003  * haven't implemented that kind of control on this example and that's
6004  * something controlled by Window Managers on windows they are tracking, which
6005  * is not the case with this one.
6006  * @until ELM_MAIN
6007  *
6008  * The full code listing of this example can be found at
6009  * @ref win_example.c "win_example.c".
6010  *
6011  * @example win_example.c
6012  */
6013
6014 /**
6015  * @page bg_example_01_c bg_example_01.c
6016  * @include bg_example_01.c
6017  * @example bg_example_01.c
6018  */
6019
6020 /**
6021  * @page bg_example_02_c bg_example_02.c
6022  * @include bg_example_02.c
6023  * @example bg_example_02.c
6024  */
6025
6026 /**
6027  * @page bg_example_03_c bg_example_03.c
6028  * @include bg_example_03.c
6029  * @example bg_example_03.c
6030  */
6031
6032 /**
6033  * @page actionslider_example_01 Actionslider example
6034  * @include actionslider_example_01.c
6035  * @example actionslider_example_01.c
6036  */
6037
6038 /**
6039  * @page animator_example_01_c Animator example 01
6040  * @include animator_example_01.c
6041  * @example animator_example_01.c
6042  */
6043
6044 /**
6045  * @page transit_example_01_c Transit example 1
6046  * @include transit_example_01.c
6047  * @example transit_example_01.c
6048  */
6049
6050 /**
6051  * @page transit_example_02_c Transit example 2
6052  * @include transit_example_02.c
6053  * @example transit_example_02.c
6054  */
6055
6056 /**
6057  * @page general_functions_example_c General (top-level) functions example
6058  * @include general_funcs_example.c
6059  * @example general_funcs_example.c
6060  */
6061
6062 /**
6063  * @page clock_example_c Clock example
6064  * @include clock_example.c
6065  * @example clock_example.c
6066  */
6067
6068 /**
6069  * @page flipselector_example_c Flipselector example
6070  * @include flipselector_example.c
6071  * @example flipselector_example.c
6072  */
6073
6074 /**
6075  * @page fileselector_example_c Fileselector example
6076  * @include fileselector_example.c
6077  * @example fileselector_example.c
6078  */
6079
6080 /**
6081  * @page fileselector_button_example_c Fileselector button example
6082  * @include fileselector_button_example.c
6083  * @example fileselector_button_example.c
6084  */
6085
6086 /**
6087  * @page fileselector_entry_example_c Fileselector entry example
6088  * @include fileselector_entry_example.c
6089  * @example fileselector_entry_example.c
6090  */
6091
6092 /**
6093  * @page index_example_01_c Index example
6094  * @include index_example_01.c
6095  * @example index_example_01.c
6096  */
6097
6098 /**
6099  * @page index_example_02_c Index example
6100  * @include index_example_02.c
6101  * @example index_example_02.c
6102  */
6103
6104 /**
6105  * @page layout_example_01_c layout_example_01.c
6106  * @include layout_example_01.c
6107  * @example layout_example_01.c
6108  */
6109
6110 /**
6111  * @page layout_example_02_c layout_example_02.c
6112  * @include layout_example_02.c
6113  * @example layout_example_02.c
6114  */
6115
6116 /**
6117  * @page layout_example_03_c layout_example_03.c
6118  * @include layout_example_03.c
6119  * @example layout_example_03.c
6120  */
6121
6122 /**
6123  * @page layout_example_edc An example of layout theme file
6124  *
6125  * This theme file contains two groups. Each of them is a different theme, and
6126  * can be used by an Elementary Layout widget. A theme can be used more than
6127  * once by many different Elementary Layout widgets too.
6128  *
6129  * @include layout_example.edc
6130  * @example layout_example.edc
6131  */
6132
6133 /**
6134  * @page gengrid_example_c Gengrid example
6135  * @include gengrid_example.c
6136  * @example gengrid_example.c
6137  */
6138
6139 /**
6140  * @page genlist_example_01_c genlist_example_01.c
6141  * @include genlist_example_01.c
6142  * @example genlist_example_01.c
6143  */
6144
6145 /**
6146  * @page genlist_example_02_c genlist_example_02.c
6147  * @include genlist_example_02.c
6148  * @example genlist_example_02.c
6149  */
6150
6151 /**
6152  * @page genlist_example_04_c genlist_example_04.c
6153  * @include genlist_example_04.c
6154  * @example genlist_example_04.c
6155  */
6156
6157 /**
6158  * @page genlist_example_05_c genlist_example_05.c
6159  * @include genlist_example_05.c
6160  * @example genlist_example_05.c
6161  */
6162
6163 /**
6164  * @page thumb_example_01_c thumb_example_01.c
6165  * @include thumb_example_01.c
6166  * @example thumb_example_01.c
6167  */
6168
6169 /**
6170  * @page progressbar_example_c Progress bar example
6171  * @include progressbar_example.c
6172  * @example progressbar_example.c
6173  */
6174
6175 /**
6176  * @page slideshow_example_c Slideshow example
6177  * @include slideshow_example.c
6178  * @example slideshow_example.c
6179  */