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

Graphical User Interface (GUI) components for the application. More...

Namespaces

namespace  anonymous_namespace{canvas.cc}
 
namespace  zeml
 Zelda Editor Markup Language Functions.
 

Classes

struct  AssetObject
 
class  Canvas
 Represents a canvas for drawing and manipulating graphics. More...
 
struct  DungeonAsset
 
struct  ExampleSelectionWithDeletion
 
struct  GfxSheetAssetBrowser
 
struct  MultiSelectWithClipper
 
struct  OverworldAsset
 
struct  SpriteAsset
 
struct  UnsortedAsset
 

Typedefs

using ItemLabelFlags
 

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 SnesColor &color)
 
IMGUI_API bool SnesColorButton (absl::string_view id, SnesColor &color, ImGuiColorEditFlags flags, const ImVec2 &size_arg)
 
IMGUI_API bool SnesColorEdit4 (absl::string_view label, SnesColor *color, ImGuiColorEditFlags flags)
 
absl::Status DisplayPalette (app::gfx::SnesPalette &palette, bool loaded)
 
void SelectablePalettePipeline (uint64_t &palette_id, bool &refresh_graphics, gfx::SnesPalette &palette)
 
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 FileDialogPipeline (absl::string_view display_key, absl::string_view file_extensions, std::optional< absl::string_view > button_text, std::function< void()> callback)
 
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 ColorsYaze ()
 
void DrawBitmapViewer (const std::vector< gfx::Bitmap > &bitmaps, float scale, int &current_bitmap_id)
 
TextEditor::LanguageDefinition GetAssemblyLanguageDef ()
 

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 51 of file input.h.

Enumeration Type Documentation

◆ CanvasType

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

Definition at line 22 of file canvas.h.

◆ CanvasMode

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

Definition at line 23 of file canvas.h.

◆ CanvasGridSize

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

Definition at line 24 of file canvas.h.

Function Documentation

◆ GraphicsBinCanvasPipeline()

void yaze::app::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::app::gui::ConvertSnesColorToImVec4 ( const SnesColor & color)

Definition at line 16 of file color.cc.

References yaze::app::gfx::SnesColor::rgb().

Referenced by SnesColorButton(), and SnesColorEdit4().

Here is the call graph for this function:

◆ SnesColorButton()

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

◆ SnesColorEdit4()

◆ DisplayPalette()

absl::Status yaze::app::gui::DisplayPalette ( app::gfx::SnesPalette & palette,
bool loaded )

Definition at line 56 of file color.cc.

References ASSIGN_OR_RETURN, yaze::app::gfx::SnesPalette::GetColor(), and yaze::app::gfx::SnesPalette::size().

Referenced by yaze::app::editor::ScreenEditor::DrawInventoryMenuEditor().

Here is the call graph for this function:

◆ SelectablePalettePipeline()

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

◆ InputHex() [1/2]

◆ InputHex() [2/2]

IMGUI_API bool yaze::app::gui::InputHex ( const char * label,
int * data,
int num_digits,
float input_width )

Definition at line 148 of file input.cc.

References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.

Here is the call graph for this function:

◆ InputHexShort()

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

Definition at line 155 of file input.cc.

References kStepFastHex, and kStepOneHex.

◆ InputHexWord() [1/2]

◆ InputHexWord() [2/2]

IMGUI_API bool yaze::app::gui::InputHexWord ( const char * label,
int16_t * data,
float input_width,
bool no_step )

Definition at line 168 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::app::gui::InputHexByte ( const char * label,
uint8_t * data,
uint8_t max_value,
float input_width,
bool no_step )

Definition at line 182 of file input.cc.

References ImGui::InputScalarLeft(), kStepFastHex, and kStepOneHex.

Here is the call graph for this function:

◆ ItemLabel()

IMGUI_API void yaze::app::gui::ItemLabel ( absl::string_view title,
ItemLabelFlags flags )

Definition at line 195 of file input.cc.

Referenced by yaze::app::editor::MusicEditor::DrawToolset().

◆ ListBox()

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

Definition at line 238 of file input.cc.

◆ InputTileInfo()

◆ GetID()

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

◆ FileDialogPipeline()

void yaze::app::gui::FileDialogPipeline ( absl::string_view display_key,
absl::string_view file_extensions,
std::optional< absl::string_view > button_text,
std::function< void()> callback )

◆ BeginWindowWithDisplaySettings()

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

Definition at line 11 of file style.cc.

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

◆ EndWindowWithDisplaySettings()

void yaze::app::gui::EndWindowWithDisplaySettings ( )

◆ BeginPadding()

◆ EndPadding()

void yaze::app::gui::EndPadding ( )

◆ BeginNoPadding()

void yaze::app::gui::BeginNoPadding ( )

Definition at line 42 of file style.cc.

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

◆ EndNoPadding()

◆ BeginChildWithScrollbar()

◆ BeginChildBothScrollbars()

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

Definition at line 53 of file style.cc.

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

◆ DrawDisplaySettings()

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

Definition at line 60 of file style.cc.

Referenced by yaze::app::editor::EditorManager::DrawYazeMenu().

◆ TextWithSeparators()

◆ ColorsYaze()

void yaze::app::gui::ColorsYaze ( )
Todo
Make the ColorsYaze style into a configuration file.

Definition at line 431 of file style.cc.

Referenced by yaze::app::core::Controller::CreateGuiContext(), and yaze::test::integration::RunIntegrationTest().

◆ DrawBitmapViewer()

void yaze::app::gui::DrawBitmapViewer ( const std::vector< gfx::Bitmap > & bitmaps,
float scale,
int & current_bitmap_id )

Definition at line 530 of file style.cc.

References yaze::app::gfx::Bitmap::height(), yaze::app::gfx::Bitmap::texture(), and yaze::app::gfx::Bitmap::width().

Here is the call graph for this function:

◆ GetAssemblyLanguageDef()

TextEditor::LanguageDefinition yaze::app::gui::GetAssemblyLanguageDef ( )

Definition at line 596 of file style.cc.

Referenced by yaze::app::editor::AssemblyEditor::AssemblyEditor().

Variable Documentation

◆ kBlackColor

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

Definition at line 36 of file canvas.cc.

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

◆ kRectangleColor

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

Definition at line 37 of file canvas.cc.

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

◆ kWhiteColor

◆ kOutlineRect

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

Definition at line 39 of file canvas.cc.

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

◆ kMouseFlags

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

Definition at line 41 of file canvas.cc.

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

◆ kStepOneHex

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

◆ kStepFastHex

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

◆ kDefaultModalSize

◆ kZeroPos

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