yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
macro.h File Reference

Go to the source code of this file.

Macros

#define TAB_ITEM(w)   if (ImGui::BeginTabItem(w)) {
 
#define END_TAB_ITEM()
 
#define BEGIN_TABLE(l, n, f)   if (ImGui::BeginTable(l, n, f, ImVec2(0, 0))) {
 
#define SETUP_COLUMN(l)   ImGui::TableSetupColumn(l);
 
#define TABLE_HEADERS()
 
#define NEXT_COLUMN()   ImGui::TableNextColumn();
 
#define END_TABLE()
 
#define HOVER_HINT(string)    if (ImGui::IsItemHovered()) ImGui::SetTooltip(string)
 
#define PRINT_IF_ERROR(expression)
 
#define EXIT_IF_ERROR(expression)
 
#define RETURN_VOID_IF_ERROR(expression)
 
#define RETURN_IF_ERROR(expression)
 
#define ASSIGN_OR_RETURN(type_variable_name, expression)
 
#define ASSIGN_OR_RETURN_IMPL(error_or_value, type_variable_name, expression)
 
#define ASSIGN_OR_LOG_ERROR(type_variable_name, expression)
 
#define ASSIGN_OR_LOG_ERROR_IMPL(error_or_value, type_variable_name, expression)
 
#define APPEND_NUMBER(expression, number)    APPEND_NUMBER_INNER(expression, number)
 
#define APPEND_NUMBER_INNER(expression, number)   expression##number
 
#define TEXT_WITH_SEPARATOR(text)
 
#define TABLE_BORDERS_RESIZABLE    ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable
 
#define CLEAR_AND_RETURN_STATUS(status)
 
#define RETURN_IF_EXCEPTION(expression)
 
#define SDL_RETURN_IF_ERROR()
 

Typedefs

using uint = unsigned int
 

Macro Definition Documentation

◆ TAB_ITEM

#define TAB_ITEM (   w)    if (ImGui::BeginTabItem(w)) {

Definition at line 6 of file macro.h.

◆ END_TAB_ITEM

#define END_TAB_ITEM ( )
Value:
ImGui::EndTabItem(); \
}

Definition at line 7 of file macro.h.

◆ BEGIN_TABLE

#define BEGIN_TABLE (   l,
  n,
 
)    if (ImGui::BeginTable(l, n, f, ImVec2(0, 0))) {

Definition at line 11 of file macro.h.

◆ SETUP_COLUMN

#define SETUP_COLUMN (   l)    ImGui::TableSetupColumn(l);

Definition at line 12 of file macro.h.

◆ TABLE_HEADERS

#define TABLE_HEADERS ( )
Value:
ImGui::TableHeadersRow(); \
ImGui::TableNextRow();

Definition at line 14 of file macro.h.

◆ NEXT_COLUMN

#define NEXT_COLUMN ( )    ImGui::TableNextColumn();

Definition at line 18 of file macro.h.

◆ END_TABLE

#define END_TABLE ( )
Value:
ImGui::EndTable(); \
}

Definition at line 20 of file macro.h.

◆ HOVER_HINT

#define HOVER_HINT (   string)     if (ImGui::IsItemHovered()) ImGui::SetTooltip(string)

Definition at line 24 of file macro.h.

◆ PRINT_IF_ERROR

#define PRINT_IF_ERROR (   expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
std::cout << error.ToString() << std::endl; \
} \
}

Definition at line 27 of file macro.h.

◆ EXIT_IF_ERROR

#define EXIT_IF_ERROR (   expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
std::cout << error.ToString() << std::endl; \
return EXIT_FAILURE; \
} \
}

Definition at line 35 of file macro.h.

◆ RETURN_VOID_IF_ERROR

#define RETURN_VOID_IF_ERROR (   expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
std::cout << error.ToString() << std::endl; \
return; \
} \
}

Definition at line 44 of file macro.h.

◆ RETURN_IF_ERROR

#define RETURN_IF_ERROR (   expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
return error; \
} \
}

Definition at line 53 of file macro.h.

◆ ASSIGN_OR_RETURN

#define ASSIGN_OR_RETURN (   type_variable_name,
  expression 
)
Value:
ASSIGN_OR_RETURN_IMPL(APPEND_NUMBER(error_or_value, __LINE__), \
type_variable_name, expression)
#define APPEND_NUMBER(expression, number)
Definition macro.h:84
#define ASSIGN_OR_RETURN_IMPL(error_or_value, type_variable_name, expression)
Definition macro.h:65

Definition at line 61 of file macro.h.

◆ ASSIGN_OR_RETURN_IMPL

#define ASSIGN_OR_RETURN_IMPL (   error_or_value,
  type_variable_name,
  expression 
)
Value:
auto error_or_value = expression; \
if (!error_or_value.ok()) { \
return error_or_value.status(); \
} \
type_variable_name = std::move(*error_or_value)

Definition at line 65 of file macro.h.

◆ ASSIGN_OR_LOG_ERROR

#define ASSIGN_OR_LOG_ERROR (   type_variable_name,
  expression 
)
Value:
ASSIGN_OR_LOG_ERROR_IMPL(APPEND_NUMBER(error_or_value, __LINE__), \
type_variable_name, expression)
#define ASSIGN_OR_LOG_ERROR_IMPL(error_or_value, type_variable_name, expression)
Definition macro.h:76

Definition at line 72 of file macro.h.

◆ ASSIGN_OR_LOG_ERROR_IMPL

#define ASSIGN_OR_LOG_ERROR_IMPL (   error_or_value,
  type_variable_name,
  expression 
)
Value:
auto error_or_value = expression; \
if (!error_or_value.ok()) { \
std::cout << error_or_value.status().ToString() << std::endl; \
} \
type_variable_name = std::move(*error_or_value);

Definition at line 76 of file macro.h.

◆ APPEND_NUMBER

#define APPEND_NUMBER (   expression,
  number 
)     APPEND_NUMBER_INNER(expression, number)

Definition at line 84 of file macro.h.

◆ APPEND_NUMBER_INNER

#define APPEND_NUMBER_INNER (   expression,
  number 
)    expression##number

Definition at line 87 of file macro.h.

◆ TEXT_WITH_SEPARATOR

#define TEXT_WITH_SEPARATOR (   text)
Value:
ImGui::Text(text); \
ImGui::Separator();

Definition at line 89 of file macro.h.

◆ TABLE_BORDERS_RESIZABLE

#define TABLE_BORDERS_RESIZABLE    ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable

Definition at line 93 of file macro.h.

◆ CLEAR_AND_RETURN_STATUS

#define CLEAR_AND_RETURN_STATUS (   status)
Value:
if (!status.ok()) { \
auto temp = status; \
status = absl::OkStatus(); \
return temp; \
}

Definition at line 96 of file macro.h.

◆ RETURN_IF_EXCEPTION

#define RETURN_IF_EXCEPTION (   expression)
Value:
try { \
expression; \
} catch (const std::exception &e) { \
std::cerr << e.what() << std::endl; \
return EXIT_FAILURE; \
}

Definition at line 103 of file macro.h.

◆ SDL_RETURN_IF_ERROR

#define SDL_RETURN_IF_ERROR ( )
Value:
if (SDL_GetError() != nullptr) { \
return absl::InternalError(SDL_GetError()); \
}

Definition at line 111 of file macro.h.

Typedef Documentation

◆ uint

using uint = unsigned int

Definition at line 4 of file macro.h.