efl

Форк
0
/
edje_examples.dox 
1296 строк · 44.4 Кб
1
/**
2
 * @page edje_examples Edje Examples
3
 *
4
 * Examples:
5
 * @li @ref Example_Edje_Basics
6
 * @li @ref tutorial_edje_nested
7
 * @li @ref tutorial_edje_swallow
8
 * @li @ref tutorial_edje_swallow2
9
 * @li @ref tutorial_edje_text
10
 * @li @ref tutorial_edje_table
11
 * @li @ref tutorial_edje_color_class
12
 * @li @ref Example_Edje_Signals_Messages
13
 * @li @ref tutorial_edje_box
14
 * @li @ref tutorial_edje_box2
15
 * @li @ref tutorial_edje_drag
16
 * @li @ref tutorial_edje_perspective
17
 * @li @ref tutorial_edje_animations
18
 * @li @ref tutorial_edje_multisense
19
 * @li @ref tutorial_edje_basic2
20
 * @li @ref tutorial_edje_signals_2
21
 * @li @ref tutorial_edje_animations_2
22
 */
23

24
/**
25
 * @page Example_Edje_Basics Edje basics example
26
 *
27
 * In this example, we illustrate how to start using the Edje library,
28
 * with the very basic one needs to instantiate an Edje object.
29
 *
30
 * We place, in the canvas, an Edje object along with a @b red border
31
 * image to delimit its geometry. After we instantiate the Edje
32
 * object, we @b have to set a file and a group, within that file, to
33
 * bind to it. For this example, we're using an EDC file which
34
 * declares two parts (blue and green rectangles) and an item data:
35
 * @include basic.edc
36
 *
37
 * We start by trying to access an @b unexistant group in the file, so
38
 * that you can see the usefulness of edje_object_load_error_get() and
39
 * edje_load_error_str(). Check that the error message will tell you
40
 * just that -- a group which didn't exist in the file was called for:
41
 * @dontinclude edje-basic.c
42
 * @skip file_path
43
 * @until file_path
44
 * @dontinclude edje-basic.c
45
 * @skip edje_object_add
46
 * @until }
47
 *
48
 * Than, we finally bind our Edje object to @c "example_group",
49
 * printing a message afterwards:
50
 * @dontinclude edje-basic.c
51
 * @skip file_path, "example_group"
52
 * @until object_show
53
 *
54
 * What follows is a series of Edje API calls which are of general
55
 * use. The first of them is edje_object_data_get(), which we use to
56
 * get the value we have put in the @c "example_data" data field, in
57
 * our EDC object declaration:
58
 * @dontinclude edje-basic.c
59
 * @skip data field in group
60
 * @until ;
61
 *
62
 * Than, we exemplify edje_object_part_exists():
63
 * @dontinclude edje-basic.c
64
 * @skip Testing if
65
 * @until ;
66
 *
67
 * The next call is to query @c "part_one"'s geometry, relative to the
68
 * whole Edje object's area. The part will be situated in the middle
69
 * of the Edje object's, because it has a restricted forced size (we
70
 * set its minimum size equal to its maximum, for that) and, by
71
 * default, parts are aligned to the center of their containers:
72
 * @dontinclude edje-basic.c
73
 * @skip part_geometry_get
74
 * @until x, y, w, h
75
 *
76
 * We can grab a direct pointer on the rectangle implementing @c
77
 * "part_one", by using edje_object_part_object_get(). Since we are
78
 * not allowed to set properties on it, we just check its color, to
79
 * assure its really blue, as declared in the EDC:
80
 * @dontinclude edje-basic.c
81
 * @skip color_get
82
 * @until x, y, w, h
83
 *
84
 * The @c "min" and @c "max" EDC properties can be queried with the
85
 * following calls:
86
 * @dontinclude edje-basic.c
87
 * @skip max_get
88
 * @until min. size is
89
 *
90
 * The next two calls are to make <b>size calculations</b> on our
91
 * object. Because of the minimum size declared for @c "part_one" part's
92
 * default state description, that will be our exact minimum
93
 * size calculated for the group (remember the @c "min" declaration at
94
 * group level is just a @b hint, not an enforcement). We then
95
 * exercise the edje_object_size_min_restricted_calc() function,
96
 * passing a minimum size of 500, in each axis. Since we have @b no
97
 * object bigger than that, it will be the minimum size calculated, in
98
 * the end:
99
 * @dontinclude edje-basic.c
100
 * @skip min_calc
101
 * @until size calculation is
102
 *
103
 * @c "part_two" part is there with a purpose: since it extrapolates
104
 * the Edje object's boundaries, the edje_object_parts_extends_calc()
105
 * function will report origin coordinates for the rectangle grouping
106
 * both parts with @b negative values, indicating it extrapolates to
107
 * the upper left of our group, just as we see it.
108
 *
109
 * To interact with the last features exemplified in the program,
110
 * there's a command line interface.  A help string can be asked for
111
 * with the 'h' key:
112
 * @dontinclude edje-basic.c
113
 * @skip commands
114
 * @until ;
115
 *
116
 * Those commands will change the scaling factors of our Edje objects.
117
 * The first of them, @c 's', will change Edje's @b global scaling
118
 * factor between @c 1.0 (no scaling) and @c 2.0 (double
119
 * scale). Scaling will be applied to @c "part_one", only, because
120
 * that's the part flagged to be scaled at EDC level:
121
 * @dontinclude edje-basic.c
122
 * @skip strcmp(ev->key, "s") == 0
123
 * @until }
124
 *
125
 * Note, finally, that the @c 's' command will depend on the 'r' one
126
 * to have its effects applied. The latter will change @c "part_one"'s
127
 * @b individual scaling factor, which @b overrides Edje's global
128
 * scaling factor. Only when the individual one is set to zero, will
129
 * the global one take effect:
130
 * @dontinclude edje-basic.c
131
 * @skip strcmp(ev->key, "r") == 0
132
 * @until }
133
 *
134
 *
135
 *
136
 * The example's window should look like this picture:
137
 *
138
 * @image html edje-basics-example.png
139
 * @image rtf edje-basics-example.png
140
 * @image latex edje-basics-example.eps width=\textwidth
141
 *
142
 * The full example follows.
143
 * @include edje-basic.c
144
 *
145
 * To compile use this command:
146
 * @verbatim
147
 * gcc -o edje-basic edje-basic.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
148
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
149
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
150
 *
151
 * edje_cc basic.edc
152
 * @endverbatim
153
 * @example edje-basic.c
154
 */
