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