ecff31d228
* assets: add EMV AID table for NFC app * file-worker: add searching for value by the key * nfc: add emv parser helpers * assets: add country and currency codes * nfc: add country and currency code parsing * emv_decoder: add country and currency code support * nfc: add AID. currency and country display * nfc: rework bank_card view * nfc: add currency and country save * assets: change emv chip asset * nfc: change asset in bank card * gui: add frame element to widget * nfc: add bank card frame, add documentation * rfal: fix long APDU command emulation * nfc: fix typos * Scripts ReadMe: assets delivery command Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
56 lines
1.3 KiB
C
Executable File
56 lines
1.3 KiB
C
Executable File
#pragma once
|
|
#include <furi.h>
|
|
#include <gui/view.h>
|
|
|
|
typedef enum {
|
|
GuiButtonTypeLeft,
|
|
GuiButtonTypeCenter,
|
|
GuiButtonTypeRight,
|
|
} GuiButtonType;
|
|
|
|
typedef void (*ButtonCallback)(GuiButtonType result, void* context);
|
|
|
|
typedef struct WidgetElement WidgetElement;
|
|
typedef struct Widget Widget;
|
|
|
|
struct WidgetElement {
|
|
// generic draw and input callbacks
|
|
void (*draw)(Canvas* canvas, WidgetElement* element);
|
|
bool (*input)(InputEvent* event, WidgetElement* element);
|
|
|
|
// free callback
|
|
void (*free)(WidgetElement* element);
|
|
|
|
// generic model holder
|
|
void* model;
|
|
|
|
// pointer to widget that hold our element
|
|
Widget* parent;
|
|
};
|
|
|
|
/* Create string element */
|
|
WidgetElement* widget_element_string_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
Align horizontal,
|
|
Align vertical,
|
|
Font font,
|
|
const char* text);
|
|
|
|
/* Create button element */
|
|
WidgetElement* widget_element_button_create(
|
|
GuiButtonType button_type,
|
|
const char* text,
|
|
ButtonCallback callback,
|
|
void* context);
|
|
|
|
/* Create icon element */
|
|
WidgetElement* widget_element_icon_create(uint8_t x, uint8_t y, const Icon* icon);
|
|
|
|
/* Create frame element */
|
|
WidgetElement* widget_element_frame_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
uint8_t width,
|
|
uint8_t height,
|
|
uint8_t radius); |