flipperzero-firmware/applications/gui/canvas.h

28 lines
567 B
C
Raw Normal View History

#pragma once
#include <stdint.h>
2020-10-15 15:56:47 +00:00
#include <u8g2.h>
2020-10-15 15:05:28 +00:00
typedef enum {
2020-10-15 15:57:21 +00:00
ColorWhite = 0x00,
ColorBlack = 0x01,
2020-10-15 15:05:28 +00:00
} Color;
2020-10-16 13:34:36 +00:00
typedef enum {
FontPrimary = 0x00,
FontSecondary = 0x01,
} Font;
2020-10-15 15:57:21 +00:00
2020-10-16 13:34:36 +00:00
typedef struct CanvasApi CanvasApi;
struct CanvasApi {
2020-10-15 15:05:28 +00:00
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:56:47 +00:00
void (*set_color)(CanvasApi* canvas, Color color);
void (*set_font)(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);
2020-10-15 15:56:47 +00:00
};