155

156
/**
157
 * @page tutorial_edje_nested Edje Nested Part (hierarchy) example
158
 *
159
 * Nested part feature represents the concept of hierarchy to edje.
160
 *
161
 * A nested part inherits it's location relatively to the parent part.
162
 * Thus, parent part modifications such move or map effects all nested parts.
163
 * To declare a nested part just start a new part declaration within
164
 * (before closing) the current part declaration.
165
 *
166
 * Note that nested part declaration is allowed only after
167
 * current part name is defined.
168
 *
169
 * Here's an example of a rect nested in other rect plus inner nested rect:
170
 * @include edje-nested.edc
171
 *
172
 * The example's window should look like this picture:
173
 *
174
 * @image html edje-nested.png
175
 * @image rtf edje-nested.png
176
 * @image latex edje-nested.eps width=\textwidth
177
 */
178

179
/**
180
 * @page tutorial_edje_swallow Swallow example
181
 * @dontinclude edje-swallow.c
182
 *
183
 * This is a simple example in which we create a rect and swallow it.
184
 *
185
 * Focusing on the relevant parts of the code we go right to the creation of our
186
 * rectangle. It should be noted that we don't resize or show our rect, that is
187
 * because when an object is swallowed it's geometry and visibility is
188
 * controlled by the theme:
189
 * @skip 20
190
 * @skipline evas_object_rectangle_add
191
 * @until swallow
192
 *
193
 * The other bit of code that is relevant to us now is our check that the
194
 * swallow worked:
195
 * @until printf
196
 *
197
 * The full source code follows:
198
 * @include edje-swallow.c
199
 *
200
 * To compile use this command:
201
 * @verbatim
202
 * gcc -o edje-swallow edje-swallow.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
203
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
204
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
205
 *
206
 * edje_cc swallow.edc
207
 * @endverbatim
208
 * @example edje-swallow.c
209
 */
210

211
/**
212
 * @page tutorial_edje_text Edje Text example
213
 *
214
 *
215
 * This example shows how to manipulate TEXT and TEXTBLOCK parts from code.
216
 *
217
 * The very first we are going to do is register a callback to react to changes
218
 * in the text of our parts:
219
 * @dontinclude edje-text.c
220
 * @skipline edje_object_text_change_cb_set
221
 *
222
 *
223
 * @dontinclude edje-text.c
224
 * @skipline text_change
225
 * @note Since edje_obj represent a group we'll be notified whenever any part's
226
 * text in that group changes.
227
 *
228
 * We now set the text for two our two parts:
229
 * @dontinclude edje-text.c
230
 * @skip text_set
231
 * @until edje_object_part_text_set(edje_obj, "part_two"
232
 * @note Since the "part_two" part is a TEXTBLOCK we can use formatting such as
233
 * @<b@>
234
 *
235
 * And we now move on to selection issues, first thing we do is make sure the
236
 * user can select text:
237
 * @dontinclude edje-text.c
238
 * @skip edje_object_part_text_select_allow_set
239
 * @until edje_object_part_text_select_all
240
 *
241
 * We then select the entire text, and print the selected text:
242
 * @dontinclude edje-text.c
243
 * @skipline printf("selection: %s\n",
244
 *
245
 * We now unselect the entire text(set selection to none), and print the
246
 * selected text:
247
 * @dontinclude edje-text.c
248
 * @skip edje_object_part_text_select_none
249
 * @until printf
250
 *
251
 * Our example will look like this:
252
 *
253
 * @image html edje-text.png
254
 * @image rtf edje-text.png
255
 * @image latex edje-text.eps width=\textwidth
256
 *
257
 * The full source code follows:
258
 * @include edje-text.c
259
 *
260
 *
261
 * The theme used in this example is:
262
 * @include text.edc
263
 *
264
 * To compile use this command:
265
 * @verbatim
266
 * gcc -o edje-text edje-text.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
267
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
268
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
269
 *
270
 * edje_cc text.edc
271
 * @endverbatim
272
 * @example edje-text.c
273
 */
274

275
/**
276
 * @page tutorial_edje_table Table example
277
 *
278
 * In this example, we illustrate how to organize your objects on a table, using
279
 * the edje_object_part_table functions. To be easier to understand the objects
280
 * in this example will be four simple rects, when the user click over one
281
 * item with the left button its is removed from the table, if any other button
282
 * was used all items are removed. For each action is printed a message with
283
 * the current number of rows and columns.
284
 *
285
 * We started creating an EDC file with one part of the type TABLE called
286
 * @b "table_part", that is the part which we will refer to access the table:
287
 * @include table.edc
288
 *
289
 * On the other hand, in the C file we first create the rectangles and added a
290
 * callback for mouse down, as you can see bellow:
291
 * @dontinclude edje-table.c
292
 * @skip _rects_create
293
 * @until }
294
 * @skip }
295
 * @until }
296
 *
297
 * With the objects created we have to pack them into the table, to do this, we
298
 * just have to use the function edje_object_part_table_pack().
299
 * @dontinclude edje-table.c
300
 * @skip (!edje_object_part_table_pack
301
 * @until 4
302
 *
303
 * The other bit of code that is relevant to us now is our event handler for
304
 * when the user click over the rectangle. Here we use the function
305
 * edje_object_part_table_unpack() to remove the item from the table or
306
 * edje_object_part_table_clear() to remove all items, it depends on which mouse
307
 * button the user uses.
308
 * @dontinclude edje-table.c
309
 * @skip _on_mouse_down
310
 * @until }
311
 *
312
 * Finally, the last important thing in this example is about how to know how many
313
 * columns and rows are there in the table, It should be noted that this function
314
 * don't tell you how many items are there in the table, just the number of the
315
 * columns and rows of the table.
316
 * @dontinclude edje-table.c
317
 * @skip _columns_rows_
318
 * @until }
319
 *
320
 * The example's window should look like this picture:
321
 *
322
 * @image html edje-table-example.png
323
 * @image rtf edje-table-example.png
324
 * @image latex edje-table-example.eps width=\textwidth
325
 *
326
 * The full source code follows:
327
 * @include edje-table.c
328
 *
329
 * To compile use this command:
330
 * @verbatim
331
 * gcc -o edje-table edje-table.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
332
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
333
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
334
 *
335
 * edje_cc table.edc
336
 * @endverbatim
337
 * @example edje-table.c
338
 */
