-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcimgui_te.h
More file actions
1331 lines (1237 loc) · 81.8 KB
/
Copy pathcimgui_te.h
File metadata and controls
1331 lines (1237 loc) · 81.8 KB
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
#ifndef CIMGUI_TEST_ENGINE
#define CIMGUI_TEST_ENGINE
#include "cimgui.h"
#if defined _WIN32 || defined __CYGWIN__
#ifdef CIMGUI_NO_EXPORT
#define API
#else
#define API __declspec(dllexport)
#endif
#else
#ifdef __GNUC__
#define API __attribute__((__visibility__("default")))
#else
#define API
#endif
#endif
#if defined __cplusplus
#define EXTERN extern "C"
#else
#include <stdarg.h>
#include <stdbool.h>
#define EXTERN extern
#endif
#define CIMGUI_TE_API EXTERN API
// Manually copied from imgui_te_engine.h
#define ImFuncPtr(FUNC_TYPE) FUNC_TYPE*
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
// Forward declarations
typedef struct ImGuiCaptureImageBuf ImGuiCaptureImageBuf;
typedef struct ImGuiCaptureArgs ImGuiCaptureArgs;
typedef struct ImGuiCaptureWindowData ImGuiCaptureWindowData;
typedef struct ImGuiCaptureContext ImGuiCaptureContext;
typedef struct ImGuiCaptureToolUI ImGuiCaptureToolUI;
typedef struct ImGuiTestEngineResultSummary ImGuiTestEngineResultSummary;
typedef struct ImGuiTestEngineIO ImGuiTestEngineIO;
typedef struct ImGuiTestItemInfo ImGuiTestItemInfo;
typedef struct ImGuiTestItemList ImGuiTestItemList;
typedef struct ImGuiTestLogLineInfo ImGuiTestLogLineInfo;
typedef struct ImGuiTestLog ImGuiTestLog;
typedef struct ImGuiTestOutput ImGuiTestOutput;
typedef struct ImGuiTest ImGuiTest;
typedef struct ImGuiTestRunTask ImGuiTestRunTask;
typedef struct ImGuiTestRef ImGuiTestRef;
typedef struct ImGuiTestRefDesc ImGuiTestRefDesc;
typedef struct ImGuiTestActionFilter ImGuiTestActionFilter;
typedef struct ImGuiTestGenericItemStatus ImGuiTestGenericItemStatus;
typedef struct ImGuiTestGenericVars ImGuiTestGenericVars;
typedef struct ImGuiTestContext ImGuiTestContext;
typedef struct ImGuiTestCoroutineInterface ImGuiTestCoroutineInterface;
typedef struct ImBuildInfo ImBuildInfo;
typedef struct ImGuiCsvParser ImGuiCsvParser;
typedef struct ImGuiTestInfoTask ImGuiTestInfoTask;
typedef struct ImGuiTestGatherTask ImGuiTestGatherTask;
typedef struct ImGuiTestFindByLabelTask ImGuiTestFindByLabelTask;
typedef struct ImGuiTestInput ImGuiTestInput;
typedef struct ImGuiTestInputs ImGuiTestInputs;
typedef struct ImGuiTestEnginePerfRecord ImGuiTestEnginePerfRecord;
typedef struct ImGuiTestEngine ImGuiTestEngine;
typedef struct ImGuiPerfToolEntry ImGuiPerfToolEntry;
typedef struct ImGuiPerfToolBatch ImGuiPerfToolBatch;
typedef struct ImGuiPerfTool ImGuiPerfTool;
// Enums
enum ImGuiCaptureFlags_
{
ImGuiCaptureFlags_None = 0,
ImGuiCaptureFlags_StitchAll = 1 << 0, // Capture entire window scroll area (by scrolling and taking multiple screenshot). Only works for a single window.
ImGuiCaptureFlags_IncludeOtherWindows = 1 << 1, // Disable hiding other windows (when CaptureAddWindow has been called by default other windows are hidden)
ImGuiCaptureFlags_IncludePopups = 1 << 2, // Expand capture area to automatically include visible popups (Unused if ImGuiCaptureFlags_IncludeOtherWindows is set)
ImGuiCaptureFlags_HideMouseCursor = 1 << 3, // Hide render software mouse cursor during capture.
ImGuiCaptureFlags_Instant = 1 << 4, // Perform capture on very same frame. Only works when capturing a rectangular region. Unsupported features: content stitching, window hiding, window relocation.
ImGuiCaptureFlags_NoSave = 1 << 5 // Do not save output image.
};
typedef enum ImGuiCaptureStatus
{
ImGuiCaptureStatus_InProgress,
ImGuiCaptureStatus_Done,
ImGuiCaptureStatus_Error
} ImGuiCaptureStatus;
// Stored in ImGuiTestContext: where we are currently running GuiFunc or TestFunc
typedef enum ImGuiTestActiveFunc
{
ImGuiTestActiveFunc_None,
ImGuiTestActiveFunc_GuiFunc, // == GuiFunc() handler
ImGuiTestActiveFunc_TestFunc, // == TestFunc() handler
ImGuiTestActiveFunc_TeardownFunc, // == TeardownFunc() handler
} ImGuiTestActiveFunc;
typedef enum ImGuiTestRunSpeed
{
ImGuiTestRunSpeed_Fast = 0, // Run tests as fast as possible (teleport mouse, skip delays, etc.)
ImGuiTestRunSpeed_Normal = 1, // Run tests at human watchable speed (for debugging)
ImGuiTestRunSpeed_Cinematic = 2, // Run tests with pauses between actions (for e.g. tutorials)
ImGuiTestRunSpeed_COUNT
} ImGuiTestRunSpeed;
typedef enum ImGuiTestVerboseLevel
{
ImGuiTestVerboseLevel_Silent = 0, // -v0
ImGuiTestVerboseLevel_Error = 1, // -v1
ImGuiTestVerboseLevel_Warning = 2, // -v2
ImGuiTestVerboseLevel_Info = 3, // -v3
ImGuiTestVerboseLevel_Debug = 4, // -v4
ImGuiTestVerboseLevel_Trace = 5,
ImGuiTestVerboseLevel_COUNT
} ImGuiTestVerboseLevel;
// Test status (stored in ImGuiTest)
typedef enum ImGuiTestStatus
{
ImGuiTestStatus_Unknown = 0,
ImGuiTestStatus_Success = 1,
ImGuiTestStatus_Queued = 2,
ImGuiTestStatus_Running = 3,
ImGuiTestStatus_Error = 4,
ImGuiTestStatus_Suspended = 5,
ImGuiTestStatus_COUNT
} ImGuiTestStatus;
// Test group: this is mostly used to categorize tests in our testing UI. (Stored in ImGuiTest)
typedef enum ImGuiTestGroup
{
ImGuiTestGroup_Unknown = -1,
ImGuiTestGroup_Tests = 0,
ImGuiTestGroup_Perfs = 1,
ImGuiTestGroup_COUNT
} ImGuiTestGroup;
// Flags (stored in ImGuiTest)
enum ImGuiTestFlags_
{
ImGuiTestFlags_None = 0,
ImGuiTestFlags_NoGuiWarmUp = 1 << 0, // Disable running the GUI func for 2 frames before starting test code. For tests which absolutely need to start before GuiFunc.
ImGuiTestFlags_NoAutoFinish = 1 << 1, // By default, tests with no TestFunc (only a GuiFunc) will end after warmup. Setting this require test to call ctx->Finish().
ImGuiTestFlags_NoRecoveryWarnings = 1 << 2 // Error/recovery warnings (missing End/Pop calls etc.) will be displayed as normal debug entries, for tests which may rely on those.
//ImGuiTestFlags_RequireViewports = 1 << 10
};
// Flags for IM_CHECK* macros.
enum ImGuiTestCheckFlags_
{
ImGuiTestCheckFlags_None = 0,
ImGuiTestCheckFlags_SilentSuccess = 1 << 0
};
// Flags for ImGuiTestContext::Log* functions.
enum ImGuiTestLogFlags_
{
ImGuiTestLogFlags_None = 0,
ImGuiTestLogFlags_NoHeader = 1 << 0 // Do not display frame count and depth padding
};
enum ImGuiTestRunFlags_
{
ImGuiTestRunFlags_None = 0,
ImGuiTestRunFlags_GuiFuncDisable = 1 << 0, // Used internally to temporarily disable the GUI func (at the end of a test, etc)
ImGuiTestRunFlags_GuiFuncOnly = 1 << 1, // Set when user selects "Run GUI func"
ImGuiTestRunFlags_NoSuccessMsg = 1 << 2,
ImGuiTestRunFlags_EnableRawInputs = 1 << 3, // Disable input submission to let test submission raw input event (in order to test e.g. IO queue)
ImGuiTestRunFlags_RunFromGui = 1 << 4, // Test ran manually from GUI, will disable watchdog.
ImGuiTestRunFlags_RunFromCommandLine= 1 << 5, // Test queued from command-line.
// Flags for ImGuiTestContext::RunChildTest()
ImGuiTestRunFlags_NoError = 1 << 10,
ImGuiTestRunFlags_ShareVars = 1 << 11, // Share generic vars and custom vars between child and parent tests (custom vars need to be same type)
ImGuiTestRunFlags_ShareTestContext = 1 << 12, // Share ImGuiTestContext instead of creating a new one (unsure what purpose this may be useful for yet)
// TODO: Add GuiFunc options
};
// Named actions. Generally you will call the named helpers e.g. ItemClick(). This is used by shared/low-level functions such as ItemAction().
typedef enum ImGuiTestAction
{
ImGuiTestAction_Unknown = 0,
ImGuiTestAction_Hover, // Move mouse
ImGuiTestAction_Click, // Move mouse and click
ImGuiTestAction_DoubleClick, // Move mouse and double-click
ImGuiTestAction_Check, // Check item if unchecked (Checkbox, MenuItem or any widget reporting ImGuiItemStatusFlags_Checkable)
ImGuiTestAction_Uncheck, // Uncheck item if checked
ImGuiTestAction_Open, // Open item if closed (TreeNode, BeginMenu or any widget reporting ImGuiItemStatusFlags_Openable)
ImGuiTestAction_Close, // Close item if opened
ImGuiTestAction_Input, // Start text inputing into a field (e.g. CTRL+Click on Drags/Slider, click on InputText etc.)
ImGuiTestAction_NavActivate, // Activate item with navigation
ImGuiTestAction_COUNT
} ImGuiTestAction;
// Generic flags for many ImGuiTestContext functions
// Some flags are only supported by a handful of functions. Check function headers for list of supported flags.
enum ImGuiTestOpFlags_
{
ImGuiTestOpFlags_None = 0,
ImGuiTestOpFlags_NoCheckHoveredId = 1 << 1, // Don't check for HoveredId after aiming for a widget. This is automatic when there's an active item, typically in drag and drop operation. Otherwise, a few situations may want this e.g. for items that don't use ItemHoverable(), or when intently aiming for an item behind a popup/modal inhibition layer.
ImGuiTestOpFlags_NoError = 1 << 2, // Don't abort/error e.g. if the item cannot be found or the operation doesn't succeed.
ImGuiTestOpFlags_NoFocusWindow = 1 << 3, // Don't focus window when aiming at an item
ImGuiTestOpFlags_NoAutoUncollapse = 1 << 4, // Disable automatically uncollapsing windows (useful when specifically testing Collapsing behaviors)
ImGuiTestOpFlags_NoAutoOpenFullPath = 1 << 5, // Disable automatically opening intermediaries (e.g. ItemClick("Hello/OK") will automatically first open "Hello" if "OK" isn't found. Only works if ref is a string path.
ImGuiTestOpFlags_NoYield = 1 << 6, // Don't yield (only supported by a few functions), in case you need to manage rigorous per-frame timing.
ImGuiTestOpFlags_IsSecondAttempt = 1 << 7, // Used by recursing functions to indicate a second attempt
ImGuiTestOpFlags_MoveToEdgeL = 1 << 8, // Simple Dumb aiming helpers to test widget that care about clicking position. May need to replace will better functionalities.
ImGuiTestOpFlags_MoveToEdgeR = 1 << 9,
ImGuiTestOpFlags_MoveToEdgeU = 1 << 10,
ImGuiTestOpFlags_MoveToEdgeD = 1 << 11,
ImGuiTestOpFlags_NoScroll = 1 << 12, // Disable automatically scrolling to reach an item.
};
typedef enum ImOsConsoleStream
{
ImOsConsoleStream_StandardOutput,
ImOsConsoleStream_StandardError,
} ImOsConsoleStream;
typedef enum ImOsConsoleTextColor
{
ImOsConsoleTextColor_Black,
ImOsConsoleTextColor_White,
ImOsConsoleTextColor_BrightWhite,
ImOsConsoleTextColor_BrightRed,
ImOsConsoleTextColor_BrightGreen,
ImOsConsoleTextColor_BrightBlue,
ImOsConsoleTextColor_BrightYellow,
} ImOsConsoleTextColor;
typedef enum ImGuiTestInputType
{
ImGuiTestInputType_None,
ImGuiTestInputType_Key,
ImGuiTestInputType_Char,
ImGuiTestInputType_ViewportFocus,
ImGuiTestInputType_ViewportSetPos,
ImGuiTestInputType_ViewportSetSize,
ImGuiTestInputType_ViewportClose
} ImGuiTestInputType;
typedef enum ImGuiPerfToolDisplayType
{
ImGuiPerfToolDisplayType_Simple, // Each run will be displayed individually.
ImGuiPerfToolDisplayType_PerBranchColors, // Use one bar color per branch.
ImGuiPerfToolDisplayType_CombineByBuildInfo, // Entries with same build information will be averaged.
} ImGuiPerfToolDisplayType;
typedef enum ImGuiPerfToolReportType
{
ImGuiPerfToolReportType_Details, // Show tests and batches as rows, details in columns.
ImGuiPerfToolReportType_Batches, // Show test as rows, batches in columns.
} ImGuiPerfToolReportType;
typedef enum ImGuiTestEngineExportFormat
{
ImGuiTestEngineExportFormat_None = 0,
ImGuiTestEngineExportFormat_JUnitXml,
} ImGuiTestEngineExportFormat;
// Typedefs
typedef void Str; // Manual typedef to avoid having to wrap the Str class;
typedef struct ImVector_Ulonglong { int Size; int Capacity; unsigned long long* Data; } ImVector_Ulonglong;
typedef struct ImVector_Uint { int Size; int Capacity; unsigned int* Data; } ImVector_Uint;
typedef struct ImVector_double { int Size; int Capacity; double* Data; } ImVector_double;
typedef struct ImVector_charPtr { int Size; int Capacity; char ** Data; } ImVector_charPtr;
typedef struct ImVector_ImGuiTestRunTask { int Size; int Capacity; ImGuiTestRunTask* Data; } ImVector_ImGuiTestRunTask;
typedef struct ImVector_ImGuiTestLogLineInfo { int Size; int Capacity; ImGuiTestLogLineInfo* Data; } ImVector_ImGuiTestLogLineInfo;
typedef struct ImVector_ImGuiTestItemInfo { int Size; int Capacity; ImGuiTestItemInfo* Data; } ImVector_ImGuiTestItemInfo;
typedef struct ImVector_ImGuiTestInput { int Size; int Capacity; ImGuiTestInput* Data; } ImVector_ImGuiTestInput;
typedef struct ImVector_ImGuiTestInfoTask_Ptr { int Size; int Capacity; ImGuiTestInfoTask ** Data; } ImVector_ImGuiTestInfoTask_Ptr;
typedef struct ImVector_ImGuiTest_Ptr { int Size; int Capacity; ImGuiTest ** Data; } ImVector_ImGuiTest_Ptr;
typedef struct ImVector_ImGuiPerfToolEntry { int Size; int Capacity; ImGuiPerfToolEntry* Data; } ImVector_ImGuiPerfToolEntry;
typedef struct ImVector_ImGuiPerfToolBatch { int Size; int Capacity; ImGuiPerfToolBatch* Data; } ImVector_ImGuiPerfToolBatch;
typedef struct ImVector_ImGuiCaptureWindowData { int Size; int Capacity; ImGuiCaptureWindowData* Data; } ImVector_ImGuiCaptureWindowData;
typedef struct ImPool_ImGuiTestItemInfo { ImVector_ImGuiTestItemInfo Buf; ImGuiStorage Map; ImPoolIdx FreeIdx; ImPoolIdx AliveCount; } ImPool_ImGuiTestItemInfo;
typedef struct ImMovingAverage_double { ImVector_double Samples; double Accum; int Idx; int FillAmount; } ImMovingAverage_double;
typedef unsigned int ImGuiCaptureFlags;
typedef bool (ImGuiScreenCaptureFunc)(ImGuiID viewport_id, int x, int y, int w, int h, unsigned int* pixels, void* user_data);
typedef int ImGuiTestFlags;
typedef int ImGuiTestCheckFlags;
typedef int ImGuiTestLogFlags;
typedef int ImGuiTestRunFlags;
typedef void (ImGuiTestEngineLogFunc)(ImGuiTestEngine* engine, ImGuiTestContext* test_ctx, ImGuiTestVerboseLevel level, const char* message, void* user_data);
typedef void (ImGuiTestEngineSrcFileOpenFunc)(const char* filename, int line_no, void* user_data);
typedef void (ImGuiTestGuiFunc)(ImGuiTestContext* ctx);
typedef void (ImGuiTestTestFunc)(ImGuiTestContext* ctx);
typedef void (ImGuiTestVarsConstructor)(void* buffer);
typedef void (ImGuiTestVarsPostConstructor)(ImGuiTestContext* ctx, void* ptr, void* fn);
typedef void (ImGuiTestVarsDestructor)(void* ptr);
typedef int ImGuiTestOpFlags;
typedef void* ImGuiTestCoroutineHandle;
typedef void (ImGuiTestCoroutineMainFunc)(void* data);
// [Internal]
// Helper class for simple bitmap manipulation (not particularly efficient!)
struct ImGuiCaptureImageBuf {
int Width;
int Height;
unsigned int* Data; // RGBA8
};
// Defines input and output arguments for capture process.
// When capturing from tests you can usually use the ImGuiTestContext::CaptureXXX() helpers functions.
struct ImGuiCaptureArgs {
unsigned int InFlags; // Flags for customizing behavior of screenshot tool.
ImVector_ImGuiWindowPtr InCaptureWindows; // Windows to capture. All other windows will be hidden. May be used with InCaptureRect to capture only some windows in specified rect.
ImRect InCaptureRect; // Screen rect to capture. Does not include padding.
float InPadding; // Extra padding at the edges of the screenshot. Ensure that there is available space around capture rect horizontally, also vertically if ImGuiCaptureFlags_StitchAll is not used.
char InOutputFile[256]; // Output will be saved to a file if InOutputImageBuf is nullptr.
ImGuiCaptureImageBuf* InOutputImageBuf; // _OR_ Output will be saved to image buffer if specified.
int InRecordFPSTarget; // FPS target for recording videos.
int InSizeAlign; // Resolution alignment (0 = auto, 1 = no alignment, >= 2 = align width/height to be multiple of given value)
ImVec2 OutImageSize; // Produced image size.
};
struct ImGuiCaptureWindowData {
ImGuiWindow* Window;
ImRect BackupRect;
ImVec2 PosDuringCapture;
};
// Implements functionality for capturing images
struct ImGuiCaptureContext {
ImFuncPtr(ImGuiScreenCaptureFunc) ScreenCaptureFunc; // Graphics backend specific function that captures specified portion of framebuffer and writes RGBA data to `pixels` buffer.
void* ScreenCaptureUserData; // Custom user pointer which is passed to ScreenCaptureFunc. (Optional)
char* VideoCaptureEncoderPath; // Video encoder path (not owned, stored externally).
int VideoCaptureEncoderPathSize; // Optional. Set in order to edit this parameter from UI.
char* VideoCaptureEncoderParams; // Video encoder params (not owned, stored externally).
int VideoCaptureEncoderParamsSize; // Optional. Set in order to edit this parameter from UI.
char* GifCaptureEncoderParams; // Video encoder params for GIF output (not owned, stored externally).
int GifCaptureEncoderParamsSize; // Optional. Set in order to edit this parameter from UI.
ImRect _CaptureRect; // Viewport rect that is being captured.
ImRect _CapturedWindowRect; // Top-left corner of region that covers all windows included in capture. This is not same as _CaptureRect.Min when capturing explicitly specified rect.
int _ChunkNo; // Number of chunk that is being captured when capture spans multiple frames.
int _FrameNo; // Frame number during capture process that spans multiple frames.
ImVec2 _MouseRelativeToWindowPos; // Mouse cursor position relative to captured window (when _StitchAll is in use).
ImGuiWindow* _HoveredWindow; // Window which was hovered at capture start.
ImGuiCaptureImageBuf _CaptureBuf; // Output image buffer.
const ImGuiCaptureArgs* _CaptureArgs; // Current capture args. Set only if capture is in progress.
ImVector_ImGuiCaptureWindowData _WindowsData; // Backup windows that will have their rect modified and restored. args->InCaptureWindows can not be used because popups may get closed during capture and no longer appear in that list.
bool _VideoRecording; // Flag indicating that video recording is in progress.
double _VideoLastFrameTime; // Time when last video frame was recorded.
FILE* _VideoEncoderPipe; // File writing to stdin of video encoder process.
bool _BackupMouseDrawCursor; // Initial value of g.IO.MouseDrawCursor
ImVec2 _BackupDisplayWindowPadding; // Backup padding. We set it to {0, 0} during capture.
ImVec2 _BackupDisplaySafeAreaPadding; // Backup padding. We set it to {0, 0} during capture.
};
// Implements UI for capturing images
// (when using ImGuiTestEngine scripting API you may not need to use this at all)
struct ImGuiCaptureToolUI {
float SnapGridSize; // Size of the grid cell for "snap to grid" functionality.
char OutputLastFilename[256]; // File name of last captured file.
char* VideoCaptureExtension; // Video file extension (e.g. ".gif" or ".mp4")
int VideoCaptureExtensionSize; // Optional. Set in order to edit this parameter from UI.
ImGuiCaptureArgs _CaptureArgs; // Capture args
bool _StateIsPickingWindow;
bool _StateIsCapturing;
ImVector_Uint _SelectedWindows;
char _OutputFileTemplate[256]; //
int _FileCounter; // Counter which may be appended to file name when saving. By default, counting starts from 1. When done this field holds number of saved files.
};
struct ImGuiTestEngineResultSummary {
int CountTested; // Number of tests executed
int CountSuccess; // Number of tests succeeded
int CountInQueue; // Number of tests remaining in queue (e.g. aborted, crashed)
};
struct ImGuiTestEngineIO {
ImGuiTestCoroutineInterface* CoroutineFuncs; // (Required) Coroutine functions (see imgui_te_coroutines.h)
ImFuncPtr(ImGuiTestEngineSrcFileOpenFunc) SrcFileOpenFunc; // (Optional) To open source files from test engine UI (otherwise default to open file in shell)
ImFuncPtr(ImGuiScreenCaptureFunc) ScreenCaptureFunc; // (Optional) To capture graphics output (application _MUST_ call ImGuiTestEngine_PostSwap() function after swapping is framebuffer)
void* SrcFileOpenUserData; // (Optional) User data for SrcFileOpenFunc
void* ScreenCaptureUserData; // (Optional) User data for ScreenCaptureFunc
bool ConfigSavedSettings; // Load/Save settings in main context .ini file.
ImGuiTestRunSpeed ConfigRunSpeed; // Run tests in fast/normal/cinematic mode
bool ConfigStopOnError; // Stop queued tests on test error
bool ConfigBreakOnError; // Break debugger on test error by calling IM_DEBUG_BREAK()
bool ConfigKeepGuiFunc; // Keep test GUI running at the end of the test
bool ConfigRestoreFocusAfterTests; // Restore focus back after running tests
bool ConfigCaptureEnabled; // Master enable flags for capturing and saving captures. Disable to avoid e.g. lengthy saving of large PNG files.
bool ConfigCaptureOnError;
bool ConfigNoThrottle; // Disable vsync for performance measurement or fast test running
bool ConfigMouseDrawCursor; // Enable drawing of Dear ImGui software mouse cursor when running tests
float ConfigFixedDeltaTime; // Use fixed delta time instead of calculating it from wall clock
int PerfStressAmount; // Integer to scale the amount of items submitted in test
char GitBranchName[64]; // e.g. fill in branch name (e.g. recorded in perf samples .csv)
ImGuiTestVerboseLevel ConfigVerboseLevel;
ImGuiTestVerboseLevel ConfigVerboseLevelOnError;
bool ConfigLogToTTY; // Output log entries to TTY (in addition to Test Engine UI)
bool ConfigLogToDebugger; // Output log entries to Debugger (in addition to Test Engine UI)
ImFuncPtr(ImGuiTestEngineLogFunc) ConfigLogToFunc; // Hook for logging of full serial log (vs peeking into ImGuiTest->Output.Log for a single test)
void* ConfigLogToFuncUserData;
float MouseSpeed; // Mouse speed (pixel/second) when not running in fast mode
float MouseWobble; // (0.0f..1.0f) How much wobble to apply to the mouse (pixels per pixel of move distance) when not running in fast mode
float ScrollSpeed; // Scroll speed (pixel/second) when not running in fast mode
float TypingSpeed; // Char input speed (characters/second) when not running in fast mode
float ActionDelayShort; // Time between short actions
float ActionDelayStandard; // Time between most actions
char VideoCaptureEncoderPath[256]; // Video encoder executable path, e.g. "path/to/ffmpeg.exe".
char VideoCaptureEncoderParams[256]; // Video encoder parameters for .MP4 captures, e.g. see IMGUI_CAPTURE_DEFAULT_VIDEO_PARAMS_FOR_FFMPEG
char GifCaptureEncoderParams[512]; // Video encoder parameters for .GIF captures, e.g. see IMGUI_CAPTURE_DEFAULT_GIF_PARAMS_FOR_FFMPEG
char VideoCaptureExtension[8]; // Video file extension (default, may be overridden by test).
float ConfigWatchdogWarning; // Warn when a test exceed this time (in second)
float ConfigWatchdogKillTest; // Attempt to stop running a test when exceeding this time (in second)
float ConfigWatchdogKillApp; // Stop application when exceeding this time (in second)
const char* ExportResultsFilename;
ImGuiTestEngineExportFormat ExportResultsFormat;
bool CheckDrawDataIntegrity; // Check ImDrawData integrity (buffer count, etc.). Currently cheap but may become a slow operation.
bool IsRunningTests;
bool IsRequestingMaxAppSpeed; // When running in fast mode: request app to skip vsync or even skip rendering if it wants
bool IsCapturing; // Capture is in progress
};
// Information about a given item or window, result of an ItemInfo() or WindowInfo() query
struct ImGuiTestItemInfo {
unsigned int ID; // Item ID
char DebugLabel[32]; // Shortened/truncated label for debugging and convenience purpose
ImGuiWindow* Window; // Item Window
unsigned int NavLayer : 1; // Nav layer of the item (ImGuiNavLayer)
int Depth : 16; // Depth from requested parent id. 0 == ID is immediate child of requested parent id.
int TimestampMain; // Timestamp of main result (all fields)
int TimestampStatus; // Timestamp of StatusFlags
unsigned int ParentID; // Item Parent ID (value at top of the ID stack)
ImRect RectFull; // Item Rectangle
ImRect RectClipped; // Item Rectangle (clipped with window->ClipRect at time of item submission)
int ItemFlags; // Item flags
int StatusFlags; // Item Status flags (fully updated for some items only, compare TimestampStatus to FrameCount)
};
// Result of an GatherItems() query
struct ImGuiTestItemList {
ImPool_ImGuiTestItemInfo Pool;
};
struct ImGuiTestLogLineInfo {
ImGuiTestVerboseLevel Level;
int LineOffset;
};
struct ImGuiTestLog {
ImGuiTextBuffer Buffer;
ImVector_ImGuiTestLogLineInfo LineInfo;
int CountPerLevel[6];
};
// Storage for the output of a test run
struct ImGuiTestOutput {
ImGuiTestStatus Status;
ImGuiTestLog Log;
unsigned long long StartTime;
unsigned long long EndTime;
};
// Storage for one test
struct ImGuiTest {
const char* Category; // Literal, not owned
const char* Name; // Literal, generally not owned unless NameOwned=true
ImGuiTestGroup Group; // Coarse groups: 'Tests' or 'Perf'
bool NameOwned; //
int ArgVariant; // User parameter. Generally we use it to run variations of a same test by sharing GuiFunc/TestFunc
int Flags; // See ImGuiTestFlags_
ImFuncPtr(ImGuiTestGuiFunc) GuiFunc; // GUI function (optional if your test are running over an existing GUI application)
ImFuncPtr(ImGuiTestTestFunc) TestFunc; // Test driving function
ImFuncPtr(ImGuiTestTestFunc) TeardownFunc; // Teardown driving function, executed after TestFunc _regardless_ of TestFunc failing.
void* UserData; // General purpose user data (if assigning capturing lambdas on GuiFunc/TestFunc you may not need to use this)
const char* SourceFile; // __FILE__
int SourceLine; // __LINE__
int SourceLineEnd; // end of line (when calculated by ImGuiTestEngine_StartCalcSourceLineEnds())
ImGuiTestOutput Output;
unsigned long VarsSize;
ImGuiTestVarsConstructor* VarsConstructor;
ImGuiTestVarsPostConstructor* VarsPostConstructor; // To override constructor default (in case the default are problematic on the first GuiFunc frame)
void* VarsPostConstructorUserFn;
ImGuiTestVarsDestructor* VarsDestructor;
};
// Stored in test queue
struct ImGuiTestRunTask {
ImGuiTest* Test;
int RunFlags;
};
// Weak reference to an Item/Window given an hashed ID _or_ a string path ID.
// This is most often passed as argument to function and generally has a very short lifetime.
// Documentation: https://github.com/ocornut/imgui_test_engine/wiki/Named-References
// (SUGGESTION: add those constructors to "VA Step Filter" (Visual Assist) or a .natstepfilter file (Visual Studio) so they are skipped by F11 (StepInto)
struct ImGuiTestRef {
unsigned int ID; // Pre-hashed ID
const char* Path; // Relative or absolute path (string pointed to, not owned, as our lifetime is very short)
};
// Debug helper to output a string showing the Path, ID or Debug Label based on what is available (some items only have ID as we couldn't find/store a Path)
// (The size is arbitrary, this is only used for logging info the user/debugger)
struct ImGuiTestRefDesc {
char Buf[80];
};
// Advanced filtering for ItemActionAll()
struct ImGuiTestActionFilter {
int MaxDepth;
int MaxPasses;
const int* MaxItemCountPerDepth;
int RequireAllStatusFlags;
int RequireAnyStatusFlags;
};
// Helper struct to store various query-able state of an item.
// This facilitate interactions between GuiFunc and TestFunc, since those state are frequently used.
struct ImGuiTestGenericItemStatus {
int RetValue; // return value
int Hovered; // result of IsItemHovered()
int HoveredAllowDisabled; // result of IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)
int Active; // result of IsItemActive()
int Focused; // result of IsItemFocused()
int Clicked; // result of IsItemClicked()
int Visible; // result of IsItemVisible()
int Edited; // result of IsItemEdited()
int Activated; // result of IsItemActivated()
int Deactivated; // result of IsItemDeactivated()
int DeactivatedAfterEdit; // result of IsItemDeactivatedAfterEdit()
};
// Generic structure with various storage fields.
// This is useful for tests to quickly share data between GuiFunc and TestFunc without creating custom data structure.
// If those fields are not enough: using test->SetVarsDataType<>() + ctx->GetVars<>() it is possible to store custom data.
struct ImGuiTestGenericVars {
int Step;
int Count;
unsigned int DockId;
unsigned int OwnerId;
ImVec2 WindowSize;
int WindowFlags;
int TableFlags;
int PopupFlags;
int InputTextFlags;
ImGuiTestGenericItemStatus Status;
bool ShowWindow1;
bool ShowWindow2;
bool UseClipper;
bool UseViewports;
float Width;
ImVec2 Pos;
ImVec2 Pivot;
ImVec2 ItemSize;
ImVec4 Color1;
ImVec4 Color2;
int Int1;
int Int2;
int IntArray[10];
float Float1;
float Float2;
float FloatArray[10];
bool Bool1;
bool Bool2;
bool BoolArray[10];
unsigned int Id;
unsigned int IdArray[10];
char Str1[256];
char Str2[256];
};
struct ImGuiTestContext {
ImGuiTestGenericVars GenericVars; // Generic variables holder for convenience.
void* UserVars; // Access using ctx->GetVars<Type>(). Setup with test->SetVarsDataType<>().
ImGuiContext* UiContext; // UI context
ImGuiTestEngineIO* EngineIO; // Test Engine IO/settings
ImGuiTest* Test; // Test currently running
ImGuiTestOutput* TestOutput; // Test output (generally == &Test->Output while executing TestFunc)
int OpFlags; // Flags affecting all operation (supported: ImGuiTestOpFlags_NoAutoUncollapse)
int PerfStressAmount; // Convenience copy of engine->IO.PerfStressAmount
int FrameCount; // Test frame count (restarts from zero every time)
int FirstTestFrameCount; // First frame where TestFunc is running (after warm-up frame). This is generally -1 or 0 depending on whether we have warm up enabled
bool FirstGuiFrame;
bool HasDock; // #ifdef IMGUI_HAS_DOCK expressed in an easier to test value
ImGuiCaptureArgs* CaptureArgs; // Capture settings used by ctx->Capture*() functions
ImGuiTestEngine* Engine;
ImGuiTestInputs* Inputs;
int RunFlags;
ImGuiTestActiveFunc ActiveFunc; // None/GuiFunc/TestFunc
double RunningTime; // Amount of wall clock time the Test has been running. Used by safety watchdog.
int ActionDepth; // Nested depth of ctx-> function calls (used to decorate log)
int CaptureCounter; // Number of captures
int ErrorCounter; // Number of errors (generally this maxxes at 1 as most functions will early out)
bool Abort;
double PerfRefDt;
int PerfIterations; // Number of frames for PerfCapture() measurements
char RefStr[256]; // Reference window/path over which all named references are based
unsigned int RefID; // Reference ID over which all named references are based
unsigned int RefWindowID; // ID of a window that contains RefID item
ImGuiInputSource InputMode; // Prefer interacting with mouse/keyboard/gamepad
ImVector_char TempString;
ImVector_char Clipboard; // Private clipboard for the test instance
ImVector_ImGuiWindowPtr ForeignWindowsToHide;
ImGuiTestItemInfo DummyItemInfoNull; // Storage for ItemInfoNull()
bool CachedLinesPrintedToTTY;
};
// Coroutine support interface
// Your app needs to return and implement this.
// You can '#define IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL 1' in your imconfig file to use a default implementation using std::thread
// Documentation: https://github.com/ocornut/imgui_test_engine/wiki/Setting-Up
struct ImGuiTestCoroutineInterface {
ImGuiTestCoroutineHandle (*CreateFunc)(ImGuiTestCoroutineMainFunc* func, const char* name, void* data);
void (*DestroyFunc)(ImGuiTestCoroutineHandle handle);
bool (*RunFunc)(ImGuiTestCoroutineHandle handle);
void (*YieldFunc)();
};
// All the pointers are expect to be literals/persistent
struct ImBuildInfo {
const char* Type;
const char* Cpu;
const char* OS;
const char* Compiler;
char Date[32]; // "YYYY-MM-DD"
const char* Time;
};
struct ImGuiCsvParser {
int Columns; // Number of columns in CSV file.
int Rows; // Number of rows in CSV file.
char* _Data; // CSV file data.
ImVector_charPtr _Index; // CSV table: _Index[row * _Columns + col].
};
// Query item position/window/state given ID.
struct ImGuiTestInfoTask {
unsigned int ID;
int FrameCount; // Timestamp of request
char DebugName[64]; // Debug string representing the queried ID
ImGuiTestItemInfo Result;
};
// Gather item list in given parent ID.
struct ImGuiTestGatherTask {
unsigned int InParentID;
int InMaxDepth;
short InLayerMask;
ImGuiTestItemList* OutList;
ImGuiTestItemInfo* LastItemInfo;
};
// Find item ID given a label and a parent id
// Usually used by queries with wildcards such as ItemInfo("hello/**/foo/bar")
struct ImGuiTestFindByLabelTask {
unsigned int InPrefixId; // A known base ID which appears BEFORE the wildcard ID (for "hello/**/foo/bar" it would be hash of "hello")
int InSuffixDepth; // Number of labels in a path, after unknown base ID (for "hello/**/foo/bar" it would be 2)
const char* InSuffix; // A label string which appears on ID stack after unknown base ID (for "hello/**/foo/bar" it would be "foo/bar")
const char* InSuffixLastItem; // A last label string (for "hello/**/foo/bar" it would be "bar")
unsigned int InSuffixLastItemHash;
int InFilterItemStatusFlags; // Flags required for item to be returned
unsigned int OutItemId; // Result item ID
};
// FIXME: May want to strip further now that core imgui is using its own input queue
struct ImGuiTestInput {
ImGuiTestInputType Type;
int KeyChord;
unsigned short Char;
bool Down;
unsigned int ViewportId;
ImVec2 ViewportPosSize;
};
struct ImGuiTestInputs {
ImVec2 MousePosValue; // Own non-rounded copy of MousePos in order facilitate simulating mouse movement very slow speed and high-framerate
ImVec2 MouseWheel;
unsigned int MouseHoveredViewport;
int MouseButtonsValue; // FIXME-TESTS: Use simulated_io.MouseDown[] ?
ImVector_ImGuiTestInput Queue;
bool HostEscDown;
float HostEscDownDuration; // Maintain our own DownDuration for host/backend ESC key so we can abort.
ImVec2 HostMousePos;
};
struct ImGuiTestEnginePerfRecord {
double RawValueMs; // For current frame
ImMovingAverage_double Average100;
ImMovingAverage_double Average500;
};
// [Internal] Test Engine Context
struct ImGuiTestEngine {
ImGuiTestEngineIO IO;
ImGuiContext* UiContextTarget; // imgui context for testing
ImGuiContext* UiContextActive; // imgui context for testing == UiContextTarget or nullptr
bool Started;
bool UiContextHasHooks;
unsigned long long BatchStartTime;
unsigned long long BatchEndTime;
int FrameCount;
float OverrideDeltaTime; // Inject custom delta time into imgui context to simulate clock passing faster than wall clock time.
ImVector_ImGuiTest_Ptr TestsAll;
ImVector_ImGuiTestRunTask TestsQueue;
ImGuiTestContext* TestContext; // Running test context
bool TestsSourceLinesDirty;
ImVector_ImGuiTestInfoTask_Ptr InfoTasks;
ImGuiTestGatherTask GatherTask;
ImGuiTestFindByLabelTask FindByLabelTask;
void* TestQueueCoroutine; // Coroutine to run the test queue
bool TestQueueCoroutineShouldExit; // Flag to indicate that we are shutting down and the test queue coroutine should stop
ImGuiTextBuffer StringBuilderForChecks;
ImGuiTestInputs Inputs;
bool Abort;
ImGuiTest* UiSelectAndScrollToTest;
ImGuiTest* UiSelectedTest;
Str* UiFilterTests;
Str* UiFilterPerfs;
unsigned int UiFilterByStatusMask;
bool UiMetricsOpen;
bool UiDebugLogOpen;
bool UiCaptureToolOpen;
bool UiStackToolOpen;
bool UiPerfToolOpen;
float UiLogHeight;
unsigned long long PerfTimestampPreNewFrame;
unsigned long long PerfTimestampPreRender;
unsigned long long PerfTimestampPreSwap;
unsigned long long PerfTimestampPostSwap;
ImGuiTestEnginePerfRecord PerfDtApp;
ImGuiTestEnginePerfRecord PerfDtPreNewFrameToPreRender;
ImGuiTestEnginePerfRecord PerfDtPreRenderToPreSwap;
ImGuiTestEnginePerfRecord PerfDtPreNewFrameToPreSwap;
ImGuiTestEnginePerfRecord PerfDtPreSwapToPostSwap;
ImGuiPerfTool* PerfTool;
ImGuiCaptureToolUI CaptureTool; // Capture tool UI
ImGuiCaptureContext CaptureContext; // Capture context used in tests
ImGuiCaptureArgs* CaptureCurrentArgs;
bool PreSwapCalled;
bool PostSwapCalled;
bool ToolDebugRebootUiContext; // Completely shutdown and recreate the dear imgui context in place
bool ToolSlowDown;
int ToolSlowDownMs;
ImGuiTestRunSpeed BackupConfigRunSpeed;
bool BackupConfigNoThrottle;
};
// [Internal] Perf log entry. Changes to this struct should be reflected in ImGuiTestContext::PerfCapture() and ImGuiTestEngine_Start().
// This struct assumes strings stored here will be available until next ImGuiPerfTool::Clear() call. Fortunately we do not have to actively
// manage lifetime of these strings. New entries are created only in two cases:
// 1. ImGuiTestEngine_PerfToolAppendToCSV() call after perf test has run. This call receives ImGuiPerfToolEntry with const strings stored indefinitely by application.
// 2. As a consequence of ImGuiPerfTool::LoadCSV() call, we persist the ImGuiCSVParser instance, which keeps parsed CSV text, from which strings are referenced.
// As a result our solution also doesn't make many allocations.
struct ImGuiPerfToolEntry {
unsigned long long Timestamp; // Title of a particular batch of perftool entries.
const char* Category; // Name of category the test is in.
const char* TestName; // Name of test.
double DtDeltaMs; // Result of perf test.
int PerfStressAmount; //
const char* GitBranchName; // e.g. "master"
const char* BuildType; // e.g. "Debug"
const char* Cpu; // e.g. "X64"
const char* OS; // e.g. "Windows"
const char* Compiler; // e.g. "MSVC"
const char* Date; // e.g. "2026-01-01". Date of this entry or min date of combined entries.
double DtDeltaMsMin; // May be used by perftool.
double DtDeltaMsMax; // May be used by perftool.
int NumSamples; // Number aggregated samples.
double VsBaseline; // Percent difference vs baseline.
int LabelIndex; // Index of TestName in ImGuiPerfTool::_LabelsVisible.
};
// [Internal] Perf log batch.
struct ImGuiPerfToolBatch {
unsigned long long BatchID; // Timestamp of the batch, or unique ID of the build in combined mode.
int NumSamples; // A number of unique batches aggregated.
int BranchIndex; // For per-branch color mapping.
ImVector_ImGuiPerfToolEntry Entries; // Aggregated perf test entries. Order follows ImGuiPerfTool::_LabelsVisible order.
};
struct ImGuiPerfTool {
ImVector_ImGuiPerfToolEntry _SrcData; // Raw entries from CSV file (with string pointer into CSV data).
ImVector_const_charPtr _Labels;
ImVector_const_charPtr _LabelsVisible; // ImPlot requires a pointer of all labels beforehand. Always contains a dummy "" entry at the end!
ImVector_ImGuiPerfToolBatch _Batches;
ImGuiStorage _LabelBarCounts; // Number bars each label will render.
int _NumVisibleBuilds; // Cached number of visible builds.
int _NumUniqueBuilds; // Cached number of unique builds.
ImGuiPerfToolDisplayType _DisplayType;
ImGuiPerfToolReportType _ReportType;
int _BaselineBatchIndex; // Index of baseline build.
int _BaselineTestIndex; // Index of baseline test.
unsigned long long _BaselineTimestamp;
unsigned long long _BaselineBuildId;
char _BaselineTestName[128];
char _Filter[128]; // Context menu filtering substring.
char _FilterDateFrom[11];
char _FilterDateTo[11];
float _InfoTableHeight;
int _AlignStress; // Alignment values for build info components, so they look aligned in the legend.
int _AlignType;
int _AlignOs;
int _AlignCpu;
int _AlignCompiler;
int _AlignBranch;
int _AlignSamples;
bool _InfoTableSortDirty;
ImVector_Ulonglong _InfoTableSort; // _InfoTableSort[_LabelsVisible.Size * _Batches.Size]. Contains sorted batch indices for each label.
const ImGuiTableSortSpecs* _InfoTableSortSpecs; // Current table sort specs.
ImGuiStorage _TempSet; // Used as a set
int _TableHoveredTest; // Index within _VisibleLabelPointers array.
int _TableHoveredBatch;
int _PlotHoverTest;
int _PlotHoverBatch;
bool _PlotHoverTestLabel;
bool _ReportGenerating;
ImGuiStorage _Visibility;
ImGuiCsvParser* _CsvParser; // We keep this around and point to its fields
};
#endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef ImVector<ImGuiPerfToolBatch> ImVector_ImGuiPerfToolBatch;
typedef ImVector<ImGuiCaptureWindowData> ImVector_ImGuiCaptureWindowData;
typedef ImVector<ImGuiTestRunTask> ImVector_ImGuiTestRunTask;
typedef ImVector<ImGuiTestInfoTask *> ImVector_ImGuiTestInfoTask_Ptr;
typedef ImVector<ImGuiTest *> ImVector_ImGuiTest_Ptr;
typedef ImVector<ImGuiTestLogLineInfo> ImVector_ImGuiTestLogLineInfo;
typedef ImVector<double> ImVector_double;
typedef ImVector<unsigned int> ImVector_Uint;
typedef ImVector<char *> ImVector_charPtr;
typedef ImMovingAverage<double> ImMovingAverage_double;
typedef ImVector<ImGuiTestInput> ImVector_ImGuiTestInput;
typedef ImVector<ImGuiTestItemInfo> ImVector_ImGuiTestItemInfo;
typedef ImVector<ImGuiPerfToolEntry> ImVector_ImGuiPerfToolEntry;
typedef ImVector<unsigned long long> ImVector_Ulonglong;
typedef ImPool<ImGuiTestItemInfo> ImPool_ImGuiTestItemInfo;
#endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS
/** Header file: imgui_te_ui.h **/
CIMGUI_TE_API void cImGuiTestEngine_ShowTestEngineWindows(ImGuiTestEngine* engine, bool* p_open);
CIMGUI_TE_API void cImGuiTestEngine_OpenSourceFile(ImGuiTestEngine* engine, const char* source_filename, int source_line_no);
/** Header file: imgui_te_utils.h **/
CIMGUI_TE_API ImGuiID cImHashDecoratedPath(const char* str, const char* str_end, unsigned int seed);
CIMGUI_TE_API const char * cImFindNextDecoratedPartInPath(const char* str, const char* str_end);
CIMGUI_TE_API bool cImFileExist(const char* filename);
CIMGUI_TE_API bool cImFileDelete(const char* filename);
CIMGUI_TE_API bool cImFileCreateDirectoryChain(const char* path, const char* path_end);
CIMGUI_TE_API bool cImFileFindInParents(const char* sub_path, int max_parent_count, Str* output);
CIMGUI_TE_API bool cImFileLoadSourceBlurb(const char* filename, int line_no_start, int line_no_end, ImGuiTextBuffer* out_buf);
// Return value always between path and path_end
CIMGUI_TE_API const char * cImPathFindFilename(const char* path, const char* path_end);
// Return value always between path and path_end
CIMGUI_TE_API const char * cImPathFindExtension(const char* path, const char* path_end);
CIMGUI_TE_API void cImPathFixSeparatorsForCurrentOS(char* buf);
CIMGUI_TE_API void cImStrReplace(Str* s, const char* find, const char* repl);
CIMGUI_TE_API const char * cImStrchrRangeWithEscaping(const char* str, const char* str_end, char find_c);
CIMGUI_TE_API void cImStrXmlEscape(Str* s);
CIMGUI_TE_API int cImStrBase64Encode(const unsigned char* src, char* dst, int length);
CIMGUI_TE_API void cImStrTrimTrailingZeroesFromFloat(char* buf, char* buf_end);
CIMGUI_TE_API void cImParseExtractArgcArgvFromCommandLine(int* out_argc, const char *** out_argv, const char* cmd_line);
CIMGUI_TE_API bool cImParseFindIniSection(const char* ini_config, const char* header, ImVector_char* result);
CIMGUI_TE_API uint64_t cImTimeGetInMicroseconds();
CIMGUI_TE_API void cImTimestampToISO8601(unsigned long timestamp_us, Str* out_date);
CIMGUI_TE_API void cImThreadSleepInMilliseconds(int ms);
CIMGUI_TE_API void cImThreadSetCurrentThreadDescription(const char* description);
CIMGUI_TE_API const ImBuildInfo * cImBuildGetCompilationInfo();
CIMGUI_TE_API bool cImBuildFindGitBranchName(const char* git_repo_path, Str* branch_name);
CIMGUI_TE_API bool cImOsCreateProcess(const char* cmd_line);
CIMGUI_TE_API FILE * cImOsPOpen(const char* cmd_line, const char* mode);
CIMGUI_TE_API void cImOsPClose(FILE* fp);
CIMGUI_TE_API void cImOsOpenInShell(const char* path);
CIMGUI_TE_API bool cImOsIsDebuggerPresent();
CIMGUI_TE_API void cImOsOutputDebugString(const char* message);
CIMGUI_TE_API void cImOsConsoleSetTextColor(ImOsConsoleStream stream, ImOsConsoleTextColor color);
CIMGUI_TE_API ImGuiID cTableGetHeaderID_Str(ImGuiTable* table, const char* column, int instance_no);
CIMGUI_TE_API ImGuiID cTableGetHeaderID_int(ImGuiTable* table, int column_n, int instance_no);
CIMGUI_TE_API void cTableDiscardInstance(unsigned int table_id);
CIMGUI_TE_API void cTableDiscardSettings(unsigned int table_id);
CIMGUI_TE_API void cTableDiscardInstanceAndSettings(unsigned int table_id);
CIMGUI_TE_API void cSaveIniSettingsToVector(ImVector_char* out);
CIMGUI_TE_API void cDrawDataVerifyMatchingBufferCount(ImDrawData* draw_data);
/** Header file: imgui_te_coroutine.h **/
#ifdef IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL
CIMGUI_TE_API ImGuiTestCoroutineInterface * cCoroutine_ImplStdThread_GetInterface();
#endif // IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL
/** Header file: imgui_te_internal.h **/
CIMGUI_TE_API ImGuiTestItemInfo * cImGuiTestEngine_FindItemInfo(ImGuiTestEngine* engine, unsigned int id, const char* debug_id);
CIMGUI_TE_API void cImGuiTestEngine_Yield(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_SetDeltaTime(ImGuiTestEngine* engine, float delta_time);
CIMGUI_TE_API int cImGuiTestEngine_GetFrameCount(ImGuiTestEngine* engine);
CIMGUI_TE_API bool cImGuiTestEngine_PassFilter(ImGuiTest* test, const char* filter);
CIMGUI_TE_API void cImGuiTestEngine_RunTest(ImGuiTestEngine* engine, ImGuiTestContext* ctx, ImGuiTest* test, int run_flags);
CIMGUI_TE_API void cImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
CIMGUI_TE_API void cImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
CIMGUI_TE_API void cImGuiTestEngine_RebootUiContext(ImGuiTestEngine* engine);
CIMGUI_TE_API ImGuiPerfTool * cImGuiTestEngine_GetPerfTool(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_UpdateTestsSourceLines(ImGuiTestEngine* engine);
CIMGUI_TE_API bool cImGuiTestEngine_CaptureScreenshot(ImGuiTestEngine* engine, ImGuiCaptureArgs* args);
CIMGUI_TE_API bool cImGuiTestEngine_CaptureBeginVideo(ImGuiTestEngine* engine, ImGuiCaptureArgs* args);
CIMGUI_TE_API bool cImGuiTestEngine_CaptureEndVideo(ImGuiTestEngine* engine, ImGuiCaptureArgs* args);
CIMGUI_TE_API const char * cImGuiTestEngine_GetStatusName(ImGuiTestStatus v);
CIMGUI_TE_API const char * cImGuiTestEngine_GetRunSpeedName(ImGuiTestRunSpeed v);
CIMGUI_TE_API const char * cImGuiTestEngine_GetVerboseLevelName(ImGuiTestVerboseLevel v);
/** Header file: imgui_te_engine.h **/
CIMGUI_TE_API void cImGuiTestEngineHook_ItemAdd(ImGuiContext* ui_ctx, unsigned int id, const ImRect* bb, const ImGuiLastItemData* item_data);
CIMGUI_TE_API void cImGuiTestEngineHook_ItemInfo(ImGuiContext* ui_ctx, unsigned int id, const char* label, int flags);
CIMGUI_TE_API void cImGuiTestEngineHook_Log(ImGuiContext* ui_ctx, const char* fmt, ...);
CIMGUI_TE_API const char * cImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ui_ctx, unsigned int id);
CIMGUI_TE_API bool cImGuiTestEngine_Check(const char* file, const char* func, int line, int flags, bool result, const char* expr);
CIMGUI_TE_API bool cImGuiTestEngine_CheckOpStr(const char* file, const char* func, int line, int flags, const char* op, const char* lhs_desc, const char* lhs_value, const char* rhs_desc, const char* rhs_value, bool* out_result);
CIMGUI_TE_API bool cImGuiTestEngine_Error(const char* file, const char* func, int line, int flags, const char* fmt, ...);
CIMGUI_TE_API void cImGuiTestEngine_AssertLog(const char* expr, const char* file, const char* function, int line);
CIMGUI_TE_API ImGuiTextBuffer * cImGuiTestEngine_GetTempStringBuilder();
// Create test engine
CIMGUI_TE_API ImGuiTestEngine * cImGuiTestEngine_CreateContext();
// Destroy test engine. Call after ImGui::DestroyContext() so test engine specific ini data gets saved.
CIMGUI_TE_API void cImGuiTestEngine_DestroyContext(ImGuiTestEngine* engine);
// Bind to a dear imgui context. Start coroutine.
CIMGUI_TE_API void cImGuiTestEngine_Start(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
// Stop coroutine and export if any. (Unbind will lazily happen on context shutdown)
CIMGUI_TE_API void cImGuiTestEngine_Stop(ImGuiTestEngine* engine);
// Call every frame before framebuffer present/swap (used for time measurement)
CIMGUI_TE_API void cImGuiTestEngine_PreSwap(ImGuiTestEngine* engine);
// Call every frame after framebuffer present/swap, will process screen capture and call test_io.ScreenCaptureFunc()
CIMGUI_TE_API void cImGuiTestEngine_PostSwap(ImGuiTestEngine* engine);
CIMGUI_TE_API ImGuiTestEngineIO * cImGuiTestEngine_GetIO(ImGuiTestEngine* engine);
// Prefer calling IM_REGISTER_TEST()
CIMGUI_TE_API ImGuiTest * cImGuiTestEngine_RegisterTest(ImGuiTestEngine* engine, const char* category, const char* name, const char* src_file, int src_line);
CIMGUI_TE_API void cImGuiTestEngine_UnregisterTest(ImGuiTestEngine* engine, ImGuiTest* test);
CIMGUI_TE_API void cImGuiTestEngine_UnregisterAllTests(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_QueueTest(ImGuiTestEngine* engine, ImGuiTest* test, int run_flags);
CIMGUI_TE_API void cImGuiTestEngine_QueueTests(ImGuiTestEngine* engine, ImGuiTestGroup group, const char* filter, int run_flags);
CIMGUI_TE_API bool cImGuiTestEngine_TryAbortEngine(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_AbortCurrentTest(ImGuiTestEngine* engine);
CIMGUI_TE_API ImGuiTest * cImGuiTestEngine_FindTestByName(ImGuiTestEngine* engine, const char* category, const char* name);
CIMGUI_TE_API bool cImGuiTestEngine_IsTestQueueEmpty(ImGuiTestEngine* engine);
CIMGUI_TE_API bool cImGuiTestEngine_IsUsingSimulatedInputs(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_GetResultSummary(ImGuiTestEngine* engine, ImGuiTestEngineResultSummary* out_results);
CIMGUI_TE_API void cImGuiTestEngine_GetTestList(ImGuiTestEngine* engine, ImVector_ImGuiTest_Ptr* out_tests);
CIMGUI_TE_API void cImGuiTestEngine_GetTestQueue(ImGuiTestEngine* engine, ImVector_ImGuiTestRunTask* out_tests);
// Install default crash handler (if you don't have one)
CIMGUI_TE_API void cImGuiTestEngine_InstallDefaultCrashHandler();
// Default crash handler, should be called from a custom crash handler if such exists
CIMGUI_TE_API void cImGuiTestEngine_CrashHandler();
/** Header file: imgui_te_exporters.h **/
CIMGUI_TE_API void cImGuiTestEngine_PrintResultSummary(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_Export(ImGuiTestEngine* engine);
CIMGUI_TE_API void cImGuiTestEngine_ExportEx(ImGuiTestEngine* engine, ImGuiTestEngineExportFormat format, const char* filename);
/** Header file: imgui_te_perftool.h **/
CIMGUI_TE_API void cImGuiTestEngine_PerfToolAppendToCSV(ImGuiPerfToolEntry* entry, const char* filename);
/* ImGuiCaptureImageBuf */
CIMGUI_TE_API ImGuiCaptureImageBuf * ImGuiCaptureImageBuf_ImGuiCaptureImageBuf();
CIMGUI_TE_API void ImGuiCaptureImageBuf_destroy(ImGuiCaptureImageBuf* self);
// Free allocated memory buffer if such exists.
CIMGUI_TE_API void ImGuiCaptureImageBuf_Clear(ImGuiCaptureImageBuf* self);
// Reallocate buffer for pixel data and zero it.
CIMGUI_TE_API void ImGuiCaptureImageBuf_CreateEmpty(ImGuiCaptureImageBuf* self, int w, int h);
// Save pixel data to specified image file.
CIMGUI_TE_API bool ImGuiCaptureImageBuf_SaveFile(ImGuiCaptureImageBuf* self, const char* filename);
// Clear alpha channel from all pixels.
CIMGUI_TE_API void ImGuiCaptureImageBuf_RemoveAlpha(ImGuiCaptureImageBuf* self);
/* ImGuiCaptureContext */
CIMGUI_TE_API ImGuiCaptureContext * ImGuiCaptureContext_ImGuiCaptureContext(ImGuiScreenCaptureFunc* capture_func);
CIMGUI_TE_API void ImGuiCaptureContext_PreNewFrame(ImGuiCaptureContext* self);
CIMGUI_TE_API void ImGuiCaptureContext_PreRender(ImGuiCaptureContext* self);
CIMGUI_TE_API void ImGuiCaptureContext_PostRender(ImGuiCaptureContext* self);
CIMGUI_TE_API ImGuiCaptureStatus ImGuiCaptureContext_CaptureUpdate(ImGuiCaptureContext* self, ImGuiCaptureArgs* args);
CIMGUI_TE_API void ImGuiCaptureContext_RestoreBackedUpData(ImGuiCaptureContext* self);
CIMGUI_TE_API void ImGuiCaptureContext_ClearState(ImGuiCaptureContext* self);
CIMGUI_TE_API void ImGuiCaptureContext_BeginVideoCapture(ImGuiCaptureContext* self, ImGuiCaptureArgs* args);
CIMGUI_TE_API void ImGuiCaptureContext_EndVideoCapture(ImGuiCaptureContext* self);
CIMGUI_TE_API bool ImGuiCaptureContext_IsCapturingVideo(ImGuiCaptureContext* self);
CIMGUI_TE_API bool ImGuiCaptureContext_IsCapturing(ImGuiCaptureContext* self);
// Automatically generated destructor
CIMGUI_TE_API void ImGuiCaptureContext_destroy(ImGuiCaptureContext* self);
/* ImGuiCaptureToolUI */
CIMGUI_TE_API ImGuiCaptureToolUI * ImGuiCaptureToolUI_ImGuiCaptureToolUI();
// Render a capture tool window with various options and utilities.
CIMGUI_TE_API void ImGuiCaptureToolUI_ShowCaptureToolWindow(ImGuiCaptureToolUI* self, ImGuiCaptureContext* context, bool* p_open);
// Render a window picker that captures picked window to file specified in file_name.
CIMGUI_TE_API void ImGuiCaptureToolUI__CaptureWindowPicker(ImGuiCaptureToolUI* self, ImGuiCaptureArgs* args);
// Render a selector for selecting multiple windows for capture.
CIMGUI_TE_API void ImGuiCaptureToolUI__CaptureWindowsSelector(ImGuiCaptureToolUI* self, ImGuiCaptureContext* context, ImGuiCaptureArgs* args);
// Snap edges of all visible windows to a virtual grid.
CIMGUI_TE_API void ImGuiCaptureToolUI__SnapWindowsToGrid(ImGuiCaptureToolUI* self, float cell_size);
// Format output file template into capture args struct and ensure target directory exists.
CIMGUI_TE_API bool ImGuiCaptureToolUI__InitializeOutputFile(ImGuiCaptureToolUI* self);
CIMGUI_TE_API bool ImGuiCaptureToolUI__ShowEncoderConfigFields(ImGuiCaptureToolUI* self, ImGuiCaptureContext* context);
// Automatically generated destructor
CIMGUI_TE_API void ImGuiCaptureToolUI_destroy(ImGuiCaptureToolUI* self);
/* ImGuiTestItemInfo */
CIMGUI_TE_API ImGuiTestItemInfo * ImGuiTestItemInfo_ImGuiTestItemInfo();
// Automatically generated destructor