yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui Namespace Reference

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 &params)
 
absl::StatusOr< ThemeLoadTheme (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 &current_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)
 

Detailed Description

Graphical User Interface (GUI) components for the application.

Typedef Documentation

◆ ItemLabelFlags

Initial value:
enum ItemLabelFlag {
Left = 1u << 0u,
Right = 1u << 1u,
Default = Left,
}

Definition at line 45 of file input.h.

◆ GuiElement

using yaze::gui::GuiElement = std::variant<std::function<void()>, std::string>

Definition at line 55 of file input.h.

◆ BitmapTable

Definition at line 193 of file bitmap.h.

Enumeration Type Documentation

◆ CanvasType

enum class yaze::gui::CanvasType
strong
Enumerator
kTile 
kBlock 
kMap 

Definition at line 22 of file canvas.h.

◆ CanvasMode

enum class yaze::gui::CanvasMode
strong
Enumerator
kPaint 
kSelect 

Definition at line 23 of file canvas.h.

◆ CanvasGridSize

enum class yaze::gui::CanvasGridSize
strong
Enumerator
k8x8 
k16x16 
k32x32 
k64x64 

Definition at line 24 of file canvas.h.

Function Documentation

◆ GraphicsBinCanvasPipeline()

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 )

◆ BitmapCanvasPipeline()

◆ ConvertSnesColorToImVec4()

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().

Here is the call graph for this function:

◆ SnesColorButton()

IMGUI_API bool yaze::gui::SnesColorButton ( absl::string_view id,
gfx::SnesColor & color,
ImGuiColorEditFlags flags,
const ImVec2 & size_arg )

◆ SnesColorEdit4()

IMGUI_API bool yaze::gui::SnesColorEdit4 ( absl::string_view label,
gfx::SnesColor * color,
ImGuiColorEditFlags flags )

◆ DisplayPalette()

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().

Here is the call graph for this function:

◆ SelectablePalettePipeline()

void yaze::gui::SelectablePalettePipeline ( uint64_t & palette_id,
bool & refresh_graphics,
gfx::SnesPalette & palette )

◆ ConvertColorToImVec4()

ImVec4 yaze::gui::ConvertColorToImVec4 ( const Color & color)
inline

◆ ColorToHexString()

std::string yaze::gui::ColorToHexString ( const Color & color)
inline

Definition at line 25 of file color.h.

Referenced by SaveTheme().

◆ InputHex() [1/2]

◆ InputHex() [2/2]

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.

Here is the call graph for this function:

◆ InputHexShort()

IMGUI_API bool yaze::gui::InputHexShort ( const char * label,
uint32_t * data )

Definition at line 147 of file input.cc.

References kStepFastHex, and kStepOneHex.

◆ InputHexWord() [1/2]

◆ InputHexWord() [2/2]

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.

Here is the call graph for this function:

◆ InputHexByte() [1/2]

◆ InputHexByte() [2/2]

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.

Here is the call graph for this function:

◆ ItemLabel()

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().

◆ ListBox()

IMGUI_API bool yaze::gui::ListBox ( const char * label,
int * current_item,
const std::vector< std::string > & items,
int height_in_items )

Definition at line 230 of file input.cc.

◆ InputTileInfo()

bool yaze::gui::InputTileInfo ( const char * label,
gfx::TileInfo * tile_info )

◆ GetID()

IMGUI_API ImGuiID yaze::gui::GetID ( const std::string & id)

◆ AddTableColumn()

void yaze::gui::AddTableColumn ( Table & table,
const std::string & label,
GuiElement element )

◆ DrawTable()

◆ LoadTheme()

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.

Here is the call graph for this function:

◆ SaveTheme()

◆ ApplyTheme()

◆ ColorsYaze()

void yaze::gui::ColorsYaze ( )

◆ DrawBitmapViewer()

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().

Here is the call graph for this function:

◆ GetAssemblyLanguageDef()

◆ BeginWindowWithDisplaySettings()

void yaze::gui::BeginWindowWithDisplaySettings ( const char * id,
bool * active,
const ImVec2 & size,
ImGuiWindowFlags flags )
Todo
Add more display settings to popup windows.

Definition at line 333 of file style.cc.

Referenced by yaze::editor::OverworldEditor::DrawOverworldProperties(), and yaze::editor::OverworldEditor::DrawToolset().

◆ EndWindowWithDisplaySettings()

void yaze::gui::EndWindowWithDisplaySettings ( )

◆ BeginPadding()

◆ EndPadding()

void yaze::gui::EndPadding ( )

◆ BeginNoPadding()

void yaze::gui::BeginNoPadding ( )

Definition at line 364 of file style.cc.

Referenced by yaze::editor::OverworldEditor::DrawOverworldCanvas().

◆ EndNoPadding()

◆ BeginChildWithScrollbar()

◆ BeginChildBothScrollbars()

void yaze::gui::BeginChildBothScrollbars ( int id)

Definition at line 375 of file style.cc.

Referenced by yaze::editor::OverworldEditor::DrawOverworldCanvas().

◆ DrawDisplaySettings()

void yaze::gui::DrawDisplaySettings ( ImGuiStyle * ref)

Definition at line 382 of file style.cc.

Referenced by yaze::editor::EditorManager::DrawMenuBar().

◆ TextWithSeparators()

◆ DrawFontManager()

void yaze::gui::DrawFontManager ( )

Definition at line 752 of file style.cc.

Referenced by yaze::editor::SettingsEditor::Update().

Variable Documentation

◆ kBlackColor

uint32_t yaze::gui::kBlackColor = IM_COL32(0, 0, 0, 255)
constexpr

Definition at line 35 of file canvas.cc.

Referenced by yaze::gui::Canvas::DrawRect(), and yaze::gui::Canvas::DrawText().

◆ kRectangleColor

uint32_t yaze::gui::kRectangleColor = IM_COL32(32, 32, 32, 255)
constexpr

Definition at line 36 of file canvas.cc.

Referenced by yaze::gui::Canvas::DrawBackground().

◆ kWhiteColor

◆ kOutlineRect

uint32_t yaze::gui::kOutlineRect = IM_COL32(255, 255, 255, 200)
constexpr

Definition at line 38 of file canvas.cc.

Referenced by yaze::gui::Canvas::DrawOutline().

◆ kMouseFlags

ImGuiButtonFlags yaze::gui::kMouseFlags
constexpr
Initial value:
=
ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight

Definition at line 40 of file canvas.cc.

Referenced by yaze::gui::Canvas::DrawBackground().

◆ kStepOneHex

const int yaze::gui::kStepOneHex = 0x01

◆ kStepFastHex

const int yaze::gui::kStepFastHex = 0x0F

◆ kDefaultModalSize

ImVec2 yaze::gui::kDefaultModalSize = ImVec2(200, 0)
constexpr

◆ kZeroPos

ImVec2 yaze::gui::kZeroPos = ImVec2(0, 0)
constexpr

Definition at line 22 of file input.h.

Referenced by yaze::core::Controller::OnLoad().