# Vault 7: Projects

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

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 67
- 68
- 69
- 70
- 71
…
- 373
- 374

If the while check is not in place, it possible that the only primitive that you will see in the screen is the Line. For case 2, one
can also be creative in the application code and implement some form of non-blocking scheme and make use of the time
while waiting for the primitives to render.
Another example for case 2:
GFX_STATUS DrawMyFigure(
uint16_t a,
uint16_t b,
uint16_t c,
uint16_t d,
uint16_t e,
uint16_t f)
{
typedef enum {
DRAW_LINE,
DRAW_RECT,
DRAW_BAR,
} DRAW_MYFIGURE_STATES;
static DRAW_MYFIGURE_STATES state = DRAW_LINE;
// checks if the hardware is still busy
if (GFX_RenderStatusGet() == GFX_STATUS_BUSY_BIT)
return (GFX_STATUS_FAILURE);
switch(state)
{
case DRAW_LINE:
if (GFX_LineDraw(a, b) != GFX_STATUS_SUCCESS)
return GFX_STATUS_FAILURE;
state = DRAW_RECT;
case DRAW_RECT:
if(GFX_RectangleDraw(c,d,e,f) != GFX_STATUS_SUCCESS)
return GFX_STATUS_FAILURE;
state = DRAW_BAR;
case DRAW_BAR:
if(GFX_BarDraw(c+2, d+2, e-2, f-2) !=
GFX_STATUS_SUCCESS)
return GFX_STATUS_FAILURE;
state = DRAW_LINE;
return GFX_STATUS_SUCCESS;
default:
// this case should not occur
return GFX_STATUS_SUCCESS;
}
}
This non-blocking code can be used in the application and the application can do other tasks whenever DrawMyFigure()
returns GFX_STATUS_FAILURE. Application should call DrawMyFigure() again until it return a GFX_STATUS_SUCCESS
signifying that the Line, Rectangle and Bar shapes were drawn successfully.
To disable the non-blocking feature, add this macro in the configuration.
Remarks
None.
1.5.1.19 GFX_CONFIG_PALETTE_DISABLE Macro
Macro that disables the palette feature.
File
gfx_config_template.h
Syntax
#define GFX_CONFIG_PALETTE_DISABLE
1.5 Configuring the Library MLA - Graphics Library Help Configuration Options
69

- 1
- 2
…
- 67
- 68
- 69
- 70
- 71
…
- 373
- 374