ImStrv: Step 1 - change string type to ImStrv in API. (REBASED)

(last rebase amend 2024/12/11)
This commit is contained in:
Rokas Kupstys
2020-07-14 14:14:17 +03:00
committed by ocornut
parent 5c2160ac85
commit f15ef9c27f
7 changed files with 338 additions and 336 deletions

View File

@@ -312,13 +312,13 @@ ImGuiTable* ImGui::TableFindByID(ImGuiID id)
}
// Read about "TABLE SIZING" at the top of this file.
bool ImGui::BeginTable(const char* str_id, int columns_count, ImGuiTableFlags flags, const ImVec2& outer_size, float inner_width)
bool ImGui::BeginTable(ImStrv str_id, int columns_count, ImGuiTableFlags flags, const ImVec2& outer_size, float inner_width)
{
ImGuiID id = GetID(str_id);
return BeginTableEx(str_id, id, columns_count, flags, outer_size, inner_width);
}
bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags, const ImVec2& outer_size, float inner_width)
bool ImGui::BeginTableEx(ImStrv name, ImGuiID id, int columns_count, ImGuiTableFlags flags, const ImVec2& outer_size, float inner_width)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* outer_window = GetCurrentWindow();
@@ -1734,7 +1734,7 @@ static void TableSetupColumnApply(ImGuiTable* table, int idx, ImGuiID id, ImS16
column->InitStretchWeightOrWidth = init_width_or_weight;
}
void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_data)
void ImGui::TableSetupColumn(ImStrv label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_data)
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
@@ -3321,7 +3321,7 @@ void ImGui::TableHeadersRow()
// Emit a column header (text + optional sort order)
// We cpu-clip text here so that all columns headers can be merged into a same draw call.
// Note that because of how we cpu-clip and display sorting indicators, you _cannot_ use SameLine() after a TableHeader()
void ImGui::TableHeader(const char* label)
void ImGui::TableHeader(ImStrv label)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
@@ -3674,7 +3674,7 @@ bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
}
// FIXME: Copied from MenuItem() for the purpose of being able to pass _SelectOnRelease (#9312)
static bool MenuItemForColumnReorder(const char* label, bool selected, bool enabled)
static bool MenuItemForColumnReorder(ImStrv label, bool selected, bool enabled)
{
using namespace ImGui;
ImGuiContext& g = *GImGui;
@@ -4654,7 +4654,7 @@ ImGuiOldColumns* ImGui::FindOrCreateColumns(ImGuiWindow* window, ImGuiID id)
return columns;
}
ImGuiID ImGui::GetColumnsID(const char* str_id, int columns_count)
ImGuiID ImGui::GetColumnsID(ImStrv str_id, int columns_count)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -4667,7 +4667,7 @@ ImGuiID ImGui::GetColumnsID(const char* str_id, int columns_count)
return id;
}
void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFlags flags)
void ImGui::BeginColumns(ImStrv str_id, int columns_count, ImGuiOldColumnFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -4878,7 +4878,7 @@ void ImGui::EndColumns()
NavUpdateCurrentWindowIsScrollPushableX();
}
void ImGui::Columns(int columns_count, const char* id, bool borders)
void ImGui::Columns(int columns_count, ImStrv id, bool borders)
{
ImGuiWindow* window = GetCurrentWindow();
IM_ASSERT(columns_count >= 1);