e6d53679546218e23486b13558ba0cf664dae000
[framework/uifw/evas.git] / doc / examples.dox
1 /**
2  * @page Examples Examples
3  *
4  * Here is a page with examples.
5  *
6  * @ref Example_Evas_Buffer_Simple
7  *
8  * @ref Example_Evas_Init_Shutdown
9  *
10  * @ref Example_Evas_Images
11  *
12  * @ref Example_Evas_Images_2
13  *
14  * @ref Example_Evas_Events
15  *
16  * @ref Example_Evas_Object_Manipulation
17  *
18  * @ref Example_Evas_Aspect_Hints
19  *
20  * @ref Example_Evas_Size_Hints
21  *
22  * @ref Example_Evas_Stacking
23  *
24  * @ref Example_Evas_Smart_Objects
25  */
26
27 /**
28  * @page Example_Evas_Buffer_Simple Simple Evas canvas example
29  *
30  * The canvas will here use the buffer engine.
31  *
32  * @include evas-buffer-simple.c
33  * @example evas-buffer-simple.c
34  */
35
36 /**
37  * @page Example_Evas_Init_Shutdown Evas' init/shutdown routines example
38  *
39  * @include evas-init-shutdown.c
40  * @example evas-init-shutdown.c
41  */
42
43 /**
44  * @page Example_Evas_Images Some image object functions examples
45  * @dontinclude evas-images.c
46  *
47  * In this example, we add two images to a canvas, each one having a
48  * quarter of the canvas' size, positioned on the top left and bottom
49  * right corners, respectively:
50  * @skip img1 = evas_object_image_add(d.evas);
51  * @until ecore_main_loop_begin
52  * See there is a border image around the top left one, <b>which is
53  * the one that should be displayed</b>. The other one will (on
54  * purpose) fail to load, because we set a wrong file path as image
55  * source on it:
56  * @dontinclude evas-images.c
57  * @skip valid_path
58  * @until bogus_path
59  * This is how one is supposed to test for success when binding source
60  * images to image objects: evas_object_image_load_error_get(),
61  * followed by evas_load_error_str(), if one wants to pretty print/log
62  * the error. We'll talk about the border image further.
63  *
64  * To interact with the program, there's a command line interface,
65  * whose help string can be asked for with the 'h' key:
66  * @dontinclude evas-images.c
67  * @skip commands
68  * @until ;
69  * The first four commands will change the top left images's @b fill property
70  * values, which dictate how the source image (Enlightenment's logo)
71  * is to be displayed through the image object's area. Experiment with
72  * those switches until you get the idea of evas_object_fill_set().
73  *
74  * The 'f' command will toggle that image's "filled" property, which
75  * is wheter it should track its size and set the fill one to fit the
76  * object's boundaries perfectly (stretching). Note that this command
77  * and the four above it will conflict: in real usage one would use
78  * one or other ways of setting an image object's viewport with regard
79  * to its image source.
80  *
81  * There are four commands which deal with the border image. This red
82  * frame is there to illustrate <b>image borders</b>. The image source
83  * for the border is a solid red rectangle, with a transparent @b
84  * rectangular area in its middle. See how we use it to get a 3 pixel
85  * wide frame with <code>evas_object_image_border_set(d.border, 3, 3,
86  * 3, 3)</code>. To finish the effect of showing it as a border, we
87  * issue <code>evas_object_image_border_center_fill_set(d.border,
88  * EVAS_BORDER_FILL_NONE)</code>.
89  *
90  * Use 't' to change the border's thickness. 'b' will change the
91  * border image's center region rendering schema: either a hole (no
92  * rendering), blending (see the original transparent area, in this
93  * case) or solid (the transparent area gets filled). Finally, 'c'
94  * will change the border's scaling factor.
95  *
96  * While you have the border in 'blending mode', test the command 'm':
97  * it will set whether to use or not smooth scaling on the border's
98  * source image. Since the image is small originallly (30 x 30), we're
99  * obviously up-scaling it (except the border pixels, do you
100  * remember?). With this last switch, you'll either see the
101  * transparent shape in the middle flat (no smoothing) or blurry
102  * (smoothed).
103  *
104  * The full example follows.
105  *
106  * @include evas-images.c
107  * @example evas-images.c
108  */
109
110 /**
111  * @page Example_Evas_Images_2 Some more image object functions examples (2nd block)
112  * @dontinclude evas-images2.c
113  *
114  * In this example, we have three images on the canvas, but one of
115  * them is special -- we're using it as a <b>proxy image
116  * object</b>. It will mirror the contents of the other two images
117  * (which are the ones on the top of the canvas), one at a time:
118  * @skip d.proxy_img = evas_object_image_filled_add(d.evas);
119  * @until evas_object_show(d.proxy_img);
120  * As in other examples, we have a command line interface on it.
121  * @dontinclude evas-images2.c
122  * @skip commands
123  * @until ;
124  * The 'p' one will change the source of the proxy image to one of the
125  * other two, as seem above.
126  * @skip if (strcmp(ev->keyname, "p") == 0)
127  * @until }
128  * Note the top right image, the smaller one:
129  * @dontinclude evas-images2.c
130  * @skip noise_img =
131  * @until show
132  * Since we are creating the data for its pixel buffer ourselves, we
133  * have to set its size with evas_object_image_size_set(), first. We
134  * set our data with the function evas_object_image_data_set(),
135  * whose second argument is a buffer with random data. There's a last
136  * command to print it's @b stride value. Since its created with one
137  * quarter of the canvas's original width
138  * @dontinclude evas-images2.c
139  * @skip define WIDTH
140  * @until define HEIGHT
141  * you can check this value.
142  *
143  * The image on the top left also has a subtlety: it is @b pre-loaded
144  * on this example.
145  * @dontinclude evas-images2.c
146  * @skip d.logo =
147  * @until show
148  * On real use cases we wouldn't be just printing something like this
149  * @dontinclude evas-images2.c
150  * @skip static void
151  * @until }
152  * naturally.
153  *
154  * The 's' command will save one of the images on the disk, in the png
155  * format:
156  * @dontinclude evas-images2.c
157  * @skip if (strcmp(ev->keyname, "a") == 0)
158  * @until }
159  *
160  * The full example follows.
161  *
162  * @include evas-images2.c
163  * @example evas-images2.c
164  */
165
166 /**
167  * @page Example_Evas_Events Evas events (canvas and object ones) and some canvas operations example
168  * @dontinclude evas-events.c
169  *
170  * In this example we illustrate how to interact with canvas' (and
171  * its objects') events and other canvas operations.
172  *
173  * After we grab our canvas pointer, we registrate two event callbacks on it:
174  * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
175  * @until two canvas event callbacks
176  * The first of them, whose code is
177  * @dontinclude evas-events.c
178  * @skip render flush callback
179  * @until }
180  * will be called whenever our canvas has to flush its rendering pipeline.
181  * In this example, two ways of observing that message which is printed in
182  * the cited callback are:
183  * - to resize the example's window (thus resizing the canvas' viewport)
184  * - let the animation run
185  *
186  * When one resizes the canvas, there's at least one operation it has
187  * to do which will require new calculation for rendering: the
188  * resizing of the background rectangle:
189  * @dontinclude evas-events.c
190  * @skip here just to keep
191  * @until }
192  * The animation we talked about comes from a timer we register just before
193  * we start the example's main loop:
194  * @dontinclude evas-events.c
195  * @skip d.resize_timer = ecore
196  * @until d.resize_timer = ecore
197  * being the timer's callback what follows:
198  * @dontinclude evas-events.c
199  * @skip put some action
200  * @until }
201  * As you see, the resizing of the image will also force the canvas to
202  * repaint itself, thus flushing the rendering pipeline whenever the
203  * timer ticks. When you start this example, this animation will be
204  * running, by default. To interact with the program, there's a
205  * command line interface, whose help string can be asked for with the
206  * 'h' key:
207  * @dontinclude evas-events.c
208  * @skip if (strcmp(ev->keyname, "h") == 0)
209  * @until }
210  * These are the commands the example will accept at any time, except
211  * when one triggers the 'f' one:
212  * @skip if (strcmp(ev->keyname, "f") == 0)
213  * @until }
214  * This command will exemplify evas_event_freeze(), which interrupts
215  * @b all input events processing for the canvas (in the example, just
216  * for 3 seconds). Try to issue events for it during that freeze time.
217  * The 'd' command will unregister those two canvas callbacks for you,
218  * so you won't see the messages about the focused object and the
219  * rendering process anymore:
220  * @dontinclude evas-events.c
221  * @skip if (strcmp(ev->keyname, "d") == 0)
222  * @until }
223  * The second of those callbacks has the following code:
224  * @dontinclude evas-events.c
225  * @skip called when our rectangle gets focus
226  * @until }
227  * It will take place whenever an object in the canvas receives
228  * focus. In this example, we use the focus to handle the input
229  * events:
230  * @skip so we get input events
231  * @until }
232  * The background rectangle is the chosen object to receive the
233  * focus. This also illustrates the use of
234  * evas_object_event_callback_add(), which registers an event callback
235  * on an Evas @b object (in this case, the event of a key being
236  * pressed down). On this callback, we examine each key pressed and,
237  * if they match one between the expected, we take some actions:
238  * @dontinclude evas-events.c
239  * @skip examine the keys pressed
240  * @until key grab
241  * We do so by examining the @c ev->keyname string (remember the event
242  * information struct for key down events is the #Evas_Event_Key_Down
243  * one).  There's one more trick for grabbing input events on this
244  * example -- evas_object_key_grab(). The 'c' command will, when
245  * firstly used, @b unfocus the background rectangle. Unfocused
246  * objects on an Evas canvas will @b never receive key events. We
247  * grab, then, the keys we're interested at, to the object forcefully:
248  * @skip if (d.focus)
249  * @until got here by key grabs
250  * This shows how one can handle input not depending on focus issues
251  * -- you can grab them globally. Switch back and forth focus and
252  * forced key grabbing with the 'c' key, and observe the messages
253  * printed about the focused object.  Observe, also, that we register
254  * two more @b object callbacks, this time on the image object
255  * (Enlightenment logo):
256  * @skip evas_object_show(d.img);
257  * @until mouse_out, NULL
258  * whose code blocks are
259  * @dontinclude evas-events.c
260  * @skip mouse enters the object's area
261  * @until mouse exits the object's area
262  * Experiment with moving the mouse pointer over the image, letting it
263  * enter and exit its area (stop the animation with 'a', for a better
264  * experience). When you start the example, Evas will consider this
265  * area by being the whole boundary rectangle around the picture. If
266  * you issue the 'p' command, though, you get a demonstration of Evas'
267  * precise point collision detection on objects:
268  * @dontinclude evas-events.c
269  * @skip if (strcmp(ev->keyname, "p") == 0)
270  * @until }
271  * With evas_object_precise_is_inside_get(), one can make Evas
272  * consider the transparent areas of an object (the middle of the
273  * logo's E letter, in the case) as not belonging to it when
274  * calculating mouse in/out/up/down events. To finish the example, try
275  * the command bound to Cotrol + 'o':
276  * @skip mods = evas_key_modifier_get(evas);
277  * @until end of obscured region command
278  * It exemplifies Evas' <b>obscured regions</b>. When firstly pressed,
279  * you'll get the same contents, in a region in the middle of the
280  * canvas, at the time the key was pressed, until you toggle the
281  * effect off again (make sure the animation is running on to get the
282  * idea better). When you toggle this effect off, we also demonstrate
283  * the use of evas_render_updates(), which will force immediate
284  * updates on the canvas rendering, bringing back the obscured
285  * region's contents to normal.
286  *
287  * What follows is the complete code for this example.
288  *
289  * @include evas-events.c
290  * @example evas-events.c
291  */
292
293 /**
294  * @page Example_Evas_Object_Manipulation Evas objects basic manipulation example
295  *
296  * @include evas-object-manipulation.c
297  * @example evas-object-manipulation.c
298  */
299
300 /**
301  * @page Example_Evas_Aspect_Hints Evas aspect hints example
302  *
303  * @include evas-aspect-hints.c
304  * @example evas-aspect-hints.c
305  */
306
307 /**
308  * @page Example_Evas_Size_Hints Evas alignment, minimum size, maximum size, padding and weight hints example
309  *
310  * @include evas-hints.c
311  * @example evas-hints.c
312  */
313
314 /**
315  * @page Example_Evas_Stacking Evas object stacking functions (and some event handling)
316  * @dontinclude evas-stacking.c
317  *
318  * In this example, we illustrate how to stack objects in a custom
319  * manner and how to deal with layers.
320  *
321  * We have three objects of interest in it -- white background, red
322  * rectangle, green rectangle and blue rectangle.
323  * @skip d.bg = evas_object_rectangle_add(d.canvas);
324  * @until evas_object_resize(d.bg, WIDTH, HEIGHT);
325  * @skip d.rects[2] = evas_object_rectangle_add(d.canvas);
326  * @until evas_object_show(d.rects[0]);
327  * @dontinclude evas-stacking.c
328  * Like in other Evas examples, one interacts with it be means of key commands:
329  * @skip "commands are:\n"
330  * @until "\th - print help\n");
331  * At any given point, like seem above, you'll be operating one rectangle only.
332  * Try stacking it below an adjacent object with "b":
333  * @skip evas_object_stack_below(d.rects[d.cur_rect], neighbour);
334  * @until evas_object_stack_below(d.rects[d.cur_rect], neighbour);
335  * @dontinclude evas-stacking.c
336  * "a" will do the opposite:
337  * @skip evas_object_stack_above(d.rects[d.cur_rect], neighbour);
338  * @until evas_object_stack_above(d.rects[d.cur_rect], neighbour);
339  * To bring it directly to the top/bottom, use "t"/"m", respectively:
340  * @dontinclude evas-stacking.c
341  * @skip evas_object_raise(d.rects[d.cur_rect]);
342  * @until evas_object_raise(d.rects[d.cur_rect]);
343  * @skip evas_object_lower(d.rects[d.cur_rect]);
344  * @until evas_object_lower(d.rects[d.cur_rect]);
345  * At any time, use the "s" command to see the status of the
346  * ordering. It will show the background's ordering too. Note that it
347  * also shows the @b layer for this object. It starts at a @b
348  * different layer than the others. Use "l" to change its layer
349  * (higher layer numbers mean higher layers). If the background is on
350  * the same layer as the others (0), you'll see it interact with them
351  * on the ordering. If it's in the layer above, no matter what you do,
352  * you'll see nothing but the white rectangle: it covers the other
353  * layers. For the initial layer (-1), it will never mess nor occlude
354  * the others.
355  *
356  * The last two commands available are "p" and "r", which will make
357  * the target rectangle to @b pass (ignore) and @b repeat the mouse
358  * events occurring on it (the commands will cycle through on and off
359  * states). This is demonstrated with the following
360  * #EVAS_CALLBACK_MOUSE_DOWN callback, registered on each of the
361  * colored rectangles:
362  * @dontinclude evas-stacking.c
363  * @skip static void
364  * @until }
365  * Try to change these properties on the three rectangles while
366  * experimenting with mouse clicks on their intersection region.
367  *
368  * The full example follows.
369  *
370  * @include evas-stacking.c
371  * @example evas-stacking.c
372  */
373
374 /**
375  * @page Example_Evas_Map_Overview Evas Map - Overview
376  * @dontinclude evas-map-utils.c
377  *
378  * Down to the very bottom, Map is simple: it takes an object and transforms
379  * the way it will be shown on screen. But using it properly can be a bit
380  * troublesome.
381  *
382  * For the most common operations there are utility functions that help in
383  * setting up the map to achieve the desired effects. Now we'll go through
384  * an overview of the map API and some of the things that can be done with
385  * it.
386  *
387  * The full code can be found @ref evas-map-utils.c "here".
388  *
389  * To show how some funtions work, this example listens to keys pressed to
390  * toggle several options.
391  * @skip typedef
392  * @until App_Data
393  * @until ;
394  *
395  * In this program, we divide the window in four quadrants, each holding an
396  * object that will have different map configurations applied to them in each
397  * call to an animator function.
398  * @skip static Eina_Bool
399  * @until evas_output_size_get
400  *
401  * Let's first create a map and set some of our options to it. Only four
402  * points maps are supported, so we'll stick to that magic number. We can
403  * set a color for each vertex or apply one for all of them at once
404  * @until evas_map_util_points_color_set
405  *
406  * For the first object, we'll have a plain rectangle. At its cration, this
407  * rectangle was set to be semi-transparent, but whether its own alpha is
408  * used will be defined by the map's alpha setting. If the map's alpha is
409  * disabled, then the object will be completely opaque. The map's own color,
410  * however, will use any alpha set to it.
411  *
412  * So we get our object, initialize our map geometry to match the rectangle
413  * and make it rotate around its own center, then apply the map to the
414  * object so it takes effect.
415  * @until evas_object_map_enable_set
416  *
417  * The second object is an image. Here we don't have any color set for the
418  * object, but the image itself contains an alpha channel that will not be
419  * affected by the map settings, so even with alpha set to be off, the image
420  * will still be transparent. Color applied to the map will tint it though.
421  * Since setting a map copies it into the object, we can reuse the same one
422  * we created before. We initialize it to the new object while all other
423  * options are kept the same. Notice that no rotation will be done here, as
424  * that's just an utility function that takes the coordinates set for each
425  * point of the map and transforms it accordingly.
426  * @until evas_map_util_points_populate_from_object_full
427  *
428  * This time the object is a bit farther into the screen, by using a @c z
429  * value higher than 0 to init the map. We also need to map the image used
430  * by the object, so Evas knows how to transform it properly. For this we
431  * use the evas_map_point_image_uv_set() to tell the map what coordinate
432  * within the image corresponds to each point of the map.
433  * @until evas_map_point_image_uv_set(m, 3
434  *
435  * This object will also be rotated, but in all three axis and around some
436  * other point, not its center, chosen mostly at random. If enabled, lighting
437  * will be applied to, from a light source at the center of the window.
438  * @until evas_object_map_enable_set
439  *
440  * For the third object we are doing, once more, a 3D rotation, but this time
441  * perspective will be applied to our map to make it look more realistic.
442  * The lighting source also follows the mouse cursor and it's possible to
443  * toggle backface culling, so that the object is hidden whenever we are
444  * not seeing its front face.
445  * @until evas_object_map_enable_set
446  *
447  * And we free this map, since since we messed too much with it and for the
448  * last object we want something cleaner.
449  * @until evas_map_free
450  *
451  * The last object is actually two. One image, with an image set to it, and
452  * one image proxying the first one with evas_object_image_source_set(). This
453  * way, the second object will show whatever content its source has.
454  * This time we'll be using a map more manually to simulate a simple reflection
455  * of the original image.
456  *
457  * We know that the reflection object is placed just like the original, so
458  * we take a shortcut by just getting the geometry of our to-be-mapped object.
459  * We also need to get the image size of the source.
460  * @until evas_object_image_size_get
461  *
462  * For this we'll create a map shaped so that it begins at the base of our
463  * image and it expands horizontally as it grows (downwards) in height.
464  * @until evas_map_point_coord_set(m, 3
465  *
466  * Since the reflection should show the image inverted, we need to map it
467  * this way. The first point of the map (top-left) will be mapped to the
468  * mapped to the first pixel of the last row. There's no horizontal reflection
469  * and we want the full width of the image, but as we map its upper side ww
470  * will only take two thirds of the image.
471  * @until evas_map_point_image_uv_set(m, 3
472  *
473  * Finally, to fade out our reflection we set the colors for each point in
474  * the map. The two at the top need to be visible, but we'll tone them down
475  * a bit and make them a bit translucent. The other two will go straight to
476  * full transparency. Evas interpolates the colors from one point to the next,
477  * so this will make them fade out.
478  * @until evas_object_map_enable_set
479  *
480  * Close up by freeing the map and do some other things needed to keep stuff
481  * moving in our animations and we are done.
482  * @until }
483  *
484  * The rest of the program is setup and listening to key events. Nothing that
485  * matters within the scope of this example, so we are going to skip it.
486  * Refer to it @ref evas-map-utils.c "here" however to see how everything
487  * fits together.
488  *
489  * @example evas-map-utils.c
490  */
491
492 /**
493  * @page Example_Evas_Smart_Objects Evas object smart objects
494  * @dontinclude evas-smart-object.c
495  *
496  * In this example, we illustrate how to create and handle Evas smart objects.
497  *
498  * A smart object is one that provides custom functions to handle
499  * clipping, hiding, moving, resizing, color setting and more on @b
500  * child elements, automatically, for the smart object's user. They
501  * could be as simple as a group of objects that move together (see
502  * @ref Evas_Smart_Object_Clipped) or implementations of whole complex
503  * UI widgets, providing some intelligence (thus the name) and
504  * extension to simple Evas objects.
505  *
506  * Here, we create one as an example. What it does is to control (at
507  * maximum) 2 child objects, with regard to their geometries and
508  * colors. There can be a "left" child and a "right" one. The former
509  * will always occupy the top left quadrant of the smart object's
510  * area, while the latter will occupy the bottom right. The smart
511  * object will also contain an @b internal decorative border object,
512  * which will also be controlled by it, naturally.
513  *
514  * Here is where we add it to the canvas:
515  * @skip d.smt = evas_smart_example_add(d.evas);
516  * @until show
517  *
518  * The magic starts to happen in the @c evas_smart_example_add()
519  * function, which is one in the example smart object's defined @b
520  * interface. These should be the functions you would export to the
521  * users of your smart object. We made three for this one:
522  * - @c evas_smart_example_add(): add a new instance of the example
523  *   smart object to a canvas
524  * - @c evas_smart_example_remove(): remove a given child of the smart
525  *   object from it
526  * - @c evas_smart_example_set_left(): set the left child of the smart
527  *   object
528  * - @c evas_smart_example_set_right(): set the right child of the
529  *   smart object
530  *
531  * The object's creation takes place as:
532  * @dontinclude evas-smart-object.c
533  * @skip add a new example smart object to a canvas
534  * @until }
535  *
536  * Smart objects are define by <b>smart classes</b>, which are structs
537  * defining their interfaces, or <b>smart functions</b> (see
538  * #Evas_Smart_Class, the base class for any smart object).  As you
539  * see, one has to use the evas_object_smart_add() function to
540  * instantiate smart objects. Its second parameter is what matters --
541  * an #Evas_Smart struct, which contains all the smart class
542  * definitions (smart functions, smart callbacks, and the like). Note,
543  * however, that @c _evas_smart_example_smart_class_new() seems not to
544  * be defined in our example's code. That's because it came from a very
545  * handy <b>helper macro</b>:
546  * @dontinclude evas-smart-object.c
547  * @skip EVAS_SMART_SUBCLASS_NEW
548  * @until _signals
549  * What it does is to @b subclass a given existing smart class, thus
550  * specializing it. This is very common and useful in Evas. There is a
551  * built-in smart object, the "clipped smart object", whose behavior is
552  * mostly desired by many other smart object implementors: it will clip
553  * its children to its area and move them along with it, on
554  * evas_object_resize() calls. Then, our example smart object will get
555  * that behavior for free.
556  *
557  * The first argument to the macro,
558  * @dontinclude evas-smart-object.c
559  * @skip _evas_smart_example_type
560  * @until _evas_smart_example_type
561  * will define the new smart class' name. The second tells the macro
562  * what is the @b prefix of the function it will be declaring with a @c
563  * _smart_set_user() suffix. On this function, we may override/extend
564  * any desired method from our parent smart class:
565  * @dontinclude evas-smart-object.c
566  * @skip setting our smart interface
567  * @until }
568  *
569  * The first function pointer's code will take place at an example
570  * smart object's @b creation time:
571  * @dontinclude evas-smart-object.c
572  * @skip create and setup
573  * @until }
574  *
575  * The #EVAS_SMART_DATA_ALLOC macro will take care of allocating our
576  * smart object data, which will be available on other contexts for us
577  * (mainly in our interface functions):
578  * @dontinclude evas-smart-object.c
579  * @skip typedef struct _Evas_Smart_Example_Data
580  * @until };
581  *
582  * See that, as we're inheriting from the clipped smart object's
583  * class, we @b must have their data struct as our first member. Other
584  * data of interest for us is a child members array and the border
585  * object's handle. The latter is what is created in the last
586  * mentioned function. Note how to tell Evas the border will be
587  * managed by our smart object from that time on:
588  * <code>evas_object_smart_member_add(priv->border, o);</code>.
589  * The counterpart of this function is exemplifyed on the smart
590  * object's interface function to remove children:
591  * @skip remove a child element
592  * @until set to
593  *
594  * At the end of that function we make use of an constant defined by
595  * the #EVAS_SMART_SUBCLASS_NEW: @c _evas_smart_example_parent_sc. It
596  * has the same prefix we passed to the macro, as you can see, and it
597  * holds a pointer to our @b parent smart class. Then, we can call the
598  * specialized method, itself, after our code. The @c del, @c hide, @c
599  * show and @c resize specializations are straightforward, we let the
600  * reader take a look at them below to check their behavior. What's
601  * interesting is the @c calculate one:
602  * @dontinclude evas-smart-object.c
603  * @skip act on child objects' properties
604  * @until setting
605  *
606  * This code will take place whenever the smart object itself is
607  * flagged "dirty", i.e., must be recalculated for rendering (that
608  * could come from changes on its clipper, resizing, moving,
609  * etc). There, we make sure the decorative border lies on the edges of
610  * the smart object and the children, if any, lie on their respective
611  * quadrants.
612  *
613  * After instantiating our smart object, we do some checks to exemplify
614  * some of the API on smart objects:
615  * @dontinclude evas-smart-object.c
616  * @skip ret = evas_object_smart_type_check
617  * @until "no"
618  * The evas_object_smart_type_check() one will assure we have the
619  * string naming our smart class really set to the live object. The
620  * evas_object_smart_clipped_clipper_get() exemplifyes usage of
621  * "static clippers" -- clipped smart objects have their global
622  * clippers flagged static.
623  *
624  * As in other examples, to interact with this one there's a command
625  * line interface, whose help string can be asked for with the 'h' key:
626  *
627  * @dontinclude evas-smart-object.c
628  * @skip static const char *commands =
629  * @until ;
630  * Use 'l' and 'r' keys, to create new rectangles and place them on the
631  * left (@c evas_smart_example_set_left()) or right
632  * (@c evas_smart_example_set_right()) spots of our smart object,
633  * respectively. The keyboard arrows will move the smart object along
634  * the canvas. See how it takes any child objects with it during its
635  * movement. The 'd' and 'i' keys will increase or decrease the smart
636  * object's size -- see how it affects the children's sizes,
637  * too. Finally, 'c' will change the color of the smart object's
638  * clipper (which is the exact internal clipper coming from a clipped
639  * smart object):
640  * @dontinclude evas-smart-object.c
641  * @skip d.clipper =
642  * @until .a);
643  *
644  * "Real life" examples of smart objects are Edje and Emotion objects:
645  * they both have independent libraries implementing their
646  * behavior. The full example follows.
647  *
648  * @include evas-smart-object.c
649  * @example evas-smart-object.c
650  */