summaryrefslogtreecommitdiff
path: root/src/lib/evas/Evas.h
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2014-10-18 13:52:59 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-10-18 13:53:05 +0200
commit1ba47f132bd62ca75eebd51ac61176930400d45c (patch)
treebcc8b12c6a190d2c9d36423e69ea9329576dbc21 /src/lib/evas/Evas.h
parent9eb1093424692b294be4bc2f2807073c71b622ea (diff)
evas: improve documentation.
Summary: Add more reference link and read proof. Reviewers: raster, huchi, Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1478 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/Evas.h')
-rw-r--r--src/lib/evas/Evas.h64
1 files changed, 31 insertions, 33 deletions
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index f68527e..71d91ea 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -28,8 +28,8 @@
28 changes made to the canvas and so takes this work out of the 28 changes made to the canvas and so takes this work out of the
29 programmers hand, saving a lot of time and energy. 29 programmers hand, saving a lot of time and energy.
30 30
31 It's small and lean, designed to work on embedded systems all the way 31 It is small and lean, and is designed to work on embedded systems all the way
32 to large and powerful multi-cpu workstations. It can be compiled to 32 to large and powerful multi-CPU workstations. It can be compiled to
33 only have the features you need for your target platform if you so 33 only have the features you need for your target platform if you so
34 wish, thus keeping it small and lean. It has several display 34 wish, thus keeping it small and lean. It has several display
35 back-ends, letting it display on several display systems, making it 35 back-ends, letting it display on several display systems, making it
@@ -39,13 +39,13 @@
39 39
40 Evas is not a widget set or widget toolkit, however it is their 40 Evas is not a widget set or widget toolkit, however it is their
41 base. See Elementary (http://docs.enlightenment.org/auto/elementary/) 41 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
42 for a toolkit based on Evas, Edje, @ref Ecore and other Enlightenment 42 for a toolkit based on @ref Evas, @ref Edje, @ref Ecore and other
43 technologies. 43 Enlightenment technologies.
44 44
45 It is not dependent or aware of main loops, input or output 45 It is not dependent or aware of main loops, input or output
46 systems. Input should be polled from various sources and fed to 46 systems. Input should be polled from various sources and fed to
47 Evas. Similarly, it will not create windows or report windows updates 47 Evas. Similarly, it does not create windows or report windows updates
48 to your system, rather just drawing the pixels and reporting to the 48 to your system, but just draws the pixels and report to the
49 user the areas that were changed. Of course these operations are quite 49 user the areas that were changed. Of course these operations are quite
50 common and thus they are ready to use in @ref Ecore, particularly in 50 common and thus they are ready to use in @ref Ecore, particularly in
51 @ref Ecore_Evas_Group. 51 @ref Ecore_Evas_Group.
@@ -62,7 +62,7 @@
62 the display. 62 the display.
63 63
64 Immediate mode display systems retain very little, or no state. A 64 Immediate mode display systems retain very little, or no state. A
65 program will execute a series of commands, as in the pseudo code: 65 program executes a series of commands, as in the pseudo code:
66 66
67 @verbatim 67 @verbatim
68 draw line from position (0, 0) to position (100, 200); 68 draw line from position (0, 0) to position (100, 200);
@@ -77,9 +77,9 @@
77 The series of commands is executed by the windowing system and the 77 The series of commands is executed by the windowing system and the
78 results are displayed on the screen (normally). Once the commands are 78 results are displayed on the screen (normally). Once the commands are
79 executed the display system has little or no idea of how to reproduce 79 executed the display system has little or no idea of how to reproduce
80 this image again, and so has to be instructed by the application how 80 this image again, and so has to be instructed by the application on how
81 to redraw sections of the screen whenever needed. Each successive 81 to redraw sections of the screen whenever needed. Each successive
82 command will be executed as instructed by the application and either 82 command is executed as instructed by the application and either
83 emulated by software or sent to the graphics hardware on the device to 83 emulated by software or sent to the graphics hardware on the device to
84 be performed. 84 be performed.
85 85
@@ -88,15 +88,14 @@
88 increasing complexity of displays and demands by users to have better 88 increasing complexity of displays and demands by users to have better
89 looking interfaces, more and more work is needing to be done at this 89 looking interfaces, more and more work is needing to be done at this
90 level by the internals of widget sets, custom display widgets and 90 level by the internals of widget sets, custom display widgets and
91 other programs. This means more and more logic and display rendering 91 other programs. This means that more and more logic and display rendering
92 code needs to be written time and time again, each time the 92 code needs to be written each time the application needs to figure out
93 application needs to figure out how to minimise redraws so that 93 how to minimise redraws so that display is fast and interactive, and
94 display is fast and interactive, and keep track of redraw logic. The 94 keeps track of redraw logic. The power comes at a high-price with lots
95 power comes at a high-price, lots of extra code and work. Programmers 95 of extra code and work. Programmers not very familiar with graphics
96 not very familiar with graphics programming will often make mistakes 96 programming often make mistakes at this level and produce code that
97 at this level and produce code that is sub optimal. Those familiar 97 is sub optimal. Those familiar with this kind of programming simply
98 with this kind of programming will simply get bored by writing the 98 get bored by writing the same code again and again.
99 same code again and again.
100 99
101 For example, if in the above scene, the windowing system requires the 100 For example, if in the above scene, the windowing system requires the
102 application to redraw the area from 0, 0 to 50, 50 (also referred as 101 application to redraw the area from 0, 0 to 50, 50 (also referred as
@@ -106,7 +105,7 @@
106 @verbatim 105 @verbatim
107 Redraw from position (0, 0) to position (50, 50): 106 Redraw from position (0, 0) to position (50, 50):
108 107
109 // what was in area (0, 0, 50, 50)? 108 // what is in area (0, 0, 50, 50)?
110 109
111 // 1. intersection part of line (0, 0) to (100, 200)? 110 // 1. intersection part of line (0, 0) to (100, 200)?
112 draw line from position (0, 0) to position (25, 50); 111 draw line from position (0, 0) to position (25, 50);
@@ -119,15 +118,15 @@
119 draw image bitmap_subimage at position (10, 30); 118 draw image bitmap_subimage at position (10, 30);
120 @endverbatim 119 @endverbatim
121 120
122 The clever reader might have noticed that, if all elements in the 121 You might have noticed that, if all elements in the
123 above scene are opaque, then the system is doing useless paints: part 122 above scene are opaque, then the system is doing useless paints: part
124 of the line is behind the rectangle, and part of the rectangle is 123 of the line is behind the rectangle, and part of the rectangle is
125 behind the image. These useless paints tend to be very costly, as 124 behind the image. These useless paints tend to be very costly, as
126 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x 125 pixels tend to be 4 bytes in size; thus an overlapping region of 100 x
127 100 pixels is around 40000 useless writes! The developer could write 126 100 pixels is around 40000 useless writes! You could write
128 code to calculate the overlapping areas and avoid painting then, but 127 code to calculate the overlapping areas and avoid painting then, but
129 then it should be mixed with the "expose event" handling mentioned 128 then it should be mixed with the "expose event" handling mentioned
130 above and quickly one realizes the initially simpler method became 129 above and you quickly realize that the initially simpler method became
131 really complex. 130 really complex.
132 131
133 Evas is a structural system in which the programmer creates and 132 Evas is a structural system in which the programmer creates and
@@ -156,25 +155,24 @@
156 @endverbatim 155 @endverbatim
157 156
158 This may look longer, but when the display needs to be refreshed or 157 This may look longer, but when the display needs to be refreshed or
159 updated, the programmer only moves, resizes, shows, hides etc. the 158 updated, you move, resize, show, or hide the objects that need to change.
160 objects that need to change. The programmer simply thinks at the 159 You can simply think at the object logic level, and the canvas software
161 object logic level, and the canvas software does the rest of the work 160 does the rest of the work for you, figuring out what actually changed in the
162 for them, figuring out what actually changed in the canvas since it 161 canvas since it had been last drawn, how to most efficiently redraw the canvas and
163 was last drawn, how to most efficiently redraw the canvas and its 162 its contents to reflect the current state, and then it can go off and do
164 contents to reflect the current state, and then it can go off and do
165 the actual drawing of the canvas. 163 the actual drawing of the canvas.
166 164
167 This lets the programmer think in a more natural way when dealing with 165 This lets you think in a more natural way when dealing with
168 a display, and saves time and effort of working out how to load and 166 a display, and saves time and effort of working out how to load and
169 display images, render given the current display system etc. Since 167 display images, render given the current display system, and so on. Since
170 Evas also is portable across different display systems, this also 168 Evas also is portable across different display systems, this also
171 gives the programmer the ability to have their code ported and 169 gives you the ability to have their code ported and
172 displayed on different display systems with very little work. 170 displayed on different display systems with very little work.
173 171
174 Evas can be seen as a display system that stands somewhere between a 172 Evas can be seen as a display system that stands somewhere between a
175 widget set and an immediate mode display system. It retains basic 173 widget set and an immediate mode display system. It retains basic
176 display logic, but does very little high-level logic such as 174 display logic, but does very little high-level logic such as
177 scrollbars, sliders, push buttons etc. 175 scrollbars, sliders, and push buttons.
178 176
179 177
180 @section evas_main_compiling How to compile 178 @section evas_main_compiling How to compile