@@ -1093,37 +1093,6 @@ public static float CalcItemWidth()
10931093 float ret = ImGuiNative.igCalcItemWidth();
10941094 return ret;
10951095 }
1096- public static Vector2 CalcTextSize(string text)
1097- {
1098- Vector2 __retval;
1099- byte* native_text;
1100- int text_byteCount = 0;
1101- if (text != null)
1102- {
1103- text_byteCount = Encoding.UTF8.GetByteCount(text);
1104- if (text_byteCount > Util.StackAllocationSizeLimit)
1105- {
1106- native_text = Util.Allocate(text_byteCount + 1);
1107- }
1108- else
1109- {
1110- byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1];
1111- native_text = native_text_stackBytes;
1112- }
1113- int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount);
1114- native_text[native_text_offset] = 0;
1115- }
1116- else { native_text = null; }
1117- byte* native_text_end = null;
1118- byte hide_text_after_double_hash = 0;
1119- float wrap_width = -1.0f;
1120- ImGuiNative.igCalcTextSize(&__retval, native_text, native_text_end, hide_text_after_double_hash, wrap_width);
1121- if (text_byteCount > Util.StackAllocationSizeLimit)
1122- {
1123- Util.Free(native_text);
1124- }
1125- return __retval;
1126- }
11271096 public static void CaptureKeyboardFromApp()
11281097 {
11291098 byte want_capture_keyboard_value = 1;
@@ -8085,297 +8054,6 @@ public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_
80858054 }
80868055 return ret != 0;
80878056 }
8088- public static bool InputTextWithHint(string label, string hint, string buf, uint buf_size)
8089- {
8090- byte* native_label;
8091- int label_byteCount = 0;
8092- if (label != null)
8093- {
8094- label_byteCount = Encoding.UTF8.GetByteCount(label);
8095- if (label_byteCount > Util.StackAllocationSizeLimit)
8096- {
8097- native_label = Util.Allocate(label_byteCount + 1);
8098- }
8099- else
8100- {
8101- byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1];
8102- native_label = native_label_stackBytes;
8103- }
8104- int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount);
8105- native_label[native_label_offset] = 0;
8106- }
8107- else { native_label = null; }
8108- byte* native_hint;
8109- int hint_byteCount = 0;
8110- if (hint != null)
8111- {
8112- hint_byteCount = Encoding.UTF8.GetByteCount(hint);
8113- if (hint_byteCount > Util.StackAllocationSizeLimit)
8114- {
8115- native_hint = Util.Allocate(hint_byteCount + 1);
8116- }
8117- else
8118- {
8119- byte* native_hint_stackBytes = stackalloc byte[hint_byteCount + 1];
8120- native_hint = native_hint_stackBytes;
8121- }
8122- int native_hint_offset = Util.GetUtf8(hint, native_hint, hint_byteCount);
8123- native_hint[native_hint_offset] = 0;
8124- }
8125- else { native_hint = null; }
8126- byte* native_buf;
8127- int buf_byteCount = 0;
8128- if (buf != null)
8129- {
8130- buf_byteCount = Encoding.UTF8.GetByteCount(buf);
8131- if (buf_byteCount > Util.StackAllocationSizeLimit)
8132- {
8133- native_buf = Util.Allocate(buf_byteCount + 1);
8134- }
8135- else
8136- {
8137- byte* native_buf_stackBytes = stackalloc byte[buf_byteCount + 1];
8138- native_buf = native_buf_stackBytes;
8139- }
8140- int native_buf_offset = Util.GetUtf8(buf, native_buf, buf_byteCount);
8141- native_buf[native_buf_offset] = 0;
8142- }
8143- else { native_buf = null; }
8144- ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0;
8145- ImGuiInputTextCallback callback = null;
8146- void* user_data = null;
8147- byte ret = ImGuiNative.igInputTextWithHint(native_label, native_hint, native_buf, buf_size, flags, callback, user_data);
8148- if (label_byteCount > Util.StackAllocationSizeLimit)
8149- {
8150- Util.Free(native_label);
8151- }
8152- if (hint_byteCount > Util.StackAllocationSizeLimit)
8153- {
8154- Util.Free(native_hint);
8155- }
8156- if (buf_byteCount > Util.StackAllocationSizeLimit)
8157- {
8158- Util.Free(native_buf);
8159- }
8160- return ret != 0;
8161- }
8162- public static bool InputTextWithHint(string label, string hint, string buf, uint buf_size, ImGuiInputTextFlags flags)
8163- {
8164- byte* native_label;
8165- int label_byteCount = 0;
8166- if (label != null)
8167- {
8168- label_byteCount = Encoding.UTF8.GetByteCount(label);
8169- if (label_byteCount > Util.StackAllocationSizeLimit)
8170- {
8171- native_label = Util.Allocate(label_byteCount + 1);
8172- }
8173- else
8174- {
8175- byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1];
8176- native_label = native_label_stackBytes;
8177- }
8178- int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount);
8179- native_label[native_label_offset] = 0;
8180- }
8181- else { native_label = null; }
8182- byte* native_hint;
8183- int hint_byteCount = 0;
8184- if (hint != null)
8185- {
8186- hint_byteCount = Encoding.UTF8.GetByteCount(hint);
8187- if (hint_byteCount > Util.StackAllocationSizeLimit)
8188- {
8189- native_hint = Util.Allocate(hint_byteCount + 1);
8190- }
8191- else
8192- {
8193- byte* native_hint_stackBytes = stackalloc byte[hint_byteCount + 1];
8194- native_hint = native_hint_stackBytes;
8195- }
8196- int native_hint_offset = Util.GetUtf8(hint, native_hint, hint_byteCount);
8197- native_hint[native_hint_offset] = 0;
8198- }
8199- else { native_hint = null; }
8200- byte* native_buf;
8201- int buf_byteCount = 0;
8202- if (buf != null)
8203- {
8204- buf_byteCount = Encoding.UTF8.GetByteCount(buf);
8205- if (buf_byteCount > Util.StackAllocationSizeLimit)
8206- {
8207- native_buf = Util.Allocate(buf_byteCount + 1);
8208- }
8209- else
8210- {
8211- byte* native_buf_stackBytes = stackalloc byte[buf_byteCount + 1];
8212- native_buf = native_buf_stackBytes;
8213- }
8214- int native_buf_offset = Util.GetUtf8(buf, native_buf, buf_byteCount);
8215- native_buf[native_buf_offset] = 0;
8216- }
8217- else { native_buf = null; }
8218- ImGuiInputTextCallback callback = null;
8219- void* user_data = null;
8220- byte ret = ImGuiNative.igInputTextWithHint(native_label, native_hint, native_buf, buf_size, flags, callback, user_data);
8221- if (label_byteCount > Util.StackAllocationSizeLimit)
8222- {
8223- Util.Free(native_label);
8224- }
8225- if (hint_byteCount > Util.StackAllocationSizeLimit)
8226- {
8227- Util.Free(native_hint);
8228- }
8229- if (buf_byteCount > Util.StackAllocationSizeLimit)
8230- {
8231- Util.Free(native_buf);
8232- }
8233- return ret != 0;
8234- }
8235- public static bool InputTextWithHint(string label, string hint, string buf, uint buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback)
8236- {
8237- byte* native_label;
8238- int label_byteCount = 0;
8239- if (label != null)
8240- {
8241- label_byteCount = Encoding.UTF8.GetByteCount(label);
8242- if (label_byteCount > Util.StackAllocationSizeLimit)
8243- {
8244- native_label = Util.Allocate(label_byteCount + 1);
8245- }
8246- else
8247- {
8248- byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1];
8249- native_label = native_label_stackBytes;
8250- }
8251- int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount);
8252- native_label[native_label_offset] = 0;
8253- }
8254- else { native_label = null; }
8255- byte* native_hint;
8256- int hint_byteCount = 0;
8257- if (hint != null)
8258- {
8259- hint_byteCount = Encoding.UTF8.GetByteCount(hint);
8260- if (hint_byteCount > Util.StackAllocationSizeLimit)
8261- {
8262- native_hint = Util.Allocate(hint_byteCount + 1);
8263- }
8264- else
8265- {
8266- byte* native_hint_stackBytes = stackalloc byte[hint_byteCount + 1];
8267- native_hint = native_hint_stackBytes;
8268- }
8269- int native_hint_offset = Util.GetUtf8(hint, native_hint, hint_byteCount);
8270- native_hint[native_hint_offset] = 0;
8271- }
8272- else { native_hint = null; }
8273- byte* native_buf;
8274- int buf_byteCount = 0;
8275- if (buf != null)
8276- {
8277- buf_byteCount = Encoding.UTF8.GetByteCount(buf);
8278- if (buf_byteCount > Util.StackAllocationSizeLimit)
8279- {
8280- native_buf = Util.Allocate(buf_byteCount + 1);
8281- }
8282- else
8283- {
8284- byte* native_buf_stackBytes = stackalloc byte[buf_byteCount + 1];
8285- native_buf = native_buf_stackBytes;
8286- }
8287- int native_buf_offset = Util.GetUtf8(buf, native_buf, buf_byteCount);
8288- native_buf[native_buf_offset] = 0;
8289- }
8290- else { native_buf = null; }
8291- void* user_data = null;
8292- byte ret = ImGuiNative.igInputTextWithHint(native_label, native_hint, native_buf, buf_size, flags, callback, user_data);
8293- if (label_byteCount > Util.StackAllocationSizeLimit)
8294- {
8295- Util.Free(native_label);
8296- }
8297- if (hint_byteCount > Util.StackAllocationSizeLimit)
8298- {
8299- Util.Free(native_hint);
8300- }
8301- if (buf_byteCount > Util.StackAllocationSizeLimit)
8302- {
8303- Util.Free(native_buf);
8304- }
8305- return ret != 0;
8306- }
8307- public static bool InputTextWithHint(string label, string hint, string buf, uint buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, IntPtr user_data)
8308- {
8309- byte* native_label;
8310- int label_byteCount = 0;
8311- if (label != null)
8312- {
8313- label_byteCount = Encoding.UTF8.GetByteCount(label);
8314- if (label_byteCount > Util.StackAllocationSizeLimit)
8315- {
8316- native_label = Util.Allocate(label_byteCount + 1);
8317- }
8318- else
8319- {
8320- byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1];
8321- native_label = native_label_stackBytes;
8322- }
8323- int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount);
8324- native_label[native_label_offset] = 0;
8325- }
8326- else { native_label = null; }
8327- byte* native_hint;
8328- int hint_byteCount = 0;
8329- if (hint != null)
8330- {
8331- hint_byteCount = Encoding.UTF8.GetByteCount(hint);
8332- if (hint_byteCount > Util.StackAllocationSizeLimit)
8333- {
8334- native_hint = Util.Allocate(hint_byteCount + 1);
8335- }
8336- else
8337- {
8338- byte* native_hint_stackBytes = stackalloc byte[hint_byteCount + 1];
8339- native_hint = native_hint_stackBytes;
8340- }
8341- int native_hint_offset = Util.GetUtf8(hint, native_hint, hint_byteCount);
8342- native_hint[native_hint_offset] = 0;
8343- }
8344- else { native_hint = null; }
8345- byte* native_buf;
8346- int buf_byteCount = 0;
8347- if (buf != null)
8348- {
8349- buf_byteCount = Encoding.UTF8.GetByteCount(buf);
8350- if (buf_byteCount > Util.StackAllocationSizeLimit)
8351- {
8352- native_buf = Util.Allocate(buf_byteCount + 1);
8353- }
8354- else
8355- {
8356- byte* native_buf_stackBytes = stackalloc byte[buf_byteCount + 1];
8357- native_buf = native_buf_stackBytes;
8358- }
8359- int native_buf_offset = Util.GetUtf8(buf, native_buf, buf_byteCount);
8360- native_buf[native_buf_offset] = 0;
8361- }
8362- else { native_buf = null; }
8363- void* native_user_data = (void*)user_data.ToPointer();
8364- byte ret = ImGuiNative.igInputTextWithHint(native_label, native_hint, native_buf, buf_size, flags, callback, native_user_data);
8365- if (label_byteCount > Util.StackAllocationSizeLimit)
8366- {
8367- Util.Free(native_label);
8368- }
8369- if (hint_byteCount > Util.StackAllocationSizeLimit)
8370- {
8371- Util.Free(native_hint);
8372- }
8373- if (buf_byteCount > Util.StackAllocationSizeLimit)
8374- {
8375- Util.Free(native_buf);
8376- }
8377- return ret != 0;
8378- }
83798057 public static bool InvisibleButton(string str_id, Vector2 size)
83808058 {
83818059 byte* native_str_id;
0 commit comments