test_engine.pyi 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of ImGui Test Engine
  3. # -----------------------------------------------------------------------------
  4. # imgui/test_engine.pyi: auto-generated bindings for ImGui Test Engine.
  5. #
  6. # It is automatically generated (using https://pthom.github.io/litgen/),
  7. # and is generally very close to the C++ version. Comments, docs are identical.
  8. ###############################################################################
  9. """ImGui Test Engine python bindings
  10. Note: Integrating ImGui TestEngine directly from python, and without using HelloImGui and ImmApp is very difficult:
  11. ImGui Test Engine uses two different threads (one for the main gui, and one for the scenario runner).
  12. Your python code will be called from two separate threads, and this breaks the GIL!
  13. HelloImGui and ImmApp handle this well by transferring the GIL between threads (from C++)
  14. For gory details, see https://github.com/pthom/imgui_test_engine/blob/imgui_bundle/imgui_test_engine/imgui_te_python_gil.jpg
  15. """
  16. # ruff: noqa: B008, F821
  17. import sys
  18. from typing import Any, Optional, Tuple, Callable, overload, Union
  19. import numpy as np
  20. import enum
  21. from imgui_bundle.imgui import internal as internal
  22. from imgui_bundle import imgui as imgui
  23. from imgui_bundle.imgui import (
  24. WindowFlags,
  25. TableFlags,
  26. InputTextFlags,
  27. PopupFlags,
  28. ImVec2Like,
  29. ImVec2,
  30. ImVec4,
  31. KeyChord,
  32. Viewport,
  33. ImU64,
  34. ImWchar,
  35. TableSortSpecs,
  36. MouseButton,
  37. Key,
  38. Dir,
  39. SortDirection,
  40. DataType,
  41. ImVector_int,
  42. ImVector_Window_ptr,
  43. ImVector_char,
  44. TextBuffer,
  45. )
  46. from imgui_bundle.imgui.internal import (
  47. ItemStatusFlags,
  48. DockNode,
  49. Axis,
  50. Window,
  51. ImRect,
  52. Context,
  53. ItemFlags,
  54. LastItemData,
  55. TabBar,
  56. InputSource,
  57. )
  58. ID = int
  59. Str = str
  60. Key_None = Key.none
  61. TestInputType_None = TestInputType.none # noqa
  62. TestRunFlags = int
  63. TestCheckFlags = int
  64. TestFlags = int
  65. TestOpFlags = int
  66. TestLogFlags = int
  67. CaptureFlags = int
  68. TestVerboseLevel_Warning = TestVerboseLevel.warning # noqa
  69. TestVerboseLevel_Info = TestVerboseLevel.info # noqa
  70. TestOpFlags_None = TestOpFlags_.none # noqa
  71. TestRunFlags_None = TestRunFlags_.none # noqa
  72. TestRunSpeed_Fast = TestRunSpeed.fast # noqa
  73. TestFlags_None = TestFlags_.none # noqa
  74. TestActiveFunc_None = TestActiveFunc.none # noqa
  75. TestGroup_Unknown = TestGroup.unknown # noqa
  76. TestStatus_Unknown = TestStatus.unknown # noqa
  77. TestStatus_Success = TestStatus.success # noqa
  78. InputSource_Mouse = InputSource.mouse # noqa
  79. Function_TestRunner = Callable[[TestContext], None] | None
  80. Function_TestGui = Callable[[imgui.test_engine.TestContext], None] | None
  81. Str30 = str
  82. Str256 = str
  83. ImVector_Window = ImVector_Window_ptr
  84. ##################################################
  85. # AUTO GENERATED CODE BELOW
  86. ##################################################
  87. # <litgen_stub> // Autogenerated code below! Do not edit!
  88. #################### <generated_from:imgui_te_exporters.h> ####################
  89. # dear imgui test engine
  90. # (result exporters)
  91. # Read https://github.com/ocornut/imgui_test_engine/wiki/Exporting-Results
  92. # This file is governed by the "Dear ImGui Test Engine License".
  93. # Details of the license are provided in the LICENSE.txt file in the same directory.
  94. # -------------------------------------------------------------------------
  95. # Description
  96. # -------------------------------------------------------------------------
  97. #
  98. # Test results may be exported in one of supported formats.
  99. # To enable result exporting please configure test engine as follows:
  100. #
  101. # ImGuiTestEngineIO& test_io = ImGuiTestEngine_GetIO(engine);
  102. # test_io.ExportResultsFile = "output_file.xml";
  103. # test_io.ExportResultsFormat = ImGuiTestEngineExportFormat_<...>;
  104. #
  105. # JUnit XML format
  106. # ------------------
  107. # JUnit XML format described at https://llg.cubic.org/docs/junit/. Many
  108. # third party applications support consumption of this format. Some of
  109. # of them are listed here:
  110. # - Jenkins
  111. # - Installation guide: https://www.jenkins.io/doc/book/installing/docker/
  112. # - JUnit plugin: https://plugins.jenkins.io/junit/
  113. # - xunit-viewer
  114. # - Project: https://github.com/lukejpreston/xunit-viewer
  115. # - Install npm: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
  116. # - Install viewer and view test results:
  117. # npm install xunit-viewer
  118. # imgui_test_suite -nopause -v2 -ve4 -nogui -export-file junit.xml tests
  119. # node_modules/xunit-viewer/bin/xunit-viewer -r junit.xml -o junit.html
  120. # - Open junit.html
  121. #
  122. # -------------------------------------------------------------------------
  123. # Forward Declarations
  124. # -------------------------------------------------------------------------
  125. # -------------------------------------------------------------------------
  126. # Types
  127. # -------------------------------------------------------------------------
  128. class TestEngineExportFormat(enum.IntFlag):
  129. # ImGuiTestEngineExportFormat_None = 0, /* original C++ signature */
  130. none = enum.auto() # (= 0)
  131. # ImGuiTestEngineExportFormat_JUnitXml, /* original C++ signature */
  132. # }
  133. j_unit_xml = enum.auto() # (= 1)
  134. # -------------------------------------------------------------------------
  135. # Functions
  136. # -------------------------------------------------------------------------
  137. # void ImGuiTestEngine_PrintResultSummary(ImGuiTestEngine* engine); /* original C++ signature */
  138. def print_result_summary(engine: TestEngine) -> None:
  139. """(private API)"""
  140. pass
  141. # void ImGuiTestEngine_Export(ImGuiTestEngine* engine); /* original C++ signature */
  142. def export(engine: TestEngine) -> None:
  143. """(private API)"""
  144. pass
  145. # void ImGuiTestEngine_ExportEx(ImGuiTestEngine* engine, ImGuiTestEngineExportFormat format, const char* filename); /* original C++ signature */
  146. def export_ex(engine: TestEngine, format: TestEngineExportFormat, filename: str) -> None:
  147. """(private API)"""
  148. pass
  149. #################### </generated_from:imgui_te_exporters.h> ####################
  150. #################### <generated_from:imgui_te_engine.h> ####################
  151. # dear imgui test engine
  152. # (core)
  153. # This is the interface that your initial setup (app init, main loop) will mostly be using.
  154. # Actual tests will mostly use the interface of imgui_te_context.h
  155. # This file is governed by the "Dear ImGui Test Engine License".
  156. # Details of the license are provided in the LICENSE.txt file in the same directory.
  157. # #ifdef IMGUI_BUNDLE_PYTHON_API
  158. #
  159. # #endif
  160. #
  161. # IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API is always defined (even when building python bindings),
  162. # but is used as a marker to exclude certain functions from the python binding code.
  163. # -----------------------------------------------------------------------------
  164. # Function Pointers
  165. # -----------------------------------------------------------------------------
  166. # -------------------------------------------------------------------------
  167. # Forward Declarations
  168. # -------------------------------------------------------------------------
  169. # -------------------------------------------------------------------------
  170. # Types
  171. # -------------------------------------------------------------------------
  172. class TestActiveFunc(enum.IntFlag):
  173. """Stored in ImGuiTestContext: where we are currently running GuiFunc or TestFunc"""
  174. # ImGuiTestActiveFunc_None, /* original C++ signature */
  175. none = enum.auto() # (= 0)
  176. # ImGuiTestActiveFunc_GuiFunc, /* original C++ signature */
  177. gui_func = enum.auto() # (= 1) # == GuiFunc() handler
  178. # ImGuiTestActiveFunc_TestFunc, /* original C++ signature */
  179. test_func = enum.auto() # (= 2) # == TestFunc() handler
  180. # ImGuiTestActiveFunc_TeardownFunc, /* original C++ signature */
  181. teardown_func = enum.auto() # (= 3) # == TeardownFunc() handler
  182. class TestRunSpeed(enum.IntFlag):
  183. # ImGuiTestRunSpeed_Fast = 0, /* original C++ signature */
  184. fast = enum.auto() # (= 0) # Run tests as fast as possible (teleport mouse, skip delays, etc.)
  185. # ImGuiTestRunSpeed_Normal = 1, /* original C++ signature */
  186. normal = enum.auto() # (= 1) # Run tests at human watchable speed (for debugging)
  187. # ImGuiTestRunSpeed_Cinematic = 2, /* original C++ signature */
  188. cinematic = enum.auto() # (= 2) # Run tests with pauses between actions (for e.g. tutorials)
  189. # ImGuiTestRunSpeed_COUNT /* original C++ signature */
  190. # }
  191. count = enum.auto() # (= 3)
  192. class TestVerboseLevel(enum.IntFlag):
  193. # ImGuiTestVerboseLevel_Silent = 0, /* original C++ signature */
  194. silent = enum.auto() # (= 0) # -v0
  195. # ImGuiTestVerboseLevel_Error = 1, /* original C++ signature */
  196. error = enum.auto() # (= 1) # -v1
  197. # ImGuiTestVerboseLevel_Warning = 2, /* original C++ signature */
  198. warning = enum.auto() # (= 2) # -v2
  199. # ImGuiTestVerboseLevel_Info = 3, /* original C++ signature */
  200. info = enum.auto() # (= 3) # -v3
  201. # ImGuiTestVerboseLevel_Debug = 4, /* original C++ signature */
  202. debug = enum.auto() # (= 4) # -v4
  203. # ImGuiTestVerboseLevel_Trace = 5, /* original C++ signature */
  204. trace = enum.auto() # (= 5)
  205. # ImGuiTestVerboseLevel_COUNT /* original C++ signature */
  206. # }
  207. count = enum.auto() # (= 6)
  208. class TestStatus(enum.IntFlag):
  209. """Test status (stored in ImGuiTest)"""
  210. # ImGuiTestStatus_Unknown = 0, /* original C++ signature */
  211. unknown = enum.auto() # (= 0)
  212. # ImGuiTestStatus_Success = 1, /* original C++ signature */
  213. success = enum.auto() # (= 1)
  214. # ImGuiTestStatus_Queued = 2, /* original C++ signature */
  215. queued = enum.auto() # (= 2)
  216. # ImGuiTestStatus_Running = 3, /* original C++ signature */
  217. running = enum.auto() # (= 3)
  218. # ImGuiTestStatus_Error = 4, /* original C++ signature */
  219. error = enum.auto() # (= 4)
  220. # ImGuiTestStatus_Suspended = 5, /* original C++ signature */
  221. suspended = enum.auto() # (= 5)
  222. # ImGuiTestStatus_COUNT /* original C++ signature */
  223. # }
  224. count = enum.auto() # (= 6)
  225. class TestGroup(enum.IntFlag):
  226. """Test group: this is mostly used to categorize tests in our testing UI. (Stored in ImGuiTest)"""
  227. # ImGuiTestGroup_Unknown = -1, /* original C++ signature */
  228. unknown = enum.auto() # (= -1)
  229. # ImGuiTestGroup_Tests = 0, /* original C++ signature */
  230. tests = enum.auto() # (= 0)
  231. # ImGuiTestGroup_Perfs = 1, /* original C++ signature */
  232. perfs = enum.auto() # (= 1)
  233. # ImGuiTestGroup_COUNT /* original C++ signature */
  234. # }
  235. count = enum.auto() # (= 2)
  236. class TestFlags_(enum.IntFlag):
  237. """Flags (stored in ImGuiTest)"""
  238. # ImGuiTestFlags_None = 0, /* original C++ signature */
  239. none = enum.auto() # (= 0)
  240. # ImGuiTestFlags_NoGuiWarmUp = 1 << 0, /* original C++ signature */
  241. no_gui_warm_up = (
  242. enum.auto()
  243. ) # (= 1 << 0) # Disable running the GUI func for 2 frames before starting test code. For tests which absolutely need to start before GuiFunc.
  244. # ImGuiTestFlags_NoAutoFinish = 1 << 1, /* original C++ signature */
  245. no_auto_finish = (
  246. enum.auto()
  247. ) # (= 1 << 1) # By default, tests with no TestFunc (only a GuiFunc) will end after warmup. Setting this require test to call ctx->Finish().
  248. # ImGuiTestFlags_NoRecoveryWarnings = 1 << 2 /* original C++ signature */
  249. no_recovery_warnings = (
  250. enum.auto()
  251. ) # (= 1 << 2) # Error/recovery warnings (missing End/Pop calls etc.) will be displayed as normal debug entries, for tests which may rely on those.
  252. # ImGuiTestFlags_RequireViewports = 1 << 10
  253. class TestCheckFlags_(enum.IntFlag):
  254. """Flags for IM_CHECK* macros."""
  255. # ImGuiTestCheckFlags_None = 0, /* original C++ signature */
  256. none = enum.auto() # (= 0)
  257. # ImGuiTestCheckFlags_SilentSuccess = 1 << 0 /* original C++ signature */
  258. # }
  259. silent_success = enum.auto() # (= 1 << 0)
  260. class TestLogFlags_(enum.IntFlag):
  261. """Flags for ImGuiTestContext::Log* functions."""
  262. # ImGuiTestLogFlags_None = 0, /* original C++ signature */
  263. none = enum.auto() # (= 0)
  264. # ImGuiTestLogFlags_NoHeader = 1 << 0 /* original C++ signature */
  265. no_header = enum.auto() # (= 1 << 0) # Do not display frame count and depth padding
  266. class TestRunFlags_(enum.IntFlag):
  267. # ImGuiTestRunFlags_None = 0, /* original C++ signature */
  268. none = enum.auto() # (= 0)
  269. # ImGuiTestRunFlags_GuiFuncDisable = 1 << 0, /* original C++ signature */
  270. gui_func_disable = (
  271. enum.auto()
  272. ) # (= 1 << 0) # Used internally to temporarily disable the GUI func (at the end of a test, etc)
  273. # ImGuiTestRunFlags_GuiFuncOnly = 1 << 1, /* original C++ signature */
  274. gui_func_only = enum.auto() # (= 1 << 1) # Set when user selects "Run GUI func"
  275. # ImGuiTestRunFlags_NoSuccessMsg = 1 << 2, /* original C++ signature */
  276. no_success_msg = enum.auto() # (= 1 << 2)
  277. # ImGuiTestRunFlags_EnableRawInputs = 1 << 3, /* original C++ signature */
  278. enable_raw_inputs = (
  279. enum.auto()
  280. ) # (= 1 << 3) # Disable input submission to let test submission raw input event (in order to test e.g. IO queue)
  281. # ImGuiTestRunFlags_RunFromGui = 1 << 4, /* original C++ signature */
  282. run_from_gui = enum.auto() # (= 1 << 4) # Test ran manually from GUI, will disable watchdog.
  283. # ImGuiTestRunFlags_RunFromCommandLine= 1 << 5, /* original C++ signature */
  284. run_from_command_line = enum.auto() # (= 1 << 5) # Test queued from command-line.
  285. # Flags for ImGuiTestContext::RunChildTest()
  286. # ImGuiTestRunFlags_NoError = 1 << 10, /* original C++ signature */
  287. no_error = enum.auto() # (= 1 << 10)
  288. # ImGuiTestRunFlags_ShareVars = 1 << 11, /* original C++ signature */
  289. share_vars = (
  290. enum.auto()
  291. ) # (= 1 << 11) # Share generic vars and custom vars between child and parent tests (custom vars need to be same type)
  292. # ImGuiTestRunFlags_ShareTestContext = 1 << 12, /* original C++ signature */
  293. share_test_context = (
  294. enum.auto()
  295. ) # (= 1 << 12) # Share ImGuiTestContext instead of creating a new one (unsure what purpose this may be useful for yet)
  296. # TODO: Add GuiFunc options
  297. class TestEngineResultSummary:
  298. # int CountTested = 0; /* original C++ signature */
  299. count_tested: int = 0 # Number of tests executed
  300. # int CountSuccess = 0; /* original C++ signature */
  301. count_success: int = 0 # Number of tests succeeded
  302. # int CountInQueue = 0; /* original C++ signature */
  303. count_in_queue: int = 0 # Number of tests remaining in queue (e.g. aborted, crashed)
  304. # ImGuiTestEngineResultSummary(int CountTested = 0, int CountSuccess = 0, int CountInQueue = 0); /* original C++ signature */
  305. def __init__(self, count_tested: int = 0, count_success: int = 0, count_in_queue: int = 0) -> None:
  306. """Auto-generated default constructor with named params"""
  307. pass
  308. # -------------------------------------------------------------------------
  309. # Functions
  310. # -------------------------------------------------------------------------
  311. # Legacy version support
  312. # extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ui_ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData* item_data); /* original C++ signature */
  313. def hook_item_add(ui_ctx: Context, id_: ID, bb: ImRect, item_data: LastItemData) -> None:
  314. """Hooks for core imgui/ library (generally called via macros)
  315. (private API)
  316. """
  317. pass
  318. # extern void ImGuiTestEngineHook_Log(ImGuiContext* ui_ctx, const char* fmt, ...); /* original C++ signature */
  319. def hook_log(ui_ctx: Context, fmt: str) -> None:
  320. """(private API)"""
  321. pass
  322. # extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ui_ctx, ImGuiID id); /* original C++ signature */
  323. def find_item_debug_label(ui_ctx: Context, id_: ID) -> str:
  324. """(private API)"""
  325. pass
  326. # Functions (generally called via IM_CHECK() macros)
  327. # IMGUI_API bool ImGuiTestEngine_Check(const char* file, const char* func, int line, ImGuiTestCheckFlags flags, bool result, const char* expr); /* original C++ signature */
  328. def check(file: str, func: str, line: int, flags: TestCheckFlags, result: bool, expr: str) -> bool:
  329. pass
  330. # IMGUI_API bool ImGuiTestEngine_CheckOpStr(const char* file, const char* func, int line, ImGuiTestCheckFlags flags, const char* op, const char* lhs_desc, const char* lhs_value, const char* rhs_desc, const char* rhs_value, bool* out_result); /* original C++ signature */
  331. def check_op_str(
  332. file: str,
  333. func: str,
  334. line: int,
  335. flags: TestCheckFlags,
  336. op: str,
  337. lhs_desc: str,
  338. lhs_value: str,
  339. rhs_desc: str,
  340. rhs_value: str,
  341. out_result: bool,
  342. ) -> Tuple[bool, bool]:
  343. pass
  344. # IMGUI_API bool ImGuiTestEngine_Error(const char* file, const char* func, int line, ImGuiTestCheckFlags flags, const char* fmt, ...); /* original C++ signature */
  345. def error(file: str, func: str, line: int, flags: TestCheckFlags, fmt: str) -> bool:
  346. pass
  347. # IMGUI_API void ImGuiTestEngine_AssertLog(const char* expr, const char* file, const char* function, int line); /* original C++ signature */
  348. def assert_log(expr: str, file: str, function: str, line: int) -> None:
  349. pass
  350. # IMGUI_API ImGuiTextBuffer* ImGuiTestEngine_GetTempStringBuilder(); /* original C++ signature */
  351. def get_temp_string_builder() -> TextBuffer:
  352. pass
  353. # -------------------------------------------------------------------------
  354. # ImGuiTestEngine API
  355. # -------------------------------------------------------------------------
  356. # Functions: Initialization
  357. # IMGUI_API ImGuiTestEngine* ImGuiTestEngine_CreateContext(); /* original C++ signature */
  358. def create_context() -> TestEngine:
  359. """ImGuiTestEngine_CreateContext: Create test engine
  360. Note for python bindings users:
  361. Integrating ImGui TestEngine directly from python, and without using HelloImGui and ImmApp is very difficult:
  362. ImGui Test Engine uses two different threads (one for the main gui, and one for the scenario runner).
  363. Your python code will be called from two separate threads, and this breaks the GIL!
  364. HelloImGui and ImmApp handle this well by transferring the GIL between threads (from C++)
  365. For gory details, see https://github.com/pthom/imgui_test_engine/blob/imgui_bundle/imgui_test_engine/imgui_te_python_gil.jpg
  366. """
  367. pass
  368. # IMGUI_API void ImGuiTestEngine_DestroyContext(ImGuiTestEngine* engine); /* original C++ signature */
  369. def destroy_context(engine: TestEngine) -> None:
  370. """Destroy test engine. Call after ImGui::DestroyContext() so test engine specific ini data gets saved."""
  371. pass
  372. # IMGUI_API void ImGuiTestEngine_Start(ImGuiTestEngine* engine, ImGuiContext* ui_ctx); /* original C++ signature */
  373. def start(engine: TestEngine, ui_ctx: Context) -> None:
  374. """Bind to a dear imgui context. Start coroutine."""
  375. pass
  376. # IMGUI_API void ImGuiTestEngine_Stop(ImGuiTestEngine* engine); /* original C++ signature */
  377. def stop(engine: TestEngine) -> None:
  378. """Stop coroutine and export if any. (Unbind will lazily happen on context shutdown)"""
  379. pass
  380. # IMGUI_API void ImGuiTestEngine_PostSwap(ImGuiTestEngine* engine); /* original C++ signature */
  381. def post_swap(engine: TestEngine) -> None:
  382. """Call every frame after framebuffer swap, will process screen capture and call test_io.ScreenCaptureFunc()"""
  383. pass
  384. # IMGUI_API ImGuiTestEngineIO& ImGuiTestEngine_GetIO(ImGuiTestEngine* engine); /* original C++ signature */
  385. def get_io(engine: TestEngine) -> TestEngineIO:
  386. pass
  387. # IMGUI_API ImGuiTest* ImGuiTestEngine_RegisterTest(ImGuiTestEngine* engine, const char* category, const char* name, const char* src_file = nullptr, int src_line = 0); /* original C++ signature */
  388. def register_test(
  389. engine: TestEngine, category: str, name: str, src_file: Optional[str] = None, src_line: int = 0
  390. ) -> Test:
  391. """Prefer calling IM_REGISTER_TEST()"""
  392. pass
  393. # IMGUI_API void ImGuiTestEngine_UnregisterTest(ImGuiTestEngine* engine, ImGuiTest* test); /* original C++ signature */
  394. def unregister_test(engine: TestEngine, test: Test) -> None:
  395. pass
  396. # IMGUI_API void ImGuiTestEngine_UnregisterAllTests(ImGuiTestEngine* engine); /* original C++ signature */
  397. def unregister_all_tests(engine: TestEngine) -> None:
  398. pass
  399. # Functions: Main
  400. # IMGUI_API void ImGuiTestEngine_QueueTest(ImGuiTestEngine* engine, ImGuiTest* test, ImGuiTestRunFlags run_flags = 0); /* original C++ signature */
  401. def queue_test(engine: TestEngine, test: Test, run_flags: TestRunFlags = 0) -> None:
  402. pass
  403. # IMGUI_API void ImGuiTestEngine_QueueTests(ImGuiTestEngine* engine, ImGuiTestGroup group, const char* filter = nullptr, ImGuiTestRunFlags run_flags = 0); /* original C++ signature */
  404. def queue_tests(
  405. engine: TestEngine, group: TestGroup, filter: Optional[str] = None, run_flags: TestRunFlags = 0
  406. ) -> None:
  407. pass
  408. # IMGUI_API bool ImGuiTestEngine_TryAbortEngine(ImGuiTestEngine* engine); /* original C++ signature */
  409. def try_abort_engine(engine: TestEngine) -> bool:
  410. pass
  411. # IMGUI_API void ImGuiTestEngine_AbortCurrentTest(ImGuiTestEngine* engine); /* original C++ signature */
  412. def abort_current_test(engine: TestEngine) -> None:
  413. pass
  414. # IMGUI_API ImGuiTest* ImGuiTestEngine_FindTestByName(ImGuiTestEngine* engine, const char* category, const char* name); /* original C++ signature */
  415. def find_test_by_name(engine: TestEngine, category: str, name: str) -> Test:
  416. pass
  417. # Functions: Status Queries
  418. # FIXME: Clarify API to avoid function calls vs raw bools in ImGuiTestEngineIO
  419. # IMGUI_API bool ImGuiTestEngine_IsTestQueueEmpty(ImGuiTestEngine* engine); /* original C++ signature */
  420. def is_test_queue_empty(engine: TestEngine) -> bool:
  421. pass
  422. # IMGUI_API bool ImGuiTestEngine_IsUsingSimulatedInputs(ImGuiTestEngine* engine); /* original C++ signature */
  423. def is_using_simulated_inputs(engine: TestEngine) -> bool:
  424. pass
  425. # IMGUI_API void ImGuiTestEngine_GetResultSummary(ImGuiTestEngine* engine, ImGuiTestEngineResultSummary* out_results); /* original C++ signature */
  426. def get_result_summary(engine: TestEngine, out_results: TestEngineResultSummary) -> None:
  427. pass
  428. # Functions: Crash Handling
  429. # Ensure past test results are properly exported even if application crash during a test.
  430. # IMGUI_API void ImGuiTestEngine_InstallDefaultCrashHandler(); /* original C++ signature */
  431. def install_default_crash_handler() -> None:
  432. """Install default crash handler (if you don't have one)"""
  433. pass
  434. # IMGUI_API void ImGuiTestEngine_CrashHandler(); /* original C++ signature */
  435. def crash_handler() -> None:
  436. """Default crash handler, should be called from a custom crash handler if such exists"""
  437. pass
  438. # -----------------------------------------------------------------------------
  439. # IO structure to configure the test engine
  440. # -----------------------------------------------------------------------------
  441. class TestEngineIO:
  442. # -------------------------------------------------------------------------
  443. # Functions
  444. # -------------------------------------------------------------------------
  445. # Options: Functions
  446. # void* SrcFileOpenUserData = nullptr; /* original C++ signature */
  447. src_file_open_user_data: Optional[Any] = None # (Optional) User data for SrcFileOpenFunc
  448. # void* ScreenCaptureUserData = nullptr; /* original C++ signature */
  449. screen_capture_user_data: Optional[Any] = None # (Optional) User data for ScreenCaptureFunc
  450. # Options: Main
  451. # bool ConfigSavedSettings = true; /* original C++ signature */
  452. config_saved_settings: bool = True # Load/Save settings in main context .ini file.
  453. # ImGuiTestRunSpeed ConfigRunSpeed = ImGuiTestRunSpeed_Fast; /* original C++ signature */
  454. config_run_speed: TestRunSpeed = TestRunSpeed_Fast # Run tests in fast/normal/cinematic mode
  455. # bool ConfigStopOnError = false; /* original C++ signature */
  456. config_stop_on_error: bool = False # Stop queued tests on test error
  457. # bool ConfigBreakOnError = false; /* original C++ signature */
  458. config_break_on_error: bool = False # Break debugger on test error by calling IM_DEBUG_BREAK()
  459. # bool ConfigKeepGuiFunc = false; /* original C++ signature */
  460. config_keep_gui_func: bool = False # Keep test GUI running at the end of the test
  461. # bool ConfigRestoreFocusAfterTests = true; /* original C++ signature */
  462. config_restore_focus_after_tests: bool = True # Restore focus back after running tests
  463. # bool ConfigCaptureEnabled = true; /* original C++ signature */
  464. config_capture_enabled: bool = (
  465. True # Master enable flags for capturing and saving captures. Disable to avoid e.g. lengthy saving of large PNG files.
  466. )
  467. # bool ConfigCaptureOnError = false; /* original C++ signature */
  468. config_capture_on_error: bool = False
  469. # bool ConfigNoThrottle = false; /* original C++ signature */
  470. config_no_throttle: bool = False # Disable vsync for performance measurement or fast test running
  471. # bool ConfigMouseDrawCursor = true; /* original C++ signature */
  472. config_mouse_draw_cursor: bool = True # Enable drawing of Dear ImGui software mouse cursor when running tests
  473. # float ConfigFixedDeltaTime = 0.0f; /* original C++ signature */
  474. config_fixed_delta_time: float = 0.0 # Use fixed delta time instead of calculating it from wall clock
  475. # int PerfStressAmount = 1; /* original C++ signature */
  476. perf_stress_amount: int = 1 # Integer to scale the amount of items submitted in test
  477. # Options: Logging
  478. # ImGuiTestVerboseLevel ConfigVerboseLevel = ImGuiTestVerboseLevel_Warning; /* original C++ signature */
  479. config_verbose_level: TestVerboseLevel = TestVerboseLevel_Warning
  480. # ImGuiTestVerboseLevel ConfigVerboseLevelOnError = ImGuiTestVerboseLevel_Info; /* original C++ signature */
  481. config_verbose_level_on_error: TestVerboseLevel = TestVerboseLevel_Info
  482. # bool ConfigLogToTTY = false; /* original C++ signature */
  483. config_log_to_tty: bool = False # Output log entries to TTY (in addition to Test Engine UI)
  484. # bool ConfigLogToDebugger = false; /* original C++ signature */
  485. config_log_to_debugger: bool = False # Output log entries to Debugger (in addition to Test Engine UI)
  486. # void* ConfigLogToFuncUserData = NULL; /* original C++ signature */
  487. config_log_to_func_user_data: Optional[Any] = None
  488. # Options: Speed of user simulation
  489. # float MouseSpeed = 600.0f; /* original C++ signature */
  490. mouse_speed: float = 600.0 # Mouse speed (pixel/second) when not running in fast mode
  491. # float MouseWobble = 0.25f; /* original C++ signature */
  492. mouse_wobble: float = (
  493. 0.25 # (0.0..1.0) How much wobble to apply to the mouse (pixels per pixel of move distance) when not running in fast mode
  494. )
  495. # float ScrollSpeed = 1400.0f; /* original C++ signature */
  496. scroll_speed: float = 1400.0 # Scroll speed (pixel/second) when not running in fast mode
  497. # float TypingSpeed = 20.0f; /* original C++ signature */
  498. typing_speed: float = 20.0 # Char input speed (characters/second) when not running in fast mode
  499. # float ActionDelayShort = 0.15f; /* original C++ signature */
  500. action_delay_short: float = 0.15 # Time between short actions
  501. # float ActionDelayStandard = 0.40f; /* original C++ signature */
  502. action_delay_standard: float = 0.40 # Time between most actions
  503. # Options: Screen/video capture
  504. # Options: Watchdog. Set values to FLT_MAX to disable.
  505. # Interactive GUI applications that may be slower tend to use higher values.
  506. # float ConfigWatchdogWarning = 30.0f; /* original C++ signature */
  507. config_watchdog_warning: float = 30.0 # Warn when a test exceed this time (in second)
  508. # float ConfigWatchdogKillTest = 60.0f; /* original C++ signature */
  509. config_watchdog_kill_test: float = 60.0 # Attempt to stop running a test when exceeding this time (in second)
  510. # float ConfigWatchdogKillApp = FLT_MAX; /* original C++ signature */
  511. config_watchdog_kill_app: float = sys.float_info.max # Stop application when exceeding this time (in second)
  512. # Options: Export
  513. # While you can manually call ImGuiTestEngine_Export(), registering filename/format here ensure the crash handler will always export if application crash.
  514. # Note: in Python, use export_result_filename_set() to set this value.
  515. # ImGuiTestEngineExportFormat ExportResultsFormat = (ImGuiTestEngineExportFormat)0; /* original C++ signature */
  516. export_results_format: TestEngineExportFormat = TestEngineExportFormat.j_unit_xml
  517. # #ifdef IMGUI_BUNDLE_PYTHON_API
  518. #
  519. # void ExportResultsFilename_Set(const char* filename); /* original C++ signature */
  520. def export_results_filename_set(self, filename: str) -> None:
  521. """Set ExportResultsFilename from Python
  522. (private API)
  523. """
  524. pass
  525. # #endif
  526. #
  527. # Options: Sanity Checks
  528. # bool CheckDrawDataIntegrity = false; /* original C++ signature */
  529. check_draw_data_integrity: bool = (
  530. False # Check ImDrawData integrity (buffer count, etc.). Currently cheap but may become a slow operation.
  531. )
  532. # -------------------------------------------------------------------------
  533. # Output
  534. # -------------------------------------------------------------------------
  535. # Output: State of test engine
  536. # bool IsRunningTests = false; /* original C++ signature */
  537. is_running_tests: bool = False
  538. # bool IsRequestingMaxAppSpeed = false; /* original C++ signature */
  539. is_requesting_max_app_speed: bool = (
  540. False # When running in fast mode: request app to skip vsync or even skip rendering if it wants
  541. )
  542. # bool IsCapturing = false; /* original C++ signature */
  543. is_capturing: bool = False # Capture is in progress
  544. # ImGuiTestEngineIO(bool ConfigSavedSettings = true, ImGuiTestRunSpeed ConfigRunSpeed = ImGuiTestRunSpeed_Fast, bool ConfigStopOnError = false, bool ConfigBreakOnError = false, bool ConfigKeepGuiFunc = false, bool ConfigRestoreFocusAfterTests = true, bool ConfigCaptureEnabled = true, bool ConfigCaptureOnError = false, bool ConfigNoThrottle = false, bool ConfigMouseDrawCursor = true, float ConfigFixedDeltaTime = 0.0f, int PerfStressAmount = 1, ImGuiTestVerboseLevel ConfigVerboseLevel = ImGuiTestVerboseLevel_Warning, ImGuiTestVerboseLevel ConfigVerboseLevelOnError = ImGuiTestVerboseLevel_Info, bool ConfigLogToTTY = false, bool ConfigLogToDebugger = false, float MouseSpeed = 600.0f, float MouseWobble = 0.25f, float ScrollSpeed = 1400.0f, float TypingSpeed = 20.0f, float ActionDelayShort = 0.15f, float ActionDelayStandard = 0.40f, float ConfigWatchdogWarning = 30.0f, float ConfigWatchdogKillTest = 60.0f, float ConfigWatchdogKillApp = FLT_MAX, ImGuiTestEngineExportFormat ExportResultsFormat = (ImGuiTestEngineExportFormat)0, bool CheckDrawDataIntegrity = false, bool IsRunningTests = false, bool IsRequestingMaxAppSpeed = false, bool IsCapturing = false); /* original C++ signature */
  545. def __init__(
  546. self,
  547. config_saved_settings: bool = True,
  548. config_run_speed: TestRunSpeed = TestRunSpeed_Fast,
  549. config_stop_on_error: bool = False,
  550. config_break_on_error: bool = False,
  551. config_keep_gui_func: bool = False,
  552. config_restore_focus_after_tests: bool = True,
  553. config_capture_enabled: bool = True,
  554. config_capture_on_error: bool = False,
  555. config_no_throttle: bool = False,
  556. config_mouse_draw_cursor: bool = True,
  557. config_fixed_delta_time: float = 0.0,
  558. perf_stress_amount: int = 1,
  559. config_verbose_level: TestVerboseLevel = TestVerboseLevel_Warning,
  560. config_verbose_level_on_error: TestVerboseLevel = TestVerboseLevel_Info,
  561. config_log_to_tty: bool = False,
  562. config_log_to_debugger: bool = False,
  563. mouse_speed: float = 600.0,
  564. mouse_wobble: float = 0.25,
  565. scroll_speed: float = 1400.0,
  566. typing_speed: float = 20.0,
  567. action_delay_short: float = 0.15,
  568. action_delay_standard: float = 0.40,
  569. config_watchdog_warning: float = 30.0,
  570. config_watchdog_kill_test: float = 60.0,
  571. config_watchdog_kill_app: float = sys.float_info.max,
  572. export_results_format: TestEngineExportFormat = TestEngineExportFormat.j_unit_xml,
  573. check_draw_data_integrity: bool = False,
  574. is_running_tests: bool = False,
  575. is_requesting_max_app_speed: bool = False,
  576. is_capturing: bool = False,
  577. ) -> None:
  578. """Auto-generated default constructor with named params"""
  579. pass
  580. # -------------------------------------------------------------------------
  581. # ImGuiTestItemInfo
  582. # -------------------------------------------------------------------------
  583. class TestItemInfo:
  584. """Information about a given item or window, result of an ItemInfo() or WindowInfo() query"""
  585. # ImGuiID ID = 0; /* original C++ signature */
  586. id_: ID = 0 # Item ID
  587. # ImGuiWindow* Window = nullptr; /* original C++ signature */
  588. window: Optional[Window] = None # Item Window
  589. # int TimestampMain; /* original C++ signature */
  590. timestamp_main: int # Timestamp of main result (all fields)
  591. # int TimestampStatus; /* original C++ signature */
  592. timestamp_status: int # Timestamp of StatusFlags
  593. # ImGuiID ParentID = 0; /* original C++ signature */
  594. parent_id: ID = 0 # Item Parent ID (value at top of the ID stack)
  595. # ImRect RectFull = ImRect(); /* original C++ signature */
  596. rect_full: ImRect = ImRect() # Item Rectangle
  597. # ImRect RectClipped = ImRect(); /* original C++ signature */
  598. rect_clipped: ImRect = ImRect() # Item Rectangle (clipped with window->ClipRect at time of item submission)
  599. # ImGuiItemFlags ItemFlags = 0; /* original C++ signature */
  600. item_flags: ItemFlags = 0 # Item flags
  601. # ImGuiItemFlags InFlags = 0; // Item flags (OBSOLETE: before 2024/10/17 ItemFlags was called InFlags)
  602. # ImGuiItemStatusFlags StatusFlags = 0; /* original C++ signature */
  603. status_flags: ItemStatusFlags = (
  604. 0 # Item Status flags (fully updated for some items only, compare TimestampStatus to FrameCount)
  605. )
  606. # ImGuiTestItemInfo() { memset(this, 0, sizeof(*this)); } /* original C++ signature */
  607. def __init__(self) -> None:
  608. pass
  609. class TestItemList:
  610. """Result of an GatherItems() query"""
  611. # void Clear() { Pool.Clear(); } /* original C++ signature */
  612. def clear(self) -> None:
  613. """(private API)"""
  614. pass
  615. # void Reserve(int capacity) { Pool.Reserve(capacity); } /* original C++ signature */
  616. def reserve(self, capacity: int) -> None:
  617. """(private API)"""
  618. pass
  619. # int GetSize() const { return Pool.GetMapSize(); } /* original C++ signature */
  620. def get_size(self) -> int:
  621. """(private API)"""
  622. pass
  623. # const ImGuiTestItemInfo* GetByIndex(int n) { return Pool.GetByIndex(n); } /* original C++ signature */
  624. def get_by_index(self, n: int) -> TestItemInfo:
  625. """(private API)"""
  626. pass
  627. # const ImGuiTestItemInfo* GetByID(ImGuiID id) { return Pool.GetByKey(id); } /* original C++ signature */
  628. def get_by_id(self, id_: ID) -> TestItemInfo:
  629. """(private API)"""
  630. pass
  631. # For range-for
  632. # size_t size() const { return (size_t)Pool.GetMapSize(); } /* original C++ signature */
  633. def size(self) -> int:
  634. """(private API)"""
  635. pass
  636. # const ImGuiTestItemInfo* begin() const { return Pool.Buf.begin(); } /* original C++ signature */
  637. def begin(self) -> TestItemInfo:
  638. """(private API)"""
  639. pass
  640. # const ImGuiTestItemInfo* end() const { return Pool.Buf.end(); } /* original C++ signature */
  641. def end(self) -> TestItemInfo:
  642. """(private API)"""
  643. pass
  644. # const ImGuiTestItemInfo* operator[] (size_t n) { return &Pool.Buf[(int)n]; } /* original C++ signature */
  645. def __getitem__(self, n: int) -> TestItemInfo:
  646. """(private API)"""
  647. pass
  648. # ImGuiTestItemList(); /* original C++ signature */
  649. def __init__(self) -> None:
  650. """Auto-generated default constructor"""
  651. pass
  652. # -------------------------------------------------------------------------
  653. # ImGuiTestLog: store textual output of one given Test.
  654. # -------------------------------------------------------------------------
  655. class TestLogLineInfo:
  656. # ImGuiTestVerboseLevel Level; /* original C++ signature */
  657. level: TestVerboseLevel
  658. # int LineOffset; /* original C++ signature */
  659. line_offset: int
  660. # ImGuiTestLogLineInfo(ImGuiTestVerboseLevel Level = ImGuiTestVerboseLevel(), int LineOffset = int()); /* original C++ signature */
  661. def __init__(self, level: TestVerboseLevel = TestVerboseLevel.warning, line_offset: int = int()) -> None:
  662. """Auto-generated default constructor with named params"""
  663. pass
  664. class TestLog:
  665. # ImGuiTextBuffer Buffer; /* original C++ signature */
  666. buffer: TextBuffer
  667. # ImGuiTestLog() {} /* original C++ signature */
  668. def __init__(self) -> None:
  669. """Functions"""
  670. pass
  671. # bool IsEmpty() const { return Buffer.empty(); } /* original C++ signature */
  672. def is_empty(self) -> bool:
  673. """(private API)"""
  674. pass
  675. # const char* GetText() { return Buffer.c_str(); } /* original C++ signature */
  676. def get_text(self) -> str:
  677. """(private API)"""
  678. pass
  679. # int GetTextLen() { return Buffer.size(); } /* original C++ signature */
  680. def get_text_len(self) -> int:
  681. """(private API)"""
  682. pass
  683. # void Clear(); /* original C++ signature */
  684. def clear(self) -> None:
  685. """(private API)"""
  686. pass
  687. # int ExtractLinesForVerboseLevels(ImGuiTestVerboseLevel level_min, ImGuiTestVerboseLevel level_max, ImGuiTextBuffer* out_buffer); /* original C++ signature */
  688. def extract_lines_for_verbose_levels(
  689. self, level_min: TestVerboseLevel, level_max: TestVerboseLevel, out_buffer: TextBuffer
  690. ) -> int:
  691. """Extract log contents filtered per log-level.
  692. Output:
  693. - If 'buffer != None': all extracted lines are appended to 'buffer'. Use 'buffer->c_str()' on your side to obtain the text.
  694. - Return value: number of lines extracted (should be equivalent to number of '\n' inside buffer->c_str()).
  695. - You may call the function with buffer == None to only obtain a count without getting the data.
  696. Verbose levels are inclusive:
  697. - To get ONLY Error: Use level_min == ImGuiTestVerboseLevel_Error, level_max = ImGuiTestVerboseLevel_Error
  698. - To get ONLY Error and Warnings: Use level_min == ImGuiTestVerboseLevel_Error, level_max = ImGuiTestVerboseLevel_Warning
  699. - To get All Errors, Warnings, Debug... Use level_min == ImGuiTestVerboseLevel_Error, level_max = ImGuiTestVerboseLevel_Trace
  700. (private API)
  701. """
  702. pass
  703. # void UpdateLineOffsets(ImGuiTestEngineIO* engine_io, ImGuiTestVerboseLevel level, const char* start); /* original C++ signature */
  704. def update_line_offsets(self, engine_io: TestEngineIO, level: TestVerboseLevel, start: str) -> None:
  705. """[Internal]
  706. (private API)
  707. """
  708. pass
  709. # -------------------------------------------------------------------------
  710. # ImGuiTest
  711. # -------------------------------------------------------------------------
  712. # Wraps a placement new of a given type (where 'buffer' is the allocated memory)
  713. class TestOutput:
  714. """Storage for the output of a test run"""
  715. # ImGuiTestStatus Status = ImGuiTestStatus_Unknown; /* original C++ signature */
  716. status: TestStatus = TestStatus_Unknown
  717. # ImGuiTestLog Log; /* original C++ signature */
  718. log: TestLog
  719. # ImU64 StartTime = 0; /* original C++ signature */
  720. start_time: ImU64 = 0
  721. # ImU64 EndTime = 0; /* original C++ signature */
  722. end_time: ImU64 = 0
  723. # ImGuiTestOutput(ImGuiTestStatus Status = ImGuiTestStatus_Unknown, ImGuiTestLog Log = ImGuiTestLog(), ImU64 StartTime = 0, ImU64 EndTime = 0); /* original C++ signature */
  724. def __init__(
  725. self,
  726. status: TestStatus = TestStatus_Unknown,
  727. log: Optional[TestLog] = None,
  728. start_time: ImU64 = 0,
  729. end_time: ImU64 = 0,
  730. ) -> None:
  731. """Auto-generated default constructor with named params
  732. Python bindings defaults:
  733. If Log is None, then its default value will be: TestLog()
  734. """
  735. pass
  736. class Test:
  737. """Storage for one test"""
  738. # Test Definition
  739. # Str30 Category; /* original C++ signature */
  740. category: Str30 # Stored on the stack if len<30
  741. # Str30 Name; /* original C++ signature */
  742. name: Str30 # Stored on the stack if len<30
  743. # ImGuiTestGroup Group = ImGuiTestGroup_Unknown; /* original C++ signature */
  744. group: TestGroup = TestGroup_Unknown # Coarse groups: 'Tests' or 'Perf'
  745. # int ArgVariant = 0; /* original C++ signature */
  746. arg_variant: int = (
  747. 0 # User parameter. Generally we use it to run variations of a same test by sharing GuiFunc/TestFunc
  748. )
  749. # ImGuiTestFlags Flags = ImGuiTestFlags_None; /* original C++ signature */
  750. flags: TestFlags = TestFlags_None # See ImGuiTestFlags_
  751. # Function_TestGui GuiFunc = nullptr; /* original C++ signature */
  752. gui_func: Function_TestGui = (
  753. None # GUI function (optional if your test are running over an existing GUI application)
  754. )
  755. # Function_TestRunner TestFunc = nullptr; /* original C++ signature */
  756. test_func: Function_TestRunner = None # Test driving function
  757. # Function_TestRunner TeardownFunc = nullptr; /* original C++ signature */
  758. teardown_func: Function_TestRunner = (
  759. None # Teardown driving function, executed after TestFunc _regardless_ of TestFunc failing.
  760. )
  761. # void* UserData = nullptr; /* original C++ signature */
  762. user_data: Optional[Any] = (
  763. None # General purpose user data (if assigning capturing lambdas on GuiFunc/TestFunc you may not need to use this)
  764. )
  765. # ImVector<ImGuiTestRunTask> Dependencies; // Registered via AddDependencyTest(), ran automatically before our test. This is a simpler wrapper to calling ctx->RunChildTest()
  766. # Sources information (exposed in UI)
  767. # Str256 SourceFile; /* original C++ signature */
  768. source_file: Str256 # __FILE__
  769. # int SourceLine = 0; /* original C++ signature */
  770. source_line: int = 0 # __LINE__
  771. # int SourceLineEnd = 0; /* original C++ signature */
  772. source_line_end: int = 0 # end of line (when calculated by ImGuiTestEngine_StartCalcSourceLineEnds())
  773. # ImGuiTestOutput Output; /* original C++ signature */
  774. # Last Test Output/Status
  775. # (this is the only part that may change after registration)
  776. output: TestOutput
  777. # User variables (which are instantiated when running the test)
  778. # Setup after test registration with SetVarsDataType<>(), access instance during test with GetVars<>().
  779. # This is mostly useful to communicate between GuiFunc and TestFunc. If you don't use both you may not want to use it!
  780. # size_t VarsSize = 0; /* original C++ signature */
  781. vars_size: int = 0
  782. # void* VarsPostConstructorUserFn = nullptr; /* original C++ signature */
  783. vars_post_constructor_user_fn: Optional[Any] = None
  784. # ImGuiTest() {} /* original C++ signature */
  785. def __init__(self) -> None:
  786. """Functions"""
  787. pass
  788. class TestRunTask:
  789. """Stored in test queue"""
  790. # ImGuiTest* Test = nullptr; /* original C++ signature */
  791. test: Optional[Test] = None
  792. # ImGuiTestRunFlags RunFlags = ImGuiTestRunFlags_None; /* original C++ signature */
  793. run_flags: TestRunFlags = TestRunFlags_None
  794. # ImGuiTestRunTask(ImGuiTestRunFlags RunFlags = ImGuiTestRunFlags_None); /* original C++ signature */
  795. def __init__(self, run_flags: TestRunFlags = TestRunFlags_None) -> None:
  796. """Auto-generated default constructor with named params"""
  797. pass
  798. # -------------------------------------------------------------------------
  799. #################### </generated_from:imgui_te_engine.h> ####################
  800. #################### <generated_from:imgui_te_context.h> ####################
  801. # dear imgui test engine
  802. # (context when a running test + end user automation API)
  803. # This is the main (if not only) interface that your Tests will be using.
  804. # This file is governed by the "Dear ImGui Test Engine License".
  805. # Details of the license are provided in the LICENSE.txt file in the same directory.
  806. #
  807. #
  808. # Index of this file:
  809. # // [SECTION] Header mess, warnings
  810. # // [SECTION] Forward declarations
  811. # // [SECTION] ImGuiTestRef
  812. # // [SECTION] Helper keys
  813. # // [SECTION] ImGuiTestContext related Flags/Enumerations
  814. # // [SECTION] ImGuiTestGenericVars, ImGuiTestGenericItemStatus
  815. # // [SECTION] ImGuiTestContext
  816. # // [SECTION] Debugging macros: IM_SUSPEND_TESTFUNC()
  817. # // [SECTION] Testing/Checking macros: IM_CHECK(), IM_ERRORF() etc.
  818. #
  819. #
  820. # -------------------------------------------------------------------------
  821. # [SECTION] Header mess, warnings
  822. # -------------------------------------------------------------------------
  823. # Undo some of the damage done by <windows.h>
  824. # -------------------------------------------------------------------------
  825. # [SECTION] Forward declarations
  826. # -------------------------------------------------------------------------
  827. # This file
  828. # External: imgui
  829. # External: test engine
  830. # -------------------------------------------------------------------------
  831. # [SECTION] ImGuiTestRef
  832. # -------------------------------------------------------------------------
  833. class TestRef:
  834. """Weak reference to an Item/Window given an hashed ID _or_ a string path ID.
  835. This is most often passed as argument to function and generally has a very short lifetime.
  836. Documentation: https://github.com/ocornut/imgui_test_engine/wiki/Named-References
  837. (SUGGESTION: add those constructors to "VA Step Filter" (Visual Assist) or a .natstepfilter file (Visual Studio) so they are skipped by F11 (StepInto)
  838. """
  839. # ImGuiID ID; /* original C++ signature */
  840. id_: ID # Pre-hashed ID
  841. # ImGuiTestRef() { ID = 0; Path = Str(""); } /* original C++ signature */
  842. @overload
  843. def __init__(self) -> None:
  844. pass
  845. # ImGuiTestRef(ImGuiID id) { ID = id; Path = Str(""); } /* original C++ signature */
  846. @overload
  847. def __init__(self, id_: ID) -> None:
  848. pass
  849. # ImGuiTestRef(const char* path) { ID = 0; Path = Str(path); } /* original C++ signature */
  850. @overload
  851. def __init__(self, path: str) -> None:
  852. pass
  853. # bool IsEmpty() const { return ID == 0 && Path.length() == 0; } /* original C++ signature */
  854. def is_empty(self) -> bool:
  855. """(private API)"""
  856. pass
  857. class TestRefDesc:
  858. """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)
  859. (The size is arbitrary, this is only used for logging info the user/debugger)
  860. """
  861. # const char* c_str() { return Buf; } /* original C++ signature */
  862. def c_str(self) -> str:
  863. """(private API)"""
  864. pass
  865. # ImGuiTestRefDesc(const ImGuiTestRef& ref); /* original C++ signature */
  866. @overload
  867. def __init__(self, ref: Union[TestRef, str]) -> None:
  868. pass
  869. # ImGuiTestRefDesc(const ImGuiTestRef& ref, const ImGuiTestItemInfo& item); /* original C++ signature */
  870. @overload
  871. def __init__(self, ref: Union[TestRef, str], item: TestItemInfo) -> None:
  872. pass
  873. # -------------------------------------------------------------------------
  874. # [SECTION] ImGuiTestContext related Flags/Enumerations
  875. # -------------------------------------------------------------------------
  876. class TestAction(enum.IntFlag):
  877. """Named actions. Generally you will call the named helpers e.g. ItemClick(). This is used by shared/low-level functions such as ItemAction()."""
  878. # ImGuiTestAction_Unknown = 0, /* original C++ signature */
  879. unknown = enum.auto() # (= 0)
  880. # ImGuiTestAction_Hover, /* original C++ signature */
  881. hover = enum.auto() # (= 1) # Move mouse
  882. # ImGuiTestAction_Click, /* original C++ signature */
  883. click = enum.auto() # (= 2) # Move mouse and click
  884. # ImGuiTestAction_DoubleClick, /* original C++ signature */
  885. double_click = enum.auto() # (= 3) # Move mouse and double-click
  886. # ImGuiTestAction_Check, /* original C++ signature */
  887. check = (
  888. enum.auto()
  889. ) # (= 4) # Check item if unchecked (Checkbox, MenuItem or any widget reporting ImGuiItemStatusFlags_Checkable)
  890. # ImGuiTestAction_Uncheck, /* original C++ signature */
  891. uncheck = enum.auto() # (= 5) # Uncheck item if checked
  892. # ImGuiTestAction_Open, /* original C++ signature */
  893. open = (
  894. enum.auto()
  895. ) # (= 6) # Open item if closed (TreeNode, BeginMenu or any widget reporting ImGuiItemStatusFlags_Openable)
  896. # ImGuiTestAction_Close, /* original C++ signature */
  897. close = enum.auto() # (= 7) # Close item if opened
  898. # ImGuiTestAction_Input, /* original C++ signature */
  899. input = (
  900. enum.auto()
  901. ) # (= 8) # Start text inputing into a field (e.g. CTRL+Click on Drags/Slider, click on InputText etc.)
  902. # ImGuiTestAction_NavActivate, /* original C++ signature */
  903. nav_activate = enum.auto() # (= 9) # Activate item with navigation
  904. # ImGuiTestAction_COUNT /* original C++ signature */
  905. # }
  906. count = enum.auto() # (= 10)
  907. class TestOpFlags_(enum.IntFlag):
  908. """Generic flags for many ImGuiTestContext functions
  909. Some flags are only supported by a handful of functions. Check function headers for list of supported flags.
  910. """
  911. # ImGuiTestOpFlags_None = 0, /* original C++ signature */
  912. none = enum.auto() # (= 0)
  913. # ImGuiTestOpFlags_NoCheckHoveredId = 1 << 1, /* original C++ signature */
  914. no_check_hovered_id = (
  915. enum.auto()
  916. ) # (= 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.
  917. # ImGuiTestOpFlags_NoError = 1 << 2, /* original C++ signature */
  918. no_error = (
  919. enum.auto()
  920. ) # (= 1 << 2) # Don't abort/error e.g. if the item cannot be found or the operation doesn't succeed.
  921. # ImGuiTestOpFlags_NoFocusWindow = 1 << 3, /* original C++ signature */
  922. no_focus_window = enum.auto() # (= 1 << 3) # Don't focus window when aiming at an item
  923. # ImGuiTestOpFlags_NoAutoUncollapse = 1 << 4, /* original C++ signature */
  924. no_auto_uncollapse = (
  925. enum.auto()
  926. ) # (= 1 << 4) # Disable automatically uncollapsing windows (useful when specifically testing Collapsing behaviors)
  927. # ImGuiTestOpFlags_NoAutoOpenFullPath = 1 << 5, /* original C++ signature */
  928. no_auto_open_full_path = (
  929. enum.auto()
  930. ) # (= 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.
  931. # ImGuiTestOpFlags_NoYield = 1 << 6, /* original C++ signature */
  932. no_yield = (
  933. enum.auto()
  934. ) # (= 1 << 6) # Don't yield (only supported by a few functions), in case you need to manage rigorous per-frame timing.
  935. # ImGuiTestOpFlags_IsSecondAttempt = 1 << 7, /* original C++ signature */
  936. is_second_attempt = enum.auto() # (= 1 << 7) # Used by recursing functions to indicate a second attempt
  937. # ImGuiTestOpFlags_MoveToEdgeL = 1 << 8, /* original C++ signature */
  938. move_to_edge_l = (
  939. enum.auto()
  940. ) # (= 1 << 8) # Simple Dumb aiming helpers to test widget that care about clicking position. May need to replace will better functionalities.
  941. # ImGuiTestOpFlags_MoveToEdgeR = 1 << 9, /* original C++ signature */
  942. move_to_edge_r = enum.auto() # (= 1 << 9)
  943. # ImGuiTestOpFlags_MoveToEdgeU = 1 << 10, /* original C++ signature */
  944. move_to_edge_u = enum.auto() # (= 1 << 10)
  945. # ImGuiTestOpFlags_MoveToEdgeD = 1 << 11, /* original C++ signature */
  946. move_to_edge_d = enum.auto() # (= 1 << 11)
  947. # ImGuiTestOpFlags_NoScroll = 1 << 12, /* original C++ signature */
  948. no_scroll = enum.auto() # (= 1 << 12) # Disable automatically scrolling to reach an item.
  949. class TestActionFilter:
  950. """Advanced filtering for ItemActionAll()"""
  951. # int MaxDepth; /* original C++ signature */
  952. max_depth: int
  953. # int MaxPasses; /* original C++ signature */
  954. max_passes: int
  955. # const int* MaxItemCountPerDepth; /* original C++ signature */
  956. max_item_count_per_depth: int # (const)
  957. # ImGuiItemStatusFlags RequireAllStatusFlags; /* original C++ signature */
  958. require_all_status_flags: ItemStatusFlags
  959. # ImGuiItemStatusFlags RequireAnyStatusFlags; /* original C++ signature */
  960. require_any_status_flags: ItemStatusFlags
  961. # ImGuiTestActionFilter() { MaxDepth = -1; MaxPasses = -1; MaxItemCountPerDepth = nullptr; RequireAllStatusFlags = RequireAnyStatusFlags = 0; } /* original C++ signature */
  962. def __init__(self) -> None:
  963. pass
  964. # -------------------------------------------------------------------------
  965. # [SECTION] ImGuiTestGenericVars, ImGuiTestGenericItemStatus
  966. # -------------------------------------------------------------------------
  967. class TestGenericItemStatus:
  968. """Helper struct to store various query-able state of an item.
  969. This facilitate interactions between GuiFunc and TestFunc, since those state are frequently used.
  970. """
  971. # int RetValue; /* original C++ signature */
  972. ret_value: int # return value
  973. # int Hovered; /* original C++ signature */
  974. hovered: int # result of IsItemHovered()
  975. # int HoveredAllowDisabled; /* original C++ signature */
  976. hovered_allow_disabled: int # result of IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)
  977. # int Active; /* original C++ signature */
  978. active: int # result of IsItemActive()
  979. # int Focused; /* original C++ signature */
  980. focused: int # result of IsItemFocused()
  981. # int Clicked; /* original C++ signature */
  982. clicked: int # result of IsItemClicked()
  983. # int Visible; /* original C++ signature */
  984. visible: int # result of IsItemVisible()
  985. # int Edited; /* original C++ signature */
  986. edited: int # result of IsItemEdited()
  987. # int Activated; /* original C++ signature */
  988. activated: int # result of IsItemActivated()
  989. # int Deactivated; /* original C++ signature */
  990. deactivated: int # result of IsItemDeactivated()
  991. # int DeactivatedAfterEdit; /* original C++ signature */
  992. deactivated_after_edit: int # result of IsItemDeactivatedAfterEdit()
  993. # ImGuiTestGenericItemStatus() { Clear(); } /* original C++ signature */
  994. def __init__(self) -> None:
  995. pass
  996. # void Clear() { memset(this, 0, sizeof(*this)); } /* original C++ signature */
  997. def clear(self) -> None:
  998. """(private API)"""
  999. pass
  1000. # void QuerySet(bool ret_val = false) { Clear(); QueryInc(ret_val); } /* original C++ signature */
  1001. def query_set(self, ret_val: bool = False) -> None:
  1002. """(private API)"""
  1003. pass
  1004. # void QueryInc(bool ret_val = false) { RetValue += ret_val; Hovered += ImGui::IsItemHovered(); HoveredAllowDisabled += ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled); Active += ImGui::IsItemActive(); Focused += ImGui::IsItemFocused(); Clicked += ImGui::IsItemClicked(); Visible += ImGui::IsItemVisible(); Edited += ImGui::IsItemEdited(); Activated += ImGui::IsItemActivated(); Deactivated += ImGui::IsItemDeactivated(); DeactivatedAfterEdit += ImGui::IsItemDeactivatedAfterEdit(); } /* original C++ signature */
  1005. def query_inc(self, ret_val: bool = False) -> None:
  1006. """(private API)"""
  1007. pass
  1008. # void Draw() { ImGui::Text("Ret: %d, Hovered: %d, Active: %d, Focused: %d\nClicked: %d, Visible: %d, Edited: %d\nActivated: %d, Deactivated: %d, DeactivatedAfterEdit: %d", RetValue, Hovered, Active, Focused, Clicked, Visible, Edited, Activated, Deactivated, DeactivatedAfterEdit); } /* original C++ signature */
  1009. def draw(self) -> None:
  1010. """(private API)"""
  1011. pass
  1012. class TestGenericVars:
  1013. """Generic structure with various storage fields.
  1014. This is useful for tests to quickly share data between GuiFunc and TestFunc without creating custom data structure.
  1015. If those fields are not enough: using test->SetVarsDataType<>() + ctx->GetVars<>() it is possible to store custom data.
  1016. """
  1017. # Generic storage with a bit of semantic to make user/test code look neater
  1018. # int Step; /* original C++ signature */
  1019. step: int
  1020. # int Count; /* original C++ signature */
  1021. count: int
  1022. # ImGuiID DockId; /* original C++ signature */
  1023. dock_id: ID
  1024. # ImGuiID OwnerId; /* original C++ signature */
  1025. owner_id: ID
  1026. # ImVec2 WindowSize; /* original C++ signature */
  1027. window_size: ImVec2
  1028. # ImGuiWindowFlags WindowFlags; /* original C++ signature */
  1029. window_flags: WindowFlags
  1030. # ImGuiTableFlags TableFlags; /* original C++ signature */
  1031. table_flags: TableFlags
  1032. # ImGuiPopupFlags PopupFlags; /* original C++ signature */
  1033. popup_flags: PopupFlags
  1034. # ImGuiInputTextFlags InputTextFlags; /* original C++ signature */
  1035. input_text_flags: InputTextFlags
  1036. # ImGuiTestGenericItemStatus Status; /* original C++ signature */
  1037. status: TestGenericItemStatus
  1038. # bool ShowWindow1, /* original C++ signature */
  1039. show_window1: bool
  1040. # ShowWindow2; /* original C++ signature */
  1041. show_window2: bool
  1042. # bool UseClipper; /* original C++ signature */
  1043. use_clipper: bool
  1044. # bool UseViewports; /* original C++ signature */
  1045. use_viewports: bool
  1046. # float Width; /* original C++ signature */
  1047. width: float
  1048. # ImVec2 Pos; /* original C++ signature */
  1049. pos: ImVec2
  1050. # ImVec2 Pivot; /* original C++ signature */
  1051. pivot: ImVec2
  1052. # ImVec2 ItemSize; /* original C++ signature */
  1053. item_size: ImVec2
  1054. # ImVec4 Color1, /* original C++ signature */
  1055. color1: ImVec4
  1056. # Color2; /* original C++ signature */
  1057. color2: ImVec4
  1058. # Generic unnamed storage
  1059. # int Int1, /* original C++ signature */
  1060. int1: int
  1061. # Int2, /* original C++ signature */
  1062. int2: int
  1063. # IntArray[10]; /* original C++ signature */
  1064. int_array: np.ndarray # ndarray[type=int, size=10]
  1065. # float Float1, /* original C++ signature */
  1066. float1: float
  1067. # Float2, /* original C++ signature */
  1068. float2: float
  1069. # FloatArray[10]; /* original C++ signature */
  1070. float_array: np.ndarray # ndarray[type=float, size=10]
  1071. # bool Bool1, /* original C++ signature */
  1072. bool1: bool
  1073. # Bool2, /* original C++ signature */
  1074. bool2: bool
  1075. # BoolArray[10]; /* original C++ signature */
  1076. bool_array: np.ndarray # ndarray[type=bool, size=10]
  1077. # ImGuiID Id, /* original C++ signature */
  1078. id_: ID
  1079. # IdArray[10]; /* original C++ signature */
  1080. id_array: np.ndarray # ndarray[type=ImGuiID, size=10]
  1081. # ImGuiTestGenericVars() { Clear(); } /* original C++ signature */
  1082. def __init__(self) -> None:
  1083. pass
  1084. # void Clear() { memset(this, 0, sizeof(*this)); } /* original C++ signature */
  1085. def clear(self) -> None:
  1086. """(private API)"""
  1087. pass
  1088. # -------------------------------------------------------------------------
  1089. # [SECTION] ImGuiTestContext
  1090. # Context for a running ImGuiTest
  1091. # This is the interface that most tests will interact with.
  1092. # -------------------------------------------------------------------------
  1093. class TestContext:
  1094. # User variables
  1095. # ImGuiTestGenericVars GenericVars; /* original C++ signature */
  1096. generic_vars: TestGenericVars # Generic variables holder for convenience.
  1097. # void* UserVars = nullptr; /* original C++ signature */
  1098. user_vars: Optional[Any] = None # Access using ctx->GetVars<Type>(). Setup with test->SetVarsDataType<>().
  1099. # Public fields
  1100. # ImGuiContext* UiContext = nullptr; /* original C++ signature */
  1101. ui_context: Optional[Context] = None # UI context
  1102. # ImGuiTestEngineIO* EngineIO = nullptr; /* original C++ signature */
  1103. engine_io: Optional[TestEngineIO] = None # Test Engine IO/settings
  1104. # ImGuiTest* Test = nullptr; /* original C++ signature */
  1105. test: Optional[Test] = None # Test currently running
  1106. # ImGuiTestOutput* TestOutput = nullptr; /* original C++ signature */
  1107. test_output: Optional[TestOutput] = None # Test output (generally == &Test->Output while executing TestFunc)
  1108. # ImGuiTestOpFlags OpFlags = ImGuiTestOpFlags_None; /* original C++ signature */
  1109. op_flags: TestOpFlags = (
  1110. TestOpFlags_None # Flags affecting all operation (supported: ImGuiTestOpFlags_NoAutoUncollapse)
  1111. )
  1112. # int PerfStressAmount = 0; /* original C++ signature */
  1113. perf_stress_amount: int = 0 # Convenience copy of engine->IO.PerfStressAmount
  1114. # int FrameCount = 0; /* original C++ signature */
  1115. frame_count: int = 0 # Test frame count (restarts from zero every time)
  1116. # int FirstTestFrameCount = 0; /* original C++ signature */
  1117. first_test_frame_count: int = (
  1118. 0 # First frame where TestFunc is running (after warm-up frame). This is generally -1 or 0 depending on whether we have warm up enabled
  1119. )
  1120. # bool FirstGuiFrame = false; /* original C++ signature */
  1121. first_gui_frame: bool = False
  1122. # bool HasDock = false; /* original C++ signature */
  1123. has_dock: bool = False # #ifdef IMGUI_HAS_DOCK expressed in an easier to test value
  1124. # -------------------------------------------------------------------------
  1125. # [Internal Fields]
  1126. # -------------------------------------------------------------------------
  1127. # ImGuiTestEngine* Engine = nullptr; /* original C++ signature */
  1128. engine: Optional[TestEngine] = None
  1129. # ImGuiTestInputs* Inputs = nullptr; /* original C++ signature */
  1130. inputs: Optional[TestInputs] = None
  1131. # ImGuiTestRunFlags RunFlags = ImGuiTestRunFlags_None; /* original C++ signature */
  1132. run_flags: TestRunFlags = TestRunFlags_None
  1133. # ImGuiTestActiveFunc ActiveFunc = ImGuiTestActiveFunc_None; /* original C++ signature */
  1134. active_func: TestActiveFunc = TestActiveFunc_None # None/GuiFunc/TestFunc
  1135. # double RunningTime = 0.0; /* original C++ signature */
  1136. running_time: float = 0.0 # Amount of wall clock time the Test has been running. Used by safety watchdog.
  1137. # int ActionDepth = 0; /* original C++ signature */
  1138. action_depth: int = 0 # Nested depth of ctx-> function calls (used to decorate log)
  1139. # int CaptureCounter = 0; /* original C++ signature */
  1140. capture_counter: int = 0 # Number of captures
  1141. # int ErrorCounter = 0; /* original C++ signature */
  1142. error_counter: int = 0 # Number of errors (generally this maxxes at 1 as most functions will early out)
  1143. # bool Abort = false; /* original C++ signature */
  1144. abort: bool = False
  1145. # double PerfRefDt = -1.0; /* original C++ signature */
  1146. perf_ref_dt: float = -1.0
  1147. # int PerfIterations = 400; /* original C++ signature */
  1148. perf_iterations: int = 400 # Number of frames for PerfCapture() measurements
  1149. # ImGuiID RefID = 0; /* original C++ signature */
  1150. ref_id: ID = 0 # Reference ID over which all named references are based
  1151. # ImGuiID RefWindowID = 0; /* original C++ signature */
  1152. ref_window_id: ID = 0 # ID of a window that contains RefID item
  1153. # ImGuiInputSource InputMode = ImGuiInputSource_Mouse; /* original C++ signature */
  1154. input_mode: InputSource = InputSource_Mouse # Prefer interacting with mouse/keyboard/gamepad
  1155. # ImVector<char> TempString; /* original C++ signature */
  1156. temp_string: ImVector_char
  1157. # ImVector<char> Clipboard; /* original C++ signature */
  1158. clipboard: ImVector_char # Private clipboard for the test instance
  1159. # ImVector<ImGuiWindow*> ForeignWindowsToHide; /* original C++ signature */
  1160. foreign_windows_to_hide: ImVector_Window_ptr
  1161. # ImGuiTestItemInfo DummyItemInfoNull; /* original C++ signature */
  1162. dummy_item_info_null: TestItemInfo # Storage for ItemInfoNull()
  1163. # bool CachedLinesPrintedToTTY = false; /* original C++ signature */
  1164. cached_lines_printed_to_tty: bool = False
  1165. # -------------------------------------------------------------------------
  1166. # Public API
  1167. # -------------------------------------------------------------------------
  1168. # Main control
  1169. # void Finish(ImGuiTestStatus status = ImGuiTestStatus_Success); /* original C++ signature */
  1170. def finish(self, status: TestStatus = TestStatus_Success) -> None:
  1171. """(private API)
  1172. Set test status and stop running. Usually called when running test logic from GuiFunc() only.
  1173. """
  1174. pass
  1175. # ImGuiTestStatus RunChildTest(const char* test_name, ImGuiTestRunFlags flags = 0); /* original C++ signature */
  1176. def run_child_test(self, test_name: str, flags: TestRunFlags = 0) -> TestStatus:
  1177. """(private API)
  1178. [Experimental] Run another test from the current test.
  1179. """
  1180. pass
  1181. # Main status queries
  1182. # bool IsError() const { return TestOutput->Status == ImGuiTestStatus_Error || Abort; } /* original C++ signature */
  1183. def is_error(self) -> bool:
  1184. """(private API)"""
  1185. pass
  1186. # bool IsWarmUpGuiFrame() const { return FrameCount < FirstTestFrameCount; } /* original C++ signature */
  1187. def is_warm_up_gui_frame(self) -> bool:
  1188. """(private API)
  1189. Unless test->Flags has ImGuiTestFlags_NoGuiWarmUp, we run GuiFunc() twice before running TestFunc(). Those frames are called "WarmUp" frames.
  1190. """
  1191. pass
  1192. # bool IsFirstGuiFrame() const { return FirstGuiFrame; } /* original C++ signature */
  1193. def is_first_gui_frame(self) -> bool:
  1194. """(private API)"""
  1195. pass
  1196. # bool IsFirstTestFrame() const { return FrameCount == FirstTestFrameCount; } /* original C++ signature */
  1197. def is_first_test_frame(self) -> bool:
  1198. """(private API)
  1199. First frame where TestFunc is running (after warm-up frame).
  1200. """
  1201. pass
  1202. # bool IsGuiFuncOnly() const { return (RunFlags & ImGuiTestRunFlags_GuiFuncOnly) != 0; } /* original C++ signature */
  1203. def is_gui_func_only(self) -> bool:
  1204. """(private API)"""
  1205. pass
  1206. # Debugging
  1207. # bool SuspendTestFunc(const char* file = nullptr, int line = 0); /* original C++ signature */
  1208. def suspend_test_func(self, file: Optional[str] = None, line: int = 0) -> bool:
  1209. """(private API)
  1210. [DEBUG] Generally called via IM_SUSPEND_TESTFUNC
  1211. """
  1212. pass
  1213. # Logging
  1214. # void LogEx(ImGuiTestVerboseLevel level, ImGuiTestLogFlags flags, const char* fmt, ...) ; /* original C++ signature */
  1215. def log_ex(self, level: TestVerboseLevel, flags: TestLogFlags, fmt: str) -> None:
  1216. """(private API)"""
  1217. pass
  1218. # void LogToTTY(ImGuiTestVerboseLevel level, const char* message, const char* message_end = nullptr); /* original C++ signature */
  1219. def log_to_tty(self, level: TestVerboseLevel, message: str, message_end: Optional[str] = None) -> None:
  1220. """(private API)"""
  1221. pass
  1222. # void LogToDebugger(ImGuiTestVerboseLevel level, const char* message); /* original C++ signature */
  1223. def log_to_debugger(self, level: TestVerboseLevel, message: str) -> None:
  1224. """(private API)"""
  1225. pass
  1226. # void LogDebug(const char* fmt, ...) ; /* original C++ signature */
  1227. def log_debug(self, fmt: str) -> None:
  1228. """(private API)
  1229. ImGuiTestVerboseLevel_Debug or ImGuiTestVerboseLevel_Trace depending on context depth
  1230. """
  1231. pass
  1232. # void LogInfo(const char* fmt, ...) ; /* original C++ signature */
  1233. def log_info(self, fmt: str) -> None:
  1234. """(private API)
  1235. ImGuiTestVerboseLevel_Info
  1236. """
  1237. pass
  1238. # void LogWarning(const char* fmt, ...) ; /* original C++ signature */
  1239. def log_warning(self, fmt: str) -> None:
  1240. """(private API)
  1241. ImGuiTestVerboseLevel_Warning
  1242. """
  1243. pass
  1244. # void LogError(const char* fmt, ...) ; /* original C++ signature */
  1245. def log_error(self, fmt: str) -> None:
  1246. """(private API)
  1247. ImGuiTestVerboseLevel_Error
  1248. """
  1249. pass
  1250. # void LogBasicUiState(); /* original C++ signature */
  1251. def log_basic_ui_state(self) -> None:
  1252. """(private API)"""
  1253. pass
  1254. # void LogItemList(ImGuiTestItemList* list); /* original C++ signature */
  1255. def log_item_list(self, list: TestItemList) -> None:
  1256. """(private API)"""
  1257. pass
  1258. # Yield, Timing
  1259. # void Yield(int count = 1); /* original C++ signature */
  1260. def yield_(self, count: int = 1) -> None:
  1261. """(private API)"""
  1262. pass
  1263. # void Sleep(float time_in_second); /* original C++ signature */
  1264. def sleep(self, time_in_second: float) -> None:
  1265. """(private API)
  1266. Sleep for a given simulation time, unless in Fast mode
  1267. """
  1268. pass
  1269. # void SleepShort(); /* original C++ signature */
  1270. def sleep_short(self) -> None:
  1271. """(private API)
  1272. Standard short delay of io.ActionDelayShort (~0.15), unless in Fast mode.
  1273. """
  1274. pass
  1275. # void SleepStandard(); /* original C++ signature */
  1276. def sleep_standard(self) -> None:
  1277. """(private API)
  1278. Standard regular delay of io.ActionDelayStandard (~0.40), unless in Fast mode.
  1279. """
  1280. pass
  1281. # void SleepNoSkip(float time_in_second, float framestep_in_second); /* original C++ signature */
  1282. def sleep_no_skip(self, time_in_second: float, framestep_in_second: float) -> None:
  1283. """(private API)"""
  1284. pass
  1285. # Base Reference
  1286. # - ItemClick("Window/Button") --> click "Window/Button"
  1287. # - SetRef("Window"), ItemClick("Button") --> click "Window/Button"
  1288. # - SetRef("Window"), ItemClick("/Button") --> click "Window/Button"
  1289. # - SetRef("Window"), ItemClick("//Button") --> click "/Button"
  1290. # - SetRef("//$FOCUSED"), ItemClick("Button") --> click "Button" in focused window.
  1291. # See https://github.com/ocornut/imgui_test_engine/wiki/Named-References about using ImGuiTestRef in all ImGuiTestContext functions.
  1292. # Note: SetRef() may take multiple frames to complete if specified ref is an item id.
  1293. # Note: SetRef() ignores current reference, so they are always absolute path.
  1294. # void SetRef(ImGuiTestRef ref); /* original C++ signature */
  1295. @overload
  1296. def set_ref(self, ref: Union[TestRef, str]) -> None:
  1297. """(private API)"""
  1298. pass
  1299. # void SetRef(ImGuiWindow* window); /* original C++ signature */
  1300. @overload
  1301. def set_ref(self, window: Window) -> None:
  1302. """(private API)
  1303. Shortcut to SetRef(window->Name) which works for ChildWindow (see code)
  1304. """
  1305. pass
  1306. # ImGuiTestRef GetRef(); /* original C++ signature */
  1307. def get_ref(self) -> TestRef:
  1308. """(private API)"""
  1309. pass
  1310. # Windows
  1311. # - Use WindowInfo() to access path to child windows, since the paths are internally mangled.
  1312. # - SetRef(WindowInfo("Parent/Child")->Window) --> set ref to child window.
  1313. # ImGuiTestItemInfo WindowInfo(ImGuiTestRef window_ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1314. def window_info(self, window_ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> TestItemInfo:
  1315. """(private API)"""
  1316. pass
  1317. # void WindowClose(ImGuiTestRef window_ref); /* original C++ signature */
  1318. def window_close(self, window_ref: Union[TestRef, str]) -> None:
  1319. """(private API)"""
  1320. pass
  1321. # void WindowCollapse(ImGuiTestRef window_ref, bool collapsed); /* original C++ signature */
  1322. def window_collapse(self, window_ref: Union[TestRef, str], collapsed: bool) -> None:
  1323. """(private API)"""
  1324. pass
  1325. # void WindowFocus(ImGuiTestRef window_ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1326. def window_focus(self, window_ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> None:
  1327. """(private API)"""
  1328. pass
  1329. # void WindowBringToFront(ImGuiTestRef window_ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1330. def window_bring_to_front(self, window_ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> None:
  1331. """(private API)"""
  1332. pass
  1333. # void WindowMove(ImGuiTestRef window_ref, ImVec2 pos, ImVec2 pivot = ImVec2(0.0f, 0.0f), ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1334. def window_move(
  1335. self,
  1336. window_ref: Union[TestRef, str],
  1337. pos: ImVec2Like,
  1338. pivot: Optional[ImVec2Like] = None,
  1339. flags: TestOpFlags = TestOpFlags_None,
  1340. ) -> None:
  1341. """Python bindings defaults:
  1342. If pivot is None, then its default value will be: ImVec2(0.0, 0.0)
  1343. (private API)
  1344. """
  1345. pass
  1346. # void WindowResize(ImGuiTestRef window_ref, ImVec2 sz); /* original C++ signature */
  1347. def window_resize(self, window_ref: Union[TestRef, str], sz: ImVec2Like) -> None:
  1348. """(private API)"""
  1349. pass
  1350. # bool WindowTeleportToMakePosVisible(ImGuiTestRef window_ref, ImVec2 pos_in_window); /* original C++ signature */
  1351. def window_teleport_to_make_pos_visible(self, window_ref: Union[TestRef, str], pos_in_window: ImVec2Like) -> bool:
  1352. """(private API)"""
  1353. pass
  1354. # ImGuiWindow*GetWindowByRef(ImGuiTestRef window_ref); /* original C++ signature */
  1355. def get_window_by_ref(self, window_ref: Union[TestRef, str]) -> Window:
  1356. """(private API)"""
  1357. pass
  1358. # Popups
  1359. # void PopupCloseOne(); /* original C++ signature */
  1360. def popup_close_one(self) -> None:
  1361. """(private API)"""
  1362. pass
  1363. # void PopupCloseAll(); /* original C++ signature */
  1364. def popup_close_all(self) -> None:
  1365. """(private API)"""
  1366. pass
  1367. # ImGuiID PopupGetWindowID(ImGuiTestRef ref); /* original C++ signature */
  1368. def popup_get_window_id(self, ref: Union[TestRef, str]) -> ID:
  1369. """(private API)"""
  1370. pass
  1371. # Get hash for a decorated ID Path.
  1372. # Note: for windows you may use WindowInfo()
  1373. # ImGuiID GetID(ImGuiTestRef ref); /* original C++ signature */
  1374. @overload
  1375. def get_id(self, ref: Union[TestRef, str]) -> ID:
  1376. """(private API)"""
  1377. pass
  1378. # ImGuiID GetID(ImGuiTestRef ref, ImGuiTestRef seed_ref); /* original C++ signature */
  1379. @overload
  1380. def get_id(self, ref: Union[TestRef, str], seed_ref: Union[TestRef, str]) -> ID:
  1381. """(private API)"""
  1382. pass
  1383. # Miscellaneous helpers
  1384. # ImVec2 GetPosOnVoid(ImGuiViewport* viewport); /* original C++ signature */
  1385. def get_pos_on_void(self, viewport: Viewport) -> ImVec2:
  1386. """(private API)
  1387. Find a point that has no windows // FIXME: This needs error return and flag to enable/disable forcefully finding None.
  1388. """
  1389. pass
  1390. # ImVec2 GetWindowTitlebarPoint(ImGuiTestRef window_ref); /* original C++ signature */
  1391. def get_window_titlebar_point(self, window_ref: Union[TestRef, str]) -> ImVec2:
  1392. """(private API)
  1393. Return a clickable point on window title-bar (window tab for docked windows) that will e.g. move this single window.
  1394. """
  1395. pass
  1396. # ImVec2 GetMainMonitorWorkPos(); /* original C++ signature */
  1397. def get_main_monitor_work_pos(self) -> ImVec2:
  1398. """(private API)
  1399. Work pos and size of main viewport when viewports are disabled, or work pos and size of monitor containing main viewport when viewports are enabled.
  1400. """
  1401. pass
  1402. # ImVec2 GetMainMonitorWorkSize(); /* original C++ signature */
  1403. def get_main_monitor_work_size(self) -> ImVec2:
  1404. """(private API)"""
  1405. pass
  1406. # Screenshot/Video Captures
  1407. # void CaptureReset(); /* original C++ signature */
  1408. def capture_reset(self) -> None:
  1409. """(private API)
  1410. Reset state (use when doing multiple captures)
  1411. """
  1412. pass
  1413. # void CaptureSetExtension(const char* ext); /* original C++ signature */
  1414. def capture_set_extension(self, ext: str) -> None:
  1415. """(private API)
  1416. Set capture file format (otherwise for video this default to EngineIO->VideoCaptureExtension)
  1417. """
  1418. pass
  1419. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1420. #
  1421. # void CaptureSetFilename(const char* filename); /* original C++ signature */
  1422. def capture_set_filename(self, filename: str) -> None:
  1423. """[ADAPT_IMGUI_BUNDLE]
  1424. Where to save the next CaptureScreenshot*/CaptureBeginVideo (length: 256 max!)
  1425. (private API)
  1426. """
  1427. pass
  1428. # #endif
  1429. #
  1430. # bool CaptureAddWindow(ImGuiTestRef ref); /* original C++ signature */
  1431. def capture_add_window(self, ref: Union[TestRef, str]) -> bool:
  1432. """(private API)
  1433. Add window to be captured (default to capture everything)
  1434. """
  1435. pass
  1436. # void CaptureScreenshotWindow(ImGuiTestRef ref, int capture_flags = 0); /* original C++ signature */
  1437. def capture_screenshot_window(self, ref: Union[TestRef, str], capture_flags: int = 0) -> None:
  1438. """(private API)
  1439. Trigger a screen capture of a single window (== CaptureAddWindow() + CaptureScreenshot())
  1440. """
  1441. pass
  1442. # bool CaptureScreenshot(int capture_flags = 0); /* original C++ signature */
  1443. def capture_screenshot(self, capture_flags: int = 0) -> bool:
  1444. """(private API)
  1445. Trigger a screen capture
  1446. """
  1447. pass
  1448. # bool CaptureBeginVideo(); /* original C++ signature */
  1449. def capture_begin_video(self) -> bool:
  1450. """(private API)
  1451. Start a video capture
  1452. """
  1453. pass
  1454. # bool CaptureEndVideo(); /* original C++ signature */
  1455. def capture_end_video(self) -> bool:
  1456. """(private API)"""
  1457. pass
  1458. # Mouse inputs
  1459. # void MouseMove(ImGuiTestRef ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1460. def mouse_move(self, ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> None:
  1461. """(private API)"""
  1462. pass
  1463. # void MouseMoveToPos(ImVec2 pos); /* original C++ signature */
  1464. def mouse_move_to_pos(self, pos: ImVec2Like) -> None:
  1465. """(private API)"""
  1466. pass
  1467. # void MouseTeleportToPos(ImVec2 pos, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1468. def mouse_teleport_to_pos(self, pos: ImVec2Like, flags: TestOpFlags = TestOpFlags_None) -> None:
  1469. """(private API)"""
  1470. pass
  1471. # void MouseClick(ImGuiMouseButton button = 0); /* original C++ signature */
  1472. def mouse_click(self, button: MouseButton = 0) -> None:
  1473. """(private API)"""
  1474. pass
  1475. # void MouseClickMulti(ImGuiMouseButton button, int count); /* original C++ signature */
  1476. def mouse_click_multi(self, button: MouseButton, count: int) -> None:
  1477. """(private API)"""
  1478. pass
  1479. # void MouseDoubleClick(ImGuiMouseButton button = 0); /* original C++ signature */
  1480. def mouse_double_click(self, button: MouseButton = 0) -> None:
  1481. """(private API)"""
  1482. pass
  1483. # void MouseDown(ImGuiMouseButton button = 0); /* original C++ signature */
  1484. def mouse_down(self, button: MouseButton = 0) -> None:
  1485. """(private API)"""
  1486. pass
  1487. # void MouseUp(ImGuiMouseButton button = 0); /* original C++ signature */
  1488. def mouse_up(self, button: MouseButton = 0) -> None:
  1489. """(private API)"""
  1490. pass
  1491. # void MouseLiftDragThreshold(ImGuiMouseButton button = 0); /* original C++ signature */
  1492. def mouse_lift_drag_threshold(self, button: MouseButton = 0) -> None:
  1493. """(private API)"""
  1494. pass
  1495. # void MouseDragWithDelta(ImVec2 delta, ImGuiMouseButton button = 0); /* original C++ signature */
  1496. def mouse_drag_with_delta(self, delta: ImVec2Like, button: MouseButton = 0) -> None:
  1497. """(private API)"""
  1498. pass
  1499. # void MouseWheel(ImVec2 delta); /* original C++ signature */
  1500. def mouse_wheel(self, delta: ImVec2Like) -> None:
  1501. """(private API)"""
  1502. pass
  1503. # void MouseWheelX(float dx) { MouseWheel(ImVec2(dx, 0.0f)); } /* original C++ signature */
  1504. def mouse_wheel_x(self, dx: float) -> None:
  1505. """(private API)"""
  1506. pass
  1507. # void MouseWheelY(float dy) { MouseWheel(ImVec2(0.0f, dy)); } /* original C++ signature */
  1508. def mouse_wheel_y(self, dy: float) -> None:
  1509. """(private API)
  1510. +1: up, -1: down
  1511. """
  1512. pass
  1513. # void MouseMoveToVoid(ImGuiViewport* viewport = nullptr); /* original C++ signature */
  1514. def mouse_move_to_void(self, viewport: Optional[Viewport] = None) -> None:
  1515. """(private API)"""
  1516. pass
  1517. # void MouseClickOnVoid(ImGuiMouseButton button = 0, ImGuiViewport* viewport = nullptr); /* original C++ signature */
  1518. def mouse_click_on_void(self, button: MouseButton = 0, viewport: Optional[Viewport] = None) -> None:
  1519. """(private API)"""
  1520. pass
  1521. # ImGuiWindow*FindHoveredWindowAtPos(const ImVec2& pos); /* original C++ signature */
  1522. def find_hovered_window_at_pos(self, pos: ImVec2Like) -> Window:
  1523. """(private API)"""
  1524. pass
  1525. # bool FindExistingVoidPosOnViewport(ImGuiViewport* viewport, ImVec2* out); /* original C++ signature */
  1526. def find_existing_void_pos_on_viewport(self, viewport: Viewport, out: ImVec2Like) -> bool:
  1527. """(private API)"""
  1528. pass
  1529. # Mouse inputs: Viewports
  1530. # - This is automatically called by SetRef() and any mouse action taking an item reference (e.g. ItemClick("button"), MouseClick("button"))
  1531. # - But when using raw position directy e.g. MouseMoveToPos() / MouseTeleportToPos() without referring to the parent window before, this needs to be set.
  1532. # void MouseSetViewport(ImGuiWindow* window); /* original C++ signature */
  1533. def mouse_set_viewport(self, window: Window) -> None:
  1534. """(private API)"""
  1535. pass
  1536. # void MouseSetViewportID(ImGuiID viewport_id); /* original C++ signature */
  1537. def mouse_set_viewport_id(self, viewport_id: ID) -> None:
  1538. """(private API)"""
  1539. pass
  1540. # Keyboard inputs
  1541. # void KeyDown(ImGuiKeyChord key_chord); /* original C++ signature */
  1542. def key_down(self, key_chord: KeyChord) -> None:
  1543. """(private API)"""
  1544. pass
  1545. # void KeyUp(ImGuiKeyChord key_chord); /* original C++ signature */
  1546. def key_up(self, key_chord: KeyChord) -> None:
  1547. """(private API)"""
  1548. pass
  1549. # void KeyPress(ImGuiKeyChord key_chord, int count = 1); /* original C++ signature */
  1550. def key_press(self, key_chord: KeyChord, count: int = 1) -> None:
  1551. """(private API)"""
  1552. pass
  1553. # void KeyHold(ImGuiKeyChord key_chord, float time); /* original C++ signature */
  1554. def key_hold(self, key_chord: KeyChord, time: float) -> None:
  1555. """(private API)"""
  1556. pass
  1557. # void KeySetEx(ImGuiKeyChord key_chord, bool is_down, float time); /* original C++ signature */
  1558. def key_set_ex(self, key_chord: KeyChord, is_down: bool, time: float) -> None:
  1559. """(private API)"""
  1560. pass
  1561. # void KeyChars(const char* chars); /* original C++ signature */
  1562. def key_chars(self, chars: str) -> None:
  1563. """(private API)
  1564. Input characters
  1565. """
  1566. pass
  1567. # void KeyCharsAppend(const char* chars); /* original C++ signature */
  1568. def key_chars_append(self, chars: str) -> None:
  1569. """(private API)
  1570. Input characters at end of field
  1571. """
  1572. pass
  1573. # void KeyCharsAppendEnter(const char* chars); /* original C++ signature */
  1574. def key_chars_append_enter(self, chars: str) -> None:
  1575. """(private API)
  1576. Input characters at end of field, press Enter
  1577. """
  1578. pass
  1579. # void KeyCharsReplace(const char* chars); /* original C++ signature */
  1580. def key_chars_replace(self, chars: str) -> None:
  1581. """(private API)
  1582. Delete existing field then input characters
  1583. """
  1584. pass
  1585. # void KeyCharsReplaceEnter(const char* chars); /* original C++ signature */
  1586. def key_chars_replace_enter(self, chars: str) -> None:
  1587. """(private API)
  1588. Delete existing field then input characters, press Enter
  1589. """
  1590. pass
  1591. # Navigation inputs
  1592. # FIXME: Need some redesign/refactoring:
  1593. # - This was initially intended to: replace mouse action with keyboard/gamepad
  1594. # - Abstract keyboard vs gamepad actions
  1595. # However this is widely inconsistent and unfinished at this point.
  1596. # void SetInputMode(ImGuiInputSource input_mode); /* original C++ signature */
  1597. def set_input_mode(self, input_mode: InputSource) -> None:
  1598. """(private API)
  1599. Mouse or Keyboard or Gamepad. In Keyboard or Gamepad mode, actions such as ItemClick or ItemInput are using nav facilities instead of Mouse.
  1600. """
  1601. pass
  1602. # void NavMoveTo(ImGuiTestRef ref); /* original C++ signature */
  1603. def nav_move_to(self, ref: Union[TestRef, str]) -> None:
  1604. """(private API)"""
  1605. pass
  1606. # void NavActivate(); /* original C++ signature */
  1607. def nav_activate(self) -> None:
  1608. """(private API)
  1609. Activate current selected item: activate button, tweak sliders/drags. Equivalent of pressing Space on keyboard, ImGuiKey_GamepadFaceUp on a gamepad.
  1610. """
  1611. pass
  1612. # void NavInput(); /* original C++ signature */
  1613. def nav_input(self) -> None:
  1614. """(private API)
  1615. Input into select item: input sliders/drags. Equivalent of pressing Enter on keyboard, ImGuiKey_GamepadFaceDown on a gamepad.
  1616. """
  1617. pass
  1618. # void ScrollTo(ImGuiTestRef ref, ImGuiAxis axis, float scroll_v, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1619. def scroll_to(
  1620. self, ref: Union[TestRef, str], axis: Axis, scroll_v: float, flags: TestOpFlags = TestOpFlags_None
  1621. ) -> None:
  1622. """Scrolling
  1623. (private API)
  1624. """
  1625. pass
  1626. # void ScrollToX(ImGuiTestRef ref, float scroll_x) { ScrollTo(ref, ImGuiAxis_X, scroll_x); } /* original C++ signature */
  1627. def scroll_to_x(self, ref: Union[TestRef, str], scroll_x: float) -> None:
  1628. """(private API)"""
  1629. pass
  1630. # void ScrollToY(ImGuiTestRef ref, float scroll_y) { ScrollTo(ref, ImGuiAxis_Y, scroll_y); } /* original C++ signature */
  1631. def scroll_to_y(self, ref: Union[TestRef, str], scroll_y: float) -> None:
  1632. """(private API)"""
  1633. pass
  1634. # void ScrollToTop(ImGuiTestRef ref); /* original C++ signature */
  1635. def scroll_to_top(self, ref: Union[TestRef, str]) -> None:
  1636. """(private API)"""
  1637. pass
  1638. # void ScrollToBottom(ImGuiTestRef ref); /* original C++ signature */
  1639. def scroll_to_bottom(self, ref: Union[TestRef, str]) -> None:
  1640. """(private API)"""
  1641. pass
  1642. # void ScrollToPos(ImGuiTestRef window_ref, float pos_v, ImGuiAxis axis, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1643. def scroll_to_pos(
  1644. self, window_ref: Union[TestRef, str], pos_v: float, axis: Axis, flags: TestOpFlags = TestOpFlags_None
  1645. ) -> None:
  1646. """(private API)"""
  1647. pass
  1648. # void ScrollToPosX(ImGuiTestRef window_ref, float pos_x); /* original C++ signature */
  1649. def scroll_to_pos_x(self, window_ref: Union[TestRef, str], pos_x: float) -> None:
  1650. """(private API)"""
  1651. pass
  1652. # void ScrollToPosY(ImGuiTestRef window_ref, float pos_y); /* original C++ signature */
  1653. def scroll_to_pos_y(self, window_ref: Union[TestRef, str], pos_y: float) -> None:
  1654. """(private API)"""
  1655. pass
  1656. # void ScrollToItem(ImGuiTestRef ref, ImGuiAxis axis, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1657. def scroll_to_item(self, ref: Union[TestRef, str], axis: Axis, flags: TestOpFlags = TestOpFlags_None) -> None:
  1658. """(private API)"""
  1659. pass
  1660. # void ScrollToItemX(ImGuiTestRef ref); /* original C++ signature */
  1661. def scroll_to_item_x(self, ref: Union[TestRef, str]) -> None:
  1662. """(private API)"""
  1663. pass
  1664. # void ScrollToItemY(ImGuiTestRef ref); /* original C++ signature */
  1665. def scroll_to_item_y(self, ref: Union[TestRef, str]) -> None:
  1666. """(private API)"""
  1667. pass
  1668. # void ScrollToTabItem(ImGuiTabBar* tab_bar, ImGuiID tab_id); /* original C++ signature */
  1669. def scroll_to_tab_item(self, tab_bar: TabBar, tab_id: ID) -> None:
  1670. """(private API)"""
  1671. pass
  1672. # Low-level queries
  1673. # - ItemInfo queries never returns None! Instead they return an empty instance (info->IsEmpty(), info->ID == 0) and set contexted as errored.
  1674. # - You can use ImGuiTestOpFlags_NoError to do a query without marking context as errored. This is what ItemExists() does.
  1675. # ImGuiTestItemInfo ItemInfo(ImGuiTestRef ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1676. def item_info(self, ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> TestItemInfo:
  1677. """(private API)"""
  1678. pass
  1679. # ImGuiTestItemInfo ItemInfoOpenFullPath(ImGuiTestRef ref, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1680. def item_info_open_full_path(self, ref: Union[TestRef, str], flags: TestOpFlags = TestOpFlags_None) -> TestItemInfo:
  1681. """(private API)"""
  1682. pass
  1683. # ImGuiID ItemInfoHandleWildcardSearch(const char* wildcard_prefix_start, const char* wildcard_prefix_end, const char* wildcard_suffix_start); /* original C++ signature */
  1684. def item_info_handle_wildcard_search(
  1685. self, wildcard_prefix_start: str, wildcard_prefix_end: str, wildcard_suffix_start: str
  1686. ) -> ID:
  1687. """(private API)"""
  1688. pass
  1689. # ImGuiTestItemInfo ItemInfoNull() { return ImGuiTestItemInfo(); } /* original C++ signature */
  1690. def item_info_null(self) -> TestItemInfo:
  1691. """(private API)"""
  1692. pass
  1693. # void GatherItems(ImGuiTestItemList* out_list, ImGuiTestRef parent, int depth = -1); /* original C++ signature */
  1694. def gather_items(self, out_list: TestItemList, parent: Union[TestRef, str], depth: int = -1) -> None:
  1695. """(private API)"""
  1696. pass
  1697. # void ItemAction(ImGuiTestAction action, ImGuiTestRef ref, ImGuiTestOpFlags flags = 0, void* action_arg = nullptr); /* original C++ signature */
  1698. def item_action(
  1699. self, action: TestAction, ref: Union[TestRef, str], flags: TestOpFlags = 0, action_arg: Optional[Any] = None
  1700. ) -> None:
  1701. """Item/Widgets manipulation
  1702. (private API)
  1703. """
  1704. pass
  1705. # void ItemClick(ImGuiTestRef ref, ImGuiMouseButton button = 0, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Click, ref, flags, (void*)(size_t)button); } /* original C++ signature */
  1706. def item_click(self, ref: Union[TestRef, str], button: MouseButton = 0, flags: TestOpFlags = 0) -> None:
  1707. """(private API)"""
  1708. pass
  1709. # void ItemDoubleClick(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_DoubleClick, ref, flags); } /* original C++ signature */
  1710. def item_double_click(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1711. """(private API)"""
  1712. pass
  1713. # void ItemCheck(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Check, ref, flags); } /* original C++ signature */
  1714. def item_check(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1715. """(private API)"""
  1716. pass
  1717. # void ItemUncheck(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Uncheck, ref, flags); } /* original C++ signature */
  1718. def item_uncheck(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1719. """(private API)"""
  1720. pass
  1721. # void ItemOpen(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Open, ref, flags); } /* original C++ signature */
  1722. def item_open(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1723. """(private API)"""
  1724. pass
  1725. # void ItemClose(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Close, ref, flags); } /* original C++ signature */
  1726. def item_close(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1727. """(private API)"""
  1728. pass
  1729. # void ItemInput(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Input, ref, flags); } /* original C++ signature */
  1730. def item_input(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1731. """(private API)"""
  1732. pass
  1733. # void ItemNavActivate(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_NavActivate, ref, flags); } /* original C++ signature */
  1734. def item_nav_activate(self, ref: Union[TestRef, str], flags: TestOpFlags = 0) -> None:
  1735. """(private API)"""
  1736. pass
  1737. # Item/Widgets: Batch actions over an entire scope
  1738. # void ItemActionAll(ImGuiTestAction action, ImGuiTestRef ref_parent, const ImGuiTestActionFilter* filter = nullptr); /* original C++ signature */
  1739. def item_action_all(
  1740. self, action: TestAction, ref_parent: Union[TestRef, str], filter: Optional[TestActionFilter] = None
  1741. ) -> None:
  1742. """(private API)"""
  1743. pass
  1744. # void ItemOpenAll(ImGuiTestRef ref_parent, int depth = -1, int passes = -1); /* original C++ signature */
  1745. def item_open_all(self, ref_parent: Union[TestRef, str], depth: int = -1, passes: int = -1) -> None:
  1746. """(private API)"""
  1747. pass
  1748. # void ItemCloseAll(ImGuiTestRef ref_parent, int depth = -1, int passes = -1); /* original C++ signature */
  1749. def item_close_all(self, ref_parent: Union[TestRef, str], depth: int = -1, passes: int = -1) -> None:
  1750. """(private API)"""
  1751. pass
  1752. # Item/Widgets: Helpers to easily set a value
  1753. # void ItemInputValue(ImGuiTestRef ref, int v); /* original C++ signature */
  1754. @overload
  1755. def item_input_value(self, ref: Union[TestRef, str], v: int) -> None:
  1756. """(private API)"""
  1757. pass
  1758. # void ItemInputValue(ImGuiTestRef ref, float f); /* original C++ signature */
  1759. @overload
  1760. def item_input_value(self, ref: Union[TestRef, str], f: float) -> None:
  1761. """(private API)"""
  1762. pass
  1763. # void ItemInputValue(ImGuiTestRef ref, const char* str); /* original C++ signature */
  1764. @overload
  1765. def item_input_value(self, ref: Union[TestRef, str], str: str) -> None:
  1766. """(private API)"""
  1767. pass
  1768. # Item/Widgets: Helpers to easily read a value by selecting Slider/Drag/Input text, copying it and parsing it.
  1769. # - This requires the item to be selectable (we will later provide helpers that works in more general manner)
  1770. # - (this temporarily use the internal test clipboard, but original clipboard value is restored afterwards)
  1771. # See https://github.com/ocornut/imgui_test_engine/wiki/Automation-API#accessing-your-data
  1772. # int ItemReadAsInt(ImGuiTestRef ref); /* original C++ signature */
  1773. def item_read_as_int(self, ref: Union[TestRef, str]) -> int:
  1774. """(private API)"""
  1775. pass
  1776. # float ItemReadAsFloat(ImGuiTestRef ref); /* original C++ signature */
  1777. def item_read_as_float(self, ref: Union[TestRef, str]) -> float:
  1778. """(private API)"""
  1779. pass
  1780. # bool ItemReadAsScalar(ImGuiTestRef ref, ImGuiDataType data_type, void* out_data, ImGuiTestOpFlags flags = ImGuiTestOpFlags_None); /* original C++ signature */
  1781. def item_read_as_scalar(
  1782. self, ref: Union[TestRef, str], data_type: DataType, out_data: Any, flags: TestOpFlags = TestOpFlags_None
  1783. ) -> bool:
  1784. """(private API)"""
  1785. pass
  1786. # Item/Widgets: Status query
  1787. # bool ItemExists(ImGuiTestRef ref); /* original C++ signature */
  1788. def item_exists(self, ref: Union[TestRef, str]) -> bool:
  1789. """(private API)"""
  1790. pass
  1791. # bool ItemIsChecked(ImGuiTestRef ref); /* original C++ signature */
  1792. def item_is_checked(self, ref: Union[TestRef, str]) -> bool:
  1793. """(private API)"""
  1794. pass
  1795. # bool ItemIsOpened(ImGuiTestRef ref); /* original C++ signature */
  1796. def item_is_opened(self, ref: Union[TestRef, str]) -> bool:
  1797. """(private API)"""
  1798. pass
  1799. # bool ItemIsVisible(ImGuiTestRef ref); /* original C++ signature */
  1800. def item_is_visible(self, ref: Union[TestRef, str]) -> bool:
  1801. """(private API)"""
  1802. pass
  1803. # void ItemVerifyCheckedIfAlive(ImGuiTestRef ref, bool checked); /* original C++ signature */
  1804. def item_verify_checked_if_alive(self, ref: Union[TestRef, str], checked: bool) -> None:
  1805. """(private API)"""
  1806. pass
  1807. # Item/Widgets: Drag and Mouse operations
  1808. # void ItemHold(ImGuiTestRef ref, float time); /* original C++ signature */
  1809. def item_hold(self, ref: Union[TestRef, str], time: float) -> None:
  1810. """(private API)"""
  1811. pass
  1812. # void ItemHoldForFrames(ImGuiTestRef ref, int frames); /* original C++ signature */
  1813. def item_hold_for_frames(self, ref: Union[TestRef, str], frames: int) -> None:
  1814. """(private API)"""
  1815. pass
  1816. # void ItemDragOverAndHold(ImGuiTestRef ref_src, ImGuiTestRef ref_dst); /* original C++ signature */
  1817. def item_drag_over_and_hold(self, ref_src: Union[TestRef, str], ref_dst: Union[TestRef, str]) -> None:
  1818. """(private API)"""
  1819. pass
  1820. # void ItemDragAndDrop(ImGuiTestRef ref_src, ImGuiTestRef ref_dst, ImGuiMouseButton button = 0); /* original C++ signature */
  1821. def item_drag_and_drop(
  1822. self, ref_src: Union[TestRef, str], ref_dst: Union[TestRef, str], button: MouseButton = 0
  1823. ) -> None:
  1824. """(private API)"""
  1825. pass
  1826. # void ItemDragWithDelta(ImGuiTestRef ref_src, ImVec2 pos_delta); /* original C++ signature */
  1827. def item_drag_with_delta(self, ref_src: Union[TestRef, str], pos_delta: ImVec2Like) -> None:
  1828. """(private API)"""
  1829. pass
  1830. # Helpers for Tab Bars widgets
  1831. # void TabClose(ImGuiTestRef ref); /* original C++ signature */
  1832. def tab_close(self, ref: Union[TestRef, str]) -> None:
  1833. """(private API)"""
  1834. pass
  1835. # Helpers for MenuBar and Menus widgets
  1836. # - e.g. MenuCheck("File/Options/Enable grid"); // Access menu in current ref window.
  1837. # - e.g. MenuClick("//Window/File/Quit"); // Access menu in another window.
  1838. # void MenuAction(ImGuiTestAction action, ImGuiTestRef ref); /* original C++ signature */
  1839. def menu_action(self, action: TestAction, ref: Union[TestRef, str]) -> None:
  1840. """(private API)"""
  1841. pass
  1842. # void MenuActionAll(ImGuiTestAction action, ImGuiTestRef ref_parent); /* original C++ signature */
  1843. def menu_action_all(self, action: TestAction, ref_parent: Union[TestRef, str]) -> None:
  1844. """(private API)"""
  1845. pass
  1846. # void MenuClick(ImGuiTestRef ref) { MenuAction(ImGuiTestAction_Click, ref); } /* original C++ signature */
  1847. def menu_click(self, ref: Union[TestRef, str]) -> None:
  1848. """(private API)"""
  1849. pass
  1850. # void MenuCheck(ImGuiTestRef ref) { MenuAction(ImGuiTestAction_Check, ref); } /* original C++ signature */
  1851. def menu_check(self, ref: Union[TestRef, str]) -> None:
  1852. """(private API)"""
  1853. pass
  1854. # void MenuUncheck(ImGuiTestRef ref) { MenuAction(ImGuiTestAction_Uncheck, ref); } /* original C++ signature */
  1855. def menu_uncheck(self, ref: Union[TestRef, str]) -> None:
  1856. """(private API)"""
  1857. pass
  1858. # void MenuCheckAll(ImGuiTestRef ref_parent) { MenuActionAll(ImGuiTestAction_Check, ref_parent); } /* original C++ signature */
  1859. def menu_check_all(self, ref_parent: Union[TestRef, str]) -> None:
  1860. """(private API)"""
  1861. pass
  1862. # void MenuUncheckAll(ImGuiTestRef ref_parent) { MenuActionAll(ImGuiTestAction_Uncheck, ref_parent); } /* original C++ signature */
  1863. def menu_uncheck_all(self, ref_parent: Union[TestRef, str]) -> None:
  1864. """(private API)"""
  1865. pass
  1866. # Helpers for Combo Boxes
  1867. # void ComboClick(ImGuiTestRef ref); /* original C++ signature */
  1868. def combo_click(self, ref: Union[TestRef, str]) -> None:
  1869. """(private API)"""
  1870. pass
  1871. # void ComboClickAll(ImGuiTestRef ref); /* original C++ signature */
  1872. def combo_click_all(self, ref: Union[TestRef, str]) -> None:
  1873. """(private API)"""
  1874. pass
  1875. # Helpers for Tables
  1876. # void TableOpenContextMenu(ImGuiTestRef ref, int column_n = -1); /* original C++ signature */
  1877. def table_open_context_menu(self, ref: Union[TestRef, str], column_n: int = -1) -> None:
  1878. """(private API)"""
  1879. pass
  1880. # ImGuiSortDirection TableClickHeader(ImGuiTestRef ref, const char* label, ImGuiKeyChord key_mods = 0); /* original C++ signature */
  1881. def table_click_header(self, ref: Union[TestRef, str], label: str, key_mods: KeyChord = 0) -> SortDirection:
  1882. """(private API)"""
  1883. pass
  1884. # void TableSetColumnEnabled(ImGuiTestRef ref, int column_n, bool enabled); /* original C++ signature */
  1885. @overload
  1886. def table_set_column_enabled(self, ref: Union[TestRef, str], column_n: int, enabled: bool) -> None:
  1887. """(private API)"""
  1888. pass
  1889. # void TableSetColumnEnabled(ImGuiTestRef ref, const char* label, bool enabled); /* original C++ signature */
  1890. @overload
  1891. def table_set_column_enabled(self, ref: Union[TestRef, str], label: str, enabled: bool) -> None:
  1892. """(private API)"""
  1893. pass
  1894. # void TableResizeColumn(ImGuiTestRef ref, int column_n, float width); /* original C++ signature */
  1895. def table_resize_column(self, ref: Union[TestRef, str], column_n: int, width: float) -> None:
  1896. """(private API)"""
  1897. pass
  1898. # const ImGuiTableSortSpecs* TableGetSortSpecs(ImGuiTestRef ref); /* original C++ signature */
  1899. def table_get_sort_specs(self, ref: Union[TestRef, str]) -> TableSortSpecs:
  1900. """(private API)"""
  1901. pass
  1902. # Viewports
  1903. # IMPORTANT: Those function may alter Platform state (unless using the "Mock Viewport" backend). Use carefully.
  1904. # Those are mostly useful to simulate OS actions and testing of viewport-specific features, may not be useful to most users.
  1905. # Docking
  1906. # #ifdef IMGUI_HAS_DOCK
  1907. #
  1908. # void DockClear(const char* window_name, ...); /* original C++ signature */
  1909. def dock_clear(self, window_name: str) -> None:
  1910. """(private API)"""
  1911. pass
  1912. # void DockInto(ImGuiTestRef src_id, ImGuiTestRef dst_id, ImGuiDir split_dir = ImGuiDir_None, bool is_outer_docking = false, ImGuiTestOpFlags flags = 0); /* original C++ signature */
  1913. def dock_into(
  1914. self,
  1915. src_id: Union[TestRef, str],
  1916. dst_id: Union[TestRef, str],
  1917. split_dir: Optional[Dir] = None,
  1918. is_outer_docking: bool = False,
  1919. flags: TestOpFlags = 0,
  1920. ) -> None:
  1921. """Python bindings defaults:
  1922. If split_dir is None, then its default value will be: Dir_None
  1923. (private API)
  1924. """
  1925. pass
  1926. # void UndockNode(ImGuiID dock_id); /* original C++ signature */
  1927. def undock_node(self, dock_id: ID) -> None:
  1928. """(private API)"""
  1929. pass
  1930. # void UndockWindow(const char* window_name); /* original C++ signature */
  1931. def undock_window(self, window_name: str) -> None:
  1932. """(private API)"""
  1933. pass
  1934. # bool WindowIsUndockedOrStandalone(ImGuiWindow* window); /* original C++ signature */
  1935. def window_is_undocked_or_standalone(self, window: Window) -> bool:
  1936. """(private API)"""
  1937. pass
  1938. # bool DockIdIsUndockedOrStandalone(ImGuiID dock_id); /* original C++ signature */
  1939. def dock_id_is_undocked_or_standalone(self, dock_id: ID) -> bool:
  1940. """(private API)"""
  1941. pass
  1942. # void DockNodeHideTabBar(ImGuiDockNode* node, bool hidden); /* original C++ signature */
  1943. def dock_node_hide_tab_bar(self, node: DockNode, hidden: bool) -> None:
  1944. """(private API)"""
  1945. pass
  1946. # ImVec2 GetDockNodeTitlebarPos(ImGuiDockNode* node);
  1947. # #endif
  1948. #
  1949. # Performances Measurement (use along with Dear ImGui Perf Tool)
  1950. # void PerfCalcRef(); /* original C++ signature */
  1951. def perf_calc_ref(self) -> None:
  1952. """(private API)"""
  1953. pass
  1954. # void PerfCapture(const char* category = nullptr, const char* test_name = nullptr, const char* csv_file = nullptr); /* original C++ signature */
  1955. def perf_capture(
  1956. self, category: Optional[str] = None, test_name: Optional[str] = None, csv_file: Optional[str] = None
  1957. ) -> None:
  1958. """(private API)"""
  1959. pass
  1960. # Obsolete functions
  1961. # [Internal]
  1962. # void _ScrollVerifyScrollMax(ImGuiTestRef ref); /* original C++ signature */
  1963. def _scroll_verify_scroll_max(self, ref: Union[TestRef, str]) -> None:
  1964. """(private API)"""
  1965. pass
  1966. # void _MakeAimingSpaceOverPos(ImGuiViewport* viewport, ImGuiWindow* over_window, const ImVec2& over_pos); /* original C++ signature */
  1967. def _make_aiming_space_over_pos(self, viewport: Viewport, over_window: Window, over_pos: ImVec2Like) -> None:
  1968. """(private API)
  1969. Move windows covering 'window' at pos.
  1970. """
  1971. pass
  1972. # void _ForeignWindowsUnhideAll(); /* original C++ signature */
  1973. def _foreign_windows_unhide_all(self) -> None:
  1974. """(private API)
  1975. FIXME: Aim to remove this system...
  1976. """
  1977. pass
  1978. # ImGuiTestContext(ImGuiTestGenericVars GenericVars = ImGuiTestGenericVars(), ImGuiTestOpFlags OpFlags = ImGuiTestOpFlags_None, int PerfStressAmount = 0, int FrameCount = 0, int FirstTestFrameCount = 0, bool FirstGuiFrame = false, bool HasDock = false, ImGuiTestRunFlags RunFlags = ImGuiTestRunFlags_None, ImGuiTestActiveFunc ActiveFunc = ImGuiTestActiveFunc_None, double RunningTime = 0.0, int ActionDepth = 0, int CaptureCounter = 0, int ErrorCounter = 0, bool Abort = false, double PerfRefDt = -1.0, int PerfIterations = 400, ImGuiID RefID = 0, ImGuiID RefWindowID = 0, ImGuiInputSource InputMode = ImGuiInputSource_Mouse, ImVector<char> TempString = ImVector<char>(), ImVector<char> Clipboard = ImVector<char>(), ImVector<ImGuiWindow*> ForeignWindowsToHide = ImVector<ImGuiWindow*>(), ImGuiTestItemInfo DummyItemInfoNull = ImGuiTestItemInfo(), bool CachedLinesPrintedToTTY = false); /* original C++ signature */
  1979. def __init__(
  1980. self,
  1981. generic_vars: Optional[TestGenericVars] = None,
  1982. op_flags: TestOpFlags = TestOpFlags_None,
  1983. perf_stress_amount: int = 0,
  1984. frame_count: int = 0,
  1985. first_test_frame_count: int = 0,
  1986. first_gui_frame: bool = False,
  1987. has_dock: bool = False,
  1988. run_flags: TestRunFlags = TestRunFlags_None,
  1989. active_func: TestActiveFunc = TestActiveFunc_None,
  1990. running_time: float = 0.0,
  1991. action_depth: int = 0,
  1992. capture_counter: int = 0,
  1993. error_counter: int = 0,
  1994. abort: bool = False,
  1995. perf_ref_dt: float = -1.0,
  1996. perf_iterations: int = 400,
  1997. ref_id: ID = 0,
  1998. ref_window_id: ID = 0,
  1999. input_mode: Optional[InputSource] = None,
  2000. temp_string: Optional[ImVector_int] = None,
  2001. clipboard: Optional[ImVector_int] = None,
  2002. foreign_windows_to_hide: Optional[ImVector_Window] = None,
  2003. dummy_item_info_null: Optional[TestItemInfo] = None,
  2004. cached_lines_printed_to_tty: bool = False,
  2005. ) -> None:
  2006. """Auto-generated default constructor with named params
  2007. Python bindings defaults:
  2008. If any of the params below is None, then its default value below will be used:
  2009. * GenericVars: TestGenericVars()
  2010. * InputMode: InputSource_Mouse
  2011. * TempString: ImVector_char()
  2012. * Clipboard: ImVector_char()
  2013. * ForeignWindowsToHide: ImVector_Window_ptr()
  2014. * DummyItemInfoNull: TestItemInfo()
  2015. """
  2016. pass
  2017. # -------------------------------------------------------------------------
  2018. # [SECTION] Debugging macros (IM_SUSPEND_TESTFUNC)
  2019. # -------------------------------------------------------------------------
  2020. # -------------------------------------------------------------------------
  2021. # [SECTION] Testing/Checking macros: IM_CHECK(), IM_ERRORF() etc.
  2022. # -------------------------------------------------------------------------
  2023. # Helpers used by IM_CHECK_OP() macros.
  2024. # ImGuiTestEngine_GetTempStringBuilder() returns a shared instance of ImGuiTextBuffer to recycle memory allocations
  2025. # We embed every macro in a do {} while(0) statement as a trick to allow using them as regular single statement, e.g. if (XXX) IM_CHECK(A); else IM_CHECK(B)
  2026. # We leave the IM_DEBUG_BREAK() outside of the check function to step out faster when using a debugger. It also has the benefit of being lighter than an IM_ASSERT().
  2027. # Scalar compares
  2028. # Scalar compares, without return on failure
  2029. # String compares
  2030. # Floating point compares using an epsilon
  2031. # -------------------------------------------------------------------------
  2032. #################### </generated_from:imgui_te_context.h> ####################
  2033. #################### <generated_from:imgui_te_internal.h> ####################
  2034. # dear imgui test engine
  2035. # (internal api)
  2036. # This file is governed by the "Dear ImGui Test Engine License".
  2037. # Details of the license are provided in the LICENSE.txt file in the same directory.
  2038. # -------------------------------------------------------------------------
  2039. # FORWARD DECLARATIONS
  2040. # -------------------------------------------------------------------------
  2041. # -------------------------------------------------------------------------
  2042. # DATA STRUCTURES
  2043. # -------------------------------------------------------------------------
  2044. class TestInfoTask:
  2045. """Query item position/window/state given ID."""
  2046. # Input
  2047. # ImGuiID ID = 0; /* original C++ signature */
  2048. id_: ID = 0
  2049. # int FrameCount = -1; /* original C++ signature */
  2050. frame_count: int = -1 # Timestamp of request
  2051. # ImGuiTestItemInfo Result; /* original C++ signature */
  2052. # Output
  2053. result: TestItemInfo
  2054. # ImGuiTestInfoTask(ImGuiID ID = 0, int FrameCount = -1, ImGuiTestItemInfo Result = ImGuiTestItemInfo()); /* original C++ signature */
  2055. def __init__(self, id_: ID = 0, frame_count: int = -1, result: Optional[TestItemInfo] = None) -> None:
  2056. """Auto-generated default constructor with named params
  2057. Python bindings defaults:
  2058. If Result is None, then its default value will be: TestItemInfo()
  2059. """
  2060. pass
  2061. class TestGatherTask:
  2062. """Gather item list in given parent ID."""
  2063. # Input
  2064. # ImGuiID InParentID = 0; /* original C++ signature */
  2065. in_parent_id: ID = 0
  2066. # int InMaxDepth = 0; /* original C++ signature */
  2067. in_max_depth: int = 0
  2068. # short InLayerMask = 0; /* original C++ signature */
  2069. in_layer_mask: int = 0
  2070. # Output/Temp
  2071. # ImGuiTestItemList* OutList = nullptr; /* original C++ signature */
  2072. out_list: Optional[TestItemList] = None
  2073. # ImGuiTestItemInfo* LastItemInfo = nullptr; /* original C++ signature */
  2074. last_item_info: Optional[TestItemInfo] = None
  2075. # void Clear() { memset(this, 0, sizeof(*this)); } /* original C++ signature */
  2076. def clear(self) -> None:
  2077. """(private API)"""
  2078. pass
  2079. # ImGuiTestGatherTask(ImGuiID InParentID = 0, int InMaxDepth = 0, short InLayerMask = 0); /* original C++ signature */
  2080. def __init__(self, in_parent_id: ID = 0, in_max_depth: int = 0, in_layer_mask: int = 0) -> None:
  2081. """Auto-generated default constructor with named params"""
  2082. pass
  2083. class TestFindByLabelTask:
  2084. """Find item ID given a label and a parent id
  2085. Usually used by queries with wildcards such as ItemInfo("hello/**/foo/bar")
  2086. """
  2087. # Input
  2088. # ImGuiID InPrefixId = 0; /* original C++ signature */
  2089. in_prefix_id: ID = (
  2090. 0 # A known base ID which appears BEFORE the wildcard ID (for "hello/**/foo/bar" it would be hash of "hello")
  2091. )
  2092. # int InSuffixDepth = 0; /* original C++ signature */
  2093. in_suffix_depth: int = 0 # Number of labels in a path, after unknown base ID (for "hello/**/foo/bar" it would be 2)
  2094. # const char* InSuffix = nullptr; /* original C++ signature */
  2095. in_suffix: Optional[str] = (
  2096. None # A label string which appears on ID stack after unknown base ID (for "hello/**/foo/bar" it would be "foo/bar") # (const)
  2097. )
  2098. # const char* InSuffixLastItem = nullptr; /* original C++ signature */
  2099. in_suffix_last_item: Optional[str] = (
  2100. None # A last label string (for "hello/**/foo/bar" it would be "bar") # (const)
  2101. )
  2102. # ImGuiID InSuffixLastItemHash = 0; /* original C++ signature */
  2103. in_suffix_last_item_hash: ID = 0
  2104. # ImGuiItemStatusFlags InFilterItemStatusFlags = 0; /* original C++ signature */
  2105. in_filter_item_status_flags: ItemStatusFlags = 0 # Flags required for item to be returned
  2106. # Output
  2107. # ImGuiID OutItemId = 0; /* original C++ signature */
  2108. out_item_id: ID = 0 # Result item ID
  2109. # ImGuiTestFindByLabelTask(ImGuiID InPrefixId = 0, int InSuffixDepth = 0, ImGuiID InSuffixLastItemHash = 0, ImGuiItemStatusFlags InFilterItemStatusFlags = 0, ImGuiID OutItemId = 0); /* original C++ signature */
  2110. def __init__(
  2111. self,
  2112. in_prefix_id: ID = 0,
  2113. in_suffix_depth: int = 0,
  2114. in_suffix_last_item_hash: ID = 0,
  2115. in_filter_item_status_flags: ItemStatusFlags = 0,
  2116. out_item_id: ID = 0,
  2117. ) -> None:
  2118. """Auto-generated default constructor with named params"""
  2119. pass
  2120. class TestInputType(enum.IntFlag):
  2121. # ImGuiTestInputType_None, /* original C++ signature */
  2122. none = enum.auto() # (= 0)
  2123. # ImGuiTestInputType_Key, /* original C++ signature */
  2124. key = enum.auto() # (= 1)
  2125. # ImGuiTestInputType_Char, /* original C++ signature */
  2126. char = enum.auto() # (= 2)
  2127. # ImGuiTestInputType_ViewportFocus, /* original C++ signature */
  2128. viewport_focus = enum.auto() # (= 3)
  2129. # ImGuiTestInputType_ViewportSetPos, /* original C++ signature */
  2130. viewport_set_pos = enum.auto() # (= 4)
  2131. # ImGuiTestInputType_ViewportSetSize, /* original C++ signature */
  2132. viewport_set_size = enum.auto() # (= 5)
  2133. # ImGuiTestInputType_ViewportClose /* original C++ signature */
  2134. # }
  2135. viewport_close = enum.auto() # (= 6)
  2136. class TestInput:
  2137. """FIXME: May want to strip further now that core imgui is using its own input queue"""
  2138. # ImGuiTestInputType Type = ImGuiTestInputType_None; /* original C++ signature */
  2139. type: TestInputType = TestInputType_None
  2140. # ImGuiKeyChord KeyChord = ImGuiKey_None; /* original C++ signature */
  2141. key_chord: KeyChord = Key_None
  2142. # ImWchar Char = 0; /* original C++ signature */
  2143. char: ImWchar = 0
  2144. # bool Down = false; /* original C++ signature */
  2145. down: bool = False
  2146. # ImGuiID ViewportId = 0; /* original C++ signature */
  2147. viewport_id: ID = 0
  2148. # ImVec2 ViewportPosSize; /* original C++ signature */
  2149. viewport_pos_size: ImVec2
  2150. # static ImGuiTestInput ForKeyChord(ImGuiKeyChord key_chord, bool down) /* original C++ signature */
  2151. # {
  2152. # ImGuiTestInput inp;
  2153. # inp.Type = ImGuiTestInputType_Key;
  2154. # inp.KeyChord = key_chord;
  2155. # inp.Down = down;
  2156. # return inp;
  2157. # }
  2158. @staticmethod
  2159. def for_key_chord(key_chord: KeyChord, down: bool) -> TestInput:
  2160. """(private API)"""
  2161. pass
  2162. # static ImGuiTestInput ForChar(ImWchar v) /* original C++ signature */
  2163. # {
  2164. # ImGuiTestInput inp;
  2165. # inp.Type = ImGuiTestInputType_Char;
  2166. # inp.Char = v;
  2167. # return inp;
  2168. # }
  2169. @staticmethod
  2170. def for_char(v: ImWchar) -> TestInput:
  2171. """(private API)"""
  2172. pass
  2173. # static ImGuiTestInput ForViewportFocus(ImGuiID viewport_id) /* original C++ signature */
  2174. # {
  2175. # ImGuiTestInput inp;
  2176. # inp.Type = ImGuiTestInputType_ViewportFocus;
  2177. # inp.ViewportId = viewport_id;
  2178. # return inp;
  2179. # }
  2180. @staticmethod
  2181. def for_viewport_focus(viewport_id: ID) -> TestInput:
  2182. """(private API)"""
  2183. pass
  2184. # static ImGuiTestInput ForViewportSetPos(ImGuiID viewport_id, const ImVec2& pos) /* original C++ signature */
  2185. # {
  2186. # ImGuiTestInput inp;
  2187. # inp.Type = ImGuiTestInputType_ViewportSetPos;
  2188. # inp.ViewportId = viewport_id;
  2189. # inp.ViewportPosSize = pos;
  2190. # return inp;
  2191. # }
  2192. @staticmethod
  2193. def for_viewport_set_pos(viewport_id: ID, pos: ImVec2Like) -> TestInput:
  2194. """(private API)"""
  2195. pass
  2196. # static ImGuiTestInput ForViewportSetSize(ImGuiID viewport_id, const ImVec2& size) /* original C++ signature */
  2197. # {
  2198. # ImGuiTestInput inp;
  2199. # inp.Type = ImGuiTestInputType_ViewportSetSize;
  2200. # inp.ViewportId = viewport_id;
  2201. # inp.ViewportPosSize = size;
  2202. # return inp;
  2203. # }
  2204. @staticmethod
  2205. def for_viewport_set_size(viewport_id: ID, size: ImVec2Like) -> TestInput:
  2206. """(private API)"""
  2207. pass
  2208. # static ImGuiTestInput ForViewportClose(ImGuiID viewport_id) /* original C++ signature */
  2209. # {
  2210. # ImGuiTestInput inp;
  2211. # inp.Type = ImGuiTestInputType_ViewportClose;
  2212. # inp.ViewportId = viewport_id;
  2213. # return inp;
  2214. # }
  2215. @staticmethod
  2216. def for_viewport_close(viewport_id: ID) -> TestInput:
  2217. """(private API)"""
  2218. pass
  2219. # ImGuiTestInput(ImGuiTestInputType Type = ImGuiTestInputType_None, ImGuiKeyChord KeyChord = ImGuiKey_None, ImWchar Char = 0, bool Down = false, ImGuiID ViewportId = 0, ImVec2 ViewportPosSize = ImVec2()); /* original C++ signature */
  2220. def __init__(
  2221. self,
  2222. type: TestInputType = TestInputType_None,
  2223. key_chord: Optional[KeyChord] = None,
  2224. char: ImWchar = 0,
  2225. down: bool = False,
  2226. viewport_id: ID = 0,
  2227. viewport_pos_size: Optional[ImVec2Like] = None,
  2228. ) -> None:
  2229. """Auto-generated default constructor with named params
  2230. Python bindings defaults:
  2231. If any of the params below is None, then its default value below will be used:
  2232. * KeyChord: Key_None
  2233. * ViewportPosSize: ImVec2()
  2234. """
  2235. pass
  2236. class TestInputs:
  2237. # ImVec2 MousePosValue; /* original C++ signature */
  2238. mouse_pos_value: ImVec2 # Own non-rounded copy of MousePos in order facilitate simulating mouse movement very slow speed and high-framerate
  2239. # ImVec2 MouseWheel; /* original C++ signature */
  2240. mouse_wheel: ImVec2
  2241. # ImGuiID MouseHoveredViewport = 0; /* original C++ signature */
  2242. mouse_hovered_viewport: ID = 0
  2243. # int MouseButtonsValue = 0x00; /* original C++ signature */
  2244. mouse_buttons_value: int = 0x00 # FIXME-TESTS: Use simulated_io.MouseDown[] ?
  2245. # bool HostEscDown = false; /* original C++ signature */
  2246. host_esc_down: bool = False
  2247. # float HostEscDownDuration = -1.0f; /* original C++ signature */
  2248. host_esc_down_duration: float = -1.0 # Maintain our own DownDuration for host/backend ESC key so we can abort.
  2249. # ImVec2 HostMousePos; /* original C++ signature */
  2250. host_mouse_pos: ImVec2
  2251. # ImGuiTestInputs(ImVec2 MousePosValue = ImVec2(), ImVec2 MouseWheel = ImVec2(), ImGuiID MouseHoveredViewport = 0, int MouseButtonsValue = 0x00, bool HostEscDown = false, float HostEscDownDuration = -1.0f, ImVec2 HostMousePos = ImVec2()); /* original C++ signature */
  2252. def __init__(
  2253. self,
  2254. mouse_pos_value: Optional[ImVec2Like] = None,
  2255. mouse_wheel: Optional[ImVec2Like] = None,
  2256. mouse_hovered_viewport: ID = 0,
  2257. mouse_buttons_value: int = 0x00,
  2258. host_esc_down: bool = False,
  2259. host_esc_down_duration: float = -1.0,
  2260. host_mouse_pos: Optional[ImVec2Like] = None,
  2261. ) -> None:
  2262. """Auto-generated default constructor with named params
  2263. Python bindings defaults:
  2264. If any of the params below is None, then its default value below will be used:
  2265. * MousePosValue: ImVec2()
  2266. * MouseWheel: ImVec2()
  2267. * HostMousePos: ImVec2()
  2268. """
  2269. pass
  2270. class TestEngine:
  2271. """[Internal] Test Engine Context"""
  2272. # ImGuiTestEngineIO IO; /* original C++ signature */
  2273. io: TestEngineIO
  2274. # ImGuiContext* UiContextTarget = nullptr; /* original C++ signature */
  2275. ui_context_target: Optional[Context] = None # imgui context for testing
  2276. # ImGuiContext* UiContextActive = nullptr; /* original C++ signature */
  2277. ui_context_active: Optional[Context] = None # imgui context for testing == UiContextTarget or None
  2278. # bool Started = false; /* original C++ signature */
  2279. started: bool = False
  2280. # bool UiContextHasHooks = false; /* original C++ signature */
  2281. ui_context_has_hooks: bool = False
  2282. # ImU64 BatchStartTime = 0; /* original C++ signature */
  2283. batch_start_time: ImU64 = 0
  2284. # ImU64 BatchEndTime = 0; /* original C++ signature */
  2285. batch_end_time: ImU64 = 0
  2286. # int FrameCount = 0; /* original C++ signature */
  2287. frame_count: int = 0
  2288. # float OverrideDeltaTime = -1.0f; /* original C++ signature */
  2289. override_delta_time: float = (
  2290. -1.0
  2291. ) # Inject custom delta time into imgui context to simulate clock passing faster than wall clock time.
  2292. # ImGuiTestContext* TestContext = nullptr; /* original C++ signature */
  2293. test_context: Optional[TestContext] = None # Running test context
  2294. # bool TestsSourceLinesDirty = false; /* original C++ signature */
  2295. tests_source_lines_dirty: bool = False
  2296. # ImGuiTestGatherTask GatherTask; /* original C++ signature */
  2297. gather_task: TestGatherTask
  2298. # ImGuiTestFindByLabelTask FindByLabelTask; /* original C++ signature */
  2299. find_by_label_task: TestFindByLabelTask
  2300. # ImGuiTextBuffer StringBuilderForChecks; /* original C++ signature */
  2301. string_builder_for_checks: TextBuffer
  2302. # ImGuiTestInputs Inputs; /* original C++ signature */
  2303. # Inputs
  2304. inputs: TestInputs
  2305. # UI support
  2306. # bool Abort = false; /* original C++ signature */
  2307. abort: bool = False
  2308. # ImGuiTest* UiSelectAndScrollToTest = nullptr; /* original C++ signature */
  2309. ui_select_and_scroll_to_test: Optional[Test] = None
  2310. # ImGuiTest* UiSelectedTest = nullptr; /* original C++ signature */
  2311. ui_selected_test: Optional[Test] = None
  2312. # bool UiMetricsOpen = false; /* original C++ signature */
  2313. ui_metrics_open: bool = False
  2314. # bool UiDebugLogOpen = false; /* original C++ signature */
  2315. ui_debug_log_open: bool = False
  2316. # bool UiCaptureToolOpen = false; /* original C++ signature */
  2317. ui_capture_tool_open: bool = False
  2318. # bool UiStackToolOpen = false; /* original C++ signature */
  2319. ui_stack_tool_open: bool = False
  2320. # bool UiPerfToolOpen = false; /* original C++ signature */
  2321. ui_perf_tool_open: bool = False
  2322. # float UiLogHeight = 150.0f; /* original C++ signature */
  2323. ui_log_height: float = 150.0
  2324. # Performance Monitor
  2325. # double PerfRefDeltaTime; /* original C++ signature */
  2326. perf_ref_delta_time: float
  2327. # Screen/Video Capturing
  2328. # Tools
  2329. # bool PostSwapCalled = false; /* original C++ signature */
  2330. post_swap_called: bool = False
  2331. # bool ToolDebugRebootUiContext = false; /* original C++ signature */
  2332. tool_debug_reboot_ui_context: bool = False # Completely shutdown and recreate the dear imgui context in place
  2333. # bool ToolSlowDown = false; /* original C++ signature */
  2334. tool_slow_down: bool = False
  2335. # int ToolSlowDownMs = 100; /* original C++ signature */
  2336. tool_slow_down_ms: int = 100
  2337. # ImGuiTestRunSpeed BackupConfigRunSpeed = ImGuiTestRunSpeed_Fast; /* original C++ signature */
  2338. backup_config_run_speed: TestRunSpeed = TestRunSpeed_Fast
  2339. # bool BackupConfigNoThrottle = false; /* original C++ signature */
  2340. backup_config_no_throttle: bool = False
  2341. # ImGuiTestEngine(); /* original C++ signature */
  2342. def __init__(self) -> None:
  2343. """Functions"""
  2344. pass
  2345. # -------------------------------------------------------------------------
  2346. # INTERNAL FUNCTIONS
  2347. # -------------------------------------------------------------------------
  2348. # ImGuiTestItemInfo* ImGuiTestEngine_FindItemInfo(ImGuiTestEngine* engine, ImGuiID id, const char* debug_id); /* original C++ signature */
  2349. def find_item_info(engine: TestEngine, id_: ID, debug_id: str) -> TestItemInfo:
  2350. """(private API)"""
  2351. pass
  2352. # void ImGuiTestEngine_Yield(ImGuiTestEngine* engine); /* original C++ signature */
  2353. def yield_(engine: TestEngine) -> None:
  2354. """(private API)"""
  2355. pass
  2356. # void ImGuiTestEngine_SetDeltaTime(ImGuiTestEngine* engine, float delta_time); /* original C++ signature */
  2357. def set_delta_time(engine: TestEngine, delta_time: float) -> None:
  2358. """(private API)"""
  2359. pass
  2360. # int ImGuiTestEngine_GetFrameCount(ImGuiTestEngine* engine); /* original C++ signature */
  2361. def get_frame_count(engine: TestEngine) -> int:
  2362. """(private API)"""
  2363. pass
  2364. # bool ImGuiTestEngine_PassFilter(ImGuiTest* test, const char* filter); /* original C++ signature */
  2365. def pass_filter(test: Test, filter: str) -> bool:
  2366. """(private API)"""
  2367. pass
  2368. # void ImGuiTestEngine_RunTest(ImGuiTestEngine* engine, ImGuiTestContext* ctx, ImGuiTest* test, ImGuiTestRunFlags run_flags); /* original C++ signature */
  2369. def run_test(engine: TestEngine, ctx: TestContext, test: Test, run_flags: TestRunFlags) -> None:
  2370. """(private API)"""
  2371. pass
  2372. # void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx); /* original C++ signature */
  2373. def bind_im_gui_context(engine: TestEngine, ui_ctx: Context) -> None:
  2374. """(private API)"""
  2375. pass
  2376. # void ImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx); /* original C++ signature */
  2377. def unbind_im_gui_context(engine: TestEngine, ui_ctx: Context) -> None:
  2378. """(private API)"""
  2379. pass
  2380. # void ImGuiTestEngine_RebootUiContext(ImGuiTestEngine* engine); /* original C++ signature */
  2381. def reboot_ui_context(engine: TestEngine) -> None:
  2382. """(private API)"""
  2383. pass
  2384. # void ImGuiTestEngine_UpdateTestsSourceLines(ImGuiTestEngine* engine); /* original C++ signature */
  2385. def update_tests_source_lines(engine: TestEngine) -> None:
  2386. """(private API)"""
  2387. pass
  2388. # Screen/Video Capturing
  2389. # Helper functions
  2390. # const char* ImGuiTestEngine_GetStatusName(ImGuiTestStatus v); /* original C++ signature */
  2391. def get_status_name(v: TestStatus) -> str:
  2392. """(private API)"""
  2393. pass
  2394. # const char* ImGuiTestEngine_GetRunSpeedName(ImGuiTestRunSpeed v); /* original C++ signature */
  2395. def get_run_speed_name(v: TestRunSpeed) -> str:
  2396. """(private API)"""
  2397. pass
  2398. # const char* ImGuiTestEngine_GetVerboseLevelName(ImGuiTestVerboseLevel v); /* original C++ signature */
  2399. def get_verbose_level_name(v: TestVerboseLevel) -> str:
  2400. """(private API)"""
  2401. pass
  2402. # -------------------------------------------------------------------------
  2403. #################### </generated_from:imgui_te_internal.h> ####################
  2404. #################### <generated_from:imgui_te_ui.h> ####################
  2405. # dear imgui test engine
  2406. # (ui)
  2407. # If you run tests in an interactive or visible application, you may want to call ImGuiTestEngine_ShowTestEngineWindows()
  2408. # This file is governed by the "Dear ImGui Test Engine License".
  2409. # Details of the license are provided in the LICENSE.txt file in the same directory.
  2410. # Provide access to:
  2411. # - "Dear ImGui Test Engine" main interface
  2412. # - "Dear ImGui Capture Tool"
  2413. # - "Dear ImGui Perf Tool"
  2414. # - other core debug functions: Metrics, Debug Log
  2415. # Functions
  2416. # IMGUI_API void ImGuiTestEngine_ShowTestEngineWindows(ImGuiTestEngine* engine, bool* p_open); /* original C++ signature */
  2417. def show_test_engine_windows(engine: TestEngine, p_open: bool) -> bool:
  2418. pass
  2419. # IMGUI_API void ImGuiTestEngine_OpenSourceFile(ImGuiTestEngine* engine, const char* source_filename, int source_line_no); /* original C++ signature */
  2420. def open_source_file(engine: TestEngine, source_filename: str, source_line_no: int) -> None:
  2421. pass
  2422. #################### </generated_from:imgui_te_ui.h> ####################
  2423. #################### <generated_from:imgui_capture_tool.h> ####################
  2424. # dear imgui test engine
  2425. # (screen/video capture tool)
  2426. # This is usable as a standalone applet or controlled by the test engine.
  2427. # This file is governed by the "Dear ImGui Test Engine License".
  2428. # Details of the license are provided in the LICENSE.txt file in the same directory.
  2429. # Need "imgui_te_engine.h" included for ImFuncPtr
  2430. # -----------------------------------------------------------------------------
  2431. # Forward declarations
  2432. # -----------------------------------------------------------------------------
  2433. # Our types
  2434. # External types
  2435. # -----------------------------------------------------------------------------
  2436. class CaptureFlags_(enum.IntFlag):
  2437. # ImGuiCaptureFlags_None = 0, /* original C++ signature */
  2438. none = enum.auto() # (= 0)
  2439. # ImGuiCaptureFlags_StitchAll = 1 << 0, /* original C++ signature */
  2440. stitch_all = (
  2441. enum.auto()
  2442. ) # (= 1 << 0) # Capture entire window scroll area (by scrolling and taking multiple screenshot). Only works for a single window.
  2443. # ImGuiCaptureFlags_IncludeOtherWindows = 1 << 1, /* original C++ signature */
  2444. include_other_windows = (
  2445. enum.auto()
  2446. ) # (= 1 << 1) # Disable hiding other windows (when CaptureAddWindow has been called by default other windows are hidden)
  2447. # ImGuiCaptureFlags_IncludePopups = 1 << 2, /* original C++ signature */
  2448. include_popups = (
  2449. enum.auto()
  2450. ) # (= 1 << 2) # Expand capture area to automatically include visible popups (Unused if ImGuiCaptureFlags_IncludeOtherWindows is set)
  2451. # ImGuiCaptureFlags_HideMouseCursor = 1 << 3, /* original C++ signature */
  2452. hide_mouse_cursor = enum.auto() # (= 1 << 3) # Hide render software mouse cursor during capture.
  2453. # ImGuiCaptureFlags_Instant = 1 << 4, /* original C++ signature */
  2454. instant = (
  2455. enum.auto()
  2456. ) # (= 1 << 4) # Perform capture on very same frame. Only works when capturing a rectangular region. Unsupported features: content stitching, window hiding, window relocation.
  2457. # ImGuiCaptureFlags_NoSave = 1 << 5 /* original C++ signature */
  2458. no_save = enum.auto() # (= 1 << 5) # Do not save output image.
  2459. class CaptureArgs:
  2460. """Defines input and output arguments for capture process.
  2461. When capturing from tests you can usually use the ImGuiTestContext::CaptureXXX() helpers functions.
  2462. """
  2463. # [Input]
  2464. # ImGuiCaptureFlags InFlags = 0; /* original C++ signature */
  2465. in_flags: CaptureFlags = 0 # Flags for customizing behavior of screenshot tool.
  2466. # ImVector<ImGuiWindow*> InCaptureWindows; /* original C++ signature */
  2467. in_capture_windows: ImVector_Window_ptr # Windows to capture. All other windows will be hidden. May be used with InCaptureRect to capture only some windows in specified rect.
  2468. # ImRect InCaptureRect; /* original C++ signature */
  2469. in_capture_rect: ImRect # Screen rect to capture. Does not include padding.
  2470. # float InPadding = 16.0f; /* original C++ signature */
  2471. in_padding: float = (
  2472. 16.0 # 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.
  2473. )
  2474. # int InRecordFPSTarget = 30; /* original C++ signature */
  2475. in_record_fps_target: int = 30 # FPS target for recording videos.
  2476. # int InSizeAlign = 0; /* original C++ signature */
  2477. in_size_align: int = (
  2478. 0 # Resolution alignment (0 = auto, 1 = no alignment, >= 2 = align width/height to be multiple of given value)
  2479. )
  2480. # [Output]
  2481. # ImVec2 OutImageSize; /* original C++ signature */
  2482. out_image_size: ImVec2 # Produced image size.
  2483. # ImGuiCaptureArgs(ImGuiCaptureFlags InFlags = 0, ImVector<ImGuiWindow*> InCaptureWindows = ImVector<ImGuiWindow*>(), ImRect InCaptureRect = ImRect(), float InPadding = 16.0f, int InRecordFPSTarget = 30, int InSizeAlign = 0, ImVec2 OutImageSize = ImVec2()); /* original C++ signature */
  2484. def __init__(
  2485. self,
  2486. in_flags: CaptureFlags = 0,
  2487. in_capture_windows: Optional[ImVector_Window] = None,
  2488. in_capture_rect: Optional[ImRect] = None,
  2489. in_padding: float = 16.0,
  2490. in_record_fps_target: int = 30,
  2491. in_size_align: int = 0,
  2492. out_image_size: Optional[ImVec2Like] = None,
  2493. ) -> None:
  2494. """Auto-generated default constructor with named params
  2495. Python bindings defaults:
  2496. If any of the params below is None, then its default value below will be used:
  2497. * InCaptureWindows: ImVector_Window_ptr()
  2498. * InCaptureRect: ImRect()
  2499. * OutImageSize: ImVec2()
  2500. """
  2501. pass
  2502. class CaptureStatus(enum.IntFlag):
  2503. # ImGuiCaptureStatus_InProgress, /* original C++ signature */
  2504. in_progress = enum.auto() # (= 0)
  2505. # ImGuiCaptureStatus_Done, /* original C++ signature */
  2506. done = enum.auto() # (= 1)
  2507. # ImGuiCaptureStatus_Error /* original C++ signature */
  2508. # }
  2509. error = enum.auto() # (= 2)
  2510. class CaptureWindowData:
  2511. # ImGuiWindow* Window; /* original C++ signature */
  2512. window: Window
  2513. # ImRect BackupRect; /* original C++ signature */
  2514. backup_rect: ImRect
  2515. # ImVec2 PosDuringCapture; /* original C++ signature */
  2516. pos_during_capture: ImVec2
  2517. # ImGuiCaptureWindowData(ImRect BackupRect = ImRect(), ImVec2 PosDuringCapture = ImVec2()); /* original C++ signature */
  2518. def __init__(self, backup_rect: Optional[ImRect] = None, pos_during_capture: Optional[ImVec2Like] = None) -> None:
  2519. """Auto-generated default constructor with named params
  2520. Python bindings defaults:
  2521. If any of the params below is None, then its default value below will be used:
  2522. * BackupRect: ImRect()
  2523. * PosDuringCapture: ImVec2()
  2524. """
  2525. pass
  2526. # -----------------------------------------------------------------------------
  2527. # ImGuiCaptureToolUI
  2528. # -----------------------------------------------------------------------------
  2529. #################### </generated_from:imgui_capture_tool.h> ####################
  2530. # </litgen_stub> // Autogenerated code end!