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