339

340
/**
341
 * @page tutorial_edje_box Box example - basic usage
342
 *
343
 * This example shows how to append, insert and remove elements from an Edje box
344
 * part. It will make use of the edje_object_part_box functions.
345
 *
346
 * To play with this example, use mouse left click to delete an existing
347
 * rectangle from the box and right mouse click to add a new rectangle just
348
 * before the clicked one. Use the keyboard keys "a" to append a rectangle, "i"
349
 * to prepend, and "c" to remove all rectangles from the box.
350
 *
351
 * We will store our example global information in the data structure defined
352
 * below, and also set some callbacks for resizing the canvas and exiting the
353
 * window:
354
 *
355
 * @dontinclude edje-box.c
356
 * @skip static const char
357
 * @until ecore_evas_geometry_get
358
 * @until }
359
 *
360
 * In the @c main function, we create our @c Ecore_Evas, add a background to it,
361
 * and finally load our @c Edje file that contains a @c Box part. This part is
362
 * named @c "example/box" in this case, and we use this name to append elements
363
 * to it.
364
 *
365
 * The code until now is the one that follows:
366
 *
367
 * @dontinclude edje-box.c
368
 * @skip main(int argc __UNUSED__, char *argv[])
369
 * @until ecore_evas_data_set(ee, "background", bg)
370
 *
371
 * Also notice that we set the callback @c _bg_key_down for @c "key down" events
372
 * on the background object, and that object is the one with focus.
373
 *
374
 * Now we add some small rectangles to the box part, using the
375
 * edje_object_part_box_append() API, and set some callbacks for @c "mouse down"
376
 * events on every object. These callbacks will be used to add or delete objects
377
 * from the box part.
378
 *
379
 * @dontinclude edje-box.c
380
 * @skip bg = evas_object_rectangle_add(evas)
381
 * @until evas_object_event
382
 * @until }
383
 *
384
 * Now let's take a look at the callbacks for key down and mouse down events:
385
 *
386
 * @dontinclude edje-box.c
387
 * @skip ecore_evas_geometry_get
388
 * @skip static
389
 * @until evas_object_event
390
 * @until }
391
 * @until }
392
 *
393
 * This callback for mouse down events will get left clicks and remove the
394
 * object that received that left click from the box part, and then delete it.
395
 * This is done with the edje_object_part_box_remove() function.
396
 *
397
 * However, on right clicks it will create a new rectangle object, and add it
398
 * just before the right clicked object, using
399
 * edje_object_part_box_insert_before().
400
 *
401
 * And this is the key down callback:
402
 *
403
 * @until remove_all
404
 * @until }
405
 *
406
 * It will insert elements at the beginning of the box if "i" was pressed, using
407
 * edje_object_part_box_insert_at(). It will also append objects to the box if
408
 * "a" was pressed, just exactly like we did in the @c main function. And will
409
 * remove all objects (deleting them) if "c" was pressed.
410
 *
411
 * As you can see, this example uses the @c "horizontal_flow" layout for the
412
 * box, where each item is put linearly in rows, in as many rows as necessary to
413
 * store all of them.
414
 *
415
 * The example's window should look like this picture:
416
 *
417
 * @image html edje-box-example.png
418
 * @image rtf edje-box-example.png
419
 * @image latex edje-box-example.eps width=\textwidth
420
 *
421
 * The full source code follows:
422
 * @include edje-box.c
423
 *
424
 * To compile use this command:
425
 * @verbatim
426
 * gcc -o edje-box edje-box.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
427
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
428
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
429
 *
430
 * edje_cc box.edc
431
 * @endverbatim
432
 * @example edje-box.c
433
 */
434

435
/**
436
 * @page tutorial_edje_box2 Box example - custom layout
437
 *
438
 * This example shows how to register a custom layout to be used by the Edje box
439
 * part. It will use edje_box_layout_register() for that.
440
 *
441
 * To play with this example, use the keyboard modifier keys and number keys
442
 * together. The Ctrl key is used for adding elements, and Shift is used for
443
 * removing them. For instance, Ctrl + 3 will insert a new rectangle object in
444
 * the 3rd position of the box, while Shift + 6 will try to remove the 6th
445
 * element of the box.
446
 *
447
 * This example is very similar to the other box example, has a structure with
448
 * global data, a callback for key down events where we create or delete
449
 * rectangle objects and add or remove them to/from the box part.
450
 *
451
 * But the important part is the next one:
452
 *
453
 * @dontinclude edje-box2.c
454
 * @skip static void
455
 * @until }
456
 *
457
 * This code implements our custom layout, which will position every object
458
 * added to the box in a diagonal through the size of the box part. Notice that
459
 * it just calculates the position and offset based on the size of the box and
460
 * number of children, and then moves each child to the respective position.
461
 *
462
 * Later on the @c main function, everything we need to do is to register this
463
 * custom layout function with edje:
464
 *
465
 * @dontinclude edje-box2.c
466
 * @skipline edje_box_layout_register
467
 *
468
 * And use it inside the box.edc file:
469
 *
470
 * @dontinclude box.edc
471
 * @skip example/group2
472
 * @skip example/title
473
 * @skip part
474
 * @until BOX
475
 * @until example/box
476
 *
477
 * The example's window should look like this picture:
478
 *
479
 * @image html edje-box2-example.png
480
 * @image rtf edje-box2-example.png
481
 * @image latex edje-box2-example.eps width=\textwidth
482
 *
483
 * The full source code follows:
484
 * @include edje-box2.c
485
 *
486
 * To compile use this command:
487
 * @verbatim
488
 * gcc -o edje-box2 edje-box2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
489
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
490
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
491
 *
492
 * edje_cc box.edc
493
 * @endverbatim
494
 * @example edje-box2.c
495
 */
