summaryrefslogtreecommitdiff
path: root/legacy/edje/doc/examples.dox
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2011-07-29 16:45:49 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2011-07-29 16:45:49 +0000
commit800d331e616e4c20030e03b3ee7cd667f6be8ec1 (patch)
tree8e3b080c4db2cd3200d44b9b93956492fca97f97 /legacy/edje/doc/examples.dox
parentdec8c8dcdba1cf6d98e57b193770a426dbe0b607 (diff)
Damn.
SVN revision: 61904
Diffstat (limited to '')
-rw-r--r--legacy/edje/doc/examples.dox129
1 files changed, 129 insertions, 0 deletions
diff --git a/legacy/edje/doc/examples.dox b/legacy/edje/doc/examples.dox
new file mode 100644
index 0000000000..e8f4f57861
--- /dev/null
+++ b/legacy/edje/doc/examples.dox
@@ -0,0 +1,129 @@
1/**
2 * @page Examples Examples
3 *
4 * Here is a page with examples.
5 *
6 * @ref Example_Edje_Basics
7 */
8
9/**
10 * @page Example_Edje_Basics Edje basics example
11 *
12 * In this example, we illustrate how to start using the Edje library,
13 * with the very basic one needs to instantiate an Edje object.
14 *
15 * We place, in the canvas, an Edje object along with a @b red border
16 * image to delimit its geometry. After we instantiate the Edje
17 * object, we @b have to set a file and a group, within that file, to
18 * bind to it. For this example, we're using an EDC file which
19 * declares two parts (blue and green rectangles) and an item data:
20 * @include basic.edc
21 *
22 * We start by trying to acces an @b unexistant group in the file, so
23 * that you can see the usefulness of edje_object_load_error_get() and
24 * edje_load_error_str(). Check that the error message will tell you
25 * just that -- a group which didn't exist in the file was called for:
26 * @dontinclude edje-basic.c
27 * @skip file_path
28 * @until file_path
29 * @dontinclude edje-basic.c
30 * @skip edje_object_add
31 * @until }
32 *
33 * Than, we finally bind our Edje object to @c "example_group",
34 * printing a message afterwards:
35 * @dontinclude edje-basic.c
36 * @skip file_path, "example_group"
37 * @until object_show
38 *
39 * What follows is a series of Edje API calls which are of general
40 * use. The first of them is edje_object_data_get(), which we use to
41 * get the value we have put in the @c "example_data" data field, in
42 * our EDC object declaration:
43 * @dontinclude edje-basic.c
44 * @skip data field in group
45 * @until ;
46 *
47 * Than, we exemplify edje_object_part_exists():
48 * @dontinclude edje-basic.c
49 * @skip Testing if
50 * @until ;
51 *
52 * The next call is to query @c "part_one"'s geometry, relative to the
53 * whole Edje object's area. The part will be situated in the middle
54 * of the Edje object's, because it has a restricted forced size (we
55 * set its minimum size equal to its maximum, for that) and, by
56 * default, parts are aligned to the center of their containers:
57 * @dontinclude edje-basic.c
58 * @skip part_geometry_get
59 * @until x, y, w, h
60 *
61 * We can grab a direct pointer on the rectangle implementing @c
62 * "part_one", by using edje_object_part_object_get(). Since we are
63 * not allowed to set properties on it, we just check its color, to
64 * assure its really blue, as declared in the EDC:
65 * @dontinclude edje-basic.c
66 * @skip color_get
67 * @until x, y, w, h
68 *
69 * The @c "min" and @c "max" EDC properties can be queried with the
70 * following calls:
71 * @dontinclude edje-basic.c
72 * @skip max_get
73 * @until min. size is
74 *
75 * The next two calls are to make <b>size calculations</b> on our
76 * object. Because of the minumim size declared for @c "part_one" part's
77 * default state description, that will be our exact minimum
78 * size calculated for the group (remember the @c "min" declaration at
79 * group level is just a @b hint, not an enforcement). We then
80 * exercise the edje_object_size_min_restricted_calc() function,
81 * passing a minimum size of 500, in each axis. Since we have @b no
82 * object bigger than that, it will be the minimum size calculated, in
83 * the end:
84 * @dontinclude edje-basic.c
85 * @skip min_calc
86 * @until size calculation is
87 *
88 * @c "part_two" part is there with a purpose: since it extrapolates
89 * the Edje object's boundaries, the edje_object_parts_extends_calc()
90 * function will report origin coordinates for the rectangle grouping
91 * both parts with @b negative values, indicating it extrapolates to
92 * the upper left of our group, just as we see it.
93 *
94 * To interact with the last features exemplified in the program,
95 * there's a command line interface. A help string can be asked for
96 * with the 'h' key:
97 * @dontinclude edje-basic.c
98 * @skip commands
99 * @until ;
100 *
101 * Those commands will change the scaling factors of our Edje objects.
102 * The first of them, @c 's', will change Edje's @b global scaling
103 * factor between @c 1.0 (no scaling) and @c 2.0 (double
104 * scale). Scaling will be applied to @c "part_one", only, because
105 * that's the part flagged to be scaled at EDC level:
106 * @dontinclude edje-basic.c
107 * @skip strcmp(ev->keyname, "s") == 0
108 * @until }
109 *
110 * Note, finally, that the @c 's' command will depend on the 'r' one
111 * to have its effects applied. The latter will change @c "part_one"'s
112 * @b individual scaling factor, which @b overrides Edje's global
113 * scaling factor. Only when the individual one is set to zero, will
114 * the global one take effect:
115 * @dontinclude edje-basic.c
116 * @skip strcmp(ev->keyname, "r") == 0
117 * @until }
118 *
119 * The example's window should look like this picture:
120 *
121 * @image html edje-basics-example.png
122 * @image rtf edje-basics-example.png
123 * @image latex edje-basics-example.eps
124 *
125 * The full example follows.
126 *
127 * @include edje-basic.c
128 * @example edje-basic.c
129 */