# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 43
- 44
- 45
- 46
- 47
…
- 373
- 374

1.4 Using The Library
This topic describes the architecture of the Graphics Library and the components comprising each layers. Information on
how to use the Primitive Layer and Object Layer is also presented.
1.4.1 Library Overview
This section describes the architecture of the library and its basic components.
Description
The Graphics Library is composed of the following layers:
• 1. Application Layer - This is the program that utilizes the Graphics Library.
• 2. User Message Interface - This is a layer should be implemented by user to provide messages for the library.
• 3. Graphics Object Layer - This layer renders the control objects such as button, list box, progress bar, meter and so on.
• 4. Graphics Primitives Layer - This layer implements the primitive rendering functions.
• 5. Device Display Driver - This layer is the graphics display driver component that is optimized to the actual display
module used.
• 6. Graphics Display Module - This is the actual display module.
1.4.1.1 Graphics Objects
This section describes the basics of the Graphics Objects.
Description
The Graphics Object Layer is composed of objects that can act as control widgets in an application. There are several
pre-defined objects in the library. Users are not limited to these predefined objects. It is possible to create custom objects.
Creating custom objects will require a deeper understanding of the library's architecture. Creating custom objects is
described in an application note mentioned at the Release Notes section of this documentation.
Each object will have its own create function. In the create function the following functions are initialized:
• DRAW_FUNC - This is the function that renders the object on the screen.
• FREE_FUNC - This is the function that frees the memory used by the object when the object is removed from memory.
• ACTIONGET_FUNC - This function is optional. This function returns the a translated action of the object. A translated
action is actually a planned action that indicates the intended change in the state of the object. The translated action is
basically the response of the object to the user interaction on the object. For example: When a user presses on a button
object on a screen, a valid planned action of the object is to change its state to a pressed state. Translated actions are
specific to each object. See GFX_GOL_TRANSLATED_ACTION enumeration for the listing of all translated actions of all
objects in the library. This list do not include user defined actions. Translated actions are determined using the messaging
scheme of the library. Messaging is discussed in a separate section of this documentation. When this function is not
defined, the create function of the object must set the function pointer to NULL.
• ACTIONSET_FUNC - This function is optional. This function performs the translated action returned by the
ACTIONGET_FUNC. This is the actual function that changes the state of the object. When this function is not defined, the
create function of the object must set the function pointer to NULL.
Each of these functions are implemented in each object. The draw function of the object is specific to the object. The draw
function should not be called directly by the application. Application should instead use the GFX_GOL_ObjectListDraw()
so the management of the object rendering will be done by the Graphics Object Layer.
1.4 Using The Library MLA - Graphics Library Help Library Overview
45

- 1
- 2
…
- 43
- 44
- 45
- 46
- 47
…
- 373
- 374