Graphical User Interface (GUI) components for the application. More...
Namespaces | |
namespace | anonymous_namespace{canvas.cc} |
namespace | anonymous_namespace{style.cc} |
namespace | zeml |
Zelda Editor Markup Language Functions. | |
Classes | |
struct | AssetObject |
class | Bitmap |
Represents a bitmap image. More... | |
class | Canvas |
Represents a canvas for drawing and manipulating graphics. More... | |
struct | Color |
struct | DungeonAsset |
struct | ExampleSelectionWithDeletion |
struct | GfxSheetAssetBrowser |
struct | MultiSelectWithClipper |
struct | OverworldAsset |
class | Renderer |
The Renderer class represents the renderer for the Yaze application. More... | |
struct | SpriteAsset |
struct | Table |
struct | Theme |
struct | UnsortedAsset |
Typedefs | |
using | ItemLabelFlags |
using | GuiElement = std::variant<std::function<void()>, std::string> |
using | BitmapTable |
Enumerations | |
enum class | CanvasType { kTile , kBlock , kMap } |
enum class | CanvasMode { kPaint , kSelect } |
enum class | CanvasGridSize { k8x8 , k16x16 , k32x32 , k64x64 } |
Functions | |
void | GraphicsBinCanvasPipeline (int width, int height, int tile_size, int num_sheets_to_load, int canvas_id, bool is_loaded, gfx::BitmapTable &graphics_bin) |
void | BitmapCanvasPipeline (gui::Canvas &canvas, const gfx::Bitmap &bitmap, int width, int height, int tile_size, bool is_loaded, bool scrollbar, int canvas_id) |
ImVec4 | ConvertSnesColorToImVec4 (const gfx::SnesColor &color) |
IMGUI_API bool | SnesColorButton (absl::string_view id, gfx::SnesColor &color, ImGuiColorEditFlags flags, const ImVec2 &size_arg) |
IMGUI_API bool | SnesColorEdit4 (absl::string_view label, gfx::SnesColor *color, ImGuiColorEditFlags flags) |
absl::Status | DisplayPalette (gfx::SnesPalette &palette, bool loaded) |
void | SelectablePalettePipeline (uint64_t &palette_id, bool &refresh_graphics, gfx::SnesPalette &palette) |
ImVec4 | ConvertColorToImVec4 (const Color &color) |
std::string | ColorToHexString (const Color &color) |
bool | InputHex (const char *label, uint64_t *data) |
bool | InputHex (const char *label, int *data, int num_digits, float input_width) |
bool | InputHexShort (const char *label, uint32_t *data) |
bool | InputHexWord (const char *label, uint16_t *data, float input_width, bool no_step) |
bool | InputHexWord (const char *label, int16_t *data, float input_width, bool no_step) |
bool | InputHexByte (const char *label, uint8_t *data, float input_width, bool no_step) |
bool | InputHexByte (const char *label, uint8_t *data, uint8_t max_value, float input_width, bool no_step) |
void | ItemLabel (absl::string_view title, ItemLabelFlags flags) |
bool | ListBox (const char *label, int *current_item, const std::vector< std::string > &items, int height_in_items) |
bool | InputTileInfo (const char *label, gfx::TileInfo *tile_info) |
ImGuiID | GetID (const std::string &id) |
void | AddTableColumn (Table &table, const std::string &label, GuiElement element) |
void | DrawTable (Table ¶ms) |
absl::StatusOr< Theme > | LoadTheme (const std::string &filename) |
absl::Status | SaveTheme (const Theme &theme) |
void | ApplyTheme (const Theme &theme) |
void | ColorsYaze () |
void | DrawBitmapViewer (const std::vector< gfx::Bitmap > &bitmaps, float scale, int ¤t_bitmap_id) |
TextEditor::LanguageDefinition | GetAssemblyLanguageDef () |
void | BeginWindowWithDisplaySettings (const char *id, bool *active, const ImVec2 &size, ImGuiWindowFlags flags) |
void | EndWindowWithDisplaySettings () |
void | BeginPadding (int i) |
void | EndPadding () |
void | BeginNoPadding () |
void | EndNoPadding () |
void | BeginChildWithScrollbar (const char *str_id) |
void | BeginChildBothScrollbars (int id) |
void | DrawDisplaySettings (ImGuiStyle *ref) |
void | TextWithSeparators (const absl::string_view &text) |
void | DrawFontManager () |
Variables | |
constexpr uint32_t | kBlackColor = IM_COL32(0, 0, 0, 255) |
constexpr uint32_t | kRectangleColor = IM_COL32(32, 32, 32, 255) |
constexpr uint32_t | kWhiteColor = IM_COL32(255, 255, 255, 255) |
constexpr uint32_t | kOutlineRect = IM_COL32(255, 255, 255, 200) |
constexpr ImGuiButtonFlags | kMouseFlags |
const int | kStepOneHex = 0x01 |
const int | kStepFastHex = 0x0F |
constexpr ImVec2 | kDefaultModalSize = ImVec2(200, 0) |
constexpr ImVec2 | kZeroPos = ImVec2(0, 0) |
Graphical User Interface (GUI) components for the application.
using yaze::gui::GuiElement = std::variant<std::function<void()>, std::string> |
using yaze::gfx::BitmapTable |
|
strong |
|
strong |
|
strong |
void yaze::gui::GraphicsBinCanvasPipeline | ( | int | width, |
int | height, | ||
int | tile_size, | ||
int | num_sheets_to_load, | ||
int | canvas_id, | ||
bool | is_loaded, | ||
gfx::BitmapTable & | graphics_bin ) |
Definition at line 800 of file canvas.cc.
References yaze::gui::Canvas::draw_list(), yaze::gui::Canvas::DrawBackground(), yaze::gui::Canvas::DrawContextMenu(), yaze::gui::Canvas::DrawGrid(), yaze::gui::Canvas::DrawOverlay(), yaze::gui::Canvas::DrawTileSelector(), and yaze::gui::Canvas::zero_point().
void yaze::gui::BitmapCanvasPipeline | ( | gui::Canvas & | canvas, |
const gfx::Bitmap & | bitmap, | ||
int | width, | ||
int | height, | ||
int | tile_size, | ||
bool | is_loaded, | ||
bool | scrollbar, | ||
int | canvas_id ) |
Definition at line 831 of file canvas.cc.
References yaze::gui::Canvas::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawContextMenu(), yaze::gui::Canvas::DrawGrid(), yaze::gui::Canvas::DrawOverlay(), and yaze::gui::Canvas::DrawTileSelector().
Referenced by yaze::editor::GfxGroupEditor::DrawBlocksetViewer(), yaze::editor::GfxGroupEditor::DrawRoomsetViewer(), yaze::editor::GfxGroupEditor::DrawSpritesetViewer(), yaze::editor::GraphicsEditor::UpdateScadView(), and yaze::editor::Tile16Editor::UpdateTransferTileCanvas().
ImVec4 yaze::gui::ConvertSnesColorToImVec4 | ( | const gfx::SnesColor & | color | ) |
Definition at line 10 of file color.cc.
References yaze::gfx::SnesColor::rgb().
Referenced by SnesColorButton(), and SnesColorEdit4().
IMGUI_API bool yaze::gui::SnesColorButton | ( | absl::string_view | id, |
gfx::SnesColor & | color, | ||
ImGuiColorEditFlags | flags, | ||
const ImVec2 & | size_arg ) |
Definition at line 19 of file color.cc.
References ConvertSnesColorToImVec4(), and yaze::gfx::SnesColor::snes().
Referenced by yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawPaletteFromPaletteGroup(), yaze::editor::PaletteEditor::DrawPaletteGroup(), and SelectablePalettePipeline().
IMGUI_API bool yaze::gui::SnesColorEdit4 | ( | absl::string_view | label, |
gfx::SnesColor * | color, | ||
ImGuiColorEditFlags | flags ) |
Definition at line 36 of file color.cc.
References yaze::gfx::ConvertRgbToSnes(), ConvertSnesColorToImVec4(), yaze::gfx::SnesColor::set_rgb(), and yaze::gfx::SnesColor::set_snes().
Referenced by yaze::editor::PaletteEditor::DrawCustomPalette(), yaze::editor::PaletteEditor::DrawModifiedColors(), yaze::editor::PaletteEditor::HandleColorPopup(), and yaze::editor::PaletteEditor::Update().
absl::Status yaze::gui::DisplayPalette | ( | gfx::SnesPalette & | palette, |
bool | loaded ) |
Definition at line 50 of file color.cc.
References ASSIGN_OR_RETURN, yaze::gfx::SnesPalette::GetColor(), and yaze::gfx::SnesPalette::size().
Referenced by yaze::editor::ScreenEditor::DrawInventoryMenuEditor().
void yaze::gui::SelectablePalettePipeline | ( | uint64_t & | palette_id, |
bool & | refresh_graphics, | ||
gfx::SnesPalette & | palette ) |
Definition at line 123 of file color.cc.
References yaze::gfx::SnesPalette::size(), and SnesColorButton().
Referenced by yaze::gui::Canvas::DrawContextMenu(), yaze::editor::GraphicsEditor::DrawPaletteControls(), yaze::editor::DungeonEditor::UpdateDungeonRoomView(), and yaze::editor::GraphicsEditor::UpdatePaletteColumn().
|
inline |
Definition at line 21 of file color.h.
References yaze::gui::Color::alpha, yaze::gui::Color::blue, yaze::gui::Color::green, and yaze::gui::Color::red.
Referenced by ApplyTheme().
|
inline |
Definition at line 25 of file color.h.
Referenced by SaveTheme().
IMGUI_API bool yaze::gui::InputHex | ( | const char * | label, |
uint64_t * | data ) |
Definition at line 134 of file input.cc.
References kStepFastHex, and kStepOneHex.
Referenced by yaze::editor::GraphicsEditor::DrawClipboardImport(), yaze::editor::DrawEntranceInserterPopup(), yaze::editor::DrawExitEditorPopup(), yaze::editor::DrawExitInserterPopup(), yaze::editor::GraphicsEditor::DrawFileImport(), yaze::editor::DrawOverworldEntrancePopup(), yaze::editor::GraphicsEditor::DrawPaletteControls(), yaze::editor::DungeonEditor::DrawRoomSelector(), yaze::emu::Emulator::RenderMemoryViewer(), yaze::editor::MemoryEditorWithDiffChecker::Update(), and yaze::editor::GraphicsEditor::UpdatePaletteColumn().
IMGUI_API bool yaze::gui::InputHex | ( | const char * | label, |
int * | data, | ||
int | num_digits, | ||
float | input_width ) |
Definition at line 140 of file input.cc.
References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.
IMGUI_API bool yaze::gui::InputHexShort | ( | const char * | label, |
uint32_t * | data ) |
Definition at line 147 of file input.cc.
References kStepFastHex, and kStepOneHex.
IMGUI_API bool yaze::gui::InputHexWord | ( | const char * | label, |
uint16_t * | data, | ||
float | input_width, | ||
bool | no_step ) |
Definition at line 153 of file input.cc.
References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.
Referenced by yaze::gui::Canvas::DrawContextMenu(), yaze::editor::OverworldEditor::DrawCustomOverworldMapSettings(), yaze::editor::DungeonEditor::DrawDungeonCanvas(), yaze::editor::ScreenEditor::DrawDungeonMapsTabs(), yaze::editor::DungeonEditor::DrawEntranceSelector(), yaze::editor::DrawExitEditorPopup(), yaze::editor::DrawOverworldEntrancePopup(), yaze::editor::OverworldEditor::DrawOverworldMapSettings(), yaze::editor::DungeonEditor::DrawRoomSelector(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), InputTileInfo(), yaze::gui::zeml::Render(), and yaze::emu::Emulator::RenderBreakpointList().
IMGUI_API bool yaze::gui::InputHexWord | ( | const char * | label, |
int16_t * | data, | ||
float | input_width, | ||
bool | no_step ) |
Definition at line 160 of file input.cc.
References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.
IMGUI_API bool yaze::gui::InputHexByte | ( | const char * | label, |
uint8_t * | data, | ||
float | input_width, | ||
bool | no_step ) |
Definition at line 167 of file input.cc.
References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.
Referenced by yaze::editor::GfxGroupEditor::DrawBlocksetViewer(), yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::OverworldEditor::DrawCustomOverworldMapSettings(), yaze::editor::DungeonEditor::DrawDungeonCanvas(), yaze::editor::ScreenEditor::DrawDungeonMapsTabs(), yaze::editor::DungeonEditor::DrawEntranceSelector(), yaze::editor::DrawExitEditorPopup(), yaze::editor::GraphicsEditor::DrawGfxEditToolset(), yaze::editor::DrawOverworldEntrancePopup(), yaze::editor::OverworldEditor::DrawOverworldMapSettings(), yaze::editor::GfxGroupEditor::DrawPaletteViewer(), yaze::editor::GfxGroupEditor::DrawRoomsetViewer(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::GfxGroupEditor::DrawSpritesetViewer(), yaze::editor::Tile16Editor::DrawTileEditControls(), InputTileInfo(), yaze::gui::zeml::Render(), yaze::emu::Emulator::RenderBreakpointList(), and yaze::editor::GfxGroupEditor::Update().
IMGUI_API bool yaze::gui::InputHexByte | ( | const char * | label, |
uint8_t * | data, | ||
uint8_t | max_value, | ||
float | input_width, | ||
bool | no_step ) |
Definition at line 174 of file input.cc.
References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.
IMGUI_API void yaze::gui::ItemLabel | ( | absl::string_view | title, |
ItemLabelFlags | flags ) |
Definition at line 187 of file input.cc.
Referenced by yaze::editor::MusicEditor::DrawToolset().
IMGUI_API bool yaze::gui::ListBox | ( | const char * | label, |
int * | current_item, | ||
const std::vector< std::string > & | items, | ||
int | height_in_items ) |
bool yaze::gui::InputTileInfo | ( | const char * | label, |
gfx::TileInfo * | tile_info ) |
Definition at line 242 of file input.cc.
References yaze::gfx::TileInfo::horizontal_mirror_, yaze::gfx::TileInfo::id_, InputHexByte(), InputHexWord(), yaze::gfx::TileInfo::over_, yaze::gfx::TileInfo::palette_, and yaze::gfx::TileInfo::vertical_mirror_.
Referenced by yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx().
IMGUI_API ImGuiID yaze::gui::GetID | ( | const std::string & | id | ) |
Definition at line 256 of file input.cc.
Referenced by yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), and yaze::editor::SpriteEditor::DrawSpritesList().
void yaze::gui::AddTableColumn | ( | Table & | table, |
const std::string & | label, | ||
GuiElement | element ) |
Definition at line 258 of file input.cc.
References yaze::gui::Table::column_contents, and yaze::gui::Table::column_labels.
Referenced by yaze::editor::OverworldEditor::DrawToolset().
void yaze::gui::DrawTable | ( | Table & | params | ) |
Definition at line 263 of file input.cc.
References yaze::gui::Table::column_contents, yaze::gui::Table::column_labels, yaze::gui::Table::flags, yaze::gui::Table::id, yaze::gui::Table::num_columns, and yaze::gui::Table::size.
Referenced by yaze::editor::OverworldEditor::DrawToolset().
absl::StatusOr< Theme > yaze::gui::LoadTheme | ( | const std::string & | filename | ) |
Definition at line 48 of file style.cc.
References yaze::core::LoadFile(), and RETURN_IF_ERROR.
absl::Status yaze::gui::SaveTheme | ( | const Theme & | theme | ) |
Definition at line 75 of file style.cc.
References yaze::gui::Theme::button, yaze::gui::Theme::button_active, yaze::gui::Theme::button_hovered, ColorToHexString(), yaze::gui::Theme::header, yaze::gui::Theme::header_active, yaze::gui::Theme::header_hovered, yaze::gui::Theme::menu_bar_bg, yaze::gui::Theme::name, yaze::gui::Theme::tab, yaze::gui::Theme::tab_active, yaze::gui::Theme::tab_hovered, yaze::gui::Theme::title_bar_bg, yaze::gui::Theme::title_bg_active, and yaze::gui::Theme::title_bg_collapsed.
void yaze::gui::ApplyTheme | ( | const Theme & | theme | ) |
Definition at line 98 of file style.cc.
References yaze::gui::Theme::button, yaze::gui::Theme::button_active, yaze::gui::Theme::button_hovered, ConvertColorToImVec4(), yaze::gui::Theme::header, yaze::gui::Theme::header_active, yaze::gui::Theme::header_hovered, yaze::gui::Theme::menu_bar_bg, yaze::gui::Theme::tab, yaze::gui::Theme::tab_active, yaze::gui::Theme::tab_hovered, yaze::gui::Theme::title_bar_bg, yaze::gui::Theme::title_bg_active, and yaze::gui::Theme::title_bg_collapsed.
void yaze::gui::ColorsYaze | ( | ) |
Definition at line 117 of file style.cc.
Referenced by yaze::core::Controller::CreateGuiContext(), and yaze::test::integration::RunIntegrationTest().
void yaze::gui::DrawBitmapViewer | ( | const std::vector< gfx::Bitmap > & | bitmaps, |
float | scale, | ||
int & | current_bitmap_id ) |
Definition at line 216 of file style.cc.
References yaze::gfx::Bitmap::height(), yaze::gfx::Bitmap::texture(), and yaze::gfx::Bitmap::width().
TextEditor::LanguageDefinition yaze::gui::GetAssemblyLanguageDef | ( | ) |
Definition at line 277 of file style.cc.
References TextEditor::CharLiteral, TextEditor::Identifier, TextEditor::LanguageDefinition::mAutoIndentation, TextEditor::LanguageDefinition::mCaseSensitive, TextEditor::LanguageDefinition::mCommentEnd, TextEditor::LanguageDefinition::mCommentStart, TextEditor::Identifier::mDeclaration, TextEditor::LanguageDefinition::mIdentifiers, TextEditor::LanguageDefinition::mKeywords, TextEditor::LanguageDefinition::mName, TextEditor::LanguageDefinition::mSingleLineComment, TextEditor::LanguageDefinition::mTokenRegexStrings, TextEditor::Number, TextEditor::Preprocessor, TextEditor::Punctuation, and TextEditor::String.
Referenced by yaze::editor::AssemblyEditor::AssemblyEditor().
void yaze::gui::BeginWindowWithDisplaySettings | ( | const char * | id, |
bool * | active, | ||
const ImVec2 & | size, | ||
ImGuiWindowFlags | flags ) |
Definition at line 333 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawOverworldProperties(), and yaze::editor::OverworldEditor::DrawToolset().
void yaze::gui::EndWindowWithDisplaySettings | ( | ) |
Definition at line 353 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawOverworldProperties(), and yaze::editor::OverworldEditor::DrawToolset().
void yaze::gui::BeginPadding | ( | int | i | ) |
Definition at line 358 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::editor::MessageEditor::DrawCurrentMessage(), yaze::editor::OverworldEditor::DrawTile16Selector(), yaze::editor::OverworldEditor::DrawTileSelector(), and yaze::editor::Tile16Editor::UpdateBlockset().
void yaze::gui::EndPadding | ( | ) |
Definition at line 362 of file style.cc.
References EndNoPadding().
Referenced by yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::editor::MessageEditor::DrawCurrentMessage(), and yaze::editor::Tile16Editor::UpdateBlockset().
void yaze::gui::BeginNoPadding | ( | ) |
Definition at line 364 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawOverworldCanvas().
void yaze::gui::EndNoPadding | ( | ) |
Definition at line 368 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawOverworldCanvas(), yaze::editor::OverworldEditor::DrawTile16Selector(), yaze::editor::OverworldEditor::DrawTileSelector(), and EndPadding().
void yaze::gui::BeginChildWithScrollbar | ( | const char * | str_id | ) |
Definition at line 370 of file style.cc.
Referenced by yaze::editor::PaletteEditor::DisplayCategoryTable(), yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::editor::OverworldEditor::DrawTile16Selector(), yaze::editor::OverworldEditor::DrawTileSelector(), and yaze::editor::Tile16Editor::UpdateBlockset().
void yaze::gui::BeginChildBothScrollbars | ( | int | id | ) |
Definition at line 375 of file style.cc.
Referenced by yaze::editor::OverworldEditor::DrawOverworldCanvas().
void yaze::gui::DrawDisplaySettings | ( | ImGuiStyle * | ref | ) |
Definition at line 382 of file style.cc.
Referenced by yaze::editor::EditorManager::DrawMenuBar().
void yaze::gui::TextWithSeparators | ( | const absl::string_view & | text | ) |
Definition at line 746 of file style.cc.
Referenced by yaze::editor::GraphicsEditor::DrawCgxImport(), yaze::editor::GraphicsEditor::DrawClipboardImport(), yaze::gui::Canvas::DrawContextMenu(), yaze::editor::DrawExitEditorPopup(), yaze::editor::GraphicsEditor::DrawExperimentalFeatures(), yaze::editor::GraphicsEditor::DrawFileImport(), yaze::editor::GraphicsEditor::DrawObjImport(), yaze::editor::GraphicsEditor::DrawPaletteControls(), yaze::editor::GraphicsEditor::DrawTilemapImport(), and yaze::editor::GraphicsEditor::UpdatePaletteColumn().
void yaze::gui::DrawFontManager | ( | ) |
Definition at line 752 of file style.cc.
Referenced by yaze::editor::SettingsEditor::Update().
|
constexpr |
Definition at line 35 of file canvas.cc.
Referenced by yaze::gui::Canvas::DrawRect(), and yaze::gui::Canvas::DrawText().
|
constexpr |
Definition at line 36 of file canvas.cc.
Referenced by yaze::gui::Canvas::DrawBackground().
|
constexpr |
Definition at line 37 of file canvas.cc.
Referenced by yaze::gui::Canvas::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawGrid(), yaze::gui::Canvas::DrawInfoGrid(), yaze::gui::Canvas::DrawOverlay(), yaze::gui::Canvas::DrawSelectRect(), and yaze::gui::Canvas::DrawText().
|
constexpr |
Definition at line 38 of file canvas.cc.
Referenced by yaze::gui::Canvas::DrawOutline().
|
constexpr |
Definition at line 40 of file canvas.cc.
Referenced by yaze::gui::Canvas::DrawBackground().
const int yaze::gui::kStepOneHex = 0x01 |
Definition at line 131 of file input.cc.
Referenced by InputHex(), InputHex(), InputHexByte(), InputHexByte(), InputHexShort(), InputHexWord(), and InputHexWord().
const int yaze::gui::kStepFastHex = 0x0F |
Definition at line 132 of file input.cc.
Referenced by InputHex(), InputHex(), InputHexByte(), InputHexByte(), InputHexShort(), InputHexWord(), and InputHexWord().
|
constexpr |
Definition at line 21 of file input.h.
Referenced by yaze::editor::EditorManager::DrawMenuContent(), and yaze::editor::EditorManager::DrawPopups().
|
constexpr |
Definition at line 22 of file input.h.
Referenced by yaze::core::Controller::OnLoad().