496

497
/**
498
 * @page tutorial_edje_drag Dragable parts example
499
 *
500
 * This example shows how to manipulate a dragable part through the
501
 * edje_object_part_drag API.
502
 *
503
 * First, in the edc code, we are declaring a part which will be our movable
504
 * part, called "knob". It is a normal rectangle, which contains a block called
505
 * "dragable", that will define the area where this rectangle can be moved, and
506
 * in which axis it can be moved.
507
 *
508
 * This is our part:
509
 *
510
 * @dontinclude drag.edc
511
 * @skip // drag_area
512
 * @skip part
513
 * @until example/knob
514
 * @until example/knob
515
 *
516
 * Notice that it defines, through its @c "x:" and @c "y:' properties, that the
517
 * part will be only moved on the y axis (vertical). Check the edc reference
518
 * docs for more info about this.
519
 *
520
 * Now, in our example C code, we just do the same as on the other examples,
521
 * setting some global data on a structure, load the edje file and so:
522
 *
523
 * @dontinclude edje-drag.c
524
 * @skip static const char *PARTNAME
525
 * @until ;
526
 *
527
 * @skip main(int argc __UNUSED__, char *argv[])
528
 * @until evas_object_show
529
 *
530
 * We want to use the drag_page and drag_step functions, and in order to do so we
531
 * need to define the step size and page size of our dragable part. They are
532
 * defined as float values which represent a portion of the entire size of the
533
 * dragable area:
534
 *
535
 * @until drag page step
536
 *
537
 * We are going to use the keyboard to move the @c knob part, through the key
538
 * down callback @c _bg_key_down, but we also want to know when the user has
539
 * moved the knob by using the mouse (which is possible, since we defined that
540
 * this part will receive mouse events). Thus, we set a callback for the signal
541
 * "drag", which comes from the dragable part:
542
 *
543
 * @dontinclude edje-drag.c
544
 * @skipline evas_object_event_callback_add
545
 *
546
 * @skipline edje_object_signal_callback_add
547
 *
548
 * Now, let's take a look at our key down callback:
549
 *
550
 * @dontinclude edje-drag.c
551
 * @skip _on_bg_key_down
552
 * @until }
553
 * @skip else
554
 * @until }
555
 * @skip else
556
 * @until }
557
 * @skip else
558
 * @until }
559
 * @skip else
560
 * @until }
561
 * @skip else
562
 * @until }
563
 * @skip else
564
 * @until }
565
 * @skip else
566
 * @until }
567
 *
568
 * On this callback we define that the user will use the "up" and "down" arrows
569
 * to move the dragable part, respectively, -1.0 and 1.0 times the step size.
570
 * And that the "Page Up" (Prior) and "Page Down" (Next) keys will move -1.0 and
571
 * 1.0 times the page size. Both of these will occur on the vertical axis, since
572
 * we pass 0.0 as value to the respective horizontal axis parameters. And our
573
 * dragable part also only supports being moved in the vertical axis (defined in
574
 * the edc).
575
 *
576
 * We also define that the "m" key will be used to explicitly position the knob
577
 * part in the middle of the dragable area.
578
 *
579
 * And here is the callback for the @c "drag" signal that is received from the
580
 * theme:
581
 *
582
 * @dontinclude edje-drag.c
583
 * @skip _on_knob_moved
584
 * @until }
585
 *
586
 * The example's window should look like this picture:
587
 *
588
 * @image html edje-drag-example.png
589
 * @image rtf edje-drag-example.png
590
 * @image latex edje-drag-example.eps width=\textwidth
591
 *
592
 * The full source code follows:
593
 * @include edje-drag.c
594
 *
595
 * To compile use this command:
596
 * @verbatim
597
 * gcc -o edje-drag edje-drag.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
598
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
599
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
600
 *
601
 * edje_cc drag.edc
602
 * @endverbatim
603
 * @example edje-drag.c
604
 */
605

