/
cimgui.pxd
1238 lines (1142 loc) · 44.6 KB
/
cimgui.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
# distutils: language = c++
# distutils: include_dirs = imgui-cpp
"""
Notes:
`✓` marks API element as already mapped in core bindings.
`✗` marks API element as "yet to be mapped
"""
from libcpp cimport bool
from enums cimport ImGuiKey_, ImGuiCol_
cdef extern from "imgui.h":
# ====
# Forward declarations
ctypedef struct ImDrawChannel
ctypedef struct ImDrawCmd
ctypedef struct ImDrawData
ctypedef struct ImDrawList
ctypedef struct ImDrawListSharedData
ctypedef struct ImDrawVert
ctypedef struct ImFont
ctypedef struct ImFontAtlas
ctypedef struct ImFontConfig
ctypedef struct ImColor
ctypedef struct ImGuiIO
ctypedef struct ImGuiOnceUponAFrame
ctypedef struct ImGuiStorage
# ctypedef struct ImGuiStyle # declared later
ctypedef struct ImGuiTextFilter
ctypedef struct ImGuiTextBuffer
ctypedef struct ImGuiInputTextCallbackData
ctypedef struct ImGuiSizeCallbackData
ctypedef struct ImGuiListClipper
ctypedef struct ImGuiPayload
ctypedef struct ImGuiContext
# ====
# Various int typedefs and enumerations
ctypedef void* ImTextureID
ctypedef unsigned int ImU32
ctypedef unsigned int ImGuiID
ctypedef unsigned short ImWchar
ctypedef int ImGuiCol
ctypedef int ImGuiDataType
ctypedef int ImGuiDir
ctypedef int ImGuiCond
ctypedef int ImGuiKey
ctypedef int ImGuiNavInput
ctypedef int ImGuiMouseCursor
ctypedef int ImGuiStyleVar
ctypedef int ImDrawCornerFlags
ctypedef int ImDrawListFlags
ctypedef int ImFontAtlasFlags
ctypedef int ImGuiBackendFlags
ctypedef int ImGuiColorEditFlags
ctypedef int ImGuiColumnsFlags
ctypedef int ImGuiConfigFlags
ctypedef int ImGuiComboFlags
ctypedef int ImGuiDragDropFlags
ctypedef int ImGuiFocusedFlags
ctypedef int ImGuiHoveredFlags
ctypedef int ImGuiInputTextFlags
ctypedef int ImGuiSelectableFlags
ctypedef int ImGuiTreeNodeFlags
ctypedef int ImGuiWindowFlags
ctypedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData *data);
ctypedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data);
ctypedef struct ImVec2:
float x
float y
ctypedef struct ImVec4:
float x
float y
float z
float w
ctypedef struct ImGuiIO:
# ====
# source-note: Settings (fill once)
ImGuiConfigFlags ConfigFlags # ✗
ImGuiBackendFlags BackendFlags # ✗
ImVec2 DisplaySize # ✓
float DeltaTime # ✓
float IniSavingRate # ✓
const char* IniFilename # ✓
const char* LogFilename # ✓
float MouseDoubleClickTime # ✓
float MouseDoubleClickMaxDist # ✓
float MouseDragThreshold # ✓
# note: originally KeyMap[ImGuiKey_COUNT]
# todo: find a way to access enum var here
int* KeyMap
float KeyRepeatDelay # ✓
float KeyRepeatRate # ✓
void* UserData
ImFontAtlas* Fonts # ✓
float FontGlobalScale # ✓
bool FontAllowUserScaling # ✓
ImVec2 DisplayFramebufferScale # ✓
ImVec2 DisplayVisibleMin # ✓
ImVec2 DisplayVisibleMax # ✓
bool ConfigMacOSXBehaviors # ✓
bool ConfigInputTextCursorBlink # ✓
bool ConfigResizeWindowsFromEdges # ✓
# ====
# source-note: User Functions
# note: callbacks may wrap arbitrary Python code so we need to
# propagate exceptions from them (as well as C++ exceptions)
const char* (*GetClipboardTextFn)() except + # ✗
void (*SetClipboardTextFn)(const char* text) except + # ✗
void* (*MemAllocFn)(size_t sz) except + # ✗
void (*MemFreeFn)(void* ptr) except + # ✗
void (*ImeSetInputScreenPosFn)(int x, int y) except + # ✗
void* ImeWindowHandle # ✗
# ====
# source-note: Input - Fill before calling NewFrame()
ImVec2 MousePos # ✓
bool MouseDown[5] # ✓
float MouseWheel # ✓
float MouseWheelH # ✗
bool MouseDrawCursor # ✓
bool KeyCtrl # ✓
bool KeyShift # ✓
bool KeyAlt # ✓
bool KeySuper # ✓
bool KeysDown[512] # ✓
ImWchar InputCharacters[16+1] # ✗
void AddInputCharacter(ImWchar c) except + # ✓
void AddInputCharactersUTF8(const char* utf8_chars) except + # ✗
void ClearInputCharacters() except + # ✗
# ====
# source-note: Output - Retrieve after calling NewFrame(), you can use
# them to discard inputs or hide them from the rest of
# your application
bool WantCaptureMouse # ✓
bool WantCaptureKeyboard # ✓
bool WantTextInput # ✓
bool WantSetMousePos # ✓
bool WantSaveIniSettings # ✓
bool NavActive # ✓
bool NavVisible # ✓
float Framerate # ✓
int MetricsRenderVertices # ✓
int MetricsRenderIndices # ✓
int MetricsActiveWindows # ✓
ImVec2 MouseDelta # ✗
# ====
# source-note: [Internal] ImGui will maintain those fields for you
#ImVec2 MousePosPrev # ✗
#ImVec2 MouseClickedPos[5] # ✗
#float MouseClickedTime[5] # ✗
#bool MouseClicked[5] # ✗
#bool MouseDoubleClicked[5] # ✗
#bool MouseReleased[5] # ✗
#bool MouseDownOwned[5] # ✗
#float MouseDownDuration[5] # ✗
#float MouseDownDurationPrev[5] # ✗
#float MouseDragMaxDistanceAbs[5] # ✗
#float MouseDragMaxDistanceSqr[5] # ✗
#float KeysDownDuration[512] # ✗
#float KeysDownDurationPrev[512] # ✗
#float NavInputsDownDuration[ImGuiNavInput_COUNT] # ✗
#float NavInputsDownDurationPrev[ImGuiNavInput_COUNT] # ✗
cdef cppclass ImVector[T]:
int Size
int Capacity
T* Data
ctypedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd) # ✗
ctypedef struct ImDrawCmd: # ✓
unsigned int ElemCount # ✓
ImVec4 ClipRect # ✓
ImTextureID TextureId # ✓
ImDrawCallback UserCallback # ✗
void* UserCallbackData # ✗
ctypedef unsigned short ImDrawIdx
ctypedef struct ImDrawVert: # ✗
ImVec2 pos # ✗
ImVec2 uv # ✗
ImU32 col # ✗
ctypedef struct ImDrawList:
# we map only buffer vectors since everything else is internal
# and right now we dont want to suport it.
ImVector[ImDrawCmd] CmdBuffer # ✓
ImVector[ImDrawIdx] IdxBuffer # ✓
ImVector[ImDrawVert] VtxBuffer # ✓
void AddLine(
const ImVec2& a,
const ImVec2& b,
ImU32 col,
# note: optional
float thickness # = 1.0f
) except + # ✓
void AddRect(
const ImVec2& a,
const ImVec2& b,
ImU32 col,
# note: optional
float rounding, # = 0.0f,
int rounding_corners_flags, # = ImDrawCornerFlags_All,
float thickness # = 1.0f
) except + # ✓
void AddRectFilled(
const ImVec2& a,
const ImVec2& b,
ImU32 col,
# note: optional
float rounding, # = 0.0f
int rounding_corners_flags # = ImDrawCornerFlags_All
) except + # ✓
void AddCircle(
const ImVec2& centre,
float radius,
ImU32 col,
# note: optional
int num_segments, # = 12
float thickness # = 1.0f
) except + # ✓
void AddCircleFilled(
const ImVec2& centre,
float radius,
ImU32 col,
# note: optional
int num_segments # = 12
) except + # ✓
void ChannelsSplit(int channels_count) except + # ✓
void ChannelsMerge() except + # ✓
void ChannelsSetCurrent(int idx) except + # ✓
ctypedef struct ImDrawData: # ✓
bool Valid # ✓
ImDrawList** CmdLists # ✓
int CmdListsCount # ✓
int TotalVtxCount # ✓
int TotalIdxCount # ✓
void DeIndexAllBuffers() except + # ✓
void ScaleClipRects(const ImVec2&) except + # ✓
ctypedef struct ImFontConfig:
pass
ctypedef struct ImFont:
pass
ctypedef struct ImFontAtlas: # ✓
void* TexID # ✓
ImFont* AddFontDefault( # ✓
# note: optional
const ImFontConfig* font_cfg
) except +
ImFont* AddFontFromFileTTF( # ✓
const char* filename, float size_pixels,
# note: optional
const ImFontConfig* font_cfg,
const ImWchar* glyph_ranges
) except +
void GetTexDataAsAlpha8(unsigned char**, int*, int*, int* = NULL) except + # ✓
void GetTexDataAsRGBA32(unsigned char**, int*, int*, int* = NULL) except + # ✓
void ClearTexData() except + # ✓
void ClearInputData() except + # ✓
void ClearFonts() except + # ✓
void Clear() except + # ✓
const ImWchar* GetGlyphRangesDefault() except + # ✓
const ImWchar* GetGlyphRangesKorean() except + # ✓
const ImWchar* GetGlyphRangesJapanese() except + # ✓
const ImWchar* GetGlyphRangesChineseFull() except + # ✓
const ImWchar* GetGlyphRangesChineseSimplifiedCommon() except + # ✓
const ImWchar* GetGlyphRangesCyrillic() except + # ✓
ctypedef struct ImGuiStorage:
pass
cdef cppclass ImGuiStyle:
float Alpha # ✓
ImVec2 WindowPadding # ✓
float WindowRounding # ✓
float WindowBorderSize # ✓
ImVec2 WindowMinSize # ✓
ImVec2 WindowTitleAlign # ✓
float ChildRounding # ✓
float ChildBorderSize # ✓
float PopupRounding # ✓
float PopupBorderSize # ✓
ImVec2 FramePadding # ✓
float FrameRounding # ✓
float FrameBorderSize # ✓
ImVec2 ItemSpacing # ✓
ImVec2 ItemInnerSpacing # ✓
ImVec2 TouchExtraPadding # ✓
float IndentSpacing # ✓
float ColumnsMinSpacing # ✓
float ScrollbarSize # ✓
float ScrollbarRounding # ✓
float GrabMinSize # ✓
float GrabRounding # ✓
ImVec2 ButtonTextAlign # ✓
ImVec2 DisplayWindowPadding # ✓
ImVec2 DisplaySafeAreaPadding # ✓
float MouseCursorScale # ✓
bool AntiAliasedLines # ✓
bool AntiAliasedFill # ✓
float CurveTessellationTol # ✓
# note: originally Colors[ImGuiCol_COUNT]
# todo: find a way to access enum var here
ImVec4* Colors
ctypedef struct ImGuiContext:
pass
cdef extern from "imgui.h" namespace "ImGui":
# ====
# Context creation and access
ImGuiContext* CreateContext( # ✓
# note: optional
ImFontAtlas* shared_font_atlas
) except +
void DestroyContext(ImGuiContext* ctx) except + # ✓
ImGuiContext* GetCurrentContext() except + # ✓
void SetCurrentContext(ImGuiContext* ctx) except + # ✓
bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert) except + # ✓
# ====
# Main
ImGuiIO& GetIO() except + # ✓
ImGuiStyle& GetStyle() except + # ✓
void ScaleAllSizes(float scale_factor) except + # ✗
void NewFrame() except + # ✓
# note: Render runs callbacks that may be arbitrary Python code
# so we need to propagate exceptions from them
void Render() except + # ✓
ImDrawData* GetDrawData() except + # ✓
void EndFrame() except + # ✓
void ShowDemoWindow(bool*) except + # ✓
void ShowDemoWindow() except + # ✓
void ShowMetricsWindow(bool*) except + # ✓
void ShowMetricsWindow() except + # ✓
void ShowStyleEditor(ImGuiStyle*) except + # ✓
void ShowStyleEditor() except + # ✓
bool ShowStyleSelector(const char*) except + # ✓
void ShowFontSelector(const char*) except + # ✓
void ShowUserGuide() except + # ✓
const char* GetVersion() except + # ✓
void StyleColorsDark(ImGuiStyle* dst) except + # ✓
void StyleColorsClassic(ImGuiStyle* dst) except + # ✓
void StyleColorsLight(ImGuiStyle* dst) except + # ✓
void SetItemDefaultFocus() except + # ✓
void SetKeyboardFocusHere(int offset) except + # ✓
# ====
# Window
bool Begin(const char*, bool*, ImGuiWindowFlags) except + # ✓
# note: following API was deprecated
# bool Begin(const char*, bool*, const ImVec2&, float, ImGuiWindowFlags)
void End() except + # ✓
bool BeginChild(const char*, const ImVec2&, bool, ImGuiWindowFlags) except + # ✓
bool BeginChild(const char*, const ImVec2&, bool) except + # ✓
bool BeginChild(const char*, const ImVec2&) except + # ✓
bool BeginChild(const char*) except + # ✓
bool BeginChild(ImGuiID, const ImVec2&, bool, ImGuiWindowFlags) except + # ✓
bool BeginChild(ImGuiID, const ImVec2&, bool) except + # ✓
bool BeginChild(ImGuiID, const ImVec2&) except + # ✓
bool BeginChild(ImGuiID) except + # ✓
void EndChild() except + # ✓
# ====
# Windows Utilities
bool IsWindowAppearing() except + # ✓
bool IsWindowCollapsed() except + # ✓
bool IsWindowFocused(ImGuiFocusedFlags flags) except + # ✓
bool IsWindowHovered(ImGuiFocusedFlags flags) except + # ✓
ImDrawList* GetWindowDrawList() except + # ✓
ImDrawList* GetOverlayDrawList() except + # ✓
ImVec2 GetWindowPos() except + # ✓
ImVec2 GetWindowSize() except + # ✓
float GetWindowWidth() except + # ✓
float GetWindowHeight() except + # ✓
ImVec2 GetContentRegionMax() except + # ✓
ImVec2 GetContentRegionAvail() except + # ✓
float GetContentRegionAvailWidth() except + # ✓
ImVec2 GetWindowContentRegionMin() except + # ✓
ImVec2 GetWindowContentRegionMax() except + # ✓
float GetWindowContentRegionWidth() except + # ✓
void SetNextWindowPos( # ✓ note: overrides ommited
const ImVec2& pos,
# note: optional
ImGuiCond cond,
const ImVec2& pivot
) except +
void SetNextWindowSize( # ✓ note: overrides ommited
const ImVec2& size,
# note: optional
ImGuiCond cond
) except +
void SetNextWindowSizeConstraints( # ✗
const ImVec2& size_min,
const ImVec2& size_max,
ImGuiSizeCallback custom_callback,
void* custom_callback_data
) except +
void SetNextWindowContentSize(const ImVec2& size) except + # ✗
void SetNextWindowCollapsed( # ✓
bool collapsed,
# note: optional
ImGuiCond cond
) except +
void SetNextWindowFocus() except + # ✓
void SetNextWindowBgAlpha(float alpha) except + # ✓
void SetWindowPos( # ✗
const ImVec2& pos,
# note: optional
ImGuiCond cond
) except +
void SetWindowSize( # ✗
const ImVec2& size,
# note: optional
ImGuiCond cond
) except +
void SetWindowCollapsed( # ✗
bool collapsed,
# note: optional
ImGuiCond cond
) except +
void SetWindowFocus() except + # ✓
void SetWindowFontScale(float scale) except + # ✓
void SetWindowPos( # ✗
const char* name, const ImVec2& pos,
# note: optional
ImGuiCond cond
) except +
void SetWindowSize( # ✗
const char* name, const ImVec2& size, ImGuiCond
cond
) except +
void SetWindowCollapsed( # ✗
const char* name, bool collapsed,
# note: optional
ImGuiCond cond
) except +
void SetWindowFocus(const char* name) except + # ✗
float GetScrollX() except + # ✓
float GetScrollY() except + # ✓
float GetScrollMaxX() except + # ✓
float GetScrollMaxY() except + # ✓
void SetScrollX(float scroll_x) except + # ✓
void SetScrollY(float scroll_y) except + # ✓
void SetScrollHere( # ✓
# note: optional
float center_y_ratio
) except +
void SetScrollFromPosY( # ✓
float pos_y,
# note: optional
float center_y_ratio
) except +
void GetStateStorage(ImGuiStorage* tree) except + # ✗
ImGuiStorage* GetStateStorage() except + # ✗
# ====
# Parameters stacks (shared)
void PushFont(ImFont*) except + # ✓
void PopFont() except + # ✓
void PushStyleColor(ImGuiCol, const ImVec4&) except + # ✓
void PopStyleColor(int) except + # ✓
void PushStyleVar(ImGuiStyleVar, float) except + # ✓
void PushStyleVar(ImGuiStyleVar, const ImVec2&) except + # ✓
void PopStyleVar(int) except + # ✓
ImVec4& GetStyleColorVec4(ImGuiCol idx) except + # ✗
ImFont* GetFont() except + # ✗
float GetFontSize() except + # ✓
ImVec2 GetFontTexUvWhitePixel() except + # ✗
ImU32 GetColorU32(ImGuiCol, float) except + # ✓
ImU32 GetColorU32(const ImVec4& col) except + # ✓
ImU32 GetColorU32(ImU32 col) except + # ✓
# ====
# Parameters stacks (current window)
void PushItemWidth(float item_width) except + # ✓
void PopItemWidth() except + # ✓
float CalcItemWidth() except + # ✓
void PushTextWrapPos(float wrap_pos_x) except + # ✓
void PopTextWrapPos() except + # ✓
void PushAllowKeyboardFocus(bool v) except + # ✗
void PopAllowKeyboardFocus() except + # ✗
void PushButtonRepeat(bool repeat) except + # ✗
void PopButtonRepeat() except + # ✗
# ====
# Cursor / Layout
void Separator() except + # ✓
void SameLine( # ✓
# note: optional
float pos_x, float spacing_w)
void NewLine() except + # ✓
void Spacing() except + # ✓
void Dummy(const ImVec2& size) except + # ✓
void Indent( # ✓
# note: optional
float indent_w
) except +
void Unindent( # ✓
# note: optional
float indent_w
) except +
void BeginGroup() except + # ✓
void EndGroup() except + # ✓
ImVec2 GetCursorPos() except + # ✓
float GetCursorPosX() except + # ✗
float GetCursorPosY() except + # ✗
void SetCursorPos(const ImVec2& local_pos) except + # ✓
void SetCursorPosX(float x) except + # ✗
void SetCursorPosY(float y) except + # ✗
ImVec2 GetCursorStartPos() except + # ✓
ImVec2 GetCursorScreenPos() except + # ✓
void SetCursorScreenPos(const ImVec2& screen_pos) except + # ✓
void AlignTextToFramePadding() except + # ✗
float GetTextLineHeight() except + # ✓
float GetTextLineHeightWithSpacing() except + # ✓
float GetFrameHeight() except + # ✓
float GetFrameHeightWithSpacing() except + # ✓
# ====
# ID scopes
void PushID(const char* str_id) except + # ✓
void PushID(const char* str_id_begin, const char* str_id_end) except + # ✗
void PushID(const void* ptr_id) except + # ✗
void PushID(int int_id) except + # ✗
void PopID() except + # ✓
ImGuiID GetID(const char* str_id) except + # ✗
ImGuiID GetID(const char* str_id_begin, const char* str_id_end) except + # ✗
ImGuiID GetID(const void* ptr_id) except + # ✗
# ====
# Widgets
# Widgets: text
void TextUnformatted(const char*) except + # ✓
void Text(const char*, ...) except + # ✓
void TextColored(const ImVec4&, const char*, ...) except + # ✓
void TextDisabled(const char*, ...) except + # ✗
void TextWrapped(const char*, ...) except + # ✗
void LabelText(const char*, const char*, ...) except + # ✓
void BulletText(const char*, ...) except + # ✓
# Widgets: buttons
bool Button(const char*, const ImVec2& size) except + # ✓
bool Button(const char*) except + # ✓
bool SmallButton(const char*) except + # ✓
bool ArrowButton(const char*, ImGuiDir) except + # ✗
bool InvisibleButton(const char*, const ImVec2& size) except + # ✓
bool ImageButton( # ✓
ImTextureID user_texture_id, const ImVec2& size,
# note: optional
const ImVec2& uv0, const ImVec2& uv1, int frame_padding,
const ImVec4& bg_col, const ImVec4& tint_col
) except +
bool ColorButton( # ✓
const char *desc_id,
const ImVec4& col,
ImGuiColorEditFlags flags,
# note: optional
ImVec2 size
) except + # Widgets: images
void Image( # ✓
ImTextureID user_texture_id, const ImVec2& size,
# note: optional
const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col,
const ImVec4& border_col
) except + # Widgets: checkboxes etc.
bool Checkbox(const char* label, bool* v) except + # ✓
bool CheckboxFlags( # ✓
const char* label, unsigned int* flags, unsigned int flags_value
) except +
bool RadioButton(const char* label, bool active) except + # ✓
# note: probably no reason to support it
bool RadioButton(const char* label, int* v, int v_button) except + # ✓
# Widgets: combos
bool Combo( # ✓
const char* label, int* current_item,
const char* items_separated_by_zeros,
# note: optional
int popup_max_height_in_items
) except + # note: we only implemented the null-separated version that is fully
# compatible with following. Probably no reason to support it
bool Combo( # ✓
const char* label, int* current_item,
const char** items, int items_count,
# note: optional
int popup_max_height_in_items
) except +
bool Combo( # ✗
const char* label, int* current_item,
bool (*items_getter)(void* data, int idx, const char** out_text),
void* data, int items_count,
# note: optional
int popup_max_height_in_items
) except + # Widgets: color-edits
bool ColorEdit3(const char* label, float col[3]) except + # ✓
bool ColorEdit4( # ✓
const char* label, float col[4],
# note: optional
bool show_alpha
) except + #void ColorEditMode(ImGuiColorEditMode mode) except + # note: obsoleted
# Widgets: plots
void PlotLines( # ✓
const char* label, const float* values, int values_count,
# note: optional
int values_offset, # = 0
const char* overlay_text, # = NULL
float scale_min, # = FLT_MAX
float scale_max, # = FLT_MAX
ImVec2 graph_size, # = ImVec2(0,0)
int stride # = sizeof(float))
) except +
void PlotHistogram( # ✓
const char* label, const float* values, int values_count,
# note: optional
int values_offset, const char* overlay_text, float scale_min,
float scale_max, ImVec2 graph_size, int stride
) except +
void PlotHistogram( # ✗
const char* label, float (*values_getter)(void* data, int idx),
void* data, int values_count,
# note: optional
int values_offset, const char* overlay_text, float scale_min,
float scale_max, ImVec2 graph_size
) except +
void ProgressBar( # ✗
float fraction,
# note: optional
const ImVec2& size_arg, const char* overlay
) except + # Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard.
void Bullet() except + # ✓
# manually input values aren't clamped, can go off-bounds) except + # For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every
# functions, remember than a 'float v[3]' function argument is the same
# as 'float* v'. You can pass address of your first element out of a
# contiguous set, e.g. &myvector.x
bool DragFloat( # ✓
const char* label, float* v,
# note: optional
float v_speed, float v_min, float v_max,
const char* format, float power
) except +
bool DragFloat2( # ✓
const char* label, float v[2],
# note: optional
float v_speed, float v_min, float v_max,
const char* format, float power
) except +
bool DragFloat3( # ✓
const char* label, float v[3],
# note: optional
float v_speed, float v_min, float v_max,
const char* format, float power
) except +
bool DragFloat4( # ✓
const char* label, float v[4],
# note: optional
float v_speed, float v_min, float v_max,
const char* format, float power
) except +
bool DragFloatRange2( # ✗
const char* label, float* v_current_min, float* v_current_max,
# note: optional
float v_speed, float v_min, float v_max,
const char* format,
const char* format_max, float power
) except +
bool DragInt( # ✓
const char* label, int* v,
# note: optional
float v_speed, int v_min, int v_max,
const char* format
) except +
bool DragInt2( # ✓
const char* label, int v[2],
# note: optional
float v_speed, int v_min, int v_max,
const char* format
) except +
bool DragInt3( # ✓
const char* label, int v[3],
# note: optional
float v_speed, int v_min, int v_max,
const char* format
) except +
bool DragInt4( # ✓
const char* label, int v[4],
# note: optional
float v_speed, int v_min, int v_max,
const char* format
) except +
bool DragIntRange2( # ✗
const char* label, int* v_current_min, int* v_current_max,
# note: optional
float v_speed, int v_min, int v_max,
const char* format,
const char* format_max
) except + # Widgets: Input with Keyboard
bool DragScalar( # ✗
const char* label,
ImGuiDataType data_type, void* v,
float v_speed,
# note: optional
const void* v_min,
const void* v_max,
const char* format,
float power)
bool DragScalarN( # ✗
const char* label,
ImGuiDataType data_type, void* v,
int components, float v_speed,
# note: optional
const void* v_min,
const void* v_max,
const char* format,
float power)
bool InputText( # ✓
const char* label, char* buf, size_t buf_size,
# note: optional
ImGuiInputTextFlags flags,
ImGuiInputTextCallback callback, void* user_data
) except +
bool InputTextMultiline( # ✓
const char* label, char* buf, size_t buf_size,
# note: optional
const ImVec2& size, ImGuiInputTextFlags flags,
ImGuiInputTextCallback callback, void* user_data
) except +
bool InputFloat( # ✓
const char* label, float* v,
# note: optional
float step, float step_fast,
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputFloat2( # ✓
const char* label, float v[2],
# note: optional
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputFloat3( # ✓
const char* label, float v[3],
# note: optional
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputFloat4( # ✓
const char* label, float v[4],
# note: optional
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputInt( # ✓
const char* label, int* v,
# note: optional
int step, int step_fast,
ImGuiInputTextFlags extra_flags
) except +
bool InputInt2( # ✓
const char* label, int v[2],
# note: optional
ImGuiInputTextFlags extra_flags
) except +
bool InputInt3( # ✓
const char* label, int v[3],
# note: optional
ImGuiInputTextFlags extra_flags
) except +
bool InputInt4( # ✓
const char* label, int v[4],
# note: optional
ImGuiInputTextFlags extra_flags
) except + # Widgets: Sliders (tip: ctrl+click on a slider to input with keyboard.
bool InputDouble( # ✓
const char* label, double v,
# note: optional
double step, int step_fast,
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputScalar( # X
const char* label, ImGuiDataType data_type, void* v,
# note: optional
const void* step,
const void* step_fast,
const char* format,
ImGuiInputTextFlags extra_flags
) except +
bool InputScalarN( # X
const char* label, ImGuiDataType data_type,
void* v, int components,
# note: optional
const void* step,
const void* step_fast,
const char* format,
ImGuiInputTextFlags extra_flags
) except +
# manually input values aren't clamped, can go off-bounds)
bool SliderFloat( # ✓
const char* label, float* v, float v_min, float v_max,
# note: optional
const char* format, float power
) except +
bool SliderFloat2( # ✓
const char* label, float v[2], float v_min, float v_max,
# note: optional
const char* format, float power
) except +
bool SliderFloat3( # ✓
const char* label, float v[3], float v_min, float v_max,
# note: optional
const char* format, float power
) except +
bool SliderFloat4( # ✓
const char* label, float v[4], float v_min, float v_max,
# note: optional
const char* format, float power
) except +
bool SliderAngle( # ✗
const char* label, float* v_rad,
# note: optional
float v_degrees_min, float v_degrees_max
) except +
bool SliderInt( # ✓
const char* label, int* v, int v_min, int v_max,
# note: optional
const char* format
) except +
bool SliderInt2( # ✓
const char* label, int v[2], int v_min, int v_max,
# note: optional
const char* format
) except +
bool SliderInt3( # ✓
const char* label, int v[3], int v_min, int v_max,
# note: optional
const char* format
) except +
bool SliderInt4( # ✓
const char* label, int v[4], int v_min, int v_max,
# note: optional
const char* format
) except +
bool SliderScalar( # ✗
const char* label, ImGuiDataType data_type,
void* v, const void* v_min, const void* v_max,
# note: optional
const char* format, float power);
bool SliderScalarN( # ✗
const char* label, ImGuiDataType data_type,
void *v,
int components, const void* v_min, const void* v_max,
# note: optional
const char* format, float power);
bool VSliderFloat( # ✓
const char* label, const ImVec2& size, float* v,
float v_min, float v_max,
# note: optional
const char* format, float power
) except +
bool VSliderInt( # ✓
const char* label, const ImVec2& size, int* v, int v_min, int v_max,
# note: optional
const char* format
) except + # Widgets: Trees
bool VSliderScalar( # ✗
const char* label, const ImVec2& size, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max,
# note: optional
const char* format,
float power
) except +
bool TreeNode(const char* label) except + # ✓
# bool TreeNode(const char* str_id, const char* fmt, ...) except + # ✗
# bool TreeNode(const void* ptr_id, const char* fmt, ...) except + # ✗
# bool TreeNodeV(const char* str_id, const char* fmt, va_list args) except + # ✗
# bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args) except + # ✗
bool TreeNodeEx( # ✓
const char* label,
# note: optional
ImGuiTreeNodeFlags flags
) except + # bool TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_PRINTFARGS(3) except + # bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_PRINTFARGS(3) except + # bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) except + # bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) except + # ✗
void TreePush( # ✗
# note: optional
const char* str_id
) except +
void TreePush( # ✗
# note: optional
const void* ptr_id
) except +
void TreePop() except + # ✓
void TreeAdvanceToLabelPos() except + # ✗
float GetTreeNodeToLabelSpacing() except + # ✗
void SetNextTreeNodeOpen( # ✗
bool is_open,
# note: optional
ImGuiCond cond
) except +
bool CollapsingHeader( # ✓
const char* label,
# note: optional
ImGuiTreeNodeFlags flags
) except +
bool CollapsingHeader( # ✓
const char* label, bool* p_open,
# note: optional
ImGuiTreeNodeFlags flags
) except + # Widgets: Selectable / Lists
bool Selectable( # ✓
const char* label,
# note: optional
bool selected, ImGuiSelectableFlags flags,
const ImVec2& size
) except +
bool Selectable( # ✓
const char* label, bool* p_selected,
# note: optional
ImGuiSelectableFlags flags, const ImVec2& size
) except +
bool ListBox( # ✓
const char* label, int* current_item, const char* items[],
int items_count,
# note: optional
int height_in_items
) except +
bool ListBox( # ✗
const char* label, int* current_item,
bool (*items_getter)(void* data, int idx, const char** out_text),
void* data, int items_count,
# note: optional
int height_in_items
) except +
bool ListBoxHeader( # ✓
const char* label,
# note: optional
const ImVec2& size
) except +
bool ListBoxHeader( # ✗
const char* label, int items_count,
# note: optional
int height_in_items
) except +
void ListBoxFooter() except + # ✓
# Widgets: Value() Helpers.
void Value(const char* prefix, bool b) except + # ✗