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