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 4a2e3cce69
commit 9f6b804e58
7 changed files with 335 additions and 334 deletions

View File

@@ -309,13 +309,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();
@@ -1607,7 +1607,7 @@ static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column,
// See "COLUMNS SIZING POLICIES" comments at the top of this file
// If (init_width_or_weight <= 0.0f) it is ignored
void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id)
void ImGui::TableSetupColumn(ImStrv label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id)
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
@@ -3141,7 +3141,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;
@@ -4326,7 +4326,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();
@@ -4339,7 +4339,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();
@@ -4550,7 +4550,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);