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