This repository has been archived on 2026-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
FlippyPass/project/backend/ui.h

53 lines
838 B
C
Raw Normal View History

2024-08-26 04:20:00 -05:00
// Define once
#ifndef H_UI
#define H_UI
// Libraries
#include <furi.h>
#include <gui/gui.h>
2024-08-27 00:11:56 -05:00
#include <gui/icon.h>
2024-08-26 23:37:32 -05:00
#include "app.h"
#include "manager.h"
2024-08-26 04:20:00 -05:00
// Structures
typedef struct {
ViewPort* canvas;
2024-08-26 23:37:32 -05:00
Gui* gui;
2024-08-26 23:48:45 -05:00
enum ui_input {
Up,
Down,
Left,
Right,
Ok,
Back,
None
2024-08-26 23:48:45 -05:00
} input;
2024-08-26 04:20:00 -05:00
Manager* manager;
2024-08-27 00:11:56 -05:00
int selection;
2024-08-26 23:48:45 -05:00
int page;
2024-08-27 00:11:56 -05:00
2024-08-26 04:20:00 -05:00
bool running;
bool p_avail;
bool p_ready;
2024-08-27 22:33:59 -05:00
} UIManager;
2024-08-26 04:20:00 -05:00
// Constructors
2024-08-27 22:33:59 -05:00
UIManager* ui_create();
2024-08-26 04:20:00 -05:00
// Functions
2024-08-26 23:48:45 -05:00
void ui_input(InputEvent* event, void* ctx);
2024-08-27 23:43:31 -05:00
void ui_quit(UIManager* manager);
2024-08-26 23:37:32 -05:00
2024-08-26 04:20:00 -05:00
void ui_draw(Canvas* canvas, void* ctx);
2024-08-27 22:33:59 -05:00
void ui_p_mainmenu(Canvas* canvas, UIManager* manager);
2024-08-27 00:11:56 -05:00
void ui_p_about(Canvas* canvas);
2024-08-27 22:33:59 -05:00
void ui_p_view(Canvas* canvas, UIManager* manager);
2024-08-26 04:20:00 -05:00
2024-08-27 22:33:59 -05:00
void ui_delete(UIManager* manager);
2024-08-26 23:37:32 -05:00
2024-08-26 04:20:00 -05:00
#endif