elementary/image - Improve documentation and add an example.
[framework/uifw/elementary.git] / doc / examples.dox
1 /**
2  * @page Examples Examples
3  *
4  * Here is a page with Elementary examples.
5  *
6  * @ref bg_01_example_page
7  *
8  * @ref bg_02_example_page
9  *
10  * @ref bg_03_example_page
11  *
12  * @ref actionslider_example_page
13  *
14  * @ref elm_animator_example_page_01
15  *
16  * @ref transit_example_01_explained
17  *
18  * @ref transit_example_02_explained
19  *
20  * @ref general_functions_example_page
21  *
22  * @ref calendar_example_01
23  *
24  * @ref calendar_example_02
25  *
26  * @ref calendar_example_03
27  *
28  * @ref calendar_example_04
29  *
30  * @ref calendar_example_05
31  *
32  * @ref calendar_example_06
33  *
34  * @ref clock_example
35  *
36  * @ref flipselector_example
37  */
38
39 /**
40  * @page bg_01_example_page elm_bg - Plain color background.
41  * @dontinclude bg_example_01.c
42  *
43  * The full code for this example can be found at @ref bg_example_01_c,
44  * in the function @c test_bg_plain. It's part of the @c elementar_test
45  * suite, and thus has the code for the three examples referenced by this
46  * documentation.
47  *
48  * This first example just sets a default background with a plain color. The
49  * first part consists of creating an Elementary window. It's the common
50  * piece of code that you'll see everywhere in Elementary: @skip elm_main
51  * @until autodel_set
52  *
53  * Now we really create our background object, using the window object as
54  * its parent:
55  *
56  * @skipline bg_add
57  *
58  * Then we set the size hints of the background object so that it will use
59  * all space available for it, and then add it as a resize object to the
60  * window, making it visible in the end:
61  *
62  * @skip size_hint_weight_set
63  * @until resize_object_add
64  *
65  * See @ref evas_object_size_hint_weight_set and elm_win_resize_object_add()
66  * for more detailed info about these functions.
67  *
68  * The end of the example is quite simple, just setting the minimum and
69  * maximum size of the background, so the Elementary window knows that it
70  * has to have at least the minimum size. The background also won't scale to
71  * a size above its maximum. Then we resize the window and show it in the
72  * end:
73  *
74  * @skip set size hints
75  * @until }
76  *
77  * And here we finish our very simple background object usage example.
78  */
79
80 /**
81  * @page bg_02_example_page elm_bg - Image background.
82  * @dontinclude bg_example_02.c
83  *
84  * The full code for this example can be found at @ref bg_example_02_c,
85  * in the function @c test_bg_image. It's part of the @c elementar_test
86  * suite, and thus has the code for the three examples referenced by this
87  * documentation.
88  *
89  * This is the second example, and shows how to use the Elementary
90  * background object to set an image as background of your application.
91  *
92  * We start this example exactly in the same way as the previous one, even
93  * when creating the background object:
94  *
95  * @skip elm_main
96  * @until bg_add
97  *
98  * Now it's the different part.
99  *
100  * Our background will have an image, that will be displayed over the
101  * background color. Before loading the image, we set the load size of the
102  * image. The load size is a hint about the size that we want the image
103  * displayed in the screen. It's not the exact size that the image will have,
104  * but usually a bit bigger. The background object can still be scaled to a
105  * size bigger than the one set here. Setting the image load size to
106  * something smaller than its real size will reduce the memory used to keep
107  * the pixmap representation of the image, and the time to load it. Here we
108  * set the load size to 20x20 pixels, but the image is loaded with a size
109  * bigger than that (since it's just a hint):
110  *
111  * @skipline load_size_set
112  *
113  * And set our background image to be centered, instead of stretched or
114  * scaled, so the effect of the elm_bg_load_size_set() can be easily
115  * understood:
116  *
117  * @skipline option_set
118  *
119  * We need a filename to set, so we get one from the previous installed
120  * images in the @c PACKAGE_DATA_DIR, and write its full path to a buffer.
121  * Then we use this buffer to set the filename in the background object:
122  *
123  * @skip snprintf
124  * @until bg_file_set
125  *
126  * Notice that the third argument of the elm_bg_file_set() function is @c
127  * NULL, since we are setting an image to this background. This function
128  * also supports setting an edje group as background, in which case the @c
129  * group parameter wouldn't be @c NULL, but be the name of the group
130  * instead.
131  *
132  * Finally, we can set the size hints, add the background as a resize
133  * object, and resize the window, exactly the same thing we do in the @ref
134  * bg_01_example_page example:
135  *
136  * @skip size_hint
137  * @until }
138  *
139  * And this is the end of this example.
140  *
141  * This example will look like this:
142  * @image html screenshots/bg_01.png
143  * @image latex screenshots/bg_01.eps
144  */
145
146 /**
147  * @page bg_03_example_page elm_bg - Background properties.
148  * @dontinclude bg_example_03.c
149  *
150  * The full code for this example can be found at @ref bg_example_03_c, in the
151  * function @c test_bg_options, with the callbacks @c _cb_overlay_changed, @c
152  * _cb_color_changed and @c _cb_radio_changed defined in the beginning of the
153  * file. It's part of the @c elementar_test suite, and thus has the code for
154  * the three examples referenced by this documentation.
155  *
156  * This example will show the properties available for the background object,
157  * and will use of some more widgets to set them.
158  *
159  * In order to do this, we will set some callbacks for these widgets. The
160  * first is for the radio buttons that will be used to choose the option
161  * passed as argument to elm_bg_option_set():
162  *
163  * @skip _cb_radio_changed
164  * @until }
165  *
166  * The next callback will be used when setting the overlay (using
167  * elm_bg_overlay_set()):
168  *
169  * @skip _cb_overlay_changed
170  * @until }
171  * @until }
172  *
173  * And the last one, used to set the color (with elm_bg_color_set()):
174  *
175  * @skip _cb_color_changed
176  * @until }
177  *
178  * We will get back to what these functions do soon. If you want to know more
179  * about how to set these callbacks and what these widgets are, look for:
180  * @li elm_radio_add()
181  * @li elm_check_add()
182  * @li elm_spinner_add()
183  *
184  * Now going to the main function, @c test_bg_options, we have the common
185  * code with the other examples:
186  *
187  * @skip bg-options
188  * @until autodel_set
189  *
190  * We add a plain background to this window, so it will have the default
191  * background color behind everything:
192  *
193  * @skip bg = elm_bg_add
194  * @until evas_object_show(bg)
195  *
196  * Then we add a vertical box (elm_box_add()) that will hold the background
197  * object that we are going to play with, as well as a horizontal box that
198  * will hold widgets:
199  *
200  * @skip elm_box_add
201  * @until evas_object_show
202  *
203  * Now we add the background object that is going to be of use for our
204  * example. It is an image background, as used in @ref bg_02_example_page ,
205  * so the code should be familiar:
206  *
207  * @skip elm_bg_add
208  * @until evas_object_show
209  *
210  * Notice the call to elm_box_pack_end(): it will pack the background object
211  * in the end of the Elementary box declared above. Just refer to that
212  * documentation for more info.
213  *
214  * Since this Elementary background is already an image background, we are
215  * going to play with its other properties. We will change its option
216  * (CENTER, SCALE, STRETCH, TILE), its color (RGB), and add an overlay to it.
217  * For all of these properties, we are going to add widgets that will
218  * configure them.
219  *
220  * First, lets add the horizontal box that will hold these widgets:
221  * @skip hbox
222  * @until align_set
223  *
224  * For now, just consider this @c hbox as a rectangle that will contain the
225  * widgets, and will distribute them horizontally inside its content. Then we
226  * add radio buttons that will allow us to choose the property to use with
227  * this background:
228  *
229  * @skip radio_add
230  * @until evas_object_show
231  *
232  * Again, I won't give details about the use of these widgets, just look for
233  * their documentation if necessary. It's enough to know for now that we are
234  * packing them in the @c hbox, setting a label for them, and the most
235  * important parts: setting its value to @c ELM_BG_OPTION_CENTER and its
236  * callback to @c _cb_radio_changed (the function defined in the beginning of
237  * this example). We do this for the next 3 radio buttons added after this
238  * one, each of them with a different value.
239  *
240  * Now taking a look at the code of the callback @c _cb_radio_changed again,
241  * it will call elm_bg_option_set() with the value set from the checked radio
242  * button, thus setting the option for this background. The background is
243  * passed as argument to the @p data parameter of this callback, and is
244  * referenced here as @c o_bg.
245  *
246  * Later we set the default value for this radio button:
247  *
248  * @skipline elm_radio_value_set
249  *
250  * Then we add a checkbox for the elm_bg_overlay_set() function:
251  *
252  * @skip check_add
253  * @until evas_object_show
254  *
255  * Now look at the code of the @c _cb_overlay_changed again. If the checkbox
256  * state is checked, an overlay will be added to the background. It's done by
257  * creating an Edje object, and setting it with elm_bg_overlay_set() to the
258  * background object. For information about what are and how to set Edje
259  * object, look at the Edje documentation.
260  *
261  * Finally we add a spinner object (elm_spinner_add()) to be used to select
262  * the color of our background. In its callback it's possible to see the call
263  * to elm_bg_color_set(), which will change the color of this background.
264  * This color is used by the background to fill areas where the image doesn't
265  * cover (in this case, where we have an image background). The spinner is
266  * also packed into the @c hbox :
267  *
268  * @skip elm_spinner_add
269  * @until evas_object_show
270  *
271  * Then we just have to pack the @c hbox inside the @c box, set some size
272  * hints, and show our window:
273  *
274  * @skip pack_end
275  * @until }
276  *
277  * Now to see this code in action, open elementary_test, and go to the "Bg
278  * Options" test. It should demonstrate what was implemented here.
279  */
280
281 /**
282  * @page actionslider_example_page Actionslider usage
283  * @dontinclude actionslider_example_01.c
284  *
285  * For this example we are going to assume knowledge of evas smart callbacks
286  * and some basic evas object functions. Elementary is not meant to be used
287  * without evas, if you're not yet familiar with evas it probably is worth
288  * checking that out.
289  *
290  * And now to the example, when using Elementary we start by including
291  * Elementary.h:
292  * @skipline #include
293  *
294  * Next we define some callbacks, they all share the same signature because
295  * they are all to be used with evas_object_smart_callback_add().
296  * The first one just prints the selected label(in two different ways):
297  * @until }
298  *
299  * This next callback is a little more interesting, it makes the selected
300  * label magnetic(except if it's the center label):
301  * @until }
302  *
303  * This callback enables or disables the magnetic propertty of the center
304  * label:
305  * @until }
306  *
307  * And finally a callback to stop the main loop when the window is closed:
308  * @until }
309  *
310  * To be able to create our actionsliders we need to do some setup, but this
311  * isn't really relevant here, so if you want to know about that go @ref
312  * Win "here".
313  *
314  * With all that boring stuff out of the way we can proceed to creating some
315  * actionsliders.@n
316  * All actionsliders are created the same way:
317  * @skipline actionslider_add
318  * Next we must choose where the indicator starts, and for this one we choose
319  * the right, and set the right as magnetic:
320  * @skipline indicator_pos_set
321  * @until magnet_pos_set
322  *
323  * We then set the labels for the left and right, passing NULL as an argument
324  * to any of the labels makes that position have no label.
325  * @until Stop
326  *
327  * Furthermore we mark both left and right as enabled positions, if we didn't
328  * do this all three positions would be enabled:
329  * @until RIGHT
330  *
331  * Having the the enabled positions we now add a smart callback to change
332  * which position is magnetic, so that only the last selected position is
333  * magnetic:
334  * @until NULL
335  *
336  * And finally we set our printing callback and show the actionslider:
337  * @until object_show
338  * @skip pack_end
339  *
340  * For our next actionslider we are going to do much as we did for the
341  * previous except we are going to have the center as the magnet(and not
342  * change it):
343  * @skipline actionslider_add
344  * @skipline indicator_pos_set
345  * @until object_show
346  *
347  * And another actionslider, in this one the indicator starts on the left.
348  * It has labels only in the center and right, and both bositions are
349  * magnetic. Because the left doesn't have a label and is not magnetic once
350  * the indicator leaves it can't return:
351  * @skipline actionslider_add
352  * @skipline indicator_pos_set
353  * @until object_show
354  * @note The greyed out area is a @ref Styles "style".
355  *
356  * And now an actionslider with a label in the indicator, and whose magnet
357  * properties change based on what was last selected:
358  * @skipline actionslider_add
359  * @skipline indicator_pos_set
360  * @until object_show
361  * @note The greyed out area is a @ref Styles "style".
362  *
363  * We are almost done, this next one is just an actionslider with all
364  * positions magnetized and having every possible label:
365  * @skipline actionslider_add
366  * @skipline indicator_pos_set
367  * @until object_show
368  *
369  * And for our last actionslider we have one that turns the magnetic property
370  * on and off:
371  * @skipline actionslider_add
372  * @skipline indicator_pos_set
373  * @until object_show
374  *
375  * The example will look like this:
376  * @image html screenshots/actionslider_01.png
377  * @image latex screenshots/actionslider_01.eps
378  *
379  * See the full source code @ref actionslider_example_01 "here"
380  */
381
382 /**
383  * @page elm_animator_example_page_01 Animator usage
384  * @dontinclude animator_example_01.c
385  *
386  * For this example we will be using a bit of evas, you could animate a
387  * elementary widget in much the same way, but to keep things simple we use
388  * an evas_object_rectangle.
389  *
390  * As every other example we start with our include and a simple callback to
391  * exit the app when the window is closed:
392  * @skipline #include
393  * @until }
394  *
395  * This next callback is the one that actually creates our animation, it
396  * changes the size, position and color of a rectangle given to it in @a
397  * data:
398  * @until }
399  *
400  * Next we have a callback that prints a string, nothing special:
401  * @until }
402  *
403  * This next callback is a little more interesting, it has a state variable
404  * to know if the animation is currently paused or running, and it toogles
405  * the state of the animation accordingly:
406  * @until }
407  * @until }
408  * @until }
409  *
410  * Finally we have a callback to stop the animation:
411  * @until }
412  *
413  * As with every example we need to do a bit of setup before we can actually
414  * use an animation, but for the purposes of this example that's not relevant
415  * so let's just skip to the good stuff, creating an animator:
416  * @skipline animator_add
417  * @note Since elm_animator is not a widget we can give it a NULL parent.
418  *
419  * Now that we have an elm_animator we set it's duration to 1 second:
420  * @line duration_set
421  *
422  * We would also like our animation to be reversible, so:
423  * @line reverse_set
424  *
425  * We also set our animation to repeat as many times as possible, which will
426  * mean that _end_cb will only be called after UINT_MAX * 2 seconds(UINT_MAX
427  * for the animation running forward and UNIT_MAX for the animation running
428  * backwards):
429  * @line repeat_set
430  *
431  * To add some fun to our animation we will use the IN_OUT curve style:
432  * @line curve_style
433  *
434  * To actually animate anything we need an operation callback:
435  * @line operation_callback
436  *
437  * Even though we set our animation to repeat for a very long time we are
438  * going to set a end callback to it:
439  * @line completion_callback
440  * @note Notice that stoping the animation with the stop button will not make
441  * _end_cb be called.
442  *
443  * Now that we have fully set up our animator we can tell it to start
444  * animating:
445  * @line animate
446  *
447  * There's a bit more of code that doesn't really matter to use so we skip
448  * right down to our last interesting point:
449  * @skipline animator_del
450  * @note Because we created our animator with no parent we need to delete it
451  * ourselves.
452  *
453  * The example should look like this:
454  * @image html screenshots/animator_example_01.png
455  * @image latex screenshots/animator_example_01.eps
456  * @n
457  * @image html screenshots/animator_example_02.png
458  * @image latex screenshots/animator_example_02.eps
459  * @n
460  * @image html screenshots/animator_example_03.png
461  * @image latex screenshots/animator_example_03.eps
462  *
463  * The full source code for this example can be found @ref
464  * animator_example_01_c "here"
465  */
466
467 /**
468  * @page transit_example_03_c elm_transit - Combined effects and options.
469  *
470  * This example shows how to apply the following transition effects:
471  * @li translation
472  * @li color
473  * @li rotation
474  * @li wipe
475  * @li zoom
476  * @li resizing
477  *
478  * It allows you to apply more than one effect at once, and also allows to
479  * set properties like event_enabled, auto_reverse, repeat_times and
480  * tween_mode.
481  *
482  * @include transit_example_03.c
483  */
484
485 /**
486  * @page transit_example_04_c elm_transit - Combined effects over two objects.
487  *
488  * This example shows how to apply the transition effects:
489  * @li flip
490  * @li resizable_flip
491  * @li fade
492  * @li blend
493  * over two objects. This kind of transition effect is used to make one
494  * object disappear and another one appear on its place.
495  *
496  * You can mix more than one effect of this type on the same objects, and the
497  * transition will apply both.
498  *
499  * @include transit_example_04.c
500  */
501
502 /**
503  * @page transit_example_01_explained elm_transit - Basic transit usage.
504  * @dontinclude transit_example_01.c
505  *
506  * The full code for this example can be found at @ref transit_example_01_c.
507  *
508  * This example shows the simplest way of creating a transition and applying
509  * it to an object. Similarly to every other elementary example, we create a
510  * window, set its title, size, autodel property, and setup a callback to
511  * exit the program when finished:
512  *
513  * @skip on_done
514  * @until evas_object_resize
515  *
516  * We also add a resizeable white background to use behind our animation:
517  *
518  * @skip bg_add
519  * @until evas_object_show
520  *
521  * And then we add a button that we will use to demonstrate the effects of
522  * our animation:
523  *
524  * @skip button_add
525  * @until evas_object_show(win)
526  *
527  * Notice that we are not adding the button with elm_win_resize_object_add()
528  * because we don't want the window to control the size of the button. We
529  * will use the transition to change the button size, so it could conflict
530  * with something else trying to control that size.
531  *
532  * Now, the simplest code possible to create the resize animation:
533  *
534  * @skip transit_add
535  * @until transit_go
536  *
537  * As you can see, this code is very easy to understand. First, we create the
538  * transition itself with elm_transit_add(). Then we add the button to this
539  * transition with elm_transit_object_add(), which means that the transition
540  * will operate over this button. The effect that we want now is changing the
541  * object size from 100x50 to 300x150, and can be achieved by adding the
542  * resize effect with elm_transit_effect_resizing_add().
543  *
544  * Finally, we set the transition time to 5 seconds and start the transition
545  * with elm_transit_go(). If we wanted more effects applied to this
546  * button, we could add them to the same transition. See the
547  * @ref transit_example_03_c to watch many transitions being applied to an
548  * object.
549  */
550
551 /**
552  * @page transit_example_02_explained elm_transit - Chained transitions.
553  * @dontinclude transit_example_02.c
554  *
555  * The full code for this example can be found at @ref transit_example_02_c.
556  *
557  * This example shows how to implement a chain of transitions. This chain is
558  * used to start a transition just after another transition ended. Similarly
559  * to every other elementary example, we create a window, set its title,
560  * size, autodel property, and setup a callback to exit the program when
561  * finished:
562  *
563  * @skip on_done
564  * @until evas_object_resize
565  *
566  * We also add a resizeable white background to use behind our animation:
567  *
568  * @skip bg_add
569  * @until evas_object_show
570  *
571  * This example will have a chain of 4 transitions, each of them applied to
572  * one button. Thus we create 4 different buttons:
573  *
574  * @skip button_add
575  * @until evas_object_show(bt4)
576  *
577  * Now we create a simple translation transition that will be started as soon
578  * as the program loads. It will be our first transition, and the other
579  * transitions will be started just after this transition ends:
580  *
581  * @skip transit_add
582  * @until transit_go
583  *
584  * The code displayed until now has nothing different from what you have
585  * already seen in @ref transit_example_01_explained, but now comes the new
586  * part: instead of creating a second transition that will start later using
587  * a timer, we create the it normally, and use
588  * elm_transit_chain_transit_add() instead of elm_transit_go. Since we are
589  * adding it in a chain after the first transition, it will start as soon as
590  * the first transition ends:
591  *
592  * @skip transit_add
593  * @until transit_chain_transit_add
594  *
595  * Finally we add the 2 other transitions to the chain, and run our program.
596  * It will make one transition start after the other finish, and there is the
597  * transition chain.
598  */
599
600 /**
601  * @page general_functions_example_page General (top-level) functions example
602  * @dontinclude general_funcs_example.c
603  *
604  * As told in their documentation blocks, the
605  * elm_app_compile_*_dir_set() family of functions have to be called
606  * before elm_app_info_set():
607  * @skip tell elm about
608  * @until elm_app_info_set
609  *
610  * We are here setting the fallback paths to the compiling time target
611  * paths, naturally. If you're building the example out of the
612  * project's build system, we're assuming they are the canonical ones.
613  *
614  * After the program starts, elm_app_info_set() will actually run and
615  * then you'll see an intrincasy: Elementary does the prefix lookup @b
616  * twice. This is so because of the quicklaunch infrastructure in
617  * Elementary (@ref Start), which will register a predefined prefix
618  * for possible users of the launch schema. We're not hooking into a
619  * quick launch, so this first call can't be avoided.
620  *
621  * If you ran this example from your "bindir" installation
622  * directiory, no output will emerge from these both attempts -- it
623  * will find the "magic" file there registered and set the prefixes
624  * silently. Otherwise, you could get something like:
625  @verbatim
626  WARNING: Could not determine its installed prefix for 'ELM'
627        so am falling back on the compiled in default:
628          usr
629        implied by the following:
630          bindir    = usr/lib
631          libdir    = usr/lib
632          datadir   = usr/share/elementary
633          localedir = usr/share/locale
634        Try setting the following environment variables:
635          ELM_PREFIX     - points to the base prefix of install
636        or the next 4 variables
637          ELM_BIN_DIR    - provide a specific binary directory
638          ELM_LIB_DIR    - provide a specific library directory
639          ELM_DATA_DIR   - provide a specific data directory
640          ELM_LOCALE_DIR - provide a specific locale directory
641  @endverbatim
642  * if you also didn't change those environment variables (remember
643  * they are also a valid way of communicating your prefix to the
644  * binary) - this is the scenario where it fallbacks to the paths set
645  * for compile time.
646  *
647  * Then, you can check the prefixes set on the standard output:
648  * @skip prefix was set to
649  * @until locale directory is
650  *
651  * In the fragment
652  * @skip by using this policy
653  * @until elm_win_autodel_set
654  * we demonstrate the use of Elementary policies. The policy defining
655  * under which circunstances our application should quit automatically
656  * is set to when its last window is closed (this one has just one
657  * window, though). This will save us from having to set a callback
658  * ourselves on the window, like done in @ref bg_example_01_c "this"
659  * example. Note that we need to tell the window to delete itself's
660  * object on a request to destroy the canvas coming, with
661  * elm_win_autodel_set().
662  *
663  * What follows is some boilerplate code, creating a frame with a @b
664  * button, our object of interest, and, below, widgets to change the
665  * button's behavior and exemplify the group of functions in question.
666  *
667  * @dontinclude general_funcs_example.c
668  * We enabled the focus highlight object for this window, so that you
669  * can keep track of the current focused object better:
670  * @skip elm_win_focus_highlight_enabled_set
671  * @until evas_object_show
672  * Use the tab key to navigate through the focus chain.
673  *
674  * @dontinclude general_funcs_example.c
675  * While creating the button, we exemplify how to use Elementary's
676  * finger size information to scale our UI:
677  * @skip fprintf(stdout, "Elementary
678  * @until evas_object_show
679  *
680  * @dontinclude general_funcs_example.c
681  * The first checkbox's callback is:
682  * @skip static void
683  * @until }
684  * When unsetting the checkbox, we disable the button, which will get a new
685  * decoration (greyed out) and stop receiving events. The focus chain
686  * will also ignore it.
687  *
688  * Following, there are 2 more buttons whose actions are focus/unfocus
689  * the top button, respectively:
690  * @skip focus callback
691  * @until }
692  * and
693  * @skip unfocus callback
694  * @until }
695  * Note the situations in which they won't take effect:
696  * - the button is not allowed to get focus or
697  * - the button is disabled
698  *
699  * The first restriction above you'll get by a second checkbox, whose
700  * callback is:
701  * @skip focus allow callback
702  * @until }
703  * Note that the button will still get mouse events, though.
704  *
705  * Next, there's a slider controlling the button's scale:
706  * @skip scaling callback
707  * @until }
708  *
709  * Experiment with it, so you understand the effect better. If you
710  * change its value, it will mess with the button's original size,
711  * naturally.
712  *
713  * The full code for this example can be found
714  * @ref general_functions_example_c "here".
715  */
716
717 /**
718  * @page theme_example_01 Theme - Using extensions
719  *
720  * @dontinclude theme_example_01.c
721  *
722  * Using extensions is extremely easy, discarding the part where you have to
723  * write the theme for them.
724  *
725  * In the following example we'll be creating two buttons, one to load or
726  * unload our extension theme and one to cycle around three possible styles,
727  * one of which we created.
728  *
729  * After including our one and only header we'll jump to the callback for
730  * the buttons. First one takes care of loading or unloading our extension
731  * file, relative to the default theme set (thus the @c NULL in the
732  * functions first parameter).
733  * @skipline Elementary.h
734  * @skip static void
735  * @until }
736  * @until }
737  * @until }
738  *
739  * The second button, as we said before, will just switch around different
740  * styles. In this case we have three of them. The first one is our custom
741  * style, named after something very unlikely to find in the default theme.
742  * The other two styles are the standard and one more, anchor, which exists
743  * in the default and is similar to the default, except the button vanishes
744  * when the mouse is not over it.
745  * @skip static void
746  * @until }
747  * @until }
748  *
749  * So what happens if the style switches to our custom one when the
750  * extension is loaded? Elementary falls back to the default for the
751  * widget.
752  *
753  * And the main function, simply enough, will create the window, set the
754  * buttons and their callbacks, and just to begin with our button styled
755  * we're also loading our extension at the beginning.
756  * @skip int
757  * @until ELM_MAIN
758  *
759  * In this case we wanted to easily remove extensions, but all adding an
760  * extension does is tell Elementary where else it should look for themes
761  * when it can't find them in the default theme. Another way to do this
762  * is to set the theme search order using elm_theme_set(), but this requires
763  * that the developer is careful not to override any user configuration.
764  * That can be helped by adding our theme to the end of whatver is already
765  * set, like in the following snippet.
766  * @code
767  * char buf[4096];
768  * snprintf(buf, sizeof(buf), "%s:./theme_example.edj", elme_theme_get(NULL);
769  * elm_theme_set(NULL, buf);
770  * @endcode
771  *
772  * If we were using overlays instead of extensions, the same thing applies,
773  * but the custom theme must be added to the front of the search path.
774  *
775  * In the end, we should be looking at something like this:
776  * @image html screenshots/theme_example_01.png
777  * @image latex screenshots/theme_example_01.eps
778  *
779  * That's all. Boringly simple, and the full code in one piece can be found
780  * @ref theme_example_01.c "here".
781  *
782  * And the code for our extension is @ref theme_example.edc "here".
783  *
784  * @example theme_example_01.c
785  * @example theme_example.edc
786  */
787
788 /**
789  * @page theme_example_02 Theme - Using overlays
790  *
791  * @dontinclude theme_example_02.c
792  *
793  * Overlays are like extensions in that you tell Elementary that some other
794  * theme contains the styles you need for your program. The difference is that
795  * they will be look in first, so they can override the default style of any
796  * widget.
797  *
798  * There's not much to say about them that hasn't been said in our previous
799  * example about @ref theme_example_01 "extensions", so going quickly through
800  * the code we have a function to load or unload the theme, which will be
801  * called when we click any button.
802  * @skipline Elementary.h
803  * @skip static void
804  * @until }
805  *
806  * And the main function, creating the window and adding some buttons to it.
807  * We load our theme as an overlay and nothing else. Notice there's no style
808  * set for any button there, which means they should be using the default
809  * that we override.
810  * @skip int
811  * @until ELM_MAIN
812  *
813  * That's pretty much it. The full code is @ref theme_example_02.c "here" and
814  * the definition of the theme is the same as before, and can be found in
815  * @ref theme_example.edc "here".
816  *
817  * @example theme_example_02.c
818  */
819
820  /**
821   * @page button_example_01 Button - Complete example
822   *
823   * @dontinclude button_example_01.c
824   *
825   * A button is simple, you click on it and something happens. That said,
826   * we'll go through an example to show in detail the button API less
827   * commonly used.
828   *
829   * In the end, we'll be presented with something that looks like this:
830   * @image html screenshots/button_01.png
831   * @image latex screenshots/button_01.eps
832   *
833   * The full code of the example is @ref button_example_01.c "here" and we
834   * will follow here with a rundown of it.
835   *
836   * @skip Elementary.h
837   * @until Elementary.h
838   * @skip struct
839   * @until App_Data
840   *
841   * We have several buttons to set different times for the autorepeat timeouts
842   * of the buttons that use it and a few more that we keep track of in our
843   * data struct. The mid button doesn't do much, just moves around according
844   * to what other buttons the user presses. Then four more buttons to move the
845   * central one, and we're also keeping track of the icon set in the middle
846   * button, since when this one moves, we change the icon, and when movement
847   * is finished (by releasing one of the four arrow buttons), we set back the
848   * normal icon.
849   * @skip static void
850   * @until }
851   *
852   * Keeping any of those four buttons pressed will trigger their autorepeat
853   * callback, where we move the button doing some size hint magic. To
854   * understand how that works better, refer to the @ref Box documentation.
855   * Also, the first time the function is called, we change the icon in the
856   * middle button, using elm_button_icon_unset() first to keep the reference
857   * to the previous one, so we don't need to recreate it when we are done
858   * moving it.
859   * @skip static void
860   * @until }
861   * @until size_hint_align_set
862   * @until }
863   *
864   * One more callback for the option buttons, that just sets the timeouts for
865   * the different autorepeat options.
866   *
867   * @skip static void
868   * @until }
869   * @until }
870   * @until }
871   *
872   * And the main function, which does some setting up of the buttons in boxes
873   * to make things work. Here we'll go through some snippets only.
874   *
875   * For the option buttons, it's just the button with its label and callback.
876   * @skip elm_button_add
877   * @until smart_callback_add
878   *
879   * For the ones that move the central button, we have no labels. There are
880   * icons instead, and the autorepeat option is toggled.
881   * @skip Gap: 1.0
882   * @skip elm_button_add
883   * @until data.cursors.up
884   *
885   * And just to show the mid button, which doesn't have anything special.
886   * @skip data.cursors.left
887   * @skip elm_button_add
888   * @until data.mid
889   *
890   * And we are done.
891   *
892   * @example button_example_01.c
893   */
894
895 /**
896  * @page bubble_01_example_page elm_bubble - Simple use.
897  * @dontinclude bubble_example_01.c
898  *
899  * This example shows a bubble with all fields set(label, info, content and
900  * icon) and the selected corner changing when the bubble is clicked. To be
901  * able use a bubble we need to do some setup and create a window, for this
902  * example we are going to ignore that part of the code since it isn't
903  * relevant to the bubble.
904  *
905  * To have the selected corner change in a clockwise motion we are going to
906  * use the following callback:
907  * @skip static
908  * @until }
909  * @until }
910  *
911  * Here we are creating an elm_label that is going to be used as the content
912  * for our bubble:
913  * @skipline elm_label
914  * @until show
915  * @note You could use any evas_object for this, we are using an elm_label
916  * for simplicity.
917  *
918  * Despite it's name the bubble's icon doesn't have to be an icon, it can be
919  * any evas_object. For this example we are going to make the icon a simple
920  * blue rectangle:
921  * @until show
922  *
923  * And finally we have the actual bubble creation and the setting of it's
924  * label, info and content:
925  * @until content
926  * @skipline show
927  * @note Because we didn't set a corner, the default("top_left") will be
928  * used.
929  *
930  * Now that we have our bubble all that is left is connecting the "clicked"
931  * signals to our callback:
932  * @line smart_callback
933  *
934  * This last bubble we created was very complete, so it's pertinent to show
935  * that most of that stuff is optional a bubble can be created with nothing
936  * but content:
937  * @until content
938  * @skipline show
939  *
940  * Our example will look like this:
941  * @image html screenshots/bubble_example_01.png
942  * @image latex screenshots/bubble_example_01.eps
943  *
944  * See the full source code @ref bubble_example_01.c here.
945  * @example bubble_example_01.c
946  */
947
948 /**
949  * @page box_example_01 Box - Basic API
950  *
951  * @dontinclude button_example_01.c
952  *
953  * As a special guest tonight, we have the @ref button_example_01 "simple
954  * button example". There are plenty of boxes in it, and to make the cursor
955  * buttons that moved a central one around when pressed, we had to use a
956  * variety of values for their hints.
957  *
958  * To start, let's take a look at the handling of the central button when
959  * we were moving it around. To achieve this effect without falling back to
960  * a complete manual positioning of the @c Evas_Object in our canvas, we just
961  * put it in a box and played with its alignment within it, as seen in the
962  * following snippet of the callback for the pressed buttons.
963  * @skip evas_object_size_hint_align_get
964  * @until evas_object_size_hint_align_set
965  *
966  * Not much to it. We get the current alignment of the object and change it
967  * by just a little, depending on which button was pressed, then set it
968  * again, making sure we stay within the 0.0-1.0 range so the button moves
969  * inside the space it has, instead of disappearing under the other objects.
970  *
971  * But as useful as an example as that may have been, the usual case with boxes
972  * is to set everything at the moment they are created, like we did for
973  * everything else in our main function.
974  *
975  * The entire layout of our program is made with boxes. We have one set as the
976  * resize object for the window, which means it will always be resized with
977  * the window. The weight hints set to @c EVAS_HINT_EXPAND will tell the
978  * window that the box can grow past it's minimum size, which allows resizing
979  * of it.
980  * @skip elm_main
981  * @skip elm_box_add
982  * @until evas_object_show
983  *
984  * Two more boxes, set to horizontal, hold the buttons to change the autorepeat
985  * configuration used by the buttons. We create each to take over all the
986  * available space horizontally, but we don't want them to grow vertically,
987  * so we keep that axis of the weight with 0.0. Then it gets packed in the
988  * main box.
989  * @skip box2
990  * @until evas_object_show
991  *
992  * The buttons in each of those boxes have nothing special, they are just packed
993  * in with their default values and the box will use their minimum size, as set
994  * by Elementary itself based on the label, icon, finger size and theme.
995  *
996  * But the buttons used to move the central one have a special disposition.
997  * The top one first, is placed right into the main box like our other smaller
998  * boxes. Set to expand horizontally and not vertically, and in this case we
999  * also tell it to fill that space, so it gets resized to take the entire
1000  * width of the window.
1001  * @skip Gap: 1.0
1002  * @skip elm_button_add
1003  * @until evas_object_show
1004  *
1005  * The bottom one will be the same, but for the other two we need to use a
1006  * second box set to take as much space as we have, so we can place our side
1007  * buttons in place and have the big empty space where the central button will
1008  * move.
1009  * @skip elm_box_add
1010  * @until evas_object_show
1011  *
1012  * Then the buttons will have their hints inverted to the other top and bottom
1013  * ones, to expand and fill vertically and keep their minimum size horizontally.
1014  * @skip elm_button_add
1015  * @until evas_object_show
1016  *
1017  * The central button takes every thing else. It will ask to be expanded in
1018  * both directions, but without filling its cell. Changing its alignment by
1019  * pressing the buttons will make it move around.
1020  * @skip elm_button_add
1021  * @until evas_object_show
1022  *
1023  * To end, the rightmost button is packed in the smaller box after the central
1024  * one, and back to the main box we have the bottom button at the end.
1025  */
1026
1027 /**
1028  * @page box_example_02 Box - Layout transitions
1029  *
1030  * @dontinclude box_example_02.c
1031  *
1032  * Setting a customized layout for a box is simple once you have the layout
1033  * function, which is just like the layout function for @c Evas_Box. The new
1034  * and fancier thing we can do with Elementary is animate the transition from
1035  * one layout to the next. We'll see now how to do that through a simple
1036  * example, while also taking a look at some of the API that was left
1037  * untouched in our @ref box_example_01 "previous example".
1038  *
1039  * @image html screenshots/box_example_02.png
1040  * @image latex screenshots/box_example_02.eps
1041  *
1042  * @skipline Elementary.h
1043  *
1044  * Our application data consists of a list of layout functions, given by
1045  * @c transitions. We'll be animating through them throughout the entire run.
1046  * The box with the stuff to move around and the last layout that was set to
1047  * make things easier in the code.
1048  * @skip typedef
1049  * @until Transitions_Data
1050  *
1051  * The box starts with three buttons, clicking on any of them will take it
1052  * out of the box without deleting the object. There are also two more buttons
1053  * outside, one to add an object to the box and the other to clear it.
1054  * This is all to show how you can interact with the items in the box, add
1055  * things and even remove them, while the transitions occur.
1056  *
1057  * One of the callback we'll be using creates a new button, asks the box for
1058  * the list of its children and if it's not empty, we add the new object after
1059  * the first one, otherwise just place at the end as it will not make any
1060  * difference.
1061  * @skip static void
1062  * @until }
1063  * @until }
1064  *
1065  * The clear button is even simpler. Everything in the box will be deleted,
1066  * leaving it empty and ready to fill it up with more stuff.
1067  * @skip static void
1068  * @until }
1069  *
1070  * And a little function to remove buttons from the box without deleting them.
1071  * This one is set for the @c clicked callback of the original buttons,
1072  * unpacking them when clicked and placing it somewhere in the screen where
1073  * they will not disturb. Once we do this, the box no longer has any control
1074  * of it, so it will be left untouched until the program ends.
1075  * @skip static void
1076  * @until }
1077  *
1078  * If we wanted, we could just call @c evas_object_del() on the object to
1079  * destroy it. In this case, no unpack is really necessary, as the box would
1080  * be notified of a child being deleted and adjust its calculations accordingly.
1081  *
1082  * The core of the program is the following function. It takes whatever
1083  * function is first on our list of layouts and together with the
1084  * @c last_layout, it creates an ::Elm_Box_Transition to use with
1085  * elm_box_layout_transition(). In here, we tell it to start from whatever
1086  * layout we last set, end with the one that was at the top of the list and
1087  * when everything is finished, call us back so we can create another
1088  * transition. Finally, move the new layout to the end of the list so we
1089  * can continue running through them until the program ends.
1090  * @skip static void
1091  * @until }
1092  *
1093  * The main function doesn't have antyhing special. Creation of box, initial
1094  * buttons and some callback setting. The only part worth mentioning is the
1095  * initialization of our application data.
1096  * @skip tdata.box
1097  * @until evas_object_box_layout_stack
1098  *
1099  * We have a simple static variable, set the box, the first layout we are
1100  * using as last and create the list with the different functions to go
1101  * through.
1102  *
1103  * And in the end, we set the first layout and call the same function we went
1104  * through before to start the run of transitions.
1105  * @until _test_box_transition_change
1106  *
1107  * For the full code, follow @ref box_example_02.c "here".
1108  *
1109  * @example box_example_02.c
1110  */
1111
1112 /**
1113  * @page calendar_example_01 Calendar - Simple creation.
1114  * @dontinclude calendar_example_01.c
1115  *
1116  * As a first example, let's just display a calendar in our window,
1117  * explaining all steps required to do so.
1118  *
1119  * First you should declare objects we intend to use:
1120  * @skipline Evas_Object
1121  *
1122  * Then a window is created, a title is set and its set to be autodeleted.
1123  * More details can be found on windows examples:
1124  * @until elm_win_autodel
1125  *
1126  * Next a simple background is placed on our windows. More details on
1127  * @ref bg_01_example_page:
1128  * @until evas_object_show(bg)
1129  *
1130  * Now, the exciting part, let's add the calendar with elm_calendar_add(),
1131  * passing our window object as parent.
1132  * @until evas_object_show(cal);
1133  *
1134  * To conclude our example, we should show the window and run elm mainloop:
1135  * @until ELM_MAIN
1136  *
1137  * Our example will look like this:
1138  * @image html screenshots/calendar_example_01.png
1139  * @image latex screenshots/calendar_example_01.eps
1140  *
1141  * See the full source code @ref calendar_example_01.c here.
1142  * @example calendar_example_01.c
1143  */
1144
1145 /**
1146  * @page calendar_example_02 Calendar - Layout strings formatting.
1147  * @dontinclude calendar_example_02.c
1148  *
1149  * In this simple example, we'll explain how to format the label displaying
1150  * month and year, and also set weekday names.
1151  *
1152  * To format month and year label, we need to create a callback function
1153  * to create a string given the selected time, declared under a
1154  * <tt> struct tm </tt>.
1155  *
1156  * <tt> struct tm </tt>, declared on @c time.h, is a structure composed by
1157  * nine integers:
1158  * @li tm_sec   seconds [0,59]
1159  * @li tm_min   minutes [0,59]
1160  * @li tm_hour  hour [0,23]
1161  * @li tm_mday  day of month [1,31]
1162  * @li tm_mon   month of year [0,11]
1163  * @li tm_year  years since 1900
1164  * @li tm_wday  day of week [0,6] (Sunday = 0)
1165  * @li tm_yday  day of year [0,365]
1166  * @li tm_isdst daylight savings flag
1167  * @note glib version has 2 additional fields.
1168  *
1169  * For our function, only stuff that matters are tm_mon and tm_year.
1170  * But we don't need to access it directly, since there are nice functions
1171  * to format date and time, as @c strftime.
1172  * We will get abbreviated month (%b) and year (%y) (check strftime manpage
1173  * for more) in our example:
1174  * @skipline static char
1175  * @until }
1176  *
1177  * We need to alloc the string to be returned, and calendar widget will
1178  * free it when it's not needed, what is done by @c strdup.
1179  * So let's register our callback to calendar object:
1180  * @skipline elm_calendar_format_function_set
1181  *
1182  * To set weekday names, we should declare them as an array of strings:
1183  * @dontinclude calendar_example_02.c
1184  * @skipline weekdays
1185  * @until }
1186  *
1187  * And finally set them to calendar:
1188  * skipline weekdays_names_set
1189  *
1190  * Our example will look like this:
1191  * @image html screenshots/calendar_example_02.png
1192  * @image latex screenshots/calendar_example_02.eps
1193  *
1194  * See the full source code @ref calendar_example_02.c here.
1195  * @example calendar_example_02.c
1196  */
1197
1198 /**
1199  * @page calendar_example_03 Calendar - Years restrictions.
1200  * @dontinclude calendar_example_03.c
1201  *
1202  * This example explains how to set max and min year to be displayed
1203  * by a calendar object. This means that user won't be able to
1204  * see or select a date before and after selected years.
1205  * By default, limits are 1902 and maximun value will depends
1206  * on platform architecture (year 2037 for 32 bits); You can
1207  * read more about time functions on @c ctime manpage.
1208  *
1209  * Straigh to the point, to set it is enough to call
1210  * elm_calendar_min_max_year_set(). First value is minimun year, second
1211  * is maximum. If first value is negative, it won't apply limit for min
1212  * year, if the second one is negative, won't apply for max year.
1213  * Setting both to negative value will clear limits (default state):
1214  * @skipline elm_calendar_min_max_year_set
1215  *
1216  * Our example will look like this:
1217  * @image html screenshots/calendar_example_03.png
1218  * @image latex screenshots/calendar_example_03.eps
1219  *
1220  * See the full source code @ref calendar_example_03.c here.
1221  * @example calendar_example_03.c
1222  */
1223
1224 /**
1225  * @page calendar_example_04 Calendar - Days selection.
1226  * @dontinclude calendar_example_04.c
1227  *
1228  * It's possible to disable date selection and to select a date
1229  * from your program, and that's what we'll see on this example.
1230  *
1231  * If isn't required that users could select a day on calendar,
1232  * only interacting going through months, disabling days selection
1233  * could be a good idea to avoid confusion. For that:
1234  * @skipline elm_calendar_day_selection_enabled_set
1235  *
1236  * Also, regarding days selection, you could be interested to set a
1237  * date to be highlighted on calendar from your code, maybe when
1238  * a specific event happens, or after calendar creation. Let's select
1239  * two days from current day:
1240  * @dontinclude calendar_example_04.c
1241  * @skipline SECS_DAY
1242  * @skipline current_time
1243  * @until elm_calendar_selected_time_set
1244  *
1245  * Our example will look like this:
1246  * @image html screenshots/calendar_example_04.png
1247  * @image latex screenshots/calendar_example_04.eps
1248  *
1249  * See the full source code @ref calendar_example_04.c here.
1250  * @example calendar_example_04.c
1251  */
1252
1253 /**
1254  * @page calendar_example_05 Calendar - Signal callback and getters.
1255  * @dontinclude calendar_example_05.c
1256  *
1257  * Most of setters explained on previous examples have associated getters.
1258  * That's the subject of this example. We'll add a callback to display
1259  * all calendar information every time user interacts with the calendar.
1260  *
1261  * Let's check our callback function:
1262  * @skipline static void
1263  * @until double interval;
1264  *
1265  * To get selected day, we need to call elm_calendar_selected_time_get(),
1266  * but to assure nothing wrong happened, we must check for function return.
1267  * It'll return @c EINA_FALSE if fail. Otherwise we can use time set to
1268  * our structure @p stime.
1269  * @skipline elm_calendar_selected_time_get
1270  * @until return
1271  *
1272  * Next we'll get information from calendar and place on declared vars:
1273  * @skipline interval
1274  * @until elm_calendar_weekdays_names_get
1275  *
1276  * The only tricky part is that last line gets an array of strings
1277  * (char arrays), one for each weekday.
1278  *
1279  * Then we can simple print that to stdin:
1280  * @skipline printf
1281  * @until }
1282  *
1283  * <tt> struct tm </tt> is declared on @c time.h. You can check @c ctime
1284  * manpage to read about it.
1285  *
1286  * To register this callback, that will be called every time user selects
1287  * a day or goes to next or previous month, just add a callback for signal
1288  * @b changed.
1289  * @skipline evas_object_smart_callback_add
1290  *
1291  * Our example will look like this:
1292  * @image html screenshots/calendar_example_05.png
1293  * @image latex screenshots/calendar_example_05.eps
1294  *
1295  * See the full source code @ref calendar_example_05.c here.
1296  * @example calendar_example_05.c
1297  */
1298
1299 /**
1300  * @page calendar_example_06 Calendar - Calendar marks.
1301  * @dontinclude calendar_example_06.c
1302  *
1303  * On this example marks management will be explained. Functions
1304  * elm_calendar_mark_add(), elm_calendar_mark_del() and
1305  * elm_calendar_marks_clear() will be covered.
1306  *
1307  * To add a mark, will be required to choose three things:
1308  * @li mark style
1309  * @li mark date, or start date if it will be repeated
1310  * @li mark periodicity
1311  *
1312  * Style defines the kind of mark will be displayed over marked day,
1313  * on caledar. Default theme supports @b holiday and @b checked.
1314  * If more is required, is possible to set a new theme to calendar
1315  * widget using elm_object_style_set(), and use
1316  * the signal that will be used by such marks.
1317  *
1318  * Date is a <tt> struct tm </tt>, as defined by @c time.h. More can
1319  * be read on @c ctime manpage.
1320  * If a date relative from current is required, this struct can be set
1321  * as:
1322  * @skipline current_time
1323  * @until localtime_r
1324  *
1325  * Or if it's an absolute date, you can just declare the struct like:
1326  * @dontinclude calendar_example_06.c
1327  * @skipline sunday
1328  * @until christmas.tm_mon
1329  *
1330  * Periodicity is how frequently the mark will be displayed over the
1331  * calendar.  Can be a unique mark (that don't repeat), or it can repeat
1332  * daily, weekly, monthly or annually. It's enumerated by
1333  * @c Elm_Calendar_Mark_Repeat.
1334  *
1335  * So let's add some marks to our calendar. We will add christmas holiday,
1336  * set Sundays as holidays, and check current day and day after that.
1337  * @dontinclude calendar_example_06.c
1338  * @skipline sunday
1339  * @until christmas.tm_mon
1340  * @skipline current_time
1341  * @until ELM_CALENDAR_WEEKLY
1342  *
1343  * We kept the return of first mark add, because we don't really won't it
1344  * to be checked, so let's remove it:
1345  * @skipline elm_calendar_mark_del
1346  *
1347  * After all marks are added and removed, is required to draw them:
1348  * @skipline elm_calendar_marks_draw
1349  *
1350  * Finally, to clear all marks, let's set a callback for our button:
1351  * @skipline elm_button_add
1352  * @until evas_object_show(bt);
1353  *
1354  * This callback will receive our calendar object, and should clear it:
1355  * @dontinclude calendar_example_06.c
1356  * @skipline static
1357  * @until }
1358  * @note Remember to draw marks after clear the calendar.
1359  *
1360  * Our example will look like this:
1361  * @image html screenshots/calendar_example_06.png
1362  * @image latex screenshots/calendar_example_06.eps
1363  *
1364  * See the full source code @ref calendar_example_06.c here.
1365  * @example calendar_example_06.c
1366  */
1367
1368 /**
1369  * @page clock_example Clock widget example
1370  *
1371  * This code places five Elementary clock widgets on a window, each of
1372  * them exemplifying a part of the widget's API.
1373  *
1374  * The first of them is the pristine clock:
1375  * @dontinclude clock_example.c
1376  * @skip pristine
1377  * @until evas_object_show
1378  * As you see, the defaults for a clock are:
1379  * - military time
1380  * - no seconds shown
1381  *
1382  * For am/pm time, see the second clock:
1383  * @dontinclude clock_example.c
1384  * @skip am/pm
1385  * @until evas_object_show
1386  *
1387  * The third one will show the seconds digits, which will flip in
1388  * synchrony with system time. Note, besides, that the time itself is
1389  * @b different from the system's -- it was customly set with
1390  * elm_clock_time_set():
1391  * @dontinclude clock_example.c
1392  * @skip with seconds
1393  * @until evas_object_show
1394  *
1395  * In both fourth and fifth ones, we turn on the <b>edition
1396  * mode</b>. See how you can change each of the sheets on it, and be
1397  * sure to try holding the mouse pressed over one of the sheet
1398  * arrows. The forth one also starts with a custom time set:
1399  * @dontinclude clock_example.c
1400  * @skip in edition
1401  * @until evas_object_show
1402  *
1403  * The fifth, besides editable, has only the time @b units editable,
1404  * for hours, minutes and seconds. This exemplifies
1405  * elm_clock_digit_edit_set():
1406  * @dontinclude clock_example.c
1407  * @skip but only
1408  * @until evas_object_show
1409  *
1410  * See the full @ref clock_example.c "example", whose window should
1411  * look like this picture:
1412  * @image html screenshots/clock_example.png
1413  * @image latex screenshots/clock_example.eps
1414  *
1415  * @example clock_example.c
1416  */
1417
1418 /**
1419  * @page flipselector_example Flip selector widget example
1420  *
1421  * This code places an Elementary flip selector widget on a window,
1422  * along with two buttons trigerring actions on it (though its API).
1423  *
1424  * The selector is being populated with the following items:
1425  * @dontinclude flipselector_example.c
1426  * @skip lbl[]
1427  * @until ;
1428  *
1429  * Next, we create it, populating it with those items and registering
1430  * two (smart) callbacks on it:
1431  * @dontinclude flipselector_example.c
1432  * @skip fp = elm_flipselector_add
1433  * @until object_show
1434  *
1435  * Those two callbacks will take place whenever one of those smart
1436  * events occur, and they will just print something to @c stdout:
1437  * @dontinclude flipselector_example.c
1438  * @skip underflow callback
1439  * @until static void
1440  * Flip the sheets on the widget while looking at the items list, in
1441  * the source code, and you'll get the idea of those events.
1442  *
1443  * The two buttons below the flip selector will take the actions
1444  * described in their labels:
1445  * @dontinclude flipselector_example.c
1446  * @skip bt = elm_button_add
1447  * @until callback_add(win
1448  *
1449  * @dontinclude flipselector_example.c
1450  * @skip unselect the item
1451  * @until underflow
1452  *
1453  * Click on them to exercise those flip selector API calls. To
1454  * interact with the other parts of this API, there's a command line
1455  * interface, whose help string can be asked for with the 'h' key:
1456  * @dontinclude flipselector_example.c
1457  * @skip commands
1458  * @until ;
1459  *
1460  * The 'n' and 'p' keys will exemplify elm_flipselector_flip_next()
1461  * and elm_flipselector_flip_prev(), respectively. 'f' and 'l' account
1462  * for elm_flipselector_first_item_get() and
1463  * elm_flipselector_last_item_get(), respectively. Finally, 's' will
1464  * issue elm_flipselector_selected_item_get() on our example flip
1465  * selector widget.
1466  *
1467  * See the full @ref flipselector_example.c "example", whose window should
1468  * look like this picture:
1469  * @image html screenshots/flipselector_example.png
1470  * @image latex screenshots/flipselector_example.eps
1471  *
1472  * @example flipselector_example.c
1473  */
1474
1475 /**
1476  * @page tutorial_hover Hover example
1477  * @dontinclude hover_example_01.c
1478  *
1479  * On this example we are going to have a button that when clicked will show our
1480  * hover widget, this hover will have content set on it's left, top, right and
1481  * middle positions. In the middle position we are placing a button that when
1482  * clicked will hide the hover. We are also going to use a non-default theme
1483  * for our hover. We won't explain the functioning of button for that see @ref
1484  * Button.
1485  *
1486  * We start our example with a couple of callbacks that show and hide the data
1487  * they're given(which we'll see later on is the hover widget):
1488  * @skip static
1489  * @until }
1490  * @until }
1491  *
1492  * In our main function we'll do some initialization and then create 3
1493  * rectangles, one red, one green and one blue to use in our hover. We'll also
1494  * create the 2 buttons that will show and hide the hover:
1495  * @until show(bt2)
1496  *
1497  * With all of that squared away we can now get to the heart of the matter,
1498  * creating our hover widget, which is easy as pie:
1499  * @until hover
1500  *
1501  * Having created our hover we now need to set the parent and target. Which if
1502  * you recall from the function documentations are going to tell the hover which
1503  * area it should cover and where it should be centered:
1504  * @until bt
1505  *
1506  * Now we set the theme for our hover. We're using the popout theme which gives
1507  * our contents a white background and causes their appearance to be animated:
1508  * @until popout
1509  *
1510  * And finally we set the content for our positions:
1511  * @until bt2
1512  *
1513  * So far so good? Great 'cause that's all there is too it, what is left now is
1514  * just connecting our buttons to the callbacks we defined at the beginning of
1515  * the example and run the main loop:
1516  * @until ELM_MAIN
1517  *
1518  * Our example will initially look like this:
1519  * @image html screenshots/hover_example_01.png
1520  * @image latex screenshots/hover_example_01.eps
1521  *
1522  * And after you click the "Show hover" button it will look like this:
1523  * @image html screenshots/hover_example_01_a.png
1524  * @image latex screenshots/hover_example_01_a.eps
1525  *
1526  * @example hover_example_01.c
1527  */
1528
1529 /**
1530   * @page tutorial_flip Flip example
1531   * @dontinclude flip_example_01.c
1532   *
1533   * This example will show a flip with two rectangles on it(one blue, one
1534   * green). Our example will allow the user to choose the animation the flip
1535   * uses and to interact with it. To allow the user to choose the interaction
1536   * mode we use radio buttons, we will however not explain them, if you would
1537   * like to know more about radio buttons see @ref radio.
1538   *
1539   * We start our example with the usual setup and then create the 2 rectangles
1540   * we will use in our flip:
1541   * @until show(rect2)
1542   *
1543   * The next thing to do is to create our flip and set it's front and back
1544   * content:
1545   * @until show
1546   *
1547   * The next thing we do is set the interaction mode(which the user can later
1548   * change) to the page animation:
1549   * @until PAGE
1550   *
1551   * Setting a interaction mode however is not sufficient, we also need to
1552   * choose which directions we allow interaction from, for this example we
1553   * will use all of them:
1554   * @until RIGHT
1555   *
1556   * We are also going to set the hitsize to the entire flip(in all directions)
1557   * to make our flip very easy to interact with:
1558   * @until RIGHT
1559   *
1560   * After that we create our radio buttons and start the main loop:
1561   * @until ELM_MAIN()
1562   *
1563   * When the user clicks a radio button a function that changes the
1564   * interaction mode and animates the flip is called:
1565   * @until }
1566   * @note The elm_flip_go() call here serves no purpose other than to
1567   * ilustrate that it's possible to animate the flip programmatically.
1568   *
1569   * Our example will look like this:
1570   * @image html screenshots/flip_example_01.png
1571   * @image latex screenshots/flip_example_01.eps
1572   * @note Since this is an animated example the screenshot doesn't do it
1573   * justice, it is a good idea to compile it and see the animations.
1574   *
1575   * @example flip_example_01.c
1576   */
1577
1578  /**
1579   * @page tutorial_label Label example
1580   * @dontinclude label_example_01.c
1581   *
1582   * In this example we are going to create 6 labels, set some properties on
1583   * them and see what changes in appearance those properties cause.
1584   *
1585   * We start with the setup code that by now you should be familiar with:
1586   * @until show(bg)
1587   *
1588   * For our first label we have a moderately long text(that doesn't fit in the
1589   * label's width) so we will make it a sliding label. Since the text isn't
1590   * too long we don't need the animation to be very long, 3 seconds should
1591   * give us a nice speed:
1592   * @until show(label
1593   *
1594   * For our second label we have the same text, but this time we aren't going
1595   * to have it slide, we're going to ellipsize it. Because we ask our label
1596   * widget to ellipsize the text it will first diminsh the fontsize so that it
1597   * can show as much of the text as possible:
1598   * @until show(label
1599   *
1600   * For the third label we are going to ellipsize the text again, however this
1601   * time to make sure the fontsize isn't diminshed we will set a line wrap.
1602   * The wrap won't actually cause a line break because we set the label to
1603   * ellipsize:
1604   * @until show(label
1605   *
1606   * For our fourth label we will set line wrapping but won't set ellipsis, so
1607   * that our text will indeed be wrapped instead of ellipsized. For this label
1608   * we choose character wrap:
1609   * @until show(label
1610   *
1611   * Just two more, for our fifth label we do the same as for the fourth
1612   * except we set the wrap to word:
1613   * @until show(label
1614   *
1615   * And last but not least for our sixth label we set the style to "marker" and
1616   * the color to red(the default color is white which would be hard to see on
1617   * our white background):
1618   * @until show(label
1619   *
1620   * Our example will look like this:
1621   * @image html screenshots/label_example_01.png
1622   * @image latex screenshots/label_example_01.eps
1623   *
1624   * @example label_example_01.c
1625   */
1626
1627  /**
1628   * @page tutorial_image Image example
1629   * @dontinclude image_example_01.c
1630   *
1631   * This example is as simple as possible. An image object will be added to the
1632   * window over a white background, and set to be resizeable together with the
1633   * window. All the options set through the example will affect the behavior of
1634   * this image.
1635   *
1636   * We start with the code for creating a window and its background, and also
1637   * add the code to write the path to the image that will be loaded:
1638   *
1639   * @skip int
1640   * @until snprintf
1641   *
1642   * Now we create the image object, and set that file to be loaded:
1643   *
1644   * @until }
1645   *
1646   * We can now go setting our options.
1647   *
1648   * elm_image_no_scale_set() is used just to set this value to true (we
1649   * don't want to scale our image anyway, just resize it).
1650   *
1651   * elm_image_scale_set() is used to allow the image to be resized to a size
1652   * smaller than the original one, but not to a size bigger than it.
1653   *
1654   * elm_elm_image_smooth_set() will disable the smooth scaling, so the scale
1655   * algorithm used to scale the image to the new object size is going to be
1656   * faster, but with a lower quality.
1657   *
1658   * elm_image_orient_set() is used to flip the image around the (1, 0) (0, 1)
1659   * diagonal.
1660   *
1661   * elm_image_aspect_ratio_retained_set() is used to keep the original aspect
1662   * ratio of the image, even when the window is resized to another aspect ratio.
1663   *
1664   * elm_image_fill_outside_set() is used to ensure that the image will fill the
1665   * entire area available to it, even if keeping the aspect ratio. The image
1666   * will overflow its width or height (any of them that is necessary) to the
1667   * object area, instead of resizing the image down until it can fit entirely in
1668   * this area.
1669   *
1670   * elm_image_editable_set() is used just to cover the API, but won't affect
1671   * this example since we are not using any copy & paste property.
1672   *
1673   * This is the code for setting these options:
1674   *
1675   * @until editable
1676   *
1677   * Now some last touches in our object size hints, window and background, to
1678   * display this image properly:
1679   *
1680   * @until ELM_MAIN
1681   *
1682   * This example will look like this:
1683   *
1684   * @image html screenshots/image_example_01.png
1685   * @image latex screenshots/image_example_01.eps
1686   *
1687   * @example image_example_01.c
1688   */
1689
1690 /**
1691  * @page bg_example_01_c bg_example_01.c
1692  * @include bg_example_01.c
1693  * @example bg_example_01.c
1694  */
1695
1696 /**
1697  * @page bg_example_02_c bg_example_02.c
1698  * @include bg_example_02.c
1699  * @example bg_example_02.c
1700  */
1701
1702 /**
1703  * @page bg_example_03_c bg_example_03.c
1704  * @include bg_example_03.c
1705  * @example bg_example_03.c
1706  */
1707
1708 /**
1709  * @page actionslider_example_01 Actionslider example
1710  * @include actionslider_example_01.c
1711  * @example actionslider_example_01.c
1712  */
1713
1714 /**
1715  * @page animator_example_01_c Animator example 01
1716  * @include animator_example_01.c
1717  * @example animator_example_01.c
1718  */
1719
1720 /**
1721  * @page transit_example_01_c Transit example 1
1722  * @include transit_example_01.c
1723  * @example transit_example_01.c
1724  */
1725
1726 /**
1727  * @page transit_example_02_c Transit example 2
1728  * @include transit_example_02.c
1729  * @example transit_example_02.c
1730  */
1731
1732 /**
1733  * @page general_functions_example_c General (top-level) functions example
1734  * @include general_funcs_example.c
1735  * @example general_funcs_example.c
1736  */