606
/**
607
 * @page tutorial_edje_perspective Perspective example
608
 *
609
 * This example demonstrates how someone can set a perspective to be used by an
610
 * Edje object, but setting a global perspective. The API for setting a
611
 * perspective for just one Edje object is almost the same and it's trivial, so
612
 * we are not doing that on this example.
613
 *
614
 * Let's go first to the main function, where we start creating our objects and
615
 * loading the theme. We also set some variables that will be used globally in
616
 * our program:
617
 *
618
 * @dontinclude edje-perspective.c
619
 * @skip main(
620
 * @until focal =
621
 *
622
 * A boolean is used to indicate that we are animating.
623
 *
624
 * We also set the @c app.x and @c app.y to (0, 0) because the original position
625
 * of our text + rectangle part will be on top left. This is a convention that
626
 * we are using in this example, and setting x, y to 1, 1 would mean bottom
627
 * right.  We do this to later define the name of the signals that we are
628
 * sending to the theme.
629
 *
630
 * After this, some boilerplate code to load the theme:
631
 *
632
 * @until evas_object_show(app.bg)
633
 *
634
 * Now we are going to setup a callback to tell us that the animation has ended.
635
 * We do this just to avoid sending signals to the theme while it's animating.
636
 *
637
 * @until edje_object_signal
638
 *
639
 * Finally, let's create our perspective object, define its position, focal
640
 * distance and z plane position, and set it as global:
641
 *
642
 * @until global_set
643
 *
644
 * Notice that if we wanted to set it just to our edje object, instead of
645
 * setting the perspective as global to the entire canvas, we could just use
646
 * edje_object_perspective_set() instead of edje_perspective_global_set(). The
647
 * rest of the code would be exactly the same.
648
 *
649
 * Now, let's take a look at what we do in our callbacks.
650
 *
651
 * The callback for key_down is converting the arrow keys to a signal that
652
 * represents where we want our text and rectangle moved to. It does that by
653
 * using the following function:
654
 *
655
 * @dontinclude edje-perspective.c
656
 * @skip part_move(
657
 * @until }
658
 *
659
 * Notice that, after sending the signal to the Edje object, we set our boolean
660
 * to store that we are animating now. It will only be unset when we receive a
661
 * signal from the theme that the animation has ended.
662
 *
663
 * Now, on the key_down code, we just call this function when the arrows or
664
 * "PgUp" or "PgDown" keys are pressed:
665
 *
666
 * @until unhandled
667
 * @until }
668
 *
669
 * Notice that we also do something else when the numeric keyboard "+" and "-"
670
 * keys are pressed. We change the focal distance of our global perspective, and
671
 * that will affect the part that has a map rotation applied to it, with
672
 * perspective enabled. We also need to call edje_object_calc_force(), otherwise
673
 * the Edje object has no way to know that we changed the global perspective.
674
 *
675
 * Try playing with these keys and see what happens to the animation when the
676
 * value of the focal distance changes.
677
 *
678
 * Finally we add a callback for the animation ended signal:
679
 *
680
 * @skip  _animation_end_cb
681
 * @until }
682
 *
683
 *
684
 * The example's window should look like this picture:
685
 *
686
 * @image html edje-perspective-example.png
687
 * @image rtf edje-perspective-example.png
688
 * @image latex edje-perspective-example.eps width=\textwidth
689
 *
690
 * The full source code follows:
691
 * @include edje-perspective.c
692
 *
693
 * The full .edc file
694
 * @include perspective.edc
695
 *
696
 * To compile use this command:
697
 * @verbatim
698
 * gcc -o edje-perspective edje-perspective.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
699
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
700
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
701
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
702
 *
703
 * edje_cc perspective.edc
704
 * @endverbatim
705
 * @example edje-perspective.c
706
 */
707

708
/**
709
 * @page Example_Edje_Signals_Messages Edje signals and messages
710
 *
711
 * In this example, we illustrate how Edje signals and Edje messages
712
 * work.
713
 *
714
 * We place, in the canvas, an Edje object along with a @b red border
715
 * image to delimit its geometry. The object's group definition is so
716
 * that we have four parts:
717
 * - a blue rectangle, aligned to the right
718
 * - a white rectangle, aligned to the left
719
 * - a text part, aligned to the center
720
 * - a clipper rectangle on the blue rectangle
721
 *
722
 * The left rectangle is bound to a <b>color class</b>, so that we can
723
 * multiply its colors by chosen values on the go:
724
 * @dontinclude signals-messages.edc
725
 * @until visible
726
 * @until }
727
 * @until }
728
 * @until }
729
 *
730
 * The @c \#define's on the beginning will serve as message
731
 * identifiers, for our accorded message interface between the code
732
 * and the this theme file.
733
 *
734
 * Let's move to the code, then. After instantiating the Edje object,
735
 * we register two <b>signal callbacks</b> on it. The first one uses
736
 * @b globbing, making all of the wheel mouse actions over the left
737
 * rectangle to trigger @c _mouse_wheel. Note that those kind of
738
 * signals are generated @b internally (and automatically) in Edje. The
739
 * second is a direct signal match, to a (custom) signal we defined in
740
 * the EDC, ourselves:
741
 * @dontinclude edje-signals-messages.c
742
 * @skip edje_object_add
743
 * @until _mouse_over
744
 * @dontinclude edje-signals-messages.c
745
 * @skip print signals coming from theme
746
 * @until }
747
 * @until }
748
 *
749
 * That second callback is on a signal we emit on the theme, where we
750
 * just translate Edje @c "mouse,move" internal events to the custom @c
751
 * "mouse,over" one. When that signals reaches the code, we are,
752
 * besides printing the signals' strings, sending a @b message back to
753
 * the theme. We generate random values of color components and send
754
 * them as an #EDJE_MESSAGE_INT_SET message type:
755
 * @dontinclude signals-messages.edc
756
 * @skip custom signal
757
 * @until }
758
 * @dontinclude edje-signals-messages.c
759
 * @skip mouse over signals
760
 * @until }
761
 *
762
 * In our theme we'll be changing the @c "cc" color class' values with
763
 * those integer values of the message, so that moving the mouse over
764
 * the right rectangle will change the left one's colors:
765
 * @dontinclude signals-messages.edc
766
 * @skip public message
767
 * @until }
768
 * @until }
769
 *
770
 * Now we're also sending messages <b>from the Edje object</b>,
771
 * besides signals.  We do so when one clicks with the left button
772
 * over the left rectangle.  With that, we change the text part's
773
 * text, cycling between 3 pre-set strings declared in the EDC. With
774
 * each new text string attribution, we send a string message to our
775
 * code, with the current string as argument:
776
 * @dontinclude signals-messages.edc
777
 * @skip program
778
 * @until }
779
 * @until }
780
 * @skip change text
781
 * @until }
782
 * @until }
783
 * @dontinclude signals-messages.edc
784
 * @skip set_text_string
785
 * @until }
786
 *
787
 * To get the message in code, we have to register a message handler, as
788
 * follows:
789
 * @dontinclude edje-signals-messages.c
790
 * @skip message_handler_set
791
 * @until message_handler_set
792
 * @dontinclude edje-signals-messages.c
793
 * @skip print out
794
 * @until }
795
 *
796
 * To interact with the last missing feature -- emitting signals
797
 * <b>from code</b> -- there's a command line interface to exercise
798
 * it.  A help string can be asked for with the 'h' key:
799
 * @dontinclude edje-signals-messages.c
800
 * @skip commands
801
 * @until ;
802
 *
803
 * The @c 't' command will send either @c "part_right,show" or @c
804
 * "part_right,hide" signals to the Edje object (those being the
805
 * emission part of the signal), which was set to react on them as the
806
 * names indicate. We'll set the right rectangle's visibility on/off,
807
 * respectively, for those two signals:
808
 * @dontinclude signals-messages.edc
809
 * @skip hide right rectangle
810
 * @until }
811
 * @until }
812
 * @dontinclude edje-signals-messages.c
813
 * @skip key, "t"
814
 * @until }
815
 *
816
 * The example's window should look like this picture:
817
 *
818
 * @image html edje-signals-messages-example.png
819
 * @image rtf edje-signals-messages-example.png
820
 * @image latex edje-signals-messages-example.eps width=\textwidth
821
 *
822
 * The full example follows, along with its EDC file.
823
 *
824
 * @include signals-messages.edc
825
 * @include edje-signals-messages.c
826
 *
827
 * To compile use this command:
828
 * @verbatim
829
 * gcc -o edje-signals-messages edje-signals-messages.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
830
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
831
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
832
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
833
 *
834
 * edje_cc signals-messages.edc
835
 * @endverbatim
836
 * @example edje-signals-messages.c
837
 */
