# Vault 7: Projects

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

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 163
- 164
- 165
- 166
- 167
…
- 373
- 374

Syntax
GFX_GOL_BUTTON * GFX_GOL_ButtonCreate(uint16_t ID, uint16_t left, uint16_t top, uint16_t
right, uint16_t bottom, uint16_t radius, uint16_t state, GFX_RESOURCE_HDR * pPressImage,
GFX_RESOURCE_HDR * pReleaseImage, GFX_XCHAR * pText, GFX_ALIGNMENT alignment,
GFX_GOL_OBJ_SCHEME * pScheme);
Returns
Pointer to the newly created object.
Description
This function creates a GFX_GOL_BUTTON object with the parameters given. It automatically attaches the new object into a
global linked list of objects and returns the address of the object.
This function returns the pointer to the newly created object. If the object is not successfully created, it returns NULL.
The object allows setting two images. One for the pressed state and the other for the release state. If no image is to be used
for the object set both pointers to NULL.
If only one image is used for both pressed and released state, set both pPressImage and pReleaseImage to the same image.
The behavior of GFX_GOL_ButtonCreate() will be undefined if one of the following is true:
• left >= right
• top >= bottom
• pScheme is not pointing to a GFX_GOL_OBJ_SCHEME
• pPressImage and pReleaseImage is not pointing to a GFX_RESOURCE_HDR.
• pText is an unterminated string
Preconditions
None.
Example
GFX_GOL_OBJ_SCHEME *pScheme;
GFX_GOL_BUTTON *buttons[3];
GFX_GOL_BUTTON_STATE state;
// assume pScheme is initialized to a scheme in memory.
state = GFX_GOL_BUTTON_DRAW_STATE;
buttons[0] = GFX_GOL_ButtonCreate(
1, 20, 64, 50, 118, 0,
state, NULL, NULL, "ON",
GFX_ALIGN_HCENTER | GFX_ALIGN_VCENTER,
pScheme);
// check if GFX_GOL_BUTTON 0 is created
if (buttons[0] == NULL)
return 0;
buttons[1] = GFX_GOL_ButtonCreate(
2, 52, 64, 82, 118, 0,
state, NULL, NULL, "OFF",
GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
pScheme);
// check if GFX_GOL_BUTTON 1 is created
if (buttons[1] == NULL)
return 0;
buttons[2] = GFX_GOL_ButtonCreate(
3, 84, 64, 114, 118, 0,
state, NULL, NULL, "HI",
GFX_ALIGN_RIGHT | GFX_ALIGN_VCENTER,
pScheme);
// check if GFX_GOL_BUTTON 2 is created
if (buttons[2] == NULL)
return 0;
1.6 Library Interface MLA - Graphics Library Help Graphics Object Layer
165

- 1
- 2
…
- 163
- 164
- 165
- 166
- 167
…
- 373
- 374