mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-20 09:43:23 +00:00
560ea5f995
* nfc: add scroll element for info * widget: format lines for scroll text element * widget: fix new line generation * widget: finish element text scroll * nfc: rework ultralight and NTAG info scenes * nfc: rework mf classic info screens * nfc: rework nfca info scenes * nfc: fix mf ultralight navigation * widget: add documentation * nfc: rework bank card infO * nfc: rework device info scene * nfc: fix incorrect atqa order * mf ultralight: remove unused function * widget: add mutex for model protection * widget: fix memory leak * nfc: rework delete scene * nfc: fix selected item in saved menu scene * widget: fix naming in text scroll element * nfc: fix navigation from delete success * nfc: add dictionary icon * widget: fix memory leak
90 lines
2 KiB
C
Executable file
90 lines
2 KiB
C
Executable file
/**
|
|
* @file widget_element_i.h
|
|
* GUI: internal Widget Element API
|
|
*/
|
|
|
|
#pragma once
|
|
#include <furi.h>
|
|
#include <gui/view.h>
|
|
#include <input/input.h>
|
|
|
|
typedef enum {
|
|
GuiButtonTypeLeft,
|
|
GuiButtonTypeCenter,
|
|
GuiButtonTypeRight,
|
|
} GuiButtonType;
|
|
|
|
typedef void (*ButtonCallback)(GuiButtonType result, InputType type, 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;
|
|
FuriMutex* model_mutex;
|
|
|
|
// pointer to widget that hold our element
|
|
Widget* parent;
|
|
};
|
|
|
|
/** Create multi string element */
|
|
WidgetElement* widget_element_string_multiline_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
Align horizontal,
|
|
Align vertical,
|
|
Font font,
|
|
const char* text);
|
|
|
|
/** Create string element */
|
|
WidgetElement* widget_element_string_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
Align horizontal,
|
|
Align vertical,
|
|
Font font,
|
|
const char* text);
|
|
|
|
/** Create text box element */
|
|
WidgetElement* widget_element_text_box_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
uint8_t width,
|
|
uint8_t height,
|
|
Align horizontal,
|
|
Align vertical,
|
|
const char* text,
|
|
bool strip_to_dots);
|
|
|
|
/** 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);
|
|
|
|
WidgetElement* widget_element_text_scroll_create(
|
|
uint8_t x,
|
|
uint8_t y,
|
|
uint8_t width,
|
|
uint8_t height,
|
|
const char* text);
|