838

839
/**
840
 * @page tutorial_edje_color_class Edje Color Class example
841
 * @dontinclude edje-color-class.c
842
 *
843
 * This example shows how to manipulate and change Color classes. In this example
844
 * we will create two surfaces to show what happens when you change the color
845
 * class at the process and object level.
846
 *
847
 * It's a very simple example, there are two surfaces created from the same EDC,
848
 * but just in one of them we will set a specific color class, although both will be
849
 * affected by color class set at the process level as you will see.
850
 *
851
 * It's important you know that all colors has the format R G B A. Just to be easier
852
 * to understand this example, we will create a small set of colors that will be used
853
 * along of the example. This piece of code is shown below:
854
 * @skip static color colors_init_data
855
 * @until return EINA_FALSE
856
 * @until }
857
 *
858
 * Focusing on the relevant parts of the code we go right to the part where we set
859
 * the new color class. For that we will use the functions edje_color_class_set (
860
 * which will affect all edjes) and edje_object_color_class_set (which affects just
861
 * the specific object).
862
 * @skip edje_color_class_set
863
 * @until Text shadow
864
 * @until Text shadow
865
 * @note
866
 *       - argv[1] is the name of a color class used in the EDC.
867
 *       - The second and third colors only apply to text part.
868
 *       - The color class set for the object overrides the color previously set.
869
 *
870
 * After we have set the color class we will check the color classes, for that
871
 * we created a function which prints all color classes and tries to get theirs
872
 * values and print too.
873
 * @dontinclude edje-color-class.c
874
 * @skip _color_classes_print(void)
875
 * @until free
876
 * @until }
877
 * @until }
878
 *
879
 * There are two other things that are worth mentioning, we added two callbacks for the
880
 * objects, one for mouse down (that we use to delete the color class) and another
881
 * for the signal emitted when a color class is deleted.
882
 * @skip  evas_object_event
883
 * @until NULL
884
 * @skip  edje_object_si
885
 * @until process
886
 *
887
 * And then we delete the color class:
888
 * @dontinclude edje-color-class.c
889
 * @skip _on_mouse_down
890
 * @until }
891
 *
892
 * Our example will look like this, if you run with the parameters "green_class gray pink yellow":
893
 *
894
 * @image html edje-color-class-example.png
895
 * @image rtf edje-color-class-example.png
896
 * @image latex edje-color-class-example.eps width=\textwidth
897
 * @n
898
 * @image html edje-color-class-example2.png
899
 * @image rtf edje-color-class-example2.png
900
 * @image latex edje-color-class-example2.eps width=\textwidth
901
 *
902
 * The full source code follows:
903
 * @include edje-color-class.c
904
 *
905
 *
906
 * The theme used in this example is:
907
 * @include color-class.edc
908
 *
909
 *
910
 * To compile use this command:
911
 * @verbatim
912
 * gcc -o edje-color-class edje-color-class.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
913
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
914
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
915
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
916
 *
917
 * edje_cc color-class.edc
918
 * @endverbatim
919
 * @example edje-color-class.c
920
 */
921

922
/**
923
 * @page tutorial_edje_animations Edje Animations example
924
 *
925
 * In this example we will figure out how to manipulate the animations on
926
 * an Edje object. After reading this document you will be able to manipulate
927
 * the frametime, freeze, pause and stop, all animations on an Edje object.
928
 *
929
 * To play with this example you will use the keyboard. Below are listed the
930
 * keys and what each does.
931
 *
932
 * - '+' Increase the frametime;
933
 * - '-' Decrease the frametime;
934
 * - '=' Prints the actual frametime and says if the animations is playing;
935
 * - 'f' Freezes the animations in the Edje object;
936
 * - 'F' Freezes the animations in all objects in the running program;
937
 * - 't' Thaws the animations in the Edje object;
938
 * - 'T' Thaws the animations in all objects in the running program;
939
 * - 's' Pauses the animations;
940
 * - 'p' Plays the animations previously stopped;
941
 * - 'a' Starts the animation in the Edje object;
942
 * - 'A' Stops the animations in the Edje object;
943
 *
944
 * Now that we've explained how to use our example, we will see how it is made.
945
 * Let's start by looking at the piece of code responsible to the actions commented
946
 * above.
947
 * @dontinclude edje-animations.c
948
 * @skip _on_key_down
949
 * @until Stopping
950
 * @until }
951
 * @until }
952
 * @note The actions for the keys 'f' and 'F' will have the same effect in
953
 *       our example, just because there is only one object in the running
954
 *       program, The same happens with the keys 't' and 'T'.
955
 *
956
 * As you may have seen these set of functions are pretty easy to handle. The other
957
 * important part of this example is the EDC file. The animations used in the
958
 * code were created there
959
 * @dontinclude animations.edc
960
 * @skip program
961
 * @until after: "animation,state1"
962
 * @until }
963
 * @skip program
964
 * @until }
965
 * @skip program
966
 * @until }
967
 * @until }
968
 *
969
 * The example's window should look like this picture:
970
 *
971
 * @image html edje-animations.png
972
 * @image rtf edje-animations.png
973
 * @image latex edje-animations.eps width=\textwidth
974
 * @n
975
 * @image html edje-animations2.png
976
 * @image rtf edje-animations2.png
977
 * @image latex edje-animations2.eps width=\textwidth
978
 *
979
 * The full example follows.
980
 *
981
 * @include edje-animations.c
982
 * @include animations.edc
983
 *
984
 * To compile use this command:
985
 * @verbatim
986
 * gcc -o edje-animations edje-animations.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
987
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
988
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
989
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
990
 *
991
 * edje_cc animations.edc
992
 * @endverbatim
993
 */
