flipperzero-firmware/applications/gui/canvas.h

36 lines
667 B
C
Raw Normal View History

#pragma once
#include <stdint.h>
2020-10-15 15:05:28 +00:00
typedef enum {
ColorWhite = 0x00,
ColorBlack = 0x01,
} Color;
typedef struct Canvas Canvas;
2020-10-15 15:05:28 +00:00
typedef const uint8_t* Font;
struct _CanvasApi;
typedef struct _CanvasApi CanvasApi;
2020-10-15 15:05:28 +00:00
typedef struct {
Font primary;
Font secondary;
} Fonts;
2020-10-15 15:05:28 +00:00
struct {
Canvas canvas;
Fonts* fonts;
uint8_t (*width)(CanvasApi* canvas);
uint8_t (*height)(CanvasApi* canvas);
2020-10-15 15:05:28 +00:00
void (*clear)(CanvasApi* canvas);
2020-10-15 15:05:28 +00:00
void (*canvas_color_set)(CanvasApi* canvas, Color color);
void (*canvas_font_set)(CanvasApi* canvas, Font font);
2020-10-15 15:05:28 +00:00
void (*draw_str)(CanvasApi* canvas, uint8_t x, uint8_t y, const char* str);
} _CanvasApi;