Chapter 2. Evas

2.1. What is Evas?

To put it most simply, Evas is a canvas library. It was developed by the Rasterman (and others) for use as the graphical foundation for Enlightenment 0.17.

2.1.1. What is a canvas?

In the realm of GUI components, a canvas is essentially a screen area that contains high-level objects. The traditional approach to drawing things in a GUI is to get a graphics context from the GUI toolkit, which you can then draw things (lines, circles etc.) into, or write pixels into (eg: for images). If other programs overwrite the data in the context (eg: if another window is moved on top of the program window), the overwritten section is marked by the windowing system as "dirty", and it tells the program to redraw it. the program is forced to redraw then overwritten section of the screen. The drawing context knows nothing about what's being drawn into it.

A canvas works very differently. Instead of drawing into a canvas, you create objects inside the canvas that match what you were trying to draw. For instance, instead of drawing a line into a canvas, you create a line object inside the canvas. The canvas knows all the information about the line, such as it's start and end points, colour and thickness. The same principle applies to other types of graphical entities, such as rectangles, ellipses, polygons, text and images.

Once you place objects inside a canvas, you don't need to worry about redrawing them, because the canvas knows all about them and can redraw parts of itself as necessary. However, probably the most important aspect of a canvas is that it's objects can easily be manuipulated - you can easily move a line around, change it's colour or transparency, move it in front of or behind other objects, change it's thickness, etc., without worrying about redrawing anything, because the canvas will automatically redraw the parts of itself needed to make your changes appear on-screen.

If you've ever played with a vector drawing program such as Kontour, Sodipodi or Adobe Illustrator, then the idea of a canvas will probably make a lot of sense, because these applications are essentially canvases with a fancy interface that lets you create and manipulate objects inside the canvas with your mouse and keyboard. A canvas exposes power similar to these applications to the developer.