994

995
 /**
996
 * @page tutorial_edje_multisense Multisense example
997
 * @dontinclude edje-multisense.c
998
 *
999
 * This is a simple example in which a rect is created and sound and tone
1000
 * are played on mouse down event.
1001
 *
1002
 * Focusing on the creation of sample and tone. It should be noted that
1003
 * creation of sample sound is from any supported (sndfile lib) audio file,
1004
 * tone from of specific audible frequency range are controlled by the theme:
1005
 *
1006
 * The full source code follows:
1007
 * @include edje-multisense.c
1008
 * @include multisense.edc
1009
 */
1010

1011
/**
1012
 * @page tutorial_edje_basic2 Edje basics example 2
1013
 *
1014
 * In this example we will show how to load an image and move it across the window.
1015
 *
1016
 * To load the image to our program, it needs to be declared in the .edc using the images block:
1017
 * @dontinclude basic2.edc
1018
 * @skip images
1019
 * @until }
1020
 *
1021
 * @note COMP means that we are using a lossless compression
1022
 *
1023
 * Then to be able to use it in our window we must declare a part for this image:
1024
 *
1025
 * @skip part{
1026
 * @until }
1027
 * @until }
1028
 * @until }
1029
 *
1030
 * Now we move to our .c file, you will notice this define:
1031
 * @dontinclude edje-basic2.c
1032
 * @skipline #define WALK
1033
 *
1034
 * This means how fast we want to move the image across the screen
1035
 *
1036
 * To load our edje file we will use this command, we do just like the last example (Basic example):
1037
 *
1038
 * @skip if(!edje_object
1039
 * @until evas_object_show
1040
 *
1041
 * If we want to move our image, we need to add a callback to be able to do this, so we define:
1042
 *
1043
 * @skipline evas_object_event_callback
1044
 *
1045
 * To get the position of the image we use this:
1046
 * @dontinclude edje-basic2.c
1047
 * @skipline evas_object_geometry
1048
 *
1049
 * Now we use the if's to check in what direction the user wants to move the image then we move it:
1050
 *
1051
 * @skip if(strcmp
1052
 * @until evas_object_move
1053
 *
1054
 * The example's window should look like this picture:
1055
 *
1056
 * @image html basic2final.png
1057
 * @image rtf basic2final.png
1058
 * @image latex basic2final.eps width=\textwidth
1059
 *
1060
 * The complete .edc file:
1061
 * @include basic2.edc
1062
 *
1063
 * And the source code:
1064
 * @include edje-basic2.c
1065
 *
1066
 * To compile use this command:
1067
 * @verbatim
1068
 * gcc -o edje-basic2 edje-basic2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
1069
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
1070
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
1071
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
1072
 *
1073
 * edje_cc -id /path/to/the/image basic2.edc
1074
 * @endverbatim
1075
 *
1076
 */
1077

1078
/**
1079
 * @page tutorial_edje_swallow2 Swallow example 2
1080
 *
1081
 * This example will show you how to load an image using evas and fill a swallow with it.
1082
 * It's basically almost like the last example, but with a minor change.
1083
 *
1084
 * This variables are used to store the name of the image that is going to be used,
1085
 * the path to it and a variable that will store the error cause if something goes wrong.
1086
 *
1087
 * Here it is:
1088
 * @dontinclude edje-swallow2.c
1089
 * @skipline const char  *edje_file
1090
 * @skipline const char  *img
1091
 * @skipline Evas_Load
1092
 *
1093
 *
1094
 * Then we load the image with this command:
1095
 *
1096
 * @skip img =
1097
 * @until evas_object_image_file_set(img,
1098
 *
1099
 * To check if we had some problem we use:
1100
 *
1101
 * @skip err = evas
1102
 * @until }
1103
 *
1104
 * Now we are going to swallow it and check if worked. If you notice we are
1105
 * using "part_one" as argument. We do this because we must explicit what part of our
1106
 * .edc file we want to swallow:
1107
 *
1108
 * @skip edje_object_part
1109
 * @until printf
1110
 *
1111
 * The example's window should look like this picture:
1112
 *
1113
 * @image html swallow2final.png
1114
 * @image rtf swallow2final.png
1115
 * @image latex swallow2final.eps width=\textwidth
1116
 *
1117
 * The complete .edc file:
1118
 * @include swallow.edc
1119
 *
1120
 * And the source code:
1121
 * @include edje-swallow2.c
1122
 *
1123
 * To compile use this command:
1124
 * @verbatim
1125
 * gcc -o edje-swallow2 edje-swallow2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
1126
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
1127
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
1128
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
1129
 *
1130
 * edje_cc swallow.edc
1131
 * @endverbatim
1132
 */
1133

1134
/**
1135
 * @page tutorial_edje_signals_2 Edje Signals example 2
1136
 *
1137
 * In this example we will make use of signals to help to move an image away from the mouse pointer.
1138
 *
1139
 * Signals are software interruption, this means that when it happens and if the program is sensitive to it
1140
 * the program will stop whatever it is doing and handle the signal.
1141
 *
1142
 * In this example we are only sensitive to the "mouse,move" signal so we need to register a callback to it.
1143
 * To do this we will add a signal callback to our edje object that will detect "mouse,move" signal
1144
 * coming from the part "part_image" and when this happens we will call the function _on_mouse_over passing
1145
 * the evas pointer as a parameter. The evas pointer is passed as a parameter because we need to know
1146
 * where is the mouse pointer in the screen.
1147
 *
1148
 * We can see bellow how we can listen to the signal:
1149
 *
1150
 * @dontinclude signals2.c
1151
 * @skip edje_object_signal
1152
 * @until );
1153
 *
1154
 *
1155
 * Now, let's pass to the callback function. If we want to keep the ball away from the mouse pointer
1156
 * we need to now where is the ball and where is the mouse and we can easily discovery these things using
1157
 * this:
1158
 *
1159
 * For the object position in the canvas:
1160
 * @dontinclude signals2.c
1161
 * @skipline evas_object_geometry
1162
 *
1163
 * For the mouse position relative to the screen:
1164
 * @skipline evas_pointer_output
1165
 *
1166
 * Now that we have the position of the mouse and the object we just need
1167
 * to set the new location and move the object. To set the new location we do this:
1168
 * @skip if
1169
 * @until y -= (
1170
 *
1171
 * You can change the formula above if you like. Because we are changing the object's position
1172
 * we need to do something if the new position is beyond the canvas size. So here it is:
1173
 *
1174
 * @skip if
1175
 * @until y = 0
1176
 *
1177
 * Then now what we need to do is move the object:
1178
 * @skipline  evas_object
1179
 *
1180
 * Here is the complete callback function:
1181
 *
1182
 * @dontinclude signals2.c
1183
 * @skip _on_mouse_over
1184
 * @until }
1185
 *
1186
 *
1187
 * When you compile and run it you should see this:
1188
 * @image html signal2final.png
1189
 * @image rtf signal2final.png
1190
 * @image latex signal2final.eps width=\textwidth
1191
 *
1192
 * The .edc file:
1193
 * @include signalsBubble.edc
1194
 *
1195
 * The source code:
1196
 * @include signals2.c
1197
 *
1198
 * To compile use this command:
1199
 * @verbatim
1200
 * gcc -o signals2 signals2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
1201
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
1202
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
1203
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
1204
 *
1205
 * edje_cc -id /path/to/the/image signalsBubble.edc
1206
 * @endverbatim
1207
 */
1208

1209
/**
1210
 * @page tutorial_edje_animations_2 Edje animations example 2
1211
 *
1212
 * In this example we will make an animation of a bouncing ball.
1213
 *
1214
 * Our focus now will be in the .edc file, because in the C source code we just load the edje object and do
1215
 * nothing else.
1216
 *
1217
 * We want to give the freedom to the object to use the whole canvas of our program, so lets define
1218
 * the min, max of our group:
1219
 *
1220
 * @dontinclude animations2.edc
1221
 * @skipline max
1222
 * @skipline min
1223
 *
1224
 * You will notice that in our .c file the canvas will have this size
1225
 *
1226
 * Now we will define our part that's going to be our image, the ball:
1227
 * @skip part{
1228
 * @until type:
1229
 *
1230
 *
1231
 * At the description block bellow we are saying that this part has an image, defining
1232
 * the max and min size and it's position on the edje_object. The default state is the first
1233
 * state of the part, this means that when the edje object is loaded this one is going to be showed to you.
1234
 *
1235
 * Here it is:
1236
 * @dontinclude animations2.edc
1237
 * @skip description
1238
 * @until }
1239
 * @until }
1240
 *
1241
 * Now in the next description block we are saying where the ball is going to stop.
1242
 * Note that we have the "inherit" property. This means we are inheriting everything from default,
1243
 * except rel1 and rel2, because we are redefining it.
1244
 *
1245
 * Check the code:
1246
 *
1247
 * @skip description
1248
 * @until }
1249
 *
1250
 * We defined how our object will look like and it's position during the animation,
1251
 * now we need to define how it's going to act during the time. To do this we will
1252
 * use the programs block
1253
 *
1254
 * The first program block will start the animation, it will wait for the 'load' signal. This signal
1255
 * is generated when the edje object is loaded. The 'after' property is saying to this program block exactly this:
1256
 * "When you finish, call the program 'animation,state1' ". The 'in' property is saying, wait 0.5 seconds until you execute this program block.
1257
 *
1258
 * Here is the code:
1259
 *
1260
 * @skip program {
1261
 * @until }
1262
 *
1263
 * Now lets make the ball move and bounce it. In the second program block we are defining what we need to do
1264
 * with the action property. So we are saying change to the state "down-state" using the transition BOUNCE
1265
 * and apply this to the part "part_bubble". You can notice that BOUNCE has three parameters, the first one
1266
 * is saying how much time the transition will last, the second one is the factor of curviness
1267
 * and the last one is saying how many times and object will bounce.
1268
 *
1269
 * The code is very easy:
1270
 *
1271
 * @skip program {
1272
 * @until }
1273
 *
1274
 * Now all you have to do is compile the code and run it!
1275
 *
1276
 * When you compile and run it you should see this:
1277
 * @image html signal2final.png
1278
 * @image rtf signal2final.png
1279
 * @image latex signal2final.eps width=\textwidth
1280
 *
1281
 * The .edc file:
1282
 * @include animations2.edc
1283
 *
1284
 * The source code:
1285
 * @include animations2.c
1286
 *
1287
 * To compile use this command:
1288
 * @verbatim
1289
 * gcc -o animations2 animations2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
1290
 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
1291
 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
1292
 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
1293
 *
1294
 * edje_cc  animations2.edc
1295
 * @endverbatim
1296
 */
1297

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.