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