1#ifndef YAZE_APP_CORE_INPUT_H
2#define YAZE_APP_CORE_INPUT_H
4#define IMGUI_DEFINE_MATH_OPERATORS
14#include "absl/strings/string_view.h"
16#include "imgui/imgui.h"
24IMGUI_API
bool InputHex(
const char* label, uint64_t* data);
25IMGUI_API
bool InputHex(
const char* label,
int* data,
int num_digits = 4,
26 float input_width = 50.f);
28IMGUI_API
bool InputHexShort(
const char* label, uint32_t* data);
29IMGUI_API
bool InputHexWord(
const char* label, uint16_t* data,
30 float input_width = 50.f,
bool no_step =
false);
31IMGUI_API
bool InputHexWord(
const char* label, int16_t* data,
32 float input_width = 50.f,
bool no_step =
false);
33IMGUI_API
bool InputHexByte(
const char* label, uint8_t* data,
34 float input_width = 50.f,
bool no_step =
false);
36IMGUI_API
bool InputHexByte(
const char* label, uint8_t* data, uint8_t max_value,
37 float input_width = 50.f,
bool no_step =
false);
55IMGUI_API InputHexResult
InputHexByteEx(
const char* label, uint8_t* data,
56 float input_width = 50.f,
57 bool no_step =
false);
58IMGUI_API InputHexResult
InputHexByteEx(
const char* label, uint8_t* data,
60 float input_width = 50.f,
61 bool no_step =
false);
62IMGUI_API InputHexResult
InputHexWordEx(
const char* label, uint16_t* data,
63 float input_width = 50.f,
64 bool no_step =
false);
68 float input_width = 50.f);
70 float input_width = 70.f);
72IMGUI_API
void Paragraph(
const std::string& text);
76IMGUI_API
bool ListBox(
const char* label,
int* current_item,
77 const std::vector<std::string>& items,
78 int height_in_items = -1);
90IMGUI_API ImGuiID
GetID(
const std::string&
id);
94using GuiElement = std::variant<std::function<void()>, std::string>;
107IMGUI_API
bool OpenUrl(
const std::string& url);
113 float v_max,
const char* format =
"%.3f",
114 float wheel_step = 0.05f,
115 ImGuiSliderFlags flags = 0);
116IMGUI_API
bool SliderIntWheel(
const char* label,
int* v,
int v_min,
int v_max,
117 const char* format =
"%d",
int wheel_step = 1,
118 ImGuiSliderFlags flags = 0);
SNES 16-bit tile metadata container.
bool InputHexByteCustom(const char *label, uint8_t *data, float input_width)
bool ClickableText(const std::string &text)
bool SliderIntWheel(const char *label, int *v, int v_min, int v_max, const char *format, int wheel_step, ImGuiSliderFlags flags)
void Paragraph(const std::string &text)
void ItemLabel(absl::string_view title, ItemLabelFlags flags)
bool InputHexWord(const char *label, uint16_t *data, float input_width, bool no_step)
bool ListBox(const char *label, int *current_item, const std::vector< std::string > &items, int height_in_items)
bool SliderFloatWheel(const char *label, float *v, float v_min, float v_max, const char *format, float wheel_step, ImGuiSliderFlags flags)
bool InputHexShort(const char *label, uint32_t *data)
void AddTableColumn(Table &table, const std::string &label, GuiElement element)
enum ItemLabelFlag { Left=1u<< 0u, Right=1u<< 1u, Default=Left, } ItemLabelFlags
void MemoryEditorPopup(const std::string &label, std::span< uint8_t > memory)
bool OpenUrl(const std::string &url)
bool InputHexWordCustom(const char *label, uint16_t *data, float input_width)
bool InputHex(const char *label, uint64_t *data)
bool InputTileInfo(const char *label, gfx::TileInfo *tile_info)
std::variant< std::function< void()>, std::string > GuiElement
constexpr ImVec2 kZeroPos
constexpr ImVec2 kDefaultModalSize
InputHexResult InputHexByteEx(const char *label, uint8_t *data, float input_width, bool no_step)
ImGuiID GetID(const std::string &id)
ImGuiKey MapKeyToImGuiKey(char key)
bool InputHexByte(const char *label, uint8_t *data, float input_width, bool no_step)
InputHexResult InputHexWordEx(const char *label, uint16_t *data, float input_width, bool no_step)
std::vector< std::string > column_labels
std::vector< GuiElement > column_contents