diff --git a/src/cimgui/cimgui.d b/src/cimgui/cimgui.d index 8c918ad..b0d6efa 100644 --- a/src/cimgui/cimgui.d +++ b/src/cimgui/cimgui.d @@ -3,10 +3,15 @@ module cimgui.cimgui; // get dcimgui headers to module - @system (unsafe) functions by default public import cimgui.dcimgui; -version (Windows) - alias dsize_t = ulong; +version (D_BetterC) +{ + // No conflict with object.size_t (DRT) +} else - alias dsize_t = size_t; +{ + // replace object.size_t to cimgui.dcimgui.size_t + version (Windows) alias size_t = ulong; +} scope ImGuiContext_t* CreateContext(scope const(ImFontAtlas_t)* shared_font_atlas) @trusted { @@ -801,22 +806,22 @@ void TextLinkOpenURLEx(scope const(char)* label, scope const(char)* url) @truste igTextLinkOpenURLEx(label, url); } -void Image(dsize_t user_texture_id, const ImVec2_t image_size) @trusted +void Image(size_t user_texture_id, const ImVec2_t image_size) @trusted { igImage(user_texture_id, image_size); } -void ImageEx(dsize_t user_texture_id, const ImVec2_t image_size, const ImVec2_t uv0, const ImVec2_t uv1, const ImVec4_t tint_col, const ImVec4_t border_col) @trusted +void ImageEx(size_t user_texture_id, const ImVec2_t image_size, const ImVec2_t uv0, const ImVec2_t uv1, const ImVec4_t tint_col, const ImVec4_t border_col) @trusted { igImageEx(user_texture_id, image_size, uv0, uv1, tint_col, border_col); } -bool ImageButton(scope const(char)* str_id, dsize_t user_texture_id, const ImVec2_t image_size) @trusted +bool ImageButton(scope const(char)* str_id, size_t user_texture_id, const ImVec2_t image_size) @trusted { return igImageButton(str_id, user_texture_id, image_size); } -bool ImageButtonEx(scope const(char)* str_id, dsize_t user_texture_id, const ImVec2_t image_size, const ImVec2_t uv0, const ImVec2_t uv1, const ImVec4_t bg_col, const ImVec4_t tint_col) @trusted +bool ImageButtonEx(scope const(char)* str_id, size_t user_texture_id, const ImVec2_t image_size, const ImVec2_t uv0, const ImVec2_t uv1, const ImVec4_t bg_col, const ImVec4_t tint_col) @trusted { return igImageButtonEx(str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); } @@ -1149,34 +1154,34 @@ bool VSliderScalarEx(scope const(char)* label, ImVec2_t size, int data_type, sco return igVSliderScalarEx(label, size, data_type, p_data, p_min, p_max, format, flags); } -bool InputText(scope const(char)* label, scope char* buf, dsize_t buf_size, int flags) @trusted +bool InputText(scope const(char)* label, scope char* buf, size_t buf_size, int flags) @trusted { return igInputText(label, buf, buf_size, flags); } -extern (C) bool InputTextEx(scope const(char)* label, scope char* buf, dsize_t buf_size, int flags, int function( +extern (C) bool InputTextEx(scope const(char)* label, scope char* buf, size_t buf_size, int flags, int function( const ImGuiInputTextCallbackData_t* data) callback, scope void* user_data) @trusted { return igInputTextEx(label, buf, buf_size, flags, callback, user_data); } -bool InputTextMultiline(scope const(char)* label, scope char* buf, dsize_t buf_size) @trusted +bool InputTextMultiline(scope const(char)* label, scope char* buf, size_t buf_size) @trusted { return igInputTextMultiline(label, buf, buf_size); } -extern (C) bool InputTextMultilineEx(scope const(char)* label, scope char* buf, dsize_t buf_size, ImVec2_t size, int flags, int function( +extern (C) bool InputTextMultilineEx(scope const(char)* label, scope char* buf, size_t buf_size, ImVec2_t size, int flags, int function( const ImGuiInputTextCallbackData_t* data) callback, scope void* user_data) @trusted { return igInputTextMultilineEx(label, buf, buf_size, size, flags, callback, user_data); } -bool InputTextWithHint(scope const(char)* label, scope const(char)* hint, scope char* buf, dsize_t buf_size, int flags) @trusted +bool InputTextWithHint(scope const(char)* label, scope const(char)* hint, scope char* buf, size_t buf_size, int flags) @trusted { return igInputTextWithHint(label, hint, buf, buf_size, flags); } -extern (C) bool InputTextWithHintEx(scope const(char)* label, scope const(char)* hint, scope char* buf, dsize_t buf_size, int flags, int function( +extern (C) bool InputTextWithHintEx(scope const(char)* label, scope const(char)* hint, scope char* buf, size_t buf_size, int flags, int function( const ImGuiInputTextCallbackData_t* data) callback, scope void* user_data) @trusted { return igInputTextWithHintEx(label, hint, buf, buf_size, flags, callback, user_data); @@ -1881,7 +1886,7 @@ bool BeginDragDropSource(int flags) @trusted return igBeginDragDropSource(flags); } -bool SetDragDropPayload(scope const(char)* type, scope const(void)* data, dsize_t sz, int cond) @trusted +bool SetDragDropPayload(scope const(char)* type, scope const(void)* data, size_t sz, int cond) @trusted { return igSetDragDropPayload(type, data, sz, cond); } @@ -2296,7 +2301,7 @@ void LoadIniSettingsFromDisk(scope const(char)* ini_filename) @trusted igLoadIniSettingsFromDisk(ini_filename); } -void LoadIniSettingsFromMemory(scope const(char)* ini_data, dsize_t ini_size) @trusted +void LoadIniSettingsFromMemory(scope const(char)* ini_data, size_t ini_size) @trusted { igLoadIniSettingsFromMemory(ini_data, ini_size); } @@ -2306,7 +2311,7 @@ void SaveIniSettingsToDisk(scope const(char)* ini_filename) @trusted igSaveIniSettingsToDisk(ini_filename); } -scope const(char)* SaveIniSettingsToMemory(scope dsize_t* out_ini_size) @trusted +scope const(char)* SaveIniSettingsToMemory(scope size_t* out_ini_size) @trusted { return igSaveIniSettingsToMemory(out_ini_size); } @@ -2326,7 +2331,7 @@ void DebugStartItemPicker() @trusted igDebugStartItemPicker(); } -bool DebugCheckVersionAndDataLayout(scope const(char)* version_str, dsize_t sz_io, dsize_t sz_style, dsize_t sz_vec2, dsize_t sz_vec4, dsize_t sz_drawvert, dsize_t sz_drawidx) @trusted +bool DebugCheckVersionAndDataLayout(scope const(char)* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx) @trusted { return igDebugCheckVersionAndDataLayout(version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert, sz_drawidx); } @@ -2338,19 +2343,19 @@ void DebugLogV(scope const(char)* fmt, __builtin_va_list args) @trusted igDebugLogV(fmt, args); } -extern (C) void SetAllocatorFunctions(scope void* function(dsize_t sz, void* user_data) alloc_func, void function( +extern (C) void SetAllocatorFunctions(scope void* function(size_t sz, void* user_data) alloc_func, void function( void* ptr, void* user_data) free_func, scope void* user_data) @trusted { igSetAllocatorFunctions(alloc_func, free_func, user_data); } -extern (C) void GetAllocatorFunctions(scope void* function(dsize_t sz, void* user_data)* p_alloc_func, void function( +extern (C) void GetAllocatorFunctions(scope void* function(size_t sz, void* user_data)* p_alloc_func, void function( void* ptr, void* user_data)* p_free_func, scope void** p_user_data) @trusted { igGetAllocatorFunctions(p_alloc_func, p_free_func, p_user_data); } -scope void* MemAlloc(dsize_t size) @trusted +scope void* MemAlloc(size_t size) @trusted { return igMemAlloc(size); } @@ -2769,7 +2774,7 @@ void applyRequests( ImGuiSelectionExternalStorage_ApplyRequests(self, ms_io); } -dsize_t getTexID(scope const(ImDrawCmd_t)* self) @trusted +size_t getTexID(scope const(ImDrawCmd_t)* self) @trusted { return ImDrawCmd_GetTexID(cast(ImDrawCmd_t*) self); }