hello_imgui.pyi 176 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960
  1. """Hello, Dear ImGui: cross-platform Gui apps for Windows / Mac / Linux / iOS / Android / Emscripten with the simplicity of a "Hello World" app
  2. https://github.com/pthom/hello_imgui
  3. """
  4. ###############################################################################
  5. # This file is a part of Dear ImGui Bundle, NOT a part of Hello ImGui
  6. # -----------------------------------------------------------------------------
  7. # hello_imgui.pyi is the equivalent of hello_imgui.h, using the bindings
  8. # provided by Dear ImGui Bundle.
  9. #
  10. # Most of the code of this file is automatically generated (using https://pthom.github.io/litgen/),
  11. # and is generally very close to the C++ version. Comments, docs are identical.
  12. # Do not manually edit the autogenerated parts (look for "Autogenerated" comments)!
  13. ###############################################################################
  14. # ruff: noqa: F811, B008, F821
  15. from typing import List, Any, Callable, Tuple, Optional, overload, Dict
  16. import numpy as np
  17. import enum
  18. from imgui_bundle.imgui import DockNodeFlags_, DockNodeFlags
  19. from imgui_bundle.imgui import (
  20. ImVec2,
  21. ImVec4,
  22. ImVec2Like,
  23. ImVec4Like,
  24. ImFontConfig,
  25. ImFont,
  26. ImTextureID,
  27. Dir,
  28. Cond_,
  29. )
  30. from imgui_bundle.imgui import test_engine
  31. # Notebook convenience API (injected at runtime)
  32. from . import hello_imgui_nb as nb # noqa: F401
  33. # Manual code
  34. import imgui_bundle.imgui
  35. ImGuiID = int
  36. ImGuiDefaultSettings = imgui_default_settings # noqa: F821
  37. ImGuiDockNodeFlags_ = DockNodeFlags_
  38. ImGuiDockNodeFlags = DockNodeFlags
  39. DockSpaceName = str
  40. ImGuiTestEngine = test_engine.TestEngine
  41. VoidFunction = Callable[[], None]
  42. AnyEventCallback = Callable[[Any], None]
  43. ScreenSize = Tuple[int, int]
  44. ScreenPosition = Tuple[int, int]
  45. ImGuiCond_FirstUseEver = Cond_.first_use_ever
  46. ImGuiDockNodeFlags_None = DockNodeFlags_.none
  47. ImGuiDockNodeFlags_PassthruCentralNode = DockNodeFlags_.passthru_central_node
  48. DefaultScreenSize = (800, 600)
  49. DefaultWindowSize = (800, 600)
  50. DefaultScreenPosition = (40, 40)
  51. ImGuiCond = imgui_bundle.imgui.Cond
  52. ImGuiDir_Down = Dir.down
  53. ImGuiTheme = imgui_bundle.hello_imgui
  54. ImGuiStyle = imgui_bundle.imgui.Style
  55. ImGuiDir = imgui_bundle.imgui.Dir
  56. ImGuiWindowFlags = imgui_bundle.imgui.WindowFlags
  57. # ImWcharPair is used to defined unicode glyph ranges
  58. ImWchar = int
  59. ImWcharPair = Tuple[int, int]
  60. DictTypeInputTextData = dict[str, Any]
  61. def EmptyVoidFunction() -> VoidFunction:
  62. pass
  63. def EmptyEventCallback() -> AnyEventCallback:
  64. pass
  65. def set_load_asset_file_data_function(fn: Callable[[str], bytes]) -> None:
  66. """Register a Python callback that receives an asset and returns the file contents as a **bytes** object.
  67. Example
  68. -------
  69. ```python
  70. def my_loader(filename: str) -> bytes:
  71. from pathlib import Path
  72. return Path(filename).read_bytes()
  73. hello_imgui.set_load_file_bytes_func(my_loader)
  74. """
  75. pass
  76. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  77. # <litgen_stub> // Autogenerated code below! Do not edit!
  78. #################### <generated_from:hello_imgui_amalgamation.h> ####################
  79. # THIS FILE WAS GENERATED AUTOMATICALLY. DO NOT EDIT.
  80. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  81. # hello_imgui.h //
  82. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  83. # @@md#DpiAwareParams
  84. class DpiAwareParams:
  85. """
  86. Hello ImGui will try its best to automatically handle DPI scaling for you.
  87. Parameter to change the scaling behavior:
  88. ------------------------------------------
  89. - `dpiWindowSizeFactor`:
  90. factor by which window size should be multiplied
  91. By default, Hello ImGui will compute it automatically, when it is set to 0.
  92. How to set manually:
  93. ---------------------------------
  94. If it fails (i.e. your window and/or fonts are too big or too small),
  95. you may set them manually:
  96. (1) Either by setting them programmatically in your application
  97. (set their values in `runnerParams.dpiAwareParams`)
  98. (2) Either by setting them in a `hello_imgui.ini` file. See hello_imgui/hello_imgui_example.ini for more info
  99. Note: if several methods are used, the order of priority is (1) > (2)
  100. For more information, see the documentation on DPI handling, here: https://pthom.github.io/hello_imgui/book/doc_api.html#handling-screens-with-high-dpi
  101. """
  102. # float dpiWindowSizeFactor = 0.0f; /* original C++ signature */
  103. # `dpiWindowSizeFactor`
  104. # factor by which window size should be multiplied to get a similar
  105. # physical size on different OSes (as if they were all displayed on a 96 PPI screen).
  106. # This affects the size of native app windows,
  107. # but *not* imgui Windows, and *not* the size of widgets and text.
  108. # In a standard environment (i.e. outside of Hello ImGui), an application with a size of 960x480 pixels,
  109. # may have a physical size (in mm or inches) that varies depending on the screen DPI, and the OS.
  110. #
  111. # Inside Hello ImGui, the window size is always treated as targeting a 96 PPI screen, so that its size will
  112. # look similar whatever the OS and the screen DPI.
  113. # In our example, our 960x480 pixels window will try to correspond to a 10x5 inches window
  114. #
  115. # Hello ImGui does its best to compute it on all OSes.
  116. # However, if it fails you may set its value manually.
  117. # If it is set to 0, Hello ImGui will compute it automatically,
  118. # and the resulting value will be stored in `dpiWindowSizeFactor`.
  119. dpi_window_size_factor: float = 0.0
  120. # float DpiFontLoadingFactor() const { /* original C++ signature */
  121. # return dpiWindowSizeFactor;
  122. # }
  123. def dpi_font_loading_factor(self) -> float:
  124. """`DpiFontLoadingFactor`
  125. factor by which font size should be multiplied at loading time to get a similar visible size on different OSes.
  126. This is equal to dpiWindowSizeFactor
  127. The size will be equivalent to a size given for a 96 PPI screen
  128. """
  129. pass
  130. # DpiAwareParams(float dpiWindowSizeFactor = 0.0f); /* original C++ signature */
  131. def __init__(self, dpi_window_size_factor: float = 0.0) -> None:
  132. """Auto-generated default constructor with named params"""
  133. pass
  134. # ----------------------------------------------------------------------------
  135. # @@md
  136. # *
  137. # @@md#DocEmToVec2
  138. #
  139. # Special care must be taken in order to correctly handle screen with high DPI
  140. # (for example, almost all recent laptops screens).
  141. #
  142. # Using ImVec2 with fixed values is *almost always a bad idea* if you intend your
  143. # application to be used on high DPI screens!
  144. # Otherwise, widgets might be misplaced or too small on different screens and/or OS.
  145. #
  146. # Instead, you should use scale your widgets and windows relatively to the font size,
  147. # as is done with the [em CSS Unit](https://www.w3schools.com/cssref/css_units.php).
  148. #
  149. # @@md
  150. # *
  151. # @@md#EmToVec2
  152. # __HelloImGui::EmToVec2()__ returns an ImVec2 that you can use to size
  153. # or place your widgets in a DPI independent way.
  154. # Values are in multiples of the font size (i.e. as in the em CSS unit).
  155. # ImVec2 EmToVec2(float x, float y); /* original C++ signature */
  156. @overload
  157. def em_to_vec2(x: float, y: float) -> ImVec2:
  158. pass
  159. # ImVec2 EmToVec2(ImVec2 v); /* original C++ signature */
  160. @overload
  161. def em_to_vec2(v: ImVec2Like) -> ImVec2:
  162. pass
  163. # float EmSize(); /* original C++ signature */
  164. @overload
  165. def em_size() -> float:
  166. """__HelloImGui::EmSize()__ returns the visible font size on the screen."""
  167. pass
  168. # float EmSize(float nbLines); /* original C++ signature */
  169. @overload
  170. def em_size(nb_lines: float) -> float:
  171. """__HelloImGui::EmSize(nbLines)__ returns a size corresponding to nbLines text lines"""
  172. pass
  173. # ImVec2 PixelsToEm(ImVec2 pixels); /* original C++ signature */
  174. def pixels_to_em(pixels: ImVec2Like) -> ImVec2:
  175. """__HelloImGui::PixelToEm()__ converts a Vec2 in pixels coord to a Vec2 in em units"""
  176. pass
  177. # float PixelSizeToEm(float pixelSize); /* original C++ signature */
  178. def pixel_size_to_em(pixel_size: float) -> float:
  179. """__HelloImGui::PixelSizeToEm()__ converts a size in pixels coord to a size in em units"""
  180. pass
  181. # @@md
  182. # DpiAwareParams* GetDpiAwareParams(); /* original C++ signature */
  183. def get_dpi_aware_params() -> DpiAwareParams:
  184. """Returns the current DpiAwareParams, which are used
  185. for font loading and window size scaling
  186. """
  187. pass
  188. # ----------------------------------------------------------------------------
  189. #
  190. # Legacy API, you should use RunnerParams.dpiAwareParams instead
  191. #
  192. # float DpiFontLoadingFactor(); /* original C++ signature */
  193. def dpi_font_loading_factor() -> float:
  194. """Multiply font sizes by this factor when loading fonts manually with ImGui::GetIO().Fonts->AddFont...
  195. (HelloImGui::LoadFontTTF does this by default)
  196. """
  197. pass
  198. # float DpiWindowSizeFactor(); /* original C++ signature */
  199. def dpi_window_size_factor() -> float:
  200. """DpiWindowSizeFactor() is the factor by which window size should be multiplied to get a similar visible size on different OSes.
  201. It returns ApplicationScreenPixelPerInch / 96 under windows and linux. Under macOS, it will return 1.
  202. """
  203. pass
  204. # ----------------------------------------------------------------------------
  205. # Handling screens with high DPI
  206. # ----------------------------------------------------------------------------
  207. #
  208. # @@md#HandlingScreenHighDPI
  209. #
  210. # _Note: This part is relevant only for more advanced usages. If you use `HelloImGui::LoadFont()`,
  211. # and always use `HelloImGui::EmToVec2()` to place widgets, you do not need to worry about DPI handling_
  212. #
  213. ### OS specificities
  214. #
  215. # There are several important things to know about high-DPI handling within Hello ImGui and Dear ImGui:
  216. #
  217. # 1. (virtual) screen coordinates vs (physical) pixels
  218. # 2. DisplayFramebufferScale: Frame buffer size vs window size
  219. # 3. FontGlobalScale: display-time font scaling factor
  220. # 4. How to load fonts with the correct size
  221. # 5. How to get similar window sizes on different OSes/DPI
  222. #
  223. #
  224. ### Screen coordinates
  225. #
  226. # Screen coordinates are the coordinates you use to place and size windows on the screen.
  227. #
  228. # **Screen coordinates do not always correspond to physical pixels**
  229. #
  230. # - On macOS/iOS retina screens, a screen coordinate corresponds typically
  231. # to 2x2 physical pixels (but this may vary if you change the display scaling)
  232. # - On most Linux distributions, whenever there is a high DPI screen
  233. # you can set the display scale. For example if you set the scale to 300%,
  234. # then a screen coordinate will correspond to 3x3 physical pixels
  235. # - On Windows, there are two possible situations:
  236. # - If the application is DPI aware, a screen coordinate corresponds to 1x1 physical pixel,
  237. # and you can use the full extent of your screen resolution.
  238. # - If the application is not DPI aware, a screen coordinate may correspond to 2x2 physical pixels
  239. # (if the display scaling is set to 200% for example). However, the rendering of your application
  240. # will be blurry and will not use the full extent of your screen resolution.
  241. # - Notes:
  242. # - Applications created with HelloImGui are DPI aware by default (when using glfw and sdl backends).
  243. # - SDL applications are normally not DPI aware. However, HelloImGui makes them DPI aware.
  244. #
  245. #
  246. ### DisplayFramebufferScale
  247. # `DisplayFramebufferScale` is the ratio between the frame buffer size and the window size.
  248. #
  249. # The frame buffer size is the size of the internal buffer used by the rendering backend.
  250. # It might be bigger than the actual window size.
  251. # `ImVec2 ImGui::GetIO().DisplayFramebufferScale` is a factor by which the frame buffer size is bigger than the window size.
  252. # It is set by the platform backend after it was initialized, and typically reflects the scaling ratio between
  253. # physical pixels and screen coordinates.
  254. #
  255. # Under windows, it will always be (1,1). Under macOS / linux, it will reflect the current display scaling.
  256. # It will typically be (2,2) on a macOS retina screen.
  257. #
  258. # Notes:
  259. # - You cannot change DisplayFramebufferScale manually, it will be reset at each new frame, by asking the platform backend.
  260. #
  261. #
  262. ### How to load fonts with the correct size
  263. #
  264. #### Using HelloImGui (recommended)
  265. #
  266. # [`HelloImGui::LoadFont()`](https://pthom.github.io/hello_imgui/book/doc_api.html#load-fonts) will load fonts
  267. # with the correct size, taking into account the DPI scaling.
  268. #
  269. #### Using Dear ImGui
  270. # `ImGui::GetIO().Fonts->AddFontFromFileTTF()` loads a font with a given size, in *physical pixels*.
  271. # KKDYNFONT: TBC...
  272. #
  273. ### Reproducible physical window sizes (in mm or inches)
  274. #
  275. #### Using HelloImGui
  276. # Simply specify a window size that corresponds to theoretical 96 PPI screen (inside `RunnerParams.appWindowParams.windowGeometry.size`)
  277. #
  278. #### Using your own code to create the backend window
  279. # If you prefer to create the window by yourself, its physical size in millimeters may vary widely,
  280. # depending on the OS and the current screen DPI setting.
  281. # Typically under Windows, your window may appear to be very small if your screen is high DPI.
  282. #
  283. # To get a similar window size on different OSes/DPI, you should multiply the window size by `HelloImGui::DpiWindowSizeFactor()`.
  284. #
  285. # Note: DpiWindowSizeFactor() is equal to `CurrentScreenPixelPerInch / 96` under windows and linux, and always 1 under macOS.
  286. #
  287. ### Fine tune DPI Handling
  288. #
  289. # See [`HelloImGui::DpiAwareParams`](https://pthom.github.io/hello_imgui/book/doc-params/#dpi-aware-params)
  290. # for more information on how to fine tune DPI handling when using Hello ImGui.
  291. # @@md
  292. #
  293. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  294. # hello_imgui/hello_imgui_assets.h included by hello_imgui.h //
  295. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  296. # *
  297. # @@md#AssetsStructure
  298. #
  299. # Assets located beside the application CMakeLists are embedded automatically.
  300. #
  301. # For example, you can have the following project structure:
  302. # ```
  303. # my_app/
  304. # ├── CMakeLists.txt # Your app's CMakeLists
  305. # ├── assets/ # Its assets: for mobile devices and emscripten
  306. # │ └── fonts/ # they are embedded automatically by hello_imgui_add_app.cmake
  307. # │ └── my_font.ttf
  308. # ├── my_app.main.cpp # Its source code
  309. # ```
  310. #
  311. # Then you can load the asset "fonts/my_font.ttf", on all platforms.
  312. #
  313. # @@md
  314. #
  315. # @@md#LoadAssetFileData
  316. class AssetFileData:
  317. # void * data = nullptr; /* original C++ signature */
  318. data: Optional[Any] = None
  319. # size_t dataSize = 0; /* original C++ signature */
  320. data_size: int = 0
  321. # AssetFileData(size_t dataSize = 0); /* original C++ signature */
  322. def __init__(self, data_size: int = 0) -> None:
  323. """Auto-generated default constructor with named params"""
  324. pass
  325. # AssetFileData LoadAssetFileData(const char *assetPath); /* original C++ signature */
  326. def load_asset_file_data(asset_path: str) -> AssetFileData:
  327. """LoadAssetFileData(const char *assetPath)`
  328. Will load an entire asset file into memory. This works on all platforms,
  329. including android.
  330. You *have* to call FreeAssetFileData to free the memory, except if you use
  331. ImGui::GetIO().Fonts->AddFontFromMemoryTTF, which will take ownership of the
  332. data and free it for you.
  333. This function can be redirected with setLoadAssetFileDataFunction. If not redirected,
  334. it calls DefaultLoadAssetFileData.
  335. """
  336. pass
  337. # void FreeAssetFileData(AssetFileData * assetFileData); /* original C++ signature */
  338. def free_asset_file_data(asset_file_data: AssetFileData) -> None:
  339. """FreeAssetFileData(AssetFileData *)
  340. Will free the memory.
  341. Note: "ImGui::GetIO().Fonts->AddFontFromMemoryTTF" takes ownership of the data
  342. and will free the memory for you.
  343. """
  344. pass
  345. # @@md
  346. # AssetFileData DefaultLoadAssetFileData(const char *assetPath); /* original C++ signature */
  347. def default_load_asset_file_data(asset_path: str) -> AssetFileData:
  348. """This function actually performs the asset load, as described in
  349. LoadAssetFileData
  350. """
  351. pass
  352. # @@md#assetFileFullPath
  353. # std::string AssetFileFullPath(const std::string& assetRelativeFilename, /* original C++ signature */
  354. # bool assertIfNotFound = true);
  355. def asset_file_full_path(
  356. asset_relative_filename: str, assert_if_not_found: bool = True
  357. ) -> str:
  358. """`std::string AssetFileFullPath(const std::string& assetRelativeFilename)`
  359. will return the path to assets.
  360. This works under all platforms *except Android*
  361. For compatibility with Android and other platforms, prefer to use `LoadAssetFileData`
  362. whenever possible.
  363. * Under iOS it will give a path in the app bundle (/private/XXX/....)
  364. * Under emscripten, it will be stored in the virtual filesystem at "/"
  365. * Under Android, assetFileFullPath is *not* implemented, and will throw an error:
  366. assets can be compressed under android, and you can't use standard file operations!
  367. Use LoadAssetFileData instead
  368. """
  369. pass
  370. # bool AssetExists(const std::string& assetRelativeFilename); /* original C++ signature */
  371. def asset_exists(asset_relative_filename: str) -> bool:
  372. """Returns True if this asset file exists"""
  373. pass
  374. # @@md
  375. # @@md#AssetsSearchPaths
  376. # void SetAssetsFolder(const std::string& folder); /* original C++ signature */
  377. def set_assets_folder(folder: str) -> None:
  378. """Sets the assets folder location
  379. (when using this, automatic assets installation on mobile platforms may not work)
  380. """
  381. pass
  382. # Assets search paths provide additional locations where assets can be found,
  383. # giving a unified view across multiple folders. When loading an asset, the
  384. # search order is:
  385. # 1. The main assets folder (set by SetAssetsFolder(), or the default
  386. # platform-specific locations such as exe_folder/assets)
  387. # 2. Each search path added by AddAssetsSearchPath(), in order
  388. # 3. Other built-in platform-specific fallback locations
  389. #
  390. # The first match wins. This is useful when assets are split across
  391. # directories — for example, core assets (fonts, icons) in one folder
  392. # and demo-specific assets (extra images, specialty fonts) in another.
  393. #
  394. # Note: search paths are a runtime-only mechanism. Unlike the main assets
  395. # folder (which CMake can bundle into the application for mobile/emscripten),
  396. # search path folders are not automatically embedded at compile time.
  397. # They are intended for desktop or Python usage where the filesystem
  398. # is directly accessible.
  399. # void AddAssetsSearchPath(const std::string& folder); /* original C++ signature */
  400. def add_assets_search_path(folder: str) -> None:
  401. """Add a folder to the asset search paths."""
  402. pass
  403. # void ClearAssetsSearchPaths(); /* original C++ signature */
  404. def clear_assets_search_paths() -> None:
  405. """Remove all previously added search paths."""
  406. pass
  407. # const std::vector<std::string>& GetAssetsSearchPaths(); /* original C++ signature */
  408. def get_assets_search_paths() -> List[str]:
  409. """Return the current list of search paths."""
  410. pass
  411. # @@md
  412. # void overrideAssetsFolder(const char* folder); /* original C++ signature */
  413. def override_assets_folder(folder: str) -> None:
  414. """synonym of SetAssetsFolder"""
  415. pass
  416. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  417. # hello_imgui/hello_imgui_error.h included by hello_imgui.h //
  418. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  419. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  420. # hello_imgui/hello_imgui_logger.h included by hello_imgui.h //
  421. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  422. class LogLevel(enum.IntEnum):
  423. # Debug, /* original C++ signature */
  424. debug = enum.auto() # (= 0)
  425. # Info, /* original C++ signature */
  426. info = enum.auto() # (= 1)
  427. # Warning, /* original C++ signature */
  428. warning = enum.auto() # (= 2)
  429. # Error /* original C++ signature */
  430. # }
  431. error = enum.auto() # (= 3)
  432. # void Log(LogLevel level, char const* const format, ...); /* original C++ signature */
  433. def log(level: LogLevel, format: str) -> None:
  434. pass
  435. # void LogClear(); /* original C++ signature */
  436. def log_clear() -> None:
  437. pass
  438. # void LogGui(ImVec2 size=ImVec2(0.f, 0.f)); /* original C++ signature */
  439. # }
  440. def log_gui(size: Optional[ImVec2Like] = None) -> None:
  441. """Python bindings defaults:
  442. If size is None, then its default value will be: ImVec2(0., 0.)
  443. """
  444. pass
  445. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  446. # hello_imgui/image_from_asset.h included by hello_imgui.h //
  447. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  448. # @@md#HelloImGui::ImageFromAsset
  449. #
  450. # Images are loaded when first displayed, and then cached
  451. # (they will be freed just before the application exits).
  452. #
  453. # For example, given this files structure:
  454. # ```
  455. # ├── CMakeLists.txt
  456. # ├── assets/
  457. # │ └── my_image.jpg
  458. # └── my_app.main.cpp
  459. # ```
  460. #
  461. # then, you can display "my_image.jpg", using:
  462. #
  463. # ```cpp
  464. # HelloImGui::ImageFromAsset("my_image.jpg");
  465. # ```
  466. # void ImageFromAsset(const char *assetPath, const ImVec2& size = ImVec2(0, 0), /* original C++ signature */
  467. # const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1));
  468. def image_from_asset(
  469. asset_path: str,
  470. size: Optional[ImVec2Like] = None,
  471. uv0: Optional[ImVec2Like] = None,
  472. uv1: Optional[ImVec2Like] = None,
  473. ) -> None:
  474. """`HelloImGui::ImageFromAsset(const char *assetPath, size, ...)`:
  475. will display a static image from the assets.
  476. Python bindings defaults:
  477. If any of the params below is None, then its default value below will be used:
  478. * size: ImVec2(0, 0)
  479. * uv0: ImVec2(0, 0)
  480. * uv1: ImVec2(1,1)
  481. """
  482. pass
  483. # void ImageFromAssetWithBg(const char *assetPath, const ImVec2& size = ImVec2(0, 0), /* original C++ signature */
  484. # const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1),
  485. # const ImVec4& tint_col = ImVec4(1,1,1,1),
  486. # const ImVec4& border_col = ImVec4(0,0,0,0));
  487. def image_from_asset_with_bg(
  488. asset_path: str,
  489. size: Optional[ImVec2Like] = None,
  490. uv0: Optional[ImVec2Like] = None,
  491. uv1: Optional[ImVec2Like] = None,
  492. tint_col: Optional[ImVec4Like] = None,
  493. border_col: Optional[ImVec4Like] = None,
  494. ) -> None:
  495. """`HelloImGui::ImageFromAsset(const char *assetPath, size, ...)`:
  496. will display a static image from the assets, with a colored background and a border.
  497. Python bindings defaults:
  498. If any of the params below is None, then its default value below will be used:
  499. * size: ImVec2(0, 0)
  500. * uv0: ImVec2(0, 0)
  501. * uv1: ImVec2(1,1)
  502. * tint_col: ImVec4(1,1,1,1)
  503. * border_col: ImVec4(0,0,0,0)
  504. """
  505. pass
  506. # bool ImageButtonFromAsset(const char *assetPath, const ImVec2& size = ImVec2(0, 0), /* original C++ signature */
  507. # const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1),
  508. # int frame_padding = -1,
  509. # const ImVec4& bg_col = ImVec4(0,0,0,0),
  510. # const ImVec4& tint_col = ImVec4(1,1,1,1));
  511. def image_button_from_asset(
  512. asset_path: str,
  513. size: Optional[ImVec2Like] = None,
  514. uv0: Optional[ImVec2Like] = None,
  515. uv1: Optional[ImVec2Like] = None,
  516. frame_padding: int = -1,
  517. bg_col: Optional[ImVec4Like] = None,
  518. tint_col: Optional[ImVec4Like] = None,
  519. ) -> bool:
  520. """`bool HelloImGui::ImageButtonFromAsset(const char *assetPath, size, ...)`:
  521. will display a button using an image from the assets.
  522. Python bindings defaults:
  523. If any of the params below is None, then its default value below will be used:
  524. * size: ImVec2(0, 0)
  525. * uv0: ImVec2(0, 0)
  526. * uv1: ImVec2(1,1)
  527. * bg_col: ImVec4(0,0,0,0)
  528. * tint_col: ImVec4(1,1,1,1)
  529. """
  530. pass
  531. # ImTextureID ImTextureIdFromAsset(const char *assetPath); /* original C++ signature */
  532. def im_texture_id_from_asset(asset_path: str) -> ImTextureID:
  533. """`ImTextureID HelloImGui::ImTextureIdFromAsset(assetPath)`:
  534. will return a texture ID for an image loaded from the assets.
  535. """
  536. pass
  537. # ImVec2 ImageSizeFromAsset(const char *assetPath); /* original C++ signature */
  538. def image_size_from_asset(asset_path: str) -> ImVec2:
  539. """`ImVec2 HelloImGui::ImageSizeFromAsset(assetPath)`:
  540. will return the size of an image loaded from the assets.
  541. """
  542. pass
  543. class ImageAndSize:
  544. """`HelloImGui::ImageAndSize HelloImGui::ImageAndSizeFromAsset(assetPath)`:
  545. will return the texture ID and the size of an image loaded from the assets.
  546. """
  547. # ImTextureID textureId = ImTextureID(0); /* original C++ signature */
  548. texture_id: ImTextureID = ImTextureID(0)
  549. # ImVec2 size = ImVec2(0.f, 0.f); /* original C++ signature */
  550. size: ImVec2 = ImVec2(0.0, 0.0)
  551. # ImageAndSize(ImTextureID textureId = ImTextureID(0), ImVec2 size = ImVec2(0.f, 0.f)); /* original C++ signature */
  552. def __init__(
  553. self,
  554. texture_id: Optional[ImTextureID] = None,
  555. size: Optional[ImVec2Like] = None,
  556. ) -> None:
  557. """Auto-generated default constructor with named params
  558. Python bindings defaults:
  559. If any of the params below is None, then its default value below will be used:
  560. * textureId: ImTextureID(0)
  561. * size: ImVec2(0., 0.)
  562. """
  563. pass
  564. # ImageAndSize ImageAndSizeFromAsset(const char *assetPath); /* original C++ signature */
  565. def image_and_size_from_asset(asset_path: str) -> ImageAndSize:
  566. pass
  567. # ImVec2 ImageProportionalSize(const ImVec2& askedSize, const ImVec2& imageSize); /* original C++ signature */
  568. def image_proportional_size(asked_size: ImVec2Like, image_size: ImVec2Like) -> ImVec2:
  569. """`ImVec2 HelloImGui::ImageProportionalSize(askedSize, imageSize)`:
  570. will return the displayed size of an image.
  571. - if askedSize.x or askedSize.y is 0, then the corresponding dimension
  572. will be computed from the image size, keeping the aspect ratio.
  573. - if askedSize.x>0 and askedSize.y> 0, then the image will be scaled to fit
  574. exactly the askedSize, thus potentially changing the aspect ratio.
  575. Note: this function is used internally by ImageFromAsset and ImageButtonFromAsset,
  576. so you don't need to call it directly.
  577. """
  578. pass
  579. # To upload raw RGBA pixel data to a caller-owned GPU texture, see
  580. # `HelloImGui::CreateTextureGpuFromRgbaData()` in `texture_gpu.h`.
  581. # void FreeImageCache(); /* original C++ signature */
  582. def free_image_cache() -> None:
  583. """`HelloImGui::FreeImageCache()`: clears the asset image cache shared by
  584. `ImageFromAsset`, `ImageAndSizeFromAsset` and `ImageAndSizeFromEncodedData`.
  585. Inside a `HelloImGui::Run()` context this is called automatically at
  586. shutdown. When using imgui_md (or any of the helpers above) without
  587. `Run()`, the cache lives until process exit unless you call this manually
  588. before destroying your GL context.
  589. """
  590. pass
  591. # @@md
  592. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  593. # hello_imgui/texture_gpu.h included by hello_imgui.h //
  594. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  595. # @@md#TextureGpu
  596. # @@md
  597. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  598. # hello_imgui/imgui_theme.h included by hello_imgui.h //
  599. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  600. #
  601. # Theme tweak utilities for ImGui.
  602. # Reuse and adaptation of imgui_theme.h and imgui_theme.cpp file is granted for other projects,
  603. # provided the origin of those files is stated in the copied version
  604. # Some themes were adapted by themes posted by ImGui users at https://github.com/ocornut/imgui/issues/707
  605. #
  606. class ImGuiTheme_(enum.IntEnum):
  607. # ImGuiTheme_ImGuiColorsClassic = 0, /* original C++ signature */
  608. imgui_colors_classic = enum.auto() # (= 0)
  609. # ImGuiTheme_ImGuiColorsDark, /* original C++ signature */
  610. imgui_colors_dark = enum.auto() # (= 1)
  611. # ImGuiTheme_ImGuiColorsLight, /* original C++ signature */
  612. imgui_colors_light = enum.auto() # (= 2)
  613. # ImGuiTheme_MaterialFlat, /* original C++ signature */
  614. material_flat = enum.auto() # (= 3)
  615. # ImGuiTheme_PhotoshopStyle, /* original C++ signature */
  616. photoshop_style = enum.auto() # (= 4)
  617. # ImGuiTheme_GrayVariations, /* original C++ signature */
  618. gray_variations = enum.auto() # (= 5)
  619. # ImGuiTheme_GrayVariations_Darker, /* original C++ signature */
  620. gray_variations_darker = enum.auto() # (= 6)
  621. # ImGuiTheme_MicrosoftStyle, /* original C++ signature */
  622. microsoft_style = enum.auto() # (= 7)
  623. # ImGuiTheme_Cherry, /* original C++ signature */
  624. cherry = enum.auto() # (= 8)
  625. # ImGuiTheme_Darcula, /* original C++ signature */
  626. darcula = enum.auto() # (= 9)
  627. # ImGuiTheme_DarculaDarker, /* original C++ signature */
  628. darcula_darker = enum.auto() # (= 10)
  629. # ImGuiTheme_LightRounded, /* original C++ signature */
  630. light_rounded = enum.auto() # (= 11)
  631. # ImGuiTheme_SoDark_AccentBlue, /* original C++ signature */
  632. so_dark_accent_blue = enum.auto() # (= 12)
  633. # ImGuiTheme_SoDark_AccentYellow, /* original C++ signature */
  634. so_dark_accent_yellow = enum.auto() # (= 13)
  635. # ImGuiTheme_SoDark_AccentRed, /* original C++ signature */
  636. so_dark_accent_red = enum.auto() # (= 14)
  637. # ImGuiTheme_BlackIsBlack, /* original C++ signature */
  638. black_is_black = enum.auto() # (= 15)
  639. # ImGuiTheme_WhiteIsWhite, /* original C++ signature */
  640. white_is_white = enum.auto() # (= 16)
  641. # ImGuiTheme_Count /* original C++ signature */
  642. # }
  643. count = enum.auto() # (= 17)
  644. # const char* ImGuiTheme_Name(ImGuiTheme_ theme); /* original C++ signature */
  645. def imgui_theme_name(theme: ImGuiTheme_) -> str:
  646. pass
  647. # ImGuiTheme_ ImGuiTheme_FromName(const char* themeName); /* original C++ signature */
  648. def imgui_theme_from_name(theme_name: str) -> ImGuiTheme_:
  649. pass
  650. # ImGuiStyle ThemeToStyle(ImGuiTheme_ theme); /* original C++ signature */
  651. def theme_to_style(theme: ImGuiTheme_) -> ImGuiStyle:
  652. pass
  653. # void ApplyTheme(ImGuiTheme_ theme); /* original C++ signature */
  654. def apply_theme(theme: ImGuiTheme_) -> None:
  655. pass
  656. class ImGuiThemeTweaks:
  657. # float Rounding = -1.f; /* original C++ signature */
  658. # Common rounding for widgets. If < 0, this is ignored.
  659. rounding: float = -1.0
  660. # float RoundingScrollbarRatio = 4.f; /* original C++ signature */
  661. # If rounding is applied, scrollbar rounding needs to be adjusted to be visually pleasing in conjunction with other widgets roundings. Only applied if Rounding > 0.)
  662. rounding_scrollbar_ratio: float = 4.0
  663. # float AlphaMultiplier = -1.f; /* original C++ signature */
  664. # Change the alpha that will be applied to windows, popups, etc. If < 0, this is ignored.
  665. alpha_multiplier: float = -1.0
  666. # float Hue = -1.f; /* original C++ signature */
  667. #
  668. # HSV Color tweaks
  669. #
  670. # Change the hue of all widgets (gray widgets will remain gray, since their saturation is zero). If < 0, this is ignored.
  671. hue: float = -1.0
  672. # float SaturationMultiplier = -1.f; /* original C++ signature */
  673. # Multiply the saturation of all widgets (gray widgets will remain gray, since their saturation is zero). If < 0, this is ignored.
  674. saturation_multiplier: float = -1.0
  675. # float ValueMultiplierFront = -1.f; /* original C++ signature */
  676. # Multiply the value (luminance) of all front widgets. If < 0, this is ignored.
  677. value_multiplier_front: float = -1.0
  678. # float ValueMultiplierBg = -1.f; /* original C++ signature */
  679. # Multiply the value (luminance) of all backgrounds. If < 0, this is ignored.
  680. value_multiplier_bg: float = -1.0
  681. # float ValueMultiplierText = -1.f; /* original C++ signature */
  682. # Multiply the value (luminance) of text. If < 0, this is ignored.
  683. value_multiplier_text: float = -1.0
  684. # float ValueMultiplierFrameBg = -1.f; /* original C++ signature */
  685. # Multiply the value (luminance) of FrameBg. If < 0, this is ignored.
  686. # (Background of checkbox, radio button, plot, slider, text input)
  687. value_multiplier_frame_bg: float = -1.0
  688. # ImGuiThemeTweaks() {} /* original C++ signature */
  689. def __init__(self) -> None:
  690. pass
  691. class ImGuiTweakedTheme:
  692. # ImGuiTheme_ Theme = ImGuiTheme_DarculaDarker; /* original C++ signature */
  693. theme: ImGuiTheme_ = ImGuiTheme_.darcula_darker
  694. # ImGuiThemeTweaks Tweaks = ImGuiThemeTweaks(); /* original C++ signature */
  695. tweaks: ImGuiThemeTweaks = ImGuiThemeTweaks()
  696. # ImGuiTweakedTheme(ImGuiTheme_ theme = ImGuiTheme_DarculaDarker, const ImGuiThemeTweaks& tweaks = ImGuiThemeTweaks()) /* original C++ signature */
  697. # : Theme(theme), Tweaks(tweaks) {}
  698. def __init__(
  699. self,
  700. theme: ImGuiTheme_ = ImGuiTheme_.darcula_darker,
  701. tweaks: Optional[ImGuiThemeTweaks] = None,
  702. ) -> None:
  703. """Python bindings defaults:
  704. If tweaks is None, then its default value will be: ImGuiThemeTweaks()
  705. """
  706. pass
  707. # ImGuiStyle TweakedThemeThemeToStyle(const ImGuiTweakedTheme& tweaked_theme); /* original C++ signature */
  708. def tweaked_theme_theme_to_style(tweaked_theme: ImGuiTweakedTheme) -> ImGuiStyle:
  709. pass
  710. # void ApplyTweakedTheme(const ImGuiTweakedTheme& tweaked_theme); /* original C++ signature */
  711. def apply_tweaked_theme(tweaked_theme: ImGuiTweakedTheme) -> None:
  712. pass
  713. # PushTweakedTheme() / PopTweakedTheme()
  714. # Push and pop a tweaked theme
  715. #
  716. # Note: If you want the theme to apply globally to a window, you need to apply it
  717. # *before* calling ImGui::Begin
  718. #
  719. # For example, within Hello ImGui, given a dockable window, you should set this option:
  720. # myDockableWindow.callBeginEnd = False;
  721. # And then:
  722. # - call ImGuiTheme::PushTweakedTheme
  723. # - call ImGui::Begin
  724. # - display your content
  725. # - call ImGui::End
  726. # - call ImGuiTheme::PopTweakedTheme
  727. #
  728. # See demo inside src/hello_imgui_demos/hello_imgui_demodocking/hello_imgui_demodocking.main.cpp:
  729. # look at `GuiWindowAlternativeTheme()`
  730. # void PushTweakedTheme(const ImGuiTweakedTheme& tweaked_theme); /* original C++ signature */
  731. def push_tweaked_theme(tweaked_theme: ImGuiTweakedTheme) -> None:
  732. pass
  733. # void PopTweakedTheme(); /* original C++ signature */
  734. def pop_tweaked_theme() -> None:
  735. pass
  736. # bool ShowThemeTweakGui(ImGuiTweakedTheme *tweaked_theme); /* original C++ signature */
  737. def show_theme_tweak_gui(tweaked_theme: ImGuiTweakedTheme) -> bool:
  738. """Show the theme selection listbox, the theme tweak widgets, as well as ImGui::ShowStyleEditor. Returns True if modified (Warning, when using ShowStyleEditor, no info about modification is transmitted)"""
  739. pass
  740. # Some tweakable themes
  741. # ImGuiStyle SoDark(float hue); /* original C++ signature */
  742. def so_dark(hue: float) -> ImGuiStyle:
  743. pass
  744. # ImGuiStyle ShadesOfGray(float rounding=0.f, float value_multiplier_front=1.f, float value_multiplier_bg=1.f); /* original C++ signature */
  745. def shades_of_gray(
  746. rounding: float = 0.0,
  747. value_multiplier_front: float = 1.0,
  748. value_multiplier_bg: float = 1.0,
  749. ) -> ImGuiStyle:
  750. pass
  751. # ImGuiStyle Darcula( /* original C++ signature */
  752. # float rounding=1.f,
  753. # float hue=-1.f,
  754. # float saturation_multiplier=1.f,
  755. # float value_multiplier_front=1.f,
  756. # float value_multiplier_bg=1.f,
  757. # float alpha_bg_transparency=1.f
  758. # );
  759. def darcula(
  760. rounding: float = 1.0,
  761. hue: float = -1.0,
  762. saturation_multiplier: float = 1.0,
  763. value_multiplier_front: float = 1.0,
  764. value_multiplier_bg: float = 1.0,
  765. alpha_bg_transparency: float = 1.0,
  766. ) -> ImGuiStyle:
  767. pass
  768. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  769. # hello_imgui/hello_imgui_theme.h included by hello_imgui.h //
  770. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  771. # void ShowThemeTweakGuiWindow(bool* p_open = nullptr); /* original C++ signature */
  772. # }
  773. def show_theme_tweak_gui_window(p_open: Optional[bool] = None) -> Optional[bool]:
  774. pass
  775. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  776. # hello_imgui/hello_imgui_font.h included by hello_imgui.h //
  777. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  778. # @@md#Fonts
  779. # When loading fonts, use
  780. # HelloImGui::LoadFont(..)
  781. # or
  782. # HelloImGui::LoadDpiResponsiveFont()
  783. #
  784. # Use these functions instead of ImGui::GetIO().Fonts->AddFontFromFileTTF(),
  785. # because they will automatically adjust the font size to account for HighDPI,
  786. # and will help you to get consistent font size across different OSes.
  787. class FontLoadingParams:
  788. """
  789. Font loading parameters: several options are available (color, merging, range, ...)
  790. """
  791. # bool adjustSizeToDpi = true; /* original C++ signature */
  792. # if True, the font size will be adjusted automatically to account for HighDPI
  793. #
  794. adjust_size_to_dpi: bool = True
  795. # bool mergeToLastFont = false; /* original C++ signature */
  796. # if True, the font will be merged to the last font
  797. merge_to_last_font: bool = False
  798. # bool loadColor = false; /* original C++ signature */
  799. # if True, the font will be loaded using colors
  800. # (requires freetype, enabled by IMGUI_ENABLE_FREETYPE)
  801. load_color: bool = False
  802. # bool insideAssets = true; /* original C++ signature */
  803. # if True, the font will be loaded using HelloImGui asset system.
  804. # Otherwise, it will be loaded from the filesystem
  805. inside_assets: bool = True
  806. # ImFontConfig fontConfig = ImFontConfig(); /* original C++ signature */
  807. # ImGui native font config to use
  808. font_config: ImFontConfig = ImFontConfig()
  809. # FontLoadingParams(bool adjustSizeToDpi = true, bool mergeToLastFont = false, bool loadColor = false, bool insideAssets = true, ImFontConfig fontConfig = ImFontConfig()); /* original C++ signature */
  810. def __init__(
  811. self,
  812. adjust_size_to_dpi: bool = True,
  813. merge_to_last_font: bool = False,
  814. load_color: bool = False,
  815. inside_assets: bool = True,
  816. font_config: Optional[ImFontConfig] = None,
  817. ) -> None:
  818. """Auto-generated default constructor with named params
  819. Python bindings defaults:
  820. If fontConfig is None, then its default value will be: ImFontConfig()
  821. """
  822. pass
  823. # ImFont* LoadFont( /* original C++ signature */
  824. # const std::string & fontFilename, float fontSize,
  825. # const FontLoadingParams & params = __srcmlcpp_brace_init__());
  826. def load_font(
  827. font_filename: str, font_size: float, params: Optional[FontLoadingParams] = None
  828. ) -> ImFont:
  829. """Python bindings defaults:
  830. If params is None, then its default value will be: initialized with default value
  831. """
  832. pass
  833. # ImFont* LoadFontTTF( /* original C++ signature */
  834. # const std::string & fontFilename,
  835. # float fontSize,
  836. # ImFontConfig config = ImFontConfig()
  837. # );
  838. def load_font_ttf(
  839. font_filename: str, font_size: float, config: Optional[ImFontConfig] = None
  840. ) -> ImFont:
  841. """Python bindings defaults:
  842. If config is None, then its default value will be: ImFontConfig()
  843. """
  844. pass
  845. # ImFont* LoadFontTTF_WithFontAwesomeIcons( /* original C++ signature */
  846. # const std::string & fontFilename,
  847. # float fontSize,
  848. # ImFontConfig configFont = ImFontConfig()
  849. # );
  850. def load_font_ttf_with_font_awesome_icons(
  851. font_filename: str, font_size: float, config_font: Optional[ImFontConfig] = None
  852. ) -> ImFont:
  853. """Python bindings defaults:
  854. If configFont is None, then its default value will be: ImFontConfig()
  855. """
  856. pass
  857. # @@md
  858. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  859. # hello_imgui/runner_params.h included by hello_imgui.h //
  860. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  861. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  862. # hello_imgui/app_window_params.h included by hello_imgui/runner_params.h //
  863. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  864. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  865. # hello_imgui/screen_bounds.h included by hello_imgui/app_window_params.h //
  866. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  867. # Note: note related to DPI and high resolution screens:
  868. # ScreenPosition and ScreenSize are in "Screen Coordinates":
  869. # Screen coordinates *might* differ from real pixel on high dpi screens; but this depends on the OS.
  870. # - For example, on apple a retina screenpixel size 3456x2052 might be seen as 1728x1026 in screen coordinates
  871. # - Under windows, ScreenCoordinates correspond to pixels, even on high density screens
  872. class ScreenBounds:
  873. # ScreenPosition position = DefaultScreenPosition; /* original C++ signature */
  874. position: ScreenPosition = DefaultScreenPosition
  875. # ScreenSize size = DefaultWindowSize; /* original C++ signature */
  876. size: ScreenSize = DefaultWindowSize
  877. # ScreenPosition TopLeftCorner() const{ return position; } /* original C++ signature */
  878. def top_left_corner(self) -> ScreenPosition:
  879. pass
  880. # ScreenPosition BottomRightCorner() const{ return { position[0] + size[0], position[1] + size[1] }; } /* original C++ signature */
  881. def bottom_right_corner(self) -> ScreenPosition:
  882. pass
  883. # ScreenPosition Center() const{ return { position[0] + size[0] / 2, position[1] + size[1] / 2 }; } /* original C++ signature */
  884. def center(self) -> ScreenPosition:
  885. pass
  886. # bool Contains(ScreenPosition pixel) const; /* original C++ signature */
  887. def contains(self, pixel: ScreenPosition) -> bool:
  888. pass
  889. # ScreenPosition WinPositionCentered(ScreenSize windowSize) const; /* original C++ signature */
  890. def win_position_centered(self, window_size: ScreenSize) -> ScreenPosition:
  891. pass
  892. # int DistanceFromPixel(ScreenPosition point) const; /* original C++ signature */
  893. def distance_from_pixel(self, point: ScreenPosition) -> int:
  894. pass
  895. # ScreenBounds EnsureWindowFitsThisMonitor(ScreenBounds windowBoundsOriginal) const; /* original C++ signature */
  896. def ensure_window_fits_this_monitor(
  897. self, window_bounds_original: ScreenBounds
  898. ) -> ScreenBounds:
  899. pass
  900. # bool operator==(const ScreenBounds& other) const; /* original C++ signature */
  901. def __eq__(self, other: object) -> bool:
  902. pass
  903. # ScreenBounds(ScreenPosition position = DefaultScreenPosition, ScreenSize size = DefaultWindowSize); /* original C++ signature */
  904. def __init__(
  905. self,
  906. position: Optional[ScreenPosition] = None,
  907. size: Optional[ScreenSize] = None,
  908. ) -> None:
  909. """Auto-generated default constructor with named params
  910. Python bindings defaults:
  911. If any of the params below is None, then its default value below will be used:
  912. * position: DefaultScreenPosition
  913. * size: DefaultWindowSize
  914. """
  915. pass
  916. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  917. # hello_imgui/app_window_params.h continued //
  918. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  919. class FullScreenMode(enum.IntEnum):
  920. # NoFullScreen, /* original C++ signature */
  921. no_full_screen = enum.auto() # (= 0)
  922. # FullScreen, /* original C++ signature */
  923. full_screen = enum.auto() # (= 1) # Full screen with specified resolution
  924. # FullScreenDesktopResolution, /* original C++ signature */
  925. full_screen_desktop_resolution = (
  926. enum.auto()
  927. ) # (= 2) # Full screen with current desktop mode & resolution
  928. # FullMonitorWorkArea /* original C++ signature */
  929. full_monitor_work_area = (
  930. enum.auto()
  931. ) # (= 3) # Fake full screen, maximized window on the selected monitor
  932. class WindowSizeState(enum.IntEnum):
  933. # Standard, /* original C++ signature */
  934. standard = enum.auto() # (= 0)
  935. # Minimized, /* original C++ signature */
  936. minimized = enum.auto() # (= 1)
  937. # Maximized /* original C++ signature */
  938. # }
  939. maximized = enum.auto() # (= 2)
  940. class WindowPositionMode(enum.IntEnum):
  941. # OsDefault, /* original C++ signature */
  942. os_default = enum.auto() # (= 0)
  943. # MonitorCenter, /* original C++ signature */
  944. monitor_center = enum.auto() # (= 1)
  945. # FromCoords, /* original C++ signature */
  946. # }
  947. from_coords = enum.auto() # (= 2)
  948. class EmscriptenKeyboardElement(enum.IntEnum):
  949. # Window, /* original C++ signature */
  950. window = enum.auto() # (= 0)
  951. # Document, /* original C++ signature */
  952. document = enum.auto() # (= 1)
  953. # Screen, /* original C++ signature */
  954. screen = enum.auto() # (= 2)
  955. # Canvas, /* original C++ signature */
  956. canvas = enum.auto() # (= 3)
  957. # Default /* original C++ signature */
  958. # }
  959. default = enum.auto() # (= 4)
  960. class WindowSizeMeasureMode(enum.IntEnum):
  961. # ScreenCoords, /* original C++ signature */
  962. # ScreenCoords: measure window size in screen coords.
  963. # Note: screen coordinates *might* differ from real pixel on high dpi screens; but this depends on the OS.
  964. # - For example, on apple a retina screenpixel size 3456x2052 might be seen as 1728x1026 in screen
  965. # coordinates
  966. # - Under windows, and if the application is DPI aware, ScreenCoordinates correspond to real pixels,
  967. # even on high density screens
  968. screen_coords = enum.auto() # (= 0)
  969. # RelativeTo96Ppi /* original C++ signature */
  970. # }
  971. # RelativeTo96Ppi enables to give screen size that are independant from the screen density.
  972. # For example, a window size expressed as 800x600 will correspond to a size
  973. # 800x600 (in screen coords) if the monitor dpi is 96
  974. # 1600x120 (in screen coords) if the monitor dpi is 192
  975. relative_to96_ppi = enum.auto() # (= 1)
  976. class WindowGeometry:
  977. """@@md#WindowGeometry
  978. WindowGeometry is a struct that defines the window geometry.
  979. """
  980. # --------------- Window Size ------------------
  981. # ScreenSize size = DefaultWindowSize; /* original C++ signature */
  982. # Size of the application window
  983. # used if fullScreenMode==NoFullScreen and sizeAuto==False. Default=(800, 600)
  984. # The size will be handled as if it was specified for a 96PPI screen
  985. # (i.e. a given size will correspond to the same physical size on different screens, whatever their DPI)
  986. size: ScreenSize = DefaultWindowSize
  987. # bool sizeAuto = false; /* original C++ signature */
  988. # If sizeAuto=True, adapt the app window size to the presented widgets.
  989. # After the first frame was displayed, HelloImGui will measure its size, and the
  990. # application window will be resized.
  991. # As a consequence, the application window may change between the 1st and 2nd frame.
  992. # If True, adapt the app window size to the presented widgets. This is done at startup
  993. size_auto: bool = False
  994. # WindowSizeState windowSizeState = WindowSizeState::Standard; /* original C++ signature */
  995. # `windowSizeState`: _WindowSizeState, default=Standard_
  996. # You can choose between several window size states:
  997. # Standard,
  998. # Minimized,
  999. # Maximized
  1000. window_size_state: WindowSizeState = WindowSizeState.standard
  1001. # WindowSizeMeasureMode windowSizeMeasureMode = WindowSizeMeasureMode::RelativeTo96Ppi; /* original C++ signature */
  1002. # `windowSizeMeasureMode`: _WindowSizeMeasureMode_, default=RelativeTo96Ppi
  1003. # Define how the window size is specified:
  1004. # * RelativeTo96Ppi enables to give a screen size whose physical result
  1005. # (in millimeters) is independent of the screen density.
  1006. # For example, a window size expressed as 800x600 will correspond to a size
  1007. # - 800x600 (in screen coords) if the monitor dpi is 96
  1008. # - 1600x120 (in screen coords) if the monitor dpi is 192
  1009. # (this works with Glfw. With SDL, it only works under windows)
  1010. # * ScreenCoords: measure window size in screen coords
  1011. # (Note: screen coordinates might differ from real pixels on high dpi screen)
  1012. window_size_measure_mode: WindowSizeMeasureMode = (
  1013. WindowSizeMeasureMode.relative_to96_ppi
  1014. )
  1015. # --------------- Position ------------------
  1016. # WindowPositionMode positionMode = WindowPositionMode::OsDefault; /* original C++ signature */
  1017. # `positionMode`: you can choose between several window position modes:
  1018. # OsDefault,
  1019. # MonitorCenter,
  1020. # FromCoords,
  1021. position_mode: WindowPositionMode = WindowPositionMode.os_default
  1022. # ScreenPosition position = DefaultScreenPosition; /* original C++ signature */
  1023. # `position`: used if windowPositionMode==FromCoords, default=(40, 40)
  1024. position: ScreenPosition = DefaultScreenPosition
  1025. # int monitorIdx = 0; /* original C++ signature */
  1026. # `monitorIdx`: index of the monitor to use, default=0
  1027. # used if positionMode==MonitorCenter or if fullScreenMode!=NoFullScreen
  1028. monitor_idx: int = 0
  1029. # --------------- Full screen ------------------
  1030. # FullScreenMode fullScreenMode = FullScreenMode::NoFullScreen; /* original C++ signature */
  1031. # `fullScreenMode`: you can choose between several full screen modes:
  1032. # NoFullScreen,
  1033. # FullScreen, // Full screen with specified resolution
  1034. # FullScreenDesktopResolution, // Full screen with current desktop mode & resolution
  1035. # FullMonitorWorkArea // Fake full screen (maximized window) on the selected monitor
  1036. full_screen_mode: FullScreenMode = FullScreenMode.no_full_screen
  1037. # --------------- Auto Resize ------------------
  1038. # bool resizeAppWindowAtNextFrame = false; /* original C++ signature */
  1039. # `resizeAppWindowAtNextFrame`: _bool_, default=False;
  1040. # If you set this to flag to True at any point during the execution, the application
  1041. # window will then try to resize based on its content on the next displayed frame,
  1042. # and this flag will subsequently be set to False.
  1043. # Example:
  1044. # ```cpp
  1045. # // Will resize the app window at next displayed frame
  1046. # HelloImGui::GetRunnerParams()->appWindowParams.windowGeometry.resizeAppWindowAtNextFrame = True;
  1047. # ```
  1048. # Note: this flag is intended to be used during execution, not at startup
  1049. # (use sizeAuto at startup).
  1050. resize_app_window_at_next_frame: bool = False
  1051. # WindowGeometry(ScreenSize size = DefaultWindowSize, bool sizeAuto = false, WindowSizeState windowSizeState = WindowSizeState::Standard, WindowSizeMeasureMode windowSizeMeasureMode = WindowSizeMeasureMode::RelativeTo96Ppi, WindowPositionMode positionMode = WindowPositionMode::OsDefault, ScreenPosition position = DefaultScreenPosition, int monitorIdx = 0, FullScreenMode fullScreenMode = FullScreenMode::NoFullScreen, bool resizeAppWindowAtNextFrame = false); /* original C++ signature */
  1052. def __init__(
  1053. self,
  1054. size: Optional[ScreenSize] = None,
  1055. size_auto: bool = False,
  1056. window_size_state: WindowSizeState = WindowSizeState.standard,
  1057. window_size_measure_mode: WindowSizeMeasureMode = WindowSizeMeasureMode.relative_to96_ppi,
  1058. position_mode: WindowPositionMode = WindowPositionMode.os_default,
  1059. position: Optional[ScreenPosition] = None,
  1060. monitor_idx: int = 0,
  1061. full_screen_mode: FullScreenMode = FullScreenMode.no_full_screen,
  1062. resize_app_window_at_next_frame: bool = False,
  1063. ) -> None:
  1064. """Auto-generated default constructor with named params
  1065. Python bindings defaults:
  1066. If any of the params below is None, then its default value below will be used:
  1067. * size: DefaultWindowSize
  1068. * position: DefaultScreenPosition
  1069. """
  1070. pass
  1071. # @@md
  1072. class EdgeInsets:
  1073. """If there is a notch on the iPhone, you should not display inside these insets"""
  1074. # double top = 0.; /* original C++ signature */
  1075. top: float = 0.0 # Typically around 47
  1076. # double left = 0.; /* original C++ signature */
  1077. left: float = 0.0 # Typically 0
  1078. # double bottom = 0.; /* original C++ signature */
  1079. bottom: float = 0.0 # Typically around 34
  1080. # double right = 0.; /* original C++ signature */
  1081. right: float = 0.0 # Typically 0
  1082. # EdgeInsets(double top = 0., double left = 0., double bottom = 0., double right = 0.); /* original C++ signature */
  1083. def __init__(
  1084. self,
  1085. top: float = 0.0,
  1086. left: float = 0.0,
  1087. bottom: float = 0.0,
  1088. right: float = 0.0,
  1089. ) -> None:
  1090. """Auto-generated default constructor with named params"""
  1091. pass
  1092. class AppWindowParams:
  1093. """@@md#AppWindowParams
  1094. AppWindowParams is a struct that defines the application window display params.
  1095. See https://raw.githubusercontent.com/pthom/hello_imgui/master/src/hello_imgui/doc_src/hello_imgui_diagram.jpg
  1096. for details.
  1097. """
  1098. # --------------- Standard params ------------------
  1099. # std::string windowTitle; /* original C++ signature */
  1100. # `windowTitle`: _string, default=""_. Title of the application window
  1101. window_title: str
  1102. # WindowGeometry windowGeometry; /* original C++ signature */
  1103. # `windowGeometry`: _WindowGeometry_
  1104. # Enables to precisely set the window geometry (position, monitor, size,
  1105. # full screen, fake full screen, etc.)
  1106. # _Note: on a mobile device, the application will always be full screen._
  1107. window_geometry: WindowGeometry
  1108. # bool restorePreviousGeometry = false; /* original C++ signature */
  1109. # `restorePreviousGeometry`: _bool, default=false_.
  1110. # If True, then save & restore windowGeometry from last run (the geometry
  1111. # will be written in imgui_app_window.ini)
  1112. restore_previous_geometry: bool = False
  1113. # bool resizable = true; /* original C++ signature */
  1114. # `resizable`: _bool, default = false_. Should the window be resizable.
  1115. # This is taken into account at creation.
  1116. resizable: bool = True
  1117. # bool hidden = false; /* original C++ signature */
  1118. # `hidden`: _bool, default = false_. Should the window be hidden.
  1119. # This is taken into account dynamically (you can show/hide the window with this).
  1120. # Full screen windows cannot be hidden.
  1121. hidden: bool = False
  1122. # bool topMost = false; /* original C++ signature */
  1123. # `topMost`: _bool, default = false_. Should the window stay on top of other windows.
  1124. # This is taken into account dynamically (you can change this at runtime).
  1125. # Note: This is only supported on desktop platforms (Windows, macOS, Linux).
  1126. # On mobile platforms (iOS, Android) and web (Emscripten), this setting is ignored.
  1127. # This setting is also ignored when the window is in fullscreen mode.
  1128. top_most: bool = False
  1129. # --------------- Borderless window params ------------------
  1130. # bool borderless = false; /* original C++ signature */
  1131. # `borderless`: _bool, default = false_. Should the window have borders.
  1132. # This is taken into account at creation.
  1133. borderless: bool = False
  1134. # bool borderlessMovable = true; /* original C++ signature */
  1135. # `borderlessMovable`: if the window is borderless, should it be movable.
  1136. # If so, a drag zone is displayed at the top of the window when the mouse is over it.
  1137. borderless_movable: bool = True
  1138. # bool borderlessResizable = true; /* original C++ signature */
  1139. # `borderlessResizable`: if the window is borderless, should it be resizable.
  1140. # If so, a drag zone is displayed at the bottom-right of the window
  1141. # when the mouse is over it.
  1142. borderless_resizable: bool = True
  1143. # bool borderlessClosable = true; /* original C++ signature */
  1144. # `borderlessClosable`: if the window is borderless, should it have a close button.
  1145. # If so, a close button is displayed at the top-right of the window
  1146. # when the mouse is over it.
  1147. borderless_closable: bool = True
  1148. # ImVec4 borderlessHighlightColor = ImVec4(0.2f, 0.4f, 1.f, 0.3f); /* original C++ signature */
  1149. # `borderlessHighlightColor`:
  1150. # Color of the highlight displayed on resize/move zones.
  1151. # If borderlessHighlightColor.w==0, then the highlightColor will be automatically
  1152. # set to ImGui::GetColorU32(ImGuiCol_TitleBgActive, 0.6)
  1153. borderless_highlight_color: ImVec4 = ImVec4(0.2, 0.4, 1.0, 0.3)
  1154. # --------------- iOS Notch ------------------
  1155. # EdgeInsets edgeInsets; /* original C++ signature */
  1156. # `edgeInsets`: _EdgeInsets_. iOS only, out values filled by HelloImGui.
  1157. # If there is a notch on the iPhone, you should not display inside these insets.
  1158. # HelloImGui handles this automatically, if handleEdgeInsets is True and
  1159. # if runnerParams.imGuiWindowParams.defaultImGuiWindowType is not NoDefaultWindow.
  1160. # (warning, these values are updated only after a few frames,
  1161. # they are typically 0 for the first 4 frames)
  1162. edge_insets: EdgeInsets
  1163. # bool handleEdgeInsets = true; /* original C++ signature */
  1164. # `handleEdgeInsets`: _bool, default = true_. iOS only.
  1165. # If True, HelloImGui will handle the edgeInsets on iOS.
  1166. handle_edge_insets: bool = True
  1167. # EmscriptenKeyboardElement emscriptenKeyboardElement = EmscriptenKeyboardElement::Default; /* original C++ signature */
  1168. # --------------- Emscripten ------------------
  1169. # `emscriptenKeyboardElement`: _EmscriptenKeyboardElement, default=Default_. HTML element in which SDL will capture the keyboard events.
  1170. # (For Emscripten only)
  1171. # Choose between: Window, Document, Screen, Canvas, Default.
  1172. # If Default:
  1173. # - the default SDL behavior is used, which is to capture the keyboard events for the window,
  1174. # if no previous hint was set in the javascript code.
  1175. # - under Pyodide, the default behavior is to capture the keyboard events for the canvas.
  1176. emscripten_keyboard_element: EmscriptenKeyboardElement = (
  1177. EmscriptenKeyboardElement.default
  1178. )
  1179. # bool emscriptenAllowBrowserZoomShortcuts = true; /* original C++ signature */
  1180. # `emscriptenAllowBrowserZoomShortcuts`: _bool, default=true_. (For Emscripten with GLFW backend only)
  1181. # If True, browser zoom shortcuts (Ctrl/Cmd + Plus/Minus/0) are forwarded to the browser
  1182. # instead of being captured by the application.
  1183. # Set to False if your application needs to handle these key combinations itself.
  1184. emscripten_allow_browser_zoom_shortcuts: bool = True
  1185. # bool repaintDuringResize_GotchaReentrantRepaint = false; /* original C++ signature */
  1186. # ----------------- repaint the window during resize -----------------
  1187. # Very advanced and reserved for advanced C++ users.
  1188. # If you set this to True, the window will be repainted during resize.
  1189. # Do read https://github.com/pthom/hello_imgui/issues/112 for info about the possible gotchas
  1190. # (This API is not stable, as the name suggests, and this is not supported)
  1191. repaint_during_resize_gotcha_reentrant_repaint: bool = False
  1192. # AppWindowParams(std::string windowTitle = std::string(), WindowGeometry windowGeometry = WindowGeometry(), bool restorePreviousGeometry = false, bool resizable = true, bool hidden = false, bool topMost = false, bool borderless = false, bool borderlessMovable = true, bool borderlessResizable = true, bool borderlessClosable = true, ImVec4 borderlessHighlightColor = ImVec4(0.2f, 0.4f, 1.f, 0.3f), EdgeInsets edgeInsets = EdgeInsets(), bool handleEdgeInsets = true, EmscriptenKeyboardElement emscriptenKeyboardElement = EmscriptenKeyboardElement::Default, bool emscriptenAllowBrowserZoomShortcuts = true, bool repaintDuringResize_GotchaReentrantRepaint = false); /* original C++ signature */
  1193. def __init__(
  1194. self,
  1195. window_title: str = "",
  1196. window_geometry: Optional[WindowGeometry] = None,
  1197. restore_previous_geometry: bool = False,
  1198. resizable: bool = True,
  1199. hidden: bool = False,
  1200. top_most: bool = False,
  1201. borderless: bool = False,
  1202. borderless_movable: bool = True,
  1203. borderless_resizable: bool = True,
  1204. borderless_closable: bool = True,
  1205. borderless_highlight_color: Optional[ImVec4Like] = None,
  1206. edge_insets: Optional[EdgeInsets] = None,
  1207. handle_edge_insets: bool = True,
  1208. emscripten_keyboard_element: EmscriptenKeyboardElement = EmscriptenKeyboardElement.default,
  1209. emscripten_allow_browser_zoom_shortcuts: bool = True,
  1210. repaint_during_resize_gotcha_reentrant_repaint: bool = False,
  1211. ) -> None:
  1212. """Auto-generated default constructor with named params
  1213. Python bindings defaults:
  1214. If any of the params below is None, then its default value below will be used:
  1215. * windowGeometry: WindowGeometry()
  1216. * borderlessHighlightColor: ImVec4(0.2, 0.4, 1., 0.3)
  1217. * edgeInsets: EdgeInsets()
  1218. """
  1219. pass
  1220. # @@md
  1221. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1222. # hello_imgui/imgui_window_params.h included by hello_imgui/runner_params.h //
  1223. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1224. # @@md#DefaultImGuiWindowType
  1225. class DefaultImGuiWindowType(enum.IntEnum):
  1226. """`DefaultImGuiWindowType` is an enum class that defines whether a full screen background
  1227. window is provided or not
  1228. """
  1229. # ProvideFullScreenWindow, /* original C++ signature */
  1230. # `ProvideFullScreenWindow`: a full window is provided in the background
  1231. provide_full_screen_window = enum.auto() # (= 0)
  1232. # ProvideFullScreenDockSpace, /* original C++ signature */
  1233. # `ProvideFullScreenDockSpace`: a full screen dockspace is provided in the background
  1234. provide_full_screen_dock_space = enum.auto() # (= 1)
  1235. # NoDefaultWindow /* original C++ signature */
  1236. # }
  1237. # `NoDefaultWindow`: No default window is provided
  1238. # (except for ImGui's default "debug" window)
  1239. no_default_window = enum.auto() # (= 2)
  1240. # @@md
  1241. # @@md#ImGuiWindowParams
  1242. class ImGuiWindowParams:
  1243. """`ImGuiWindowParams` is a struct that defines the ImGui inner windows params
  1244. These settings affect the imgui inner windows inside the application window.
  1245. In order to change the application window settings, change the `AppWindowsParams`
  1246. """
  1247. # ------------ Main Options -------------------------------------------------------
  1248. # DefaultImGuiWindowType defaultImGuiWindowType = /* original C++ signature */
  1249. # DefaultImGuiWindowType::ProvideFullScreenWindow;
  1250. # defaultImGuiWindowType: (enum DefaultImGuiWindowType)
  1251. # Choose between:
  1252. # - ProvideFullScreenWindow (default)
  1253. # a full window is provided in the background
  1254. # You can still add windows on top of it, since the Z-order
  1255. # of this background window is always behind
  1256. # - ProvideFullScreenDockSpace:
  1257. # a full screen dockspace is provided in the background
  1258. # (use this if you intend to use docking)
  1259. # - NoDefaultWindow:
  1260. # no default window is provided
  1261. default_imgui_window_type: DefaultImGuiWindowType = (
  1262. DefaultImGuiWindowType.provide_full_screen_window
  1263. )
  1264. # bool enableViewports = false; /* original C++ signature */
  1265. # enableViewports: Enable multiple viewports (i.e. multiple native windows)
  1266. # If True, you can drag windows outside the main window,
  1267. # in order to put their content into new native windows.
  1268. enable_viewports: bool = False
  1269. # bool configWindowsMoveFromTitleBarOnly = true; /* original C++ signature */
  1270. # Make windows only movable from the title bar
  1271. config_windows_move_from_title_bar_only: bool = True
  1272. # ------------ Menus & Status bar --------------------------------------------------
  1273. # std::string menuAppTitle = ""; /* original C++ signature */
  1274. # Set the title of the App menu. If empty, the menu name will use
  1275. # the "windowTitle" from AppWindowParams//
  1276. menu_app_title: str = ""
  1277. # bool showMenuBar = false; /* original C++ signature */
  1278. # Show Menu bar on top of imgui main window.
  1279. # In order to fully customize the menu, set showMenuBar to True, and set showMenu_App
  1280. # and showMenu_View params to False. Then, implement the callback
  1281. # `RunnerParams.callbacks.ShowMenus`
  1282. # which can optionally call `HelloImGui::ShowViewMenu` and `HelloImGui::ShowAppMenu`.
  1283. show_menu_bar: bool = False
  1284. # bool showMenu_App = true; /* original C++ signature */
  1285. # If menu bar is shown, include or not the default app menu
  1286. show_menu_app: bool = True
  1287. # bool showMenu_App_Quit = true; /* original C++ signature */
  1288. # Include or not a "Quit" item in the default app menu.
  1289. # Set this to False if you intend to provide your own quit callback
  1290. # with possible user confirmation
  1291. # (and implement it inside RunnerCallbacks.ShowAppMenuItems)
  1292. show_menu_app_quit: bool = True
  1293. # bool showMenu_View = true; /* original C++ signature */
  1294. # If menu bar is shown, include or not the default _View_ menu, that enables
  1295. # to change the layout and set the docked windows and status bar visibility)
  1296. show_menu_view: bool = True
  1297. # bool showMenu_View_Themes = true; /* original C++ signature */
  1298. # Show theme selection in view menu
  1299. show_menu_view_themes: bool = True
  1300. # bool rememberTheme = true; /* original C++ signature */
  1301. # `rememberTheme`: _bool, default=true_. Remember selected theme
  1302. remember_theme: bool = True
  1303. # bool showStatusBar = false; /* original C++ signature */
  1304. # Flag that enable to show a Status bar at the bottom. You can customize
  1305. # the status bar via RunnerCallbacks.ShowStatus()
  1306. show_status_bar: bool = False
  1307. # bool showStatus_Fps = true; /* original C++ signature */
  1308. # If set, display the FPS in the status bar.
  1309. show_status_fps: bool = True
  1310. # bool rememberStatusBarSettings = true; /* original C++ signature */
  1311. # If set, showStatusBar and showStatus_Fps are stored in the application settings.
  1312. remember_status_bar_settings: bool = True
  1313. # ------------ Change the dockspace or background window size -----------------------
  1314. # If defaultImGuiWindowType = ProvideFullScreenWindow or ProvideFullScreenDockSpace,
  1315. # you can set the position and size of the background window:
  1316. # - fullScreenWindow_MarginTopLeft is the window position
  1317. # - fullScreenWindow_MarginBottomRight is the margin between
  1318. # the "application window" bottom right corner
  1319. # and the "imgui background window" bottom right corner
  1320. # Important note:
  1321. # In order to be Dpi aware, those sizes are in *em units*, not in pixels,
  1322. # i.e. in multiples of the font size! (See HelloImGui::EmToVec2)
  1323. # ImVec2 fullScreenWindow_MarginTopLeft = ImVec2(0.f, 0.f); /* original C++ signature */
  1324. full_screen_window_margin_top_left: ImVec2 = ImVec2(0.0, 0.0)
  1325. # ImVec2 fullScreenWindow_MarginBottomRight = ImVec2(0.f, 0.f); /* original C++ signature */
  1326. full_screen_window_margin_bottom_right: ImVec2 = ImVec2(0.0, 0.0)
  1327. # ------------ Theme ---------------------------------------------------------------
  1328. # ImGuiTheme::ImGuiTweakedTheme tweakedTheme; /* original C++ signature */
  1329. # tweakedTheme: sets the ImGui theme at startup.
  1330. #
  1331. # 1. Pick a base theme (e.g. DarculaDarker, Cherry, SoDark_AccentBlue,
  1332. # PhotoshopStyle, LightRounded, ...). See all options in ImGuiTheme_ enum
  1333. # (defined in imgui_theme.h).
  1334. # 2. Optionally fine-tune with ImGuiThemeTweaks (rounding, hue, saturation,
  1335. # alpha, luminance).
  1336. #
  1337. # C++:
  1338. # params.imGuiWindowParams.tweakedTheme.Theme = ImGuiTheme::ImGuiTheme_Cherry;
  1339. # // optionally:
  1340. # params.imGuiWindowParams.tweakedTheme.Tweaks.Rounding = 10.;
  1341. #
  1342. # Python:
  1343. # params.imgui_window_params.tweaked_theme.theme = imgui_theme.ImGuiTheme_.cherry
  1344. # # optionally:
  1345. # params.imgui_window_params.tweaked_theme.tweaks.rounding = 10.0
  1346. #
  1347. # At runtime, ShowThemeTweakGui() lets the user select and tweak themes
  1348. # interactively.
  1349. tweaked_theme: ImGuiTweakedTheme
  1350. # ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f); /* original C++ signature */
  1351. # backgroundColor:
  1352. # This is the "clearColor", i.e. the app window background color, is visible *only if*
  1353. # runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow
  1354. # Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full
  1355. # control over what is drawn behind the Gui.
  1356. background_color: ImVec4 = ImVec4(0.0, 0.0, 0.0, 0.0)
  1357. # ImGuiWindowParams(DefaultImGuiWindowType defaultImGuiWindowType = DefaultImGuiWindowType::ProvideFullScreenWindow, bool enableViewports = false, bool configWindowsMoveFromTitleBarOnly = true, std::string menuAppTitle = "", bool showMenuBar = false, bool showMenu_App = true, bool showMenu_App_Quit = true, bool showMenu_View = true, bool showMenu_View_Themes = true, bool rememberTheme = true, bool showStatusBar = false, bool showStatus_Fps = true, bool rememberStatusBarSettings = true, ImVec2 fullScreenWindow_MarginTopLeft = ImVec2(0.f, 0.f), ImVec2 fullScreenWindow_MarginBottomRight = ImVec2(0.f, 0.f), ImGuiTheme::ImGuiTweakedTheme tweakedTheme = ImGuiTheme::ImGuiTweakedTheme(), ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f)); /* original C++ signature */
  1358. def __init__(
  1359. self,
  1360. default_imgui_window_type: DefaultImGuiWindowType = DefaultImGuiWindowType.provide_full_screen_window,
  1361. enable_viewports: bool = False,
  1362. config_windows_move_from_title_bar_only: bool = True,
  1363. menu_app_title: str = "",
  1364. show_menu_bar: bool = False,
  1365. show_menu_app: bool = True,
  1366. show_menu_app_quit: bool = True,
  1367. show_menu_view: bool = True,
  1368. show_menu_view_themes: bool = True,
  1369. remember_theme: bool = True,
  1370. show_status_bar: bool = False,
  1371. show_status_fps: bool = True,
  1372. remember_status_bar_settings: bool = True,
  1373. full_screen_window_margin_top_left: Optional[ImVec2Like] = None,
  1374. full_screen_window_margin_bottom_right: Optional[ImVec2Like] = None,
  1375. tweaked_theme: Optional[ImGuiTweakedTheme] = None,
  1376. background_color: Optional[ImVec4Like] = None,
  1377. ) -> None:
  1378. """Auto-generated default constructor with named params
  1379. Python bindings defaults:
  1380. If any of the params below is None, then its default value below will be used:
  1381. * fullScreenWindow_MarginTopLeft: ImVec2(0., 0.)
  1382. * fullScreenWindow_MarginBottomRight: ImVec2(0., 0.)
  1383. * tweakedTheme: ImGuiTweakedTheme()
  1384. * backgroundColor: ImVec4(0., 0., 0., 0.)
  1385. """
  1386. pass
  1387. # @@md
  1388. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1389. # hello_imgui/runner_callbacks.h included by hello_imgui/runner_params.h //
  1390. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1391. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1392. # hello_imgui/imgui_default_settings.h included by hello_imgui/runner_callbacks.h //
  1393. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1394. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1395. # hello_imgui/runner_callbacks.h continued //
  1396. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1397. # --------------------------------------------------------------------------------------------------------------------
  1398. # @@md#VoidFunction_AnyEventCallback
  1399. # inline VoidFunction EmptyVoidFunction() { return {}; } /* original C++ signature */
  1400. def empty_void_function() -> VoidFunction:
  1401. pass
  1402. # VoidFunction SequenceFunctions(const VoidFunction& f1, const VoidFunction& f2); /* original C++ signature */
  1403. def sequence_functions(f1: VoidFunction, f2: VoidFunction) -> VoidFunction:
  1404. """SequenceFunctions: returns a function that will call f1 and f2 in sequence"""
  1405. pass
  1406. # inline AnyEventCallback EmptyEventCallback() {return {}; } /* original C++ signature */
  1407. def empty_event_callback() -> AnyEventCallback:
  1408. pass
  1409. # @@md
  1410. # --------------------------------------------------------------------------------------------------------------------
  1411. # @@md#MobileCallbacks
  1412. class MobileCallbacks:
  1413. """MobileCallbacks is a struct that contains callbacks that are called by the application
  1414. when running under "Android, iOS and WinRT".
  1415. These events are specific to mobile and embedded devices that have different
  1416. requirements from your usual desktop application.
  1417. These events must be handled quickly, since often the OS needs an immediate response
  1418. and will terminate your process shortly after sending the event
  1419. if you do not handle them appropriately.
  1420. On mobile devices, it is not possible to "Quit" an application,
  1421. it can only be put on Pause.
  1422. """
  1423. # VoidFunction OnDestroy = EmptyVoidFunction(); /* original C++ signature */
  1424. # `OnDestroy`: The application is being terminated by the OS.
  1425. on_destroy: VoidFunction = empty_void_function()
  1426. # VoidFunction OnLowMemory = EmptyVoidFunction(); /* original C++ signature */
  1427. # `OnLowMemory`: _VoidFunction, default=empty_.
  1428. # When the application is low on memory, free memory if possible.
  1429. on_low_memory: VoidFunction = empty_void_function()
  1430. # VoidFunction OnPause = EmptyVoidFunction(); /* original C++ signature */
  1431. # `OnPause`: The application is about to enter the background.
  1432. on_pause: VoidFunction = empty_void_function()
  1433. # VoidFunction OnResume = EmptyVoidFunction(); /* original C++ signature */
  1434. # `OnResume`: The application came to foreground and is now interactive.
  1435. # Note: 'OnPause' and 'OnResume' are called twice consecutively under iOS
  1436. # (before and after entering background or foreground).
  1437. on_resume: VoidFunction = empty_void_function()
  1438. # MobileCallbacks(VoidFunction OnDestroy = EmptyVoidFunction(), VoidFunction OnLowMemory = EmptyVoidFunction(), VoidFunction OnPause = EmptyVoidFunction(), VoidFunction OnResume = EmptyVoidFunction()); /* original C++ signature */
  1439. def __init__(
  1440. self,
  1441. on_destroy: Optional[VoidFunction] = None,
  1442. on_low_memory: Optional[VoidFunction] = None,
  1443. on_pause: Optional[VoidFunction] = None,
  1444. on_resume: Optional[VoidFunction] = None,
  1445. ) -> None:
  1446. """Auto-generated default constructor with named params
  1447. Python bindings defaults:
  1448. If any of the params below is None, then its default value below will be used:
  1449. * OnDestroy: EmptyVoidFunction()
  1450. * OnLowMemory: EmptyVoidFunction()
  1451. * OnPause: EmptyVoidFunction()
  1452. * OnResume: EmptyVoidFunction()
  1453. """
  1454. pass
  1455. # @@md
  1456. # --------------------------------------------------------------------------------------------------------------------
  1457. # @@md#EdgeToolbar
  1458. class EdgeToolbarType(enum.IntEnum):
  1459. """EdgeToolbarType: location of an Edge Toolbar"""
  1460. # Top, /* original C++ signature */
  1461. top = enum.auto() # (= 0)
  1462. # Bottom, /* original C++ signature */
  1463. bottom = enum.auto() # (= 1)
  1464. # Left, /* original C++ signature */
  1465. left = enum.auto() # (= 2)
  1466. # Right /* original C++ signature */
  1467. # }
  1468. right = enum.auto() # (= 3)
  1469. class EdgeToolbarOptions:
  1470. # float sizeEm = 2.5f; /* original C++ signature */
  1471. # height or width the top toolbar, in em units
  1472. # (i.e. multiples of the default font size, to be Dpi aware)
  1473. size_em: float = 2.5
  1474. # ImVec2 WindowPaddingEm = ImVec2(0.3f, 0.3f); /* original C++ signature */
  1475. # Padding inside the window, in em units
  1476. window_padding_em: ImVec2 = ImVec2(0.3, 0.3)
  1477. # ImVec4 WindowBg = ImVec4(0.f, 0.f, 0.f, 0.f); /* original C++ signature */
  1478. # Window background color, only used if WindowBg.w > 0
  1479. window_bg: ImVec4 = ImVec4(0.0, 0.0, 0.0, 0.0)
  1480. # EdgeToolbarOptions(float sizeEm = 2.5f, ImVec2 WindowPaddingEm = ImVec2(0.3f, 0.3f), ImVec4 WindowBg = ImVec4(0.f, 0.f, 0.f, 0.f)); /* original C++ signature */
  1481. def __init__(
  1482. self,
  1483. size_em: float = 2.5,
  1484. window_padding_em: Optional[ImVec2Like] = None,
  1485. window_bg: Optional[ImVec4Like] = None,
  1486. ) -> None:
  1487. """Auto-generated default constructor with named params
  1488. Python bindings defaults:
  1489. If any of the params below is None, then its default value below will be used:
  1490. * WindowPaddingEm: ImVec2(0.3, 0.3)
  1491. * WindowBg: ImVec4(0., 0., 0., 0.)
  1492. """
  1493. pass
  1494. class EdgeToolbar:
  1495. """EdgeToolbar :a toolbar that can be placed on the edges of the App window
  1496. It will be placed in a non-dockable window
  1497. """
  1498. # VoidFunction ShowToolbar = EmptyVoidFunction(); /* original C++ signature */
  1499. show_toolbar: VoidFunction = empty_void_function()
  1500. # EdgeToolbarOptions options; /* original C++ signature */
  1501. options: EdgeToolbarOptions
  1502. # EdgeToolbar(VoidFunction ShowToolbar = EmptyVoidFunction(), EdgeToolbarOptions options = EdgeToolbarOptions()); /* original C++ signature */
  1503. def __init__(
  1504. self,
  1505. show_toolbar: Optional[VoidFunction] = None,
  1506. options: Optional[EdgeToolbarOptions] = None,
  1507. ) -> None:
  1508. """Auto-generated default constructor with named params
  1509. Python bindings defaults:
  1510. If any of the params below is None, then its default value below will be used:
  1511. * ShowToolbar: EmptyVoidFunction()
  1512. * options: EdgeToolbarOptions()
  1513. """
  1514. pass
  1515. # std::vector<EdgeToolbarType> AllEdgeToolbarTypes(); /* original C++ signature */
  1516. def all_edge_toolbar_types() -> List[EdgeToolbarType]:
  1517. pass
  1518. # std::string EdgeToolbarTypeName(EdgeToolbarType e); /* original C++ signature */
  1519. def edge_toolbar_type_name(e: EdgeToolbarType) -> str:
  1520. pass
  1521. # @@md
  1522. # --------------------------------------------------------------------------------------------------------------------
  1523. # @@md#DefaultIconFont
  1524. class DefaultIconFont(enum.IntEnum):
  1525. """HelloImGui can optionally merge an icon font (FontAwesome 4 or 6) to the default font
  1526. - you need to include manually icons_font_awesome_4.h or icons_font_awesome_6.h:
  1527. #include "hello_imgui/icons_font_awesome_6.h" or #include "hello_imgui/icons_font_awesome_4.h"
  1528. """
  1529. # NoIcons, /* original C++ signature */
  1530. no_icons = enum.auto() # (= 0)
  1531. # FontAwesome4, /* original C++ signature */
  1532. font_awesome4 = enum.auto() # (= 1)
  1533. # FontAwesome6 /* original C++ signature */
  1534. # }
  1535. font_awesome6 = enum.auto() # (= 2)
  1536. # @@md
  1537. # --------------------------------------------------------------------------------------------------------------------
  1538. class RunnerCallbacks:
  1539. """@@md#RunnerCallbacks
  1540. RunnerCallbacks is a struct that contains the callbacks
  1541. that are called by the application
  1542. """
  1543. # --------------- GUI Callbacks -------------------
  1544. # VoidFunction ShowGui = EmptyVoidFunction(); /* original C++ signature */
  1545. # `ShowGui`: Fill it with a function that will add your widgets.
  1546. # (ShowGui will be called at each frame, before rendering the Dockable windows, if any)
  1547. show_gui: VoidFunction = empty_void_function()
  1548. # VoidFunction ShowMenus = EmptyVoidFunction(); /* original C++ signature */
  1549. # `ShowMenus`: Fill it with a function that will add ImGui menus by calling:
  1550. # ImGui::BeginMenu(...) / ImGui::MenuItem(...) / ImGui::EndMenu()
  1551. # Notes:
  1552. # * you do not need to call ImGui::BeginMenuBar and ImGui::EndMenuBar
  1553. # * Some default menus can be provided:
  1554. # see ImGuiWindowParams options:
  1555. # _showMenuBar, showMenu_App_QuitAbout, showMenu_View_
  1556. show_menus: VoidFunction = empty_void_function()
  1557. # VoidFunction ShowAppMenuItems = EmptyVoidFunction(); /* original C++ signature */
  1558. # `ShowAppMenuItems`: A function that will render items that will be placed
  1559. # in the App menu. They will be placed before the "Quit" MenuItem,
  1560. # which is added automatically by HelloImGui.
  1561. # This will be displayed only if ImGuiWindowParams.showMenu_App is True
  1562. show_app_menu_items: VoidFunction = empty_void_function()
  1563. # VoidFunction ShowStatus = EmptyVoidFunction(); /* original C++ signature */
  1564. # `ShowStatus`: A function that will add items to the status bar.
  1565. # Use small items (ImGui::Text for example), since the height of the status is 30.
  1566. # Also, remember to call ImGui::SameLine() between items.
  1567. show_status: VoidFunction = empty_void_function()
  1568. # std::map<EdgeToolbarType, EdgeToolbar> edgesToolbars; /* original C++ signature */
  1569. # `EdgesToolbars`:
  1570. # A dict that contains toolbars that can be placed on the edges of the App window
  1571. edges_toolbars: Dict[EdgeToolbarType, EdgeToolbar]
  1572. # void AddEdgeToolbar(EdgeToolbarType edgeToolbarType, /* original C++ signature */
  1573. # VoidFunction guiFunction,
  1574. # const EdgeToolbarOptions& options = EdgeToolbarOptions());
  1575. def add_edge_toolbar(
  1576. self,
  1577. edge_toolbar_type: EdgeToolbarType,
  1578. gui_function: VoidFunction,
  1579. options: Optional[EdgeToolbarOptions] = None,
  1580. ) -> None:
  1581. """`AddEdgeToolbar`: Add a toolbar that can be placed on the edges of the App window
  1582. Python bindings defaults:
  1583. If options is None, then its default value will be: EdgeToolbarOptions()
  1584. """
  1585. pass
  1586. # --------------- Startup sequence callbacks -------------------
  1587. # VoidFunction PostInit_AddPlatformBackendCallbacks = EmptyVoidFunction(); /* original C++ signature */
  1588. # `PostInit_AddPlatformBackendCallbacks`:
  1589. # You can here add a function that will be called once after OpenGL and ImGui are inited,
  1590. # but before the platform backend callbacks are initialized.
  1591. # If you, want to add your own glfw callbacks, you should use this function to do so
  1592. # (and then ImGui will call your callbacks followed by its own callbacks)
  1593. post_init_add_platform_backend_callbacks: VoidFunction = empty_void_function()
  1594. # VoidFunction PostInit = EmptyVoidFunction(); /* original C++ signature */
  1595. # `PostInit`: You can here add a function that will be called once after everything
  1596. # is inited (ImGui, Platform and Renderer Backend)
  1597. post_init: VoidFunction = empty_void_function()
  1598. # void EnqueuePostInit(const VoidFunction& callback); /* original C++ signature */
  1599. def enqueue_post_init(self, callback: VoidFunction) -> None:
  1600. """`EnqueuePostInit`: Add a function that will be called once after OpenGL
  1601. and ImGui are inited, but before the backend callback are initialized.
  1602. (this will modify the `PostInit` callback by appending the new callback (using `SequenceFunctions`)
  1603. """
  1604. pass
  1605. # VoidFunction LoadAdditionalFonts = ImGuiDefaultSettings::LoadDefaultFont_WithFontAwesomeIcons; /* original C++ signature */
  1606. # `LoadAdditionalFonts`: default=_LoadDefaultFont_WithFontAwesome*.
  1607. # A function that is called in order to load fonts.
  1608. # `LoadAdditionalFonts` will be called once, then *set to None*.
  1609. # If you want to load additional fonts, during the app execution, you can
  1610. # set LoadAdditionalFonts to a function that will load the additional fonts.
  1611. load_additional_fonts: VoidFunction = (
  1612. imgui_default_settings.LoadDefaultFont_WithFontAwesomeIcons
  1613. )
  1614. # DefaultIconFont defaultIconFont = DefaultIconFont::FontAwesome4; /* original C++ signature */
  1615. # If LoadAdditionalFonts==LoadDefaultFont_WithFontAwesomeIcons, this parameter control
  1616. # which icon font will be loaded by default.
  1617. default_icon_font: DefaultIconFont = DefaultIconFont.font_awesome4
  1618. # VoidFunction SetupImGuiConfig = ImGuiDefaultSettings::SetupDefaultImGuiConfig; /* original C++ signature */
  1619. # `SetupImGuiConfig`: default=_ImGuiDefaultSettings::SetupDefaultImGuiConfig*.
  1620. # If needed, change ImGui config via SetupImGuiConfig
  1621. # (enable docking, gamepad, etc)
  1622. setup_imgui_config: VoidFunction = imgui_default_settings.SetupDefaultImGuiConfig
  1623. # VoidFunction SetupImGuiStyle = ImGuiDefaultSettings::SetupDefaultImGuiStyle; /* original C++ signature */
  1624. # `SetupImGuiStyle`: default=_ImGuiDefaultSettings::SetupDefaultImGuiConfig*.
  1625. # If needed, set your own style by providing your own SetupImGuiStyle callback
  1626. setup_imgui_style: VoidFunction = imgui_default_settings.SetupDefaultImGuiStyle
  1627. # VoidFunction RegisterTests = EmptyVoidFunction(); /* original C++ signature */
  1628. # `RegisterTests`: A function that is called once ImGuiTestEngine is ready
  1629. # to be filled with tests and automations definitions.
  1630. register_tests: VoidFunction = empty_void_function()
  1631. # bool registerTestsCalled = false; /* original C++ signature */
  1632. # `registerTestsCalled`: will be set to True when RegisterTests was called
  1633. # (you can set this to False if you want to RegisterTests to be called again
  1634. # during the app execution)
  1635. register_tests_called: bool = False
  1636. # --------------- Exit sequence callbacks -------------------
  1637. # VoidFunction BeforeExit = EmptyVoidFunction(); /* original C++ signature */
  1638. # `BeforeExit`: You can here add a function that will be called once before exiting
  1639. # (when OpenGL and ImGui are still inited)
  1640. before_exit: VoidFunction = empty_void_function()
  1641. # void EnqueueBeforeExit(const VoidFunction& callback); /* original C++ signature */
  1642. def enqueue_before_exit(self, callback: VoidFunction) -> None:
  1643. """`EnqueueBeforeExit`: Add a function that will be called once before exiting
  1644. (when OpenGL and ImGui are still inited)
  1645. (this will modify the `BeforeExit` callback by appending the new callback (using `SequenceFunctions`)
  1646. """
  1647. pass
  1648. # VoidFunction BeforeExit_PostCleanup = EmptyVoidFunction(); /* original C++ signature */
  1649. # `BeforeExit_PostCleanup`: You can here add a function that will be called once
  1650. # before exiting (after OpenGL and ImGui have been stopped)
  1651. before_exit_post_cleanup: VoidFunction = empty_void_function()
  1652. # --------------- Callbacks in the render loop -------------------
  1653. # VoidFunction PreNewFrame = EmptyVoidFunction(); /* original C++ signature */
  1654. # `PreNewFrame`: You can here add a function that will be called at each frame,
  1655. # and before the call to ImGui::NewFrame().
  1656. # It is a good place to add new dockable windows.
  1657. pre_new_frame: VoidFunction = empty_void_function()
  1658. # VoidFunction PostNewFrame = EmptyVoidFunction(); /* original C++ signature */
  1659. # `PostNewFrame`: You can here add a function that will be called at each frame,
  1660. # just after the call to ImGui::NewFrame(), and before any Gui code.
  1661. post_new_frame: VoidFunction = empty_void_function()
  1662. # VoidFunction BeforeImGuiRender = EmptyVoidFunction(); /* original C++ signature */
  1663. # `BeforeImGuiRender`: You can here add a function that will be called at each frame,
  1664. # after the user Gui code, and just before the call to
  1665. # ImGui::Render() (which will also call ImGui::EndFrame()).
  1666. before_imgui_render: VoidFunction = empty_void_function()
  1667. # VoidFunction AfterSwap = EmptyVoidFunction(); /* original C++ signature */
  1668. # `AfterSwap`: You can here add a function that will be called at each frame,
  1669. # after the Gui was rendered and swapped to the screen.
  1670. after_swap: VoidFunction = empty_void_function()
  1671. # VoidFunction CustomBackground = EmptyVoidFunction(); /* original C++ signature */
  1672. # `CustomBackground`:
  1673. # By default, the background is cleared using ImGuiWindowParams.backgroundColor.
  1674. # If set, this function gives you full control over the background that is drawn
  1675. # behind the Gui. An example use case is if you have a 3D application
  1676. # like a mesh editor, or game, and just want the Gui to be drawn
  1677. # on top of that content.
  1678. custom_background: VoidFunction = empty_void_function()
  1679. # VoidFunction PostRenderDockableWindows = EmptyVoidFunction(); /* original C++ signature */
  1680. # `PostRenderDockableWindows`: Fill it with a function that will be called
  1681. # after the dockable windows are rendered.
  1682. post_render_dockable_windows: VoidFunction = empty_void_function()
  1683. # VoidFunction ThemeChanged = EmptyVoidFunction(); /* original C++ signature */
  1684. # `ThemeChanged`: You can here add a function that will be called
  1685. # immediately after `ImGuiTheme::ApplyTheme` has been executed. This is
  1686. # typically triggered when the user clicks a theme menu item in the menubar,
  1687. # allowing custom drawings or UI elements to update their colors right after
  1688. # the theme change.
  1689. theme_changed: VoidFunction = empty_void_function()
  1690. # AnyEventCallback AnyBackendEventCallback = EmptyEventCallback(); /* original C++ signature */
  1691. # `AnyBackendEventCallback`:
  1692. # Callbacks for events from a specific backend. _Only implemented for SDL.
  1693. # where the event will be of type 'SDL_Event *'_
  1694. # This callback should return True if the event was handled
  1695. # and shall not be processed further.
  1696. # Note: in the case of GLFW, you should use register them in `PostInit`
  1697. any_backend_event_callback: AnyEventCallback = empty_event_callback()
  1698. # --------------- Mobile callbacks -------------------
  1699. # RunnerCallbacks(VoidFunction ShowGui = EmptyVoidFunction(), VoidFunction ShowMenus = EmptyVoidFunction(), VoidFunction ShowAppMenuItems = EmptyVoidFunction(), VoidFunction ShowStatus = EmptyVoidFunction(), VoidFunction PostInit_AddPlatformBackendCallbacks = EmptyVoidFunction(), VoidFunction PostInit = EmptyVoidFunction(), VoidFunction LoadAdditionalFonts = ImGuiDefaultSettings::LoadDefaultFont_WithFontAwesomeIcons, DefaultIconFont defaultIconFont = DefaultIconFont::FontAwesome4, VoidFunction SetupImGuiConfig = ImGuiDefaultSettings::SetupDefaultImGuiConfig, VoidFunction SetupImGuiStyle = ImGuiDefaultSettings::SetupDefaultImGuiStyle, VoidFunction RegisterTests = EmptyVoidFunction(), bool registerTestsCalled = false, VoidFunction BeforeExit = EmptyVoidFunction(), VoidFunction BeforeExit_PostCleanup = EmptyVoidFunction(), VoidFunction PreNewFrame = EmptyVoidFunction(), VoidFunction PostNewFrame = EmptyVoidFunction(), VoidFunction BeforeImGuiRender = EmptyVoidFunction(), VoidFunction AfterSwap = EmptyVoidFunction(), VoidFunction CustomBackground = EmptyVoidFunction(), VoidFunction PostRenderDockableWindows = EmptyVoidFunction(), VoidFunction ThemeChanged = EmptyVoidFunction(), AnyEventCallback AnyBackendEventCallback = EmptyEventCallback()); /* original C++ signature */
  1700. def __init__(
  1701. self,
  1702. show_gui: Optional[VoidFunction] = None,
  1703. show_menus: Optional[VoidFunction] = None,
  1704. show_app_menu_items: Optional[VoidFunction] = None,
  1705. show_status: Optional[VoidFunction] = None,
  1706. post_init_add_platform_backend_callbacks: Optional[VoidFunction] = None,
  1707. post_init: Optional[VoidFunction] = None,
  1708. load_additional_fonts: Optional[VoidFunction] = None,
  1709. default_icon_font: DefaultIconFont = DefaultIconFont.font_awesome4,
  1710. setup_imgui_config: Optional[VoidFunction] = None,
  1711. setup_imgui_style: Optional[VoidFunction] = None,
  1712. register_tests: Optional[VoidFunction] = None,
  1713. register_tests_called: bool = False,
  1714. before_exit: Optional[VoidFunction] = None,
  1715. before_exit_post_cleanup: Optional[VoidFunction] = None,
  1716. pre_new_frame: Optional[VoidFunction] = None,
  1717. post_new_frame: Optional[VoidFunction] = None,
  1718. before_imgui_render: Optional[VoidFunction] = None,
  1719. after_swap: Optional[VoidFunction] = None,
  1720. custom_background: Optional[VoidFunction] = None,
  1721. post_render_dockable_windows: Optional[VoidFunction] = None,
  1722. theme_changed: Optional[VoidFunction] = None,
  1723. any_backend_event_callback: Optional[AnyEventCallback] = None,
  1724. ) -> None:
  1725. """Auto-generated default constructor with named params
  1726. Python bindings defaults:
  1727. If any of the params below is None, then its default value below will be used:
  1728. * ShowGui: EmptyVoidFunction()
  1729. * ShowMenus: EmptyVoidFunction()
  1730. * ShowAppMenuItems: EmptyVoidFunction()
  1731. * ShowStatus: EmptyVoidFunction()
  1732. * PostInit_AddPlatformBackendCallbacks: EmptyVoidFunction()
  1733. * PostInit: EmptyVoidFunction()
  1734. * LoadAdditionalFonts: imgui_default_settings.LoadDefaultFont_WithFontAwesomeIcons
  1735. * SetupImGuiConfig: imgui_default_settings.SetupDefaultImGuiConfig
  1736. * SetupImGuiStyle: imgui_default_settings.SetupDefaultImGuiStyle
  1737. * RegisterTests: EmptyVoidFunction()
  1738. * BeforeExit: EmptyVoidFunction()
  1739. * BeforeExit_PostCleanup: EmptyVoidFunction()
  1740. * PreNewFrame: EmptyVoidFunction()
  1741. * PostNewFrame: EmptyVoidFunction()
  1742. * BeforeImGuiRender: EmptyVoidFunction()
  1743. * AfterSwap: EmptyVoidFunction()
  1744. * CustomBackground: EmptyVoidFunction()
  1745. * PostRenderDockableWindows: EmptyVoidFunction()
  1746. * ThemeChanged: EmptyVoidFunction()
  1747. * AnyBackendEventCallback: EmptyEventCallback()
  1748. """
  1749. pass
  1750. # @@md
  1751. # VoidFunction AppendCallback(const VoidFunction& previousCallback, const VoidFunction& newCallback); /* original C++ signature */
  1752. def append_callback(
  1753. previous_callback: VoidFunction, new_callback: VoidFunction
  1754. ) -> VoidFunction:
  1755. """AppendCallback: legacy synonym for SequenceFunctions"""
  1756. pass
  1757. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1758. # hello_imgui/docking_params.h included by hello_imgui/runner_params.h //
  1759. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1760. # *
  1761. # @@md#DockingIntro
  1762. #
  1763. # HelloImGui makes it easy to use dockable windows
  1764. # (based on ImGui [docking branch](https://github.com/ocornut/imgui/tree/docking)).
  1765. #
  1766. # You can define several layouts and switch between them: each layout which will remember
  1767. # the user modifications and the list of opened windows
  1768. #
  1769. # HelloImGui will then provide a "View" menu with options to show/hide the dockable windows,
  1770. # restore the default layout, switch between layouts, etc.
  1771. #
  1772. #![demo docking](https://imgui-bundle.pages.dev/resources/HelloImGuiLayout.gif)
  1773. #
  1774. # * Source for this example: https://github.com/pthom/hello_imgui/tree/master/src/hello_imgui_demos/hello_imgui_demodocking
  1775. # * [Video explanation on YouTube](https://www.youtube.com/watch?v=XKxmz__F4ow) (5 minutes)
  1776. #
  1777. #
  1778. # The different available layouts are provided inside RunnerParams via the two members below:
  1779. # ```cpp
  1780. # struct RunnerParams
  1781. # {
  1782. # ...
  1783. # // default layout of the application
  1784. # DockingParams dockingParams;
  1785. #
  1786. # // optional alternative layouts
  1787. # std::vector<DockingParams> alternativeDockingLayouts;
  1788. #
  1789. # ...
  1790. # };
  1791. # ```
  1792. #
  1793. # And `DockingParams` contains members that define a layout:
  1794. #
  1795. # ```cpp
  1796. # struct DockingParams
  1797. # {
  1798. # // displayed name of the layout
  1799. # std::string layoutName = "Default";
  1800. #
  1801. # // list of splits
  1802. # // (which define spaces where the windows will be placed)
  1803. # std::vector<DockingSplit> dockingSplits;
  1804. #
  1805. # // list of windows
  1806. # // (with their gui code, and specifying in which space they will be placed)
  1807. # std::vector<DockableWindow> dockableWindows;
  1808. #
  1809. # ...
  1810. # };
  1811. # ```
  1812. #
  1813. # Inside DockingParams, the member `dockingSplits` specifies the layout, and the member `dockableWindows`
  1814. # specifies the list of dockable windows, along with their default location, and their code (given by lambdas).
  1815. #
  1816. # @@md
  1817. #
  1818. #
  1819. # @@md#DockingExample
  1820. #
  1821. # Below is an example that shows how to instantiate a layout:
  1822. #
  1823. # 1. First, define the docking splits:
  1824. #
  1825. # ```cpp
  1826. # std::vector<HelloImGui::DockingSplit> CreateDefaultDockingSplits()
  1827. # {
  1828. # // Here, we want to split "MainDockSpace" (which is provided automatically)
  1829. # // into three zones, like this:
  1830. # // ___________________________________________
  1831. # // | | |
  1832. # // | Command| |
  1833. # // | Space | MainDockSpace |
  1834. # // | | |
  1835. # // | | |
  1836. # // | | |
  1837. # // -------------------------------------------
  1838. # // | MiscSpace |
  1839. # // -------------------------------------------
  1840. # //
  1841. #
  1842. # // add a space named "MiscSpace" whose height is 25% of the app height.
  1843. # // This will split the preexisting default dockspace "MainDockSpace" in two parts.
  1844. # HelloImGui::DockingSplit splitMainMisc;
  1845. # splitMainMisc.initialDock = "MainDockSpace";
  1846. # splitMainMisc.newDock = "MiscSpace";
  1847. # splitMainMisc.direction = ImGuiDir_Down;
  1848. # splitMainMisc.ratio = 0.25;
  1849. #
  1850. # // Then, add a space to the left which occupies a column
  1851. # // whose width is 25% of the app width
  1852. # HelloImGui::DockingSplit splitMainCommand;
  1853. # splitMainCommand.initialDock = "MainDockSpace";
  1854. # splitMainCommand.newDock = "CommandSpace";
  1855. # splitMainCommand.direction = ImGuiDir_Left;
  1856. # splitMainCommand.ratio = 0.25;
  1857. #
  1858. # std::vector<HelloImGui::DockingSplit> splits {splitMainMisc, splitMainCommand};
  1859. # return splits;
  1860. # }
  1861. # ```
  1862. #
  1863. # 2. Then, define the dockable windows:
  1864. #
  1865. # ```cpp
  1866. # std::vector<HelloImGui::DockableWindow> CreateDockableWindows(AppState& appState)
  1867. # {
  1868. # // A Command panel named "Commands" will be placed in "CommandSpace".
  1869. # // Its Gui is provided calls "CommandGui"
  1870. # HelloImGui::DockableWindow commandsWindow;
  1871. # commandsWindow.label = "Commands";
  1872. # commandsWindow.dockSpaceName = "CommandSpace";
  1873. # commandsWindow.GuiFunction = [&] { CommandGui(appState); };
  1874. #
  1875. # // A Log window named "Logs" will be placed in "MiscSpace".
  1876. # // It uses the HelloImGui logger gui
  1877. # HelloImGui::DockableWindow logsWindow;
  1878. # logsWindow.label = "Logs";
  1879. # logsWindow.dockSpaceName = "MiscSpace";
  1880. # logsWindow.GuiFunction = [] { HelloImGui::LogGui(); };
  1881. #
  1882. # ...
  1883. # }
  1884. # ```
  1885. #
  1886. # 3. Finally, fill the RunnerParams
  1887. #
  1888. # ```cpp
  1889. # HelloImGui::RunnerParams runnerParams;
  1890. # runnerParams.imGuiWindowParams.defaultImGuiWindowType =
  1891. # HelloImGui::DefaultImGuiWindowType::ProvideFullScreenDockSpace;
  1892. #
  1893. # runnerParams.dockingParams.dockingSplits = CreateDefaultDockingSplits();
  1894. # runnerParams.dockingParams.dockableWindows = CreateDockableWindows();
  1895. #
  1896. #
  1897. # HelloImGui::Run(runnerParams);
  1898. # ```
  1899. #
  1900. # @@md
  1901. #
  1902. # ***************************************************************************
  1903. # @@md#DockingSplit
  1904. class DockingSplit:
  1905. """DockingSplit is a struct that defines the way the docking splits should
  1906. be applied on the screen in order to create new Dock Spaces.
  1907. DockingParams contains a
  1908. vector<DockingSplit>
  1909. in order to partition the screen at your will.
  1910. """
  1911. # DockSpaceName initialDock; /* original C++ signature */
  1912. # `initialDock`: _DockSpaceName (aka string)_
  1913. # id of the space that should be split.
  1914. # At the start, there is only one Dock Space named "MainDockSpace".
  1915. # You should start by partitioning this space, in order to create a new dock space.
  1916. initial_dock: DockSpaceName
  1917. # DockSpaceName newDock; /* original C++ signature */
  1918. # `newDock`: _DockSpaceName (aka string)_.
  1919. # id of the new dock space that will be created.
  1920. new_dock: DockSpaceName
  1921. # ImGuiDir direction; /* original C++ signature */
  1922. # `direction`: *ImGuiDir_*
  1923. # (enum with ImGuiDir_Down, ImGuiDir_Down, ImGuiDir_Left, ImGuiDir_Right)*
  1924. # Direction where this dock space should be created.
  1925. direction: ImGuiDir
  1926. # float ratio = 0.25f; /* original C++ signature */
  1927. # `ratio`: _float, default=0.25_.
  1928. # Ratio of the initialDock size that should be used by the new dock space.
  1929. ratio: float = 0.25
  1930. # ImGuiDockNodeFlags nodeFlags = ImGuiDockNodeFlags_None; /* original C++ signature */
  1931. # `nodeFlags`: *ImGuiDockNodeFlags_ (enum)*.
  1932. # Flags to apply to the new dock space
  1933. # (enable/disable resizing, splitting, tab bar, etc.)
  1934. node_flags: ImGuiDockNodeFlags = DockNodeFlags_.none
  1935. # DockingSplit(const DockSpaceName& initialDock_ = "", const DockSpaceName& newDock_ = "", /* original C++ signature */
  1936. # ImGuiDir direction_ = ImGuiDir_Down, float ratio_ = 0.25f,
  1937. # ImGuiDockNodeFlags nodeFlags_ = ImGuiDockNodeFlags_None)
  1938. # : initialDock(initialDock_), newDock(newDock_), direction(direction_), ratio(ratio_), nodeFlags(nodeFlags_) {}
  1939. def __init__(
  1940. self,
  1941. initial_dock_: DockSpaceName = "",
  1942. new_dock_: DockSpaceName = "",
  1943. direction_: Optional[ImGuiDir] = None,
  1944. ratio_: float = 0.25,
  1945. node_flags_: Optional[ImGuiDockNodeFlags] = None,
  1946. ) -> None:
  1947. """Constructor
  1948. Python bindings defaults:
  1949. If any of the params below is None, then its default value below will be used:
  1950. * direction_: Dir.down
  1951. * nodeFlags_: DockNodeFlags_.none
  1952. """
  1953. pass
  1954. # @@md
  1955. # @@md#DockableWindow
  1956. class DockableWindow:
  1957. """DockableWindow is a struct that represents a window that can be docked."""
  1958. # --------------- Main params -------------------
  1959. # std::string label; /* original C++ signature */
  1960. # `label`: _string_. Title of the window. It should be unique! Use "##" to add a unique suffix if needed.
  1961. label: str
  1962. # DockSpaceName dockSpaceName; /* original C++ signature */
  1963. # `dockSpaceName`: _DockSpaceName (aka string)_.
  1964. # Id of the dock space where this window should initially be placed
  1965. dock_space_name: DockSpaceName
  1966. # VoidFunction GuiFunction = EmptyVoidFunction(); /* original C++ signature */
  1967. # `GuiFunction`: _VoidFunction_.
  1968. # Any function that will render this window's Gui
  1969. gui_function: VoidFunction = empty_void_function()
  1970. # --------------- Options --------------------------
  1971. # bool isVisible = true; /* original C++ signature */
  1972. # `isVisible`: _bool, default=true_.
  1973. # Flag that indicates whether this window is visible or not.
  1974. is_visible: bool = True
  1975. # bool rememberIsVisible = true; /* original C++ signature */
  1976. # `rememberIsVisible`: _bool, default=true_.
  1977. # Flag that indicates whether the window visibility should be saved in settings.
  1978. remember_is_visible: bool = True
  1979. # bool canBeClosed = true; /* original C++ signature */
  1980. # `canBeClosed`: _bool, default=true_.
  1981. # Flag that indicates whether the user can close this window.
  1982. can_be_closed: bool = True
  1983. # bool callBeginEnd = true; /* original C++ signature */
  1984. # `callBeginEnd`: _bool, default=true_.
  1985. # Flag that indicates whether ImGui::Begin and ImGui::End
  1986. # calls should be added automatically (with the given "label").
  1987. # Set to False if you want to call ImGui::Begin/End yourself
  1988. call_begin_end: bool = True
  1989. # bool includeInViewMenu = true; /* original C++ signature */
  1990. # `includeInViewMenu`: _bool, default=true_.
  1991. # Flag that indicates whether this window should be mentioned in the view menu.
  1992. include_in_view_menu: bool = True
  1993. # ImGuiWindowFlags imGuiWindowFlags = 0; /* original C++ signature */
  1994. # `imGuiWindowFlags`: _ImGuiWindowFlags, default=0_.
  1995. # Window flags, see enum ImGuiWindowFlags_
  1996. imgui_window_flags: ImGuiWindowFlags = 0
  1997. # --------------- Focus window -----------------------------
  1998. # bool focusWindowAtNextFrame = false; /* original C++ signature */
  1999. # `focusWindowAtNextFrame`: _bool, default = false_.
  2000. # If set to True this window will be focused at the next frame.
  2001. focus_window_at_next_frame: bool = False
  2002. # --------------- Size & Position --------------------------
  2003. # (only if not docked)
  2004. # ImVec2 windowSize = ImVec2(0.f, 0.f); /* original C++ signature */
  2005. # `windowSize`: _ImVec2, default=(0., 0.) (i.e let the app decide)_.
  2006. # Window size (unused if docked)
  2007. window_size: ImVec2 = ImVec2(0.0, 0.0)
  2008. # ImGuiCond windowSizeCondition = ImGuiCond_FirstUseEver; /* original C++ signature */
  2009. # `windowSizeCondition`: _ImGuiCond, default=ImGuiCond_FirstUseEver_.
  2010. # When to apply the window size.
  2011. window_size_condition: ImGuiCond = Cond_.first_use_ever
  2012. # ImVec2 windowPosition = ImVec2(0.f, 0.f); /* original C++ signature */
  2013. # `windowPos`: _ImVec2, default=(0., 0.) (i.e let the app decide)_.
  2014. # Window position (unused if docked)
  2015. window_position: ImVec2 = ImVec2(0.0, 0.0)
  2016. # ImGuiCond windowPositionCondition = ImGuiCond_FirstUseEver; /* original C++ signature */
  2017. # `windowPosCondition`: _ImGuiCond, default=ImGuiCond_FirstUseEver_.
  2018. # When to apply the window position.
  2019. window_position_condition: ImGuiCond = Cond_.first_use_ever
  2020. # DockableWindow( /* original C++ signature */
  2021. # const std::string & label_ = "",
  2022. # const DockSpaceName & dockSpaceName_ = "",
  2023. # const VoidFunction guiFunction_ = EmptyVoidFunction(),
  2024. # bool isVisible_ = true,
  2025. # bool canBeClosed_ = true)
  2026. # : label(label_), dockSpaceName(dockSpaceName_),
  2027. # GuiFunction(guiFunction_),
  2028. # isVisible(isVisible_),
  2029. # canBeClosed(canBeClosed_) {}
  2030. def __init__(
  2031. self,
  2032. label_: str = "",
  2033. dock_space_name_: DockSpaceName = "",
  2034. gui_function_: Optional[VoidFunction] = None,
  2035. is_visible_: bool = True,
  2036. can_be_closed_: bool = True,
  2037. ) -> None:
  2038. """--------------- Constructor ------------------------------
  2039. Constructor
  2040. Python bindings defaults:
  2041. If guiFunction_ is None, then its default value will be: EmptyVoidFunction()
  2042. """
  2043. pass
  2044. # @@md
  2045. class DockingLayoutCondition(enum.IntEnum):
  2046. # FirstUseEver, /* original C++ signature */
  2047. first_use_ever = enum.auto() # (= 0)
  2048. # ApplicationStart, /* original C++ signature */
  2049. application_start = enum.auto() # (= 1)
  2050. # Never /* original C++ signature */
  2051. # }
  2052. never = enum.auto() # (= 2)
  2053. # @@md#DockingParams
  2054. class DockingParams:
  2055. """DockingParams contains all the settings concerning the docking:
  2056. - list of splits
  2057. - list of dockable windows
  2058. """
  2059. # --------------- Main params -----------------------------
  2060. # std::vector<DockingSplit> dockingSplits; /* original C++ signature */
  2061. # `dockingSplits`: _vector[DockingSplit]_.
  2062. # Defines the way docking splits should be applied on the screen
  2063. # in order to create new Dock Spaces
  2064. docking_splits: List[DockingSplit]
  2065. # std::vector<DockableWindow> dockableWindows; /* original C++ signature */
  2066. # `dockableWindows`: _vector[DockableWindow]_.
  2067. # List of the dockable windows, together with their Gui code
  2068. dockable_windows: List[DockableWindow]
  2069. # std::string layoutName = "Default"; /* original C++ signature */
  2070. # `layoutName`: _string, default="default"_.
  2071. # Displayed name of the layout.
  2072. # Only used in advanced cases, when several layouts are available.
  2073. layout_name: str = "Default"
  2074. # --------------- Options -----------------------------
  2075. # ImGuiDockNodeFlags mainDockSpaceNodeFlags = ImGuiDockNodeFlags_PassthruCentralNode; /* original C++ signature */
  2076. # `mainDockSpaceNodeFlags`: _ImGuiDockNodeFlags (enum),
  2077. # default=ImGuiDockNodeFlags_PassthruCentralNode_
  2078. # Flags to apply to the main dock space
  2079. # (enable/disable resizing, splitting, tab bar, etc.).
  2080. # Most flags are inherited by children dock spaces.
  2081. # You can also set flags for specific dock spaces via `DockingSplit.nodeFlags`
  2082. main_dock_space_node_flags: ImGuiDockNodeFlags = (
  2083. DockNodeFlags_.passthru_central_node
  2084. )
  2085. # --------------- Layout handling -----------------------------
  2086. # DockingLayoutCondition layoutCondition = DockingLayoutCondition::FirstUseEver; /* original C++ signature */
  2087. # `layoutCondition`: _enum DockingLayoutCondition, default=FirstUseEver_.
  2088. # When to apply the docking layout. Choose between
  2089. # FirstUseEver (apply once, then keep user preference),
  2090. # ApplicationStart (always reapply at application start)
  2091. # Never
  2092. layout_condition: DockingLayoutCondition = DockingLayoutCondition.first_use_ever
  2093. # bool layoutReset = false; /* original C++ signature */
  2094. # `layoutReset`: _bool, default=false_.
  2095. # Reset layout on next frame, i.e. drop the layout customizations which were
  2096. # applied manually by the user. layoutReset will be reset to False after this.
  2097. layout_reset: bool = False
  2098. # --------------- Helper Methods -----------------------------
  2099. # DockableWindow * dockableWindowOfName(const std::string& name); /* original C++ signature */
  2100. def dockable_window_of_name(self, name: str) -> DockableWindow:
  2101. """`DockableWindow * dockableWindowOfName(const std::string & name)`:
  2102. returns a pointer to a dockable window
  2103. """
  2104. pass
  2105. # bool focusDockableWindow(const std::string& windowName); /* original C++ signature */
  2106. def focus_dockable_window(self, window_name: str) -> bool:
  2107. """`bool focusDockableWindow(const std::string& name)`:
  2108. will focus a dockable window (and make its tab visible if needed)
  2109. """
  2110. pass
  2111. # std::optional<ImGuiID> dockSpaceIdFromName(const std::string& dockSpaceName); /* original C++ signature */
  2112. def dock_space_id_from_name(self, dock_space_name: str) -> Optional[ImGuiID]:
  2113. """`optional<ImGuiID> dockSpaceIdFromName(const std::string& dockSpaceName)`:
  2114. returns the ImGuiID corresponding to the dockspace with this name
  2115. """
  2116. pass
  2117. # DockingParams(std::vector<DockingSplit> dockingSplits = std::vector<DockingSplit>(), std::vector<DockableWindow> dockableWindows = std::vector<DockableWindow>(), std::string layoutName = "Default", ImGuiDockNodeFlags mainDockSpaceNodeFlags = ImGuiDockNodeFlags_PassthruCentralNode, DockingLayoutCondition layoutCondition = DockingLayoutCondition::FirstUseEver, bool layoutReset = false); /* original C++ signature */
  2118. def __init__(
  2119. self,
  2120. docking_splits: Optional[List[DockingSplit]] = None,
  2121. dockable_windows: Optional[List[DockableWindow]] = None,
  2122. layout_name: str = "Default",
  2123. main_dock_space_node_flags: Optional[ImGuiDockNodeFlags] = None,
  2124. layout_condition: DockingLayoutCondition = DockingLayoutCondition.first_use_ever,
  2125. layout_reset: bool = False,
  2126. ) -> None:
  2127. """Auto-generated default constructor with named params
  2128. Python bindings defaults:
  2129. If any of the params below is None, then its default value below will be used:
  2130. * dockingSplits: List[DockingSplit]()
  2131. * dockableWindows: List[DockableWindow]()
  2132. * mainDockSpaceNodeFlags: DockNodeFlags_.passthru_central_node
  2133. """
  2134. pass
  2135. # @@md
  2136. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2137. # hello_imgui/backend_pointers.h included by hello_imgui/runner_params.h //
  2138. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2139. class BackendPointers:
  2140. """@@md#BackendPointers
  2141. BackendPointers is a struct that contains optional pointers to the
  2142. backend implementations (for SDL and GLFW).
  2143. These pointers will be filled when the application starts, and you can use them
  2144. to customize your application behavior using the selected backend.
  2145. Note: If using the Metal, Vulkan or DirectX rendering backend, you can find
  2146. some interesting pointers inside
  2147. `src/hello_imgui/internal/backend_impls/rendering_metal.h`
  2148. `src/hello_imgui/internal/backend_impls/rendering_vulkan.h`
  2149. `src/hello_imgui/internal/backend_impls/rendering_dx11.h`
  2150. `src/hello_imgui/internal/backend_impls/rendering_dx12.h`
  2151. """
  2152. # * `glfwWindow`: Pointer to the main GLFW window (of type `GLFWwindow*`).
  2153. # Only filled if the backend is GLFW.
  2154. # void* glfwWindow = nullptr; /* original C++ signature */
  2155. glfw_window: Optional[Any] = None # GLFWwindow*
  2156. # * `sdlWindow`: Pointer to the main SDL window (of type `SDL_Window*`).
  2157. # Only filled if the backend is SDL (or emscripten + sdl)
  2158. # void* sdlWindow = nullptr; /* original C++ signature */
  2159. sdl_window: Optional[Any] = None # SDL_Window*
  2160. # * `sdlGlContext`: Pointer to SDL's GlContext (of type `SDL_GLContext`).
  2161. # Only filled if the backend is SDL (or emscripten + sdl)
  2162. # void* sdlGlContext = nullptr; /* original C++ signature */
  2163. sdl_gl_context: Optional[Any] = None # SDL_GLContext
  2164. # BackendPointers(); /* original C++ signature */
  2165. def __init__(self) -> None:
  2166. """Auto-generated default constructor"""
  2167. pass
  2168. # @@md
  2169. # @@md#RemoteParams
  2170. class RemoteParams:
  2171. """RemoteParams is a struct that contains the settings for displaying the application on a remote device.
  2172. using https://github.com/sammyfreg/netImgui
  2173. or using https://github.com/ggerganov/imgui-ws
  2174. Those features are experimental and not supported with the standard version of HelloImGui,
  2175. """
  2176. # bool enableRemoting = false; /* original C++ signature */
  2177. enable_remoting: bool = False
  2178. #
  2179. # Params used only by imgui-ws
  2180. #
  2181. # int wsPort = 5003; /* original C++ signature */
  2182. ws_port: int = 5003
  2183. # std::string wsHttpRootFolder = ""; /* original C++ signature */
  2184. ws_http_root_folder: str = (
  2185. "" # Optional folder were some additional files can be served
  2186. )
  2187. # bool wsProvideIndexHtml = true; /* original C++ signature */
  2188. ws_provide_index_html: bool = (
  2189. True # If True, will automatically serve a simple index.html file that contains the canvas and the imgui-ws client code
  2190. )
  2191. #
  2192. # Params used only by netImgui
  2193. #
  2194. # bool exitWhenServerDisconnected = false; /* original C++ signature */
  2195. exit_when_server_disconnected: bool = False
  2196. # double durationMaxDisconnected = 30.0; /* original C++ signature */
  2197. duration_max_disconnected: float = 30.0
  2198. # std::string serverHost = "localhost"; /* original C++ signature */
  2199. # The server host (if empty, will use "localhost")
  2200. # The server is the app that simply displays the application on a remote device
  2201. server_host: str = "localhost"
  2202. # uint32_t serverPort = 8888; /* original C++ signature */
  2203. # The server port (default is 8888)
  2204. server_port: int = 8888
  2205. # bool transmitWindowSize = false; /* original C++ signature */
  2206. # If True, transmit the window size to the server
  2207. transmit_window_size: bool = False
  2208. # RemoteParams(bool enableRemoting = false, int wsPort = 5003, std::string wsHttpRootFolder = "", bool wsProvideIndexHtml = true, bool exitWhenServerDisconnected = false, double durationMaxDisconnected = 30.0, std::string serverHost = "localhost", uint32_t serverPort = 8888, bool transmitWindowSize = false); /* original C++ signature */
  2209. def __init__(
  2210. self,
  2211. enable_remoting: bool = False,
  2212. ws_port: int = 5003,
  2213. ws_http_root_folder: str = "",
  2214. ws_provide_index_html: bool = True,
  2215. exit_when_server_disconnected: bool = False,
  2216. duration_max_disconnected: float = 30.0,
  2217. server_host: str = "localhost",
  2218. server_port: int = 8888,
  2219. transmit_window_size: bool = False,
  2220. ) -> None:
  2221. """Auto-generated default constructor with named params"""
  2222. pass
  2223. # @@md
  2224. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2225. # hello_imgui/renderer_backend_options.h included by hello_imgui/runner_params.h //
  2226. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2227. # --------------------------------------------------------------------------------------------------------------------
  2228. # @@md#OpenGlOptions
  2229. class OpenGlOptions:
  2230. """OpenGlOptions contains advanced options used at the startup of OpenGL.
  2231. These parameters are reserved for advanced users.
  2232. By default, Hello ImGui will select reasonable default values, and these parameters are not used.
  2233. Use at your own risk, as they make break the multi-platform compatibility of your application!
  2234. All these parameters are platform dependent.
  2235. For real multiplatform examples, see
  2236. hello_imgui/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_glfw.cpp
  2237. and
  2238. hello_imgui/src/hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_setup_sdl.cpp
  2239. How to set those values manually:
  2240. ---------------------------------
  2241. you may set them manually:
  2242. (1) Either by setting them programmatically in your application
  2243. (set their values in `runnerParams.rendererBackendOptions.openGlOptions`)
  2244. (2) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders.
  2245. (this is useful when you want to set them for a specific app or set of apps, without modifying the app code)
  2246. See hello_imgui/hello_imgui_example.ini for an example of such a file.
  2247. Note: if several methods are used, the order of priority is (1) > (2)
  2248. """
  2249. # std::optional<std::string> GlslVersion = std::nullopt; /* original C++ signature */
  2250. # Could be for example:
  2251. # "150" on macOS
  2252. # "130" on Windows
  2253. # "300es" on GLES
  2254. glsl_version: Optional[str] = None
  2255. # OpenGL 3.3 (these options won't work for GlEs)
  2256. # std::optional<int> MajorVersion = std::nullopt; /* original C++ signature */
  2257. major_version: Optional[int] = None
  2258. # std::optional<int> MinorVersion = std::nullopt; /* original C++ signature */
  2259. minor_version: Optional[int] = None
  2260. # std::optional<bool> UseCoreProfile = std::nullopt; /* original C++ signature */
  2261. # OpenGL Core Profile (i.e. only includes the newer, maintained features of OpenGL)
  2262. use_core_profile: Optional[bool] = None
  2263. # std::optional<bool> UseForwardCompat = std::nullopt; /* original C++ signature */
  2264. # OpenGL Forward Compatibility (required on macOS)
  2265. use_forward_compat: Optional[bool] = None
  2266. # std::optional<int> AntiAliasingSamples = std::nullopt; /* original C++ signature */
  2267. # `AntiAliasingSamples`
  2268. # If > 0, this value will be used to set the number of samples used for anti-aliasing.
  2269. # This is used only when running with Glfw + OpenGL (which is the default)
  2270. # Notes:
  2271. # - we query the maximum number of samples supported by the hardware, via glGetIntegerv(GL_MAX_SAMPLES)
  2272. # - if you set this value to a non-zero value, it will be used instead of the default value of 8
  2273. # (except if it is greater than the maximum supported value, in which case a warning will be issued)
  2274. # - if you set this value to 0, antialiasing will be disabled
  2275. #
  2276. # AntiAliasingSamples has a strong impact on the quality of the text rendering
  2277. # - 0: no antialiasing
  2278. # - 8: optimal
  2279. # - 16: optimal if using imgui-node-editor and you want to render very small text when unzooming
  2280. anti_aliasing_samples: Optional[int] = None
  2281. # OpenGlOptions(std::optional<std::string> GlslVersion = std::nullopt, std::optional<int> MajorVersion = std::nullopt, std::optional<int> MinorVersion = std::nullopt, std::optional<bool> UseCoreProfile = std::nullopt, std::optional<bool> UseForwardCompat = std::nullopt, std::optional<int> AntiAliasingSamples = std::nullopt); /* original C++ signature */
  2282. def __init__(
  2283. self,
  2284. glsl_version: Optional[str] = None,
  2285. major_version: Optional[int] = None,
  2286. minor_version: Optional[int] = None,
  2287. use_core_profile: Optional[bool] = None,
  2288. use_forward_compat: Optional[bool] = None,
  2289. anti_aliasing_samples: Optional[int] = None,
  2290. ) -> None:
  2291. """Auto-generated default constructor with named params"""
  2292. pass
  2293. # @@md
  2294. # @@md#RendererBackendOptions
  2295. # bool hasEdrSupport(); /* original C++ signature */
  2296. def has_edr_support() -> bool:
  2297. """`bool hasEdrSupport()`:
  2298. Check whether extended dynamic range (EDR), i.e. the ability to reproduce
  2299. intensities exceeding the standard dynamic range from 0.0-1.0, is supported.
  2300. To leverage EDR support, you need to set `floatBuffer=True` in `RendererBackendOptions`.
  2301. Only the macOS Metal backend currently supports this.
  2302. This currently returns False on all backends except Metal, where it checks whether
  2303. this is supported on the current displays.
  2304. """
  2305. pass
  2306. class RendererBackendOptions:
  2307. """RendererBackendOptions is a struct that contains options for the renderer backend
  2308. (Metal, Vulkan, DirectX, OpenGL)
  2309. """
  2310. # bool requestFloatBuffer = false; /* original C++ signature */
  2311. # `requestFloatBuffer`:
  2312. # Set to True to request a floating-point framebuffer.
  2313. # Only available on Metal, if your display supports it.
  2314. # Before setting this to True, first check `hasEdrSupport()`
  2315. request_float_buffer: bool = False
  2316. # OpenGlOptions openGlOptions; /* original C++ signature */
  2317. # `openGlOptions`:
  2318. # Advanced options for OpenGL. Use at your own risk.
  2319. open_gl_options: OpenGlOptions
  2320. # RendererBackendOptions(bool requestFloatBuffer = false, OpenGlOptions openGlOptions = OpenGlOptions()); /* original C++ signature */
  2321. def __init__(
  2322. self,
  2323. request_float_buffer: bool = False,
  2324. open_gl_options: Optional[OpenGlOptions] = None,
  2325. ) -> None:
  2326. """Auto-generated default constructor with named params
  2327. Python bindings defaults:
  2328. If openGlOptions is None, then its default value will be: OpenGlOptions()
  2329. """
  2330. pass
  2331. # Note:
  2332. # If using Metal, Vulkan or DirectX, you can find interesting pointers inside:
  2333. # src/hello_imgui/internal/backend_impls/rendering_metal.h
  2334. # src/hello_imgui/internal/backend_impls/rendering_vulkan.h
  2335. # src/hello_imgui/internal/backend_impls/rendering_dx11.h
  2336. # src/hello_imgui/internal/backend_impls/rendering_dx12.h
  2337. # @@md
  2338. class OpenGlOptionsFilled_:
  2339. """(Private structure, not part of the public API)
  2340. OpenGlOptions after selecting the default platform-dependent values + after applying the user settings
  2341. """
  2342. # std::string GlslVersion = "150"; /* original C++ signature */
  2343. glsl_version: str = "150"
  2344. # int MajorVersion = 3; /* original C++ signature */
  2345. major_version: int = 3
  2346. # int MinorVersion = 3; /* original C++ signature */
  2347. minor_version: int = 3
  2348. # bool UseCoreProfile = true; /* original C++ signature */
  2349. use_core_profile: bool = True
  2350. # bool UseForwardCompat = true; /* original C++ signature */
  2351. use_forward_compat: bool = True
  2352. # int AntiAliasingSamples = 8; /* original C++ signature */
  2353. anti_aliasing_samples: int = 8
  2354. # OpenGlOptionsFilled_(std::string GlslVersion = "150", int MajorVersion = 3, int MinorVersion = 3, bool UseCoreProfile = true, bool UseForwardCompat = true, int AntiAliasingSamples = 8); /* original C++ signature */
  2355. def __init__(
  2356. self,
  2357. glsl_version: str = "150",
  2358. major_version: int = 3,
  2359. minor_version: int = 3,
  2360. use_core_profile: bool = True,
  2361. use_forward_compat: bool = True,
  2362. anti_aliasing_samples: int = 8,
  2363. ) -> None:
  2364. """Auto-generated default constructor with named params"""
  2365. pass
  2366. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2367. # hello_imgui/runner_params.h continued //
  2368. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2369. # --------------------------------------------------------------------------------------------------------------------
  2370. # @@md#PlatformBackendType
  2371. # You can select the platform backend type (SDL, GLFW) and the rendering backend type
  2372. # via RunnerParams.platformBackendType and RunnerParams.renderingBackendType.
  2373. class PlatformBackendType(enum.IntEnum):
  2374. """Platform backend type (SDL, GLFW)
  2375. They are listed in the order of preference when FirstAvailable is selected.
  2376. """
  2377. # FirstAvailable, /* original C++ signature */
  2378. first_available = enum.auto() # (= 0)
  2379. # Glfw, /* original C++ signature */
  2380. glfw = enum.auto() # (= 1)
  2381. # Sdl, /* original C++ signature */
  2382. sdl = enum.auto() # (= 2)
  2383. # Null /* original C++ signature */
  2384. # }
  2385. null = enum.auto() # (= 3)
  2386. class RendererBackendType(enum.IntEnum):
  2387. """Rendering backend type (OpenGL3, Metal, Vulkan, DirectX11, DirectX12)
  2388. They are listed in the order of preference when FirstAvailable is selected.
  2389. """
  2390. # FirstAvailable, /* original C++ signature */
  2391. first_available = enum.auto() # (= 0)
  2392. # OpenGL3, /* original C++ signature */
  2393. open_gl3 = enum.auto() # (= 1)
  2394. # Metal, /* original C++ signature */
  2395. metal = enum.auto() # (= 2)
  2396. # Vulkan, /* original C++ signature */
  2397. vulkan = enum.auto() # (= 3)
  2398. # DirectX11, /* original C++ signature */
  2399. direct_x11 = enum.auto() # (= 4)
  2400. # DirectX12, /* original C++ signature */
  2401. direct_x12 = enum.auto() # (= 5)
  2402. # Null /* original C++ signature */
  2403. # }
  2404. null = enum.auto() # (= 6)
  2405. # @@md
  2406. # std::string PlatformBackendTypeToString(PlatformBackendType platformBackendType); /* original C++ signature */
  2407. def platform_backend_type_to_string(platform_backend_type: PlatformBackendType) -> str:
  2408. pass
  2409. # std::string RendererBackendTypeToString(RendererBackendType rendererBackendType); /* original C++ signature */
  2410. def renderer_backend_type_to_string(renderer_backend_type: RendererBackendType) -> str:
  2411. pass
  2412. # --------------------------------------------------------------------------------------------------------------------
  2413. # @@md#IniFolderType
  2414. class IniFolderType(enum.IntEnum):
  2415. """IniFolderType is an enum which describes where is the base path to store
  2416. the ini file for the application settings.
  2417. You can use IniFolderLocation(iniFolderType) to get the corresponding path.
  2418. RunnerParams contains the following members, which are used to compute
  2419. the ini file location:
  2420. iniFolderType (IniFolderType::CurrentFolder by default)
  2421. iniFilename (empty string by default)
  2422. iniFilename_useAppWindowTitle
  2423. (True by default: iniFilename is derived from
  2424. appWindowParams.windowTitle)
  2425. iniFilename may contain a subfolder
  2426. (which will be created inside the iniFolderType folder if needed)
  2427. """
  2428. # CurrentFolder, /* original C++ signature */
  2429. # CurrentFolder: the folder where the application is executed
  2430. # (convenient for development, but not recommended for production)
  2431. current_folder = enum.auto() # (= 0)
  2432. # AbsolutePath, /* original C++ signature */
  2433. # AbsolutePath: an absolute path
  2434. # (convenient, but not recommended if targeting multiple platforms)
  2435. absolute_path = enum.auto() # (= 1)
  2436. # AppUserConfigFolder, /* original C++ signature */
  2437. # AppUserConfigFolder:
  2438. # AppData under Windows (Example: C:\Users\[Username]\AppData\Roaming under windows)
  2439. # ~/.config under Linux
  2440. # "~/Library/Application Support" under macOS
  2441. # (recommended for production, if settings do not need to be easily accessible by the user)
  2442. app_user_config_folder = enum.auto() # (= 2)
  2443. # AppExecutableFolder, /* original C++ signature */
  2444. # AppExecutableFolder: the folder where the application executable is located
  2445. # (this may be different from CurrentFolder if the application is launched from a shortcut)
  2446. # (convenient for development, but not recommended for production)
  2447. app_executable_folder = enum.auto() # (= 3)
  2448. # HomeFolder, /* original C++ signature */
  2449. # HomeFolder: the user home folder
  2450. # (recommended for production, if settings need to be easily accessible by the user)
  2451. home_folder = enum.auto() # (= 4)
  2452. # DocumentsFolder, /* original C++ signature */
  2453. # DocumentsFolder: the user documents folder
  2454. documents_folder = enum.auto() # (= 5)
  2455. # TempFolder /* original C++ signature */
  2456. # }
  2457. # TempFolder: the system temp folder
  2458. temp_folder = enum.auto() # (= 6)
  2459. # std::string IniFolderLocation(IniFolderType iniFolderType); /* original C++ signature */
  2460. def ini_folder_location(ini_folder_type: IniFolderType) -> str:
  2461. """Returns the path corresponding to the given IniFolderType"""
  2462. pass
  2463. # @@md
  2464. # --------------------------------------------------------------------------------------------------------------------
  2465. # @@md#FpsIdling
  2466. class FpsIdlingMode(enum.IntEnum):
  2467. """FpsIdlingMode is an enum that describes the different modes of idling
  2468. when rendering the GUI.
  2469. - Sleep:
  2470. The application sleeps when idling in order to reduce CPU usage.
  2471. - EarlyReturn:
  2472. Rendering returns immediately when idling.
  2473. This is designed for event-driven or real-time applications,
  2474. including Jupyter/async usage and web applications.
  2475. Avoid using EarlyReturn inside a tight CPU loop without pauses,
  2476. as it may cause excessive CPU consumption.
  2477. - Auto:
  2478. Use platform-specific default behavior.
  2479. On most native platforms, it will sleep.
  2480. On Emscripten, Render() will always return immediately
  2481. to avoid blocking the main browser thread.
  2482. Note: you can override the default behavior by explicitly choosing Sleep or EarlyReturn.
  2483. """
  2484. # Sleep, /* original C++ signature */
  2485. sleep = enum.auto() # (= 0)
  2486. # EarlyReturn, /* original C++ signature */
  2487. early_return = enum.auto() # (= 1)
  2488. # Auto, /* original C++ signature */
  2489. # }
  2490. auto = enum.auto() # (= 2)
  2491. class FpsIdling:
  2492. """FpsIdling is a struct that contains parameters controlling the application's
  2493. frame pacing, idling behavior, and performance.
  2494. It provides tools to:
  2495. - lower CPU/GPU usage during inactivity,
  2496. - control maximum refresh speed,
  2497. - enable/disable synchronization to the monitor refresh rate,
  2498. - adapt frame pacing for special environments (notebooks, web, etc.).
  2499. """
  2500. # float fpsIdle = 9.f; /* original C++ signature */
  2501. # `fpsIdle`: _float, default = 9_.
  2502. #
  2503. # When the application is idling (no user interaction detected), its FPS
  2504. # will be reduced to this value in order to save CPU and GPU resources.
  2505. #
  2506. # For animated or real-time widgets (e.g., live video), you may need a
  2507. # higher idle refresh rate, or even disable idling entirely.
  2508. #
  2509. # Set fpsIdle = 0. for maximum refresh speed during idling.
  2510. fps_idle: float = 9.0
  2511. # float timeActiveAfterLastEvent = 3.f; /* original C++ signature */
  2512. # `timeActiveAfterLastEvent`: _float, default = 3._.
  2513. #
  2514. # The duration (in seconds) after the last user event before the
  2515. # application switches to idling mode.
  2516. time_active_after_last_event: float = 3.0
  2517. # bool enableIdling = true; /* original C++ signature */
  2518. # `enableIdling`: _bool, default = true_.
  2519. #
  2520. # Enables or disables idling. When disabled, the application renders at
  2521. # full speed regardless of user activity.
  2522. #
  2523. # This can be changed dynamically during execution.
  2524. enable_idling: bool = True
  2525. # bool isIdling = false; /* original C++ signature */
  2526. # `isIdling`: _bool (updated dynamically)_.
  2527. #
  2528. # This boolean is updated internally at runtime, and becomes True when
  2529. # the application is considered idle.
  2530. is_idling: bool = False
  2531. # bool rememberEnableIdling = false; /* original C++ signature */
  2532. # `rememberEnableIdling`: _bool, default = False.
  2533. #
  2534. # If True, the value of enableIdling will be restored from previous
  2535. # saved settings on startup.
  2536. remember_enable_idling: bool = False
  2537. # FpsIdlingMode fpsIdlingMode = FpsIdlingMode::Auto; /* original C++ signature */
  2538. # `fpsIdlingMode`: _FpsIdlingMode, default = FpsIdlingMode::Auto_.
  2539. #
  2540. # Controls how idling is implemented internally:
  2541. # - Sleep: sleep while idling (minimizes CPU usage)
  2542. # - EarlyReturn: return immediately when idling (best for notebooks and async use)
  2543. # - Auto: platform-specific behavior
  2544. fps_idling_mode: FpsIdlingMode = FpsIdlingMode.auto
  2545. # bool vsyncToMonitor = true; /* original C++ signature */
  2546. # `vsyncToMonitor`: _bool, default = true_.
  2547. #
  2548. # If True, rendering is synchronized with the monitor refresh rate (commonly
  2549. # known as *VSync*). This limits the frame rate to the display frequency
  2550. # (e.g., 60 Hz, 120 Hz) and prevents unnecessary CPU/GPU load.
  2551. # *Only implemented with OpenGL*
  2552. #
  2553. # If False, rendering runs as fast as possible, or is limited by `fpsMax`.
  2554. # This is useful for benchmarking, offscreen rendering, or Jupyter/async workflows.
  2555. #
  2556. # Internally, this maps to the backend swap interval (e.g. glfwSwapInterval).
  2557. vsync_to_monitor: bool = True
  2558. # float fpsMax = 0.f; /* original C++ signature */
  2559. # `fpsMax`: _float, default = 0._ (unlimited).
  2560. #
  2561. # Sets an explicit upper limit on the frame rate when not idling.
  2562. #
  2563. # This is particularly useful when:
  2564. # - vsyncToMonitor is False,
  2565. # - you want to avoid >1000 FPS rendering loops,
  2566. # - preventing excessive CPU/GPU usage on high-performance machines,
  2567. # - ensuring fairness in cooperative async environments.
  2568. #
  2569. # If fpsMax > 0, the application ensures that each frame takes at least
  2570. # (1 / fpsMax) seconds to render.
  2571. #
  2572. # When both vsyncToMonitor and fpsMax are enabled:
  2573. # - The lower (stricter) limit dominates.
  2574. fps_max: float = 0.0
  2575. # FpsIdling(float fpsIdle = 9.f, float timeActiveAfterLastEvent = 3.f, bool enableIdling = true, bool isIdling = false, bool rememberEnableIdling = false, FpsIdlingMode fpsIdlingMode = FpsIdlingMode::Auto, bool vsyncToMonitor = true, float fpsMax = 0.f); /* original C++ signature */
  2576. def __init__(
  2577. self,
  2578. fps_idle: float = 9.0,
  2579. time_active_after_last_event: float = 3.0,
  2580. enable_idling: bool = True,
  2581. is_idling: bool = False,
  2582. remember_enable_idling: bool = False,
  2583. fps_idling_mode: FpsIdlingMode = FpsIdlingMode.auto,
  2584. vsync_to_monitor: bool = True,
  2585. fps_max: float = 0.0,
  2586. ) -> None:
  2587. """Auto-generated default constructor with named params"""
  2588. pass
  2589. # @@md
  2590. # --------------------------------------------------------------------------------------------------------------------
  2591. # @@md#RunnerParams
  2592. class RunnerParams:
  2593. """RunnerParams contains the settings and callbacks needed to run an application."""
  2594. # --------------- Callbacks and Window params -------------------
  2595. # RunnerCallbacks callbacks; /* original C++ signature */
  2596. # `callbacks`: _see runner_callbacks.h_
  2597. # callbacks.ShowGui() will render the gui, ShowMenus() will show the menus, etc.
  2598. callbacks: RunnerCallbacks
  2599. # AppWindowParams appWindowParams; /* original C++ signature */
  2600. # `appWindowParams`: _see app_window_params.h_
  2601. # application Window Params (position, size, title)
  2602. app_window_params: AppWindowParams
  2603. # ImGuiWindowParams imGuiWindowParams; /* original C++ signature */
  2604. # `imGuiWindowParams`: _see imgui_window_params.h_
  2605. # imgui window params (use docking, showMenuBar, ProvideFullScreenWindow, etc.)
  2606. imgui_window_params: ImGuiWindowParams
  2607. # --------------- Docking -------------------
  2608. # DockingParams dockingParams; /* original C++ signature */
  2609. # `dockingParams`: _see docking_params.h_
  2610. # dockable windows content and layout
  2611. docking_params: DockingParams
  2612. # std::vector<DockingParams> alternativeDockingLayouts; /* original C++ signature */
  2613. # `alternativeDockingLayouts`: _vector<DockingParams>, default=empty_
  2614. # List of possible additional layout for the applications. Only used in advanced
  2615. # cases when several layouts are available.
  2616. alternative_docking_layouts: List[DockingParams]
  2617. # bool rememberSelectedAlternativeLayout = true; /* original C++ signature */
  2618. # `rememberSelectedAlternativeLayout`: _bool, default=true_
  2619. # Shall the application remember the last selected layout. Only used in advanced
  2620. # cases when several layouts are available.
  2621. remember_selected_alternative_layout: bool = True
  2622. # --------------- Backends -------------------
  2623. # BackendPointers backendPointers; /* original C++ signature */
  2624. # `backendPointers`: _see backend_pointers.h_
  2625. # A struct that contains optional pointers to the backend implementations.
  2626. # These pointers will be filled when the application starts
  2627. backend_pointers: BackendPointers
  2628. # RendererBackendOptions rendererBackendOptions; /* original C++ signature */
  2629. # `rendererBackendOptions`: _see renderer_backend_options.h_
  2630. # Options for the renderer backend
  2631. renderer_backend_options: RendererBackendOptions
  2632. # PlatformBackendType platformBackendType = PlatformBackendType::FirstAvailable; /* original C++ signature */
  2633. # `platformBackendType`: _enum PlatformBackendType, default=PlatformBackendType::FirstAvailable_
  2634. # Select the wanted platform backend type between `Sdl`, `Glfw`.
  2635. # if `FirstAvailable`, Glfw will be preferred over Sdl when both are available.
  2636. # Only useful when multiple backend are compiled and available.
  2637. platform_backend_type: PlatformBackendType = PlatformBackendType.first_available
  2638. # RendererBackendType rendererBackendType = RendererBackendType::FirstAvailable; /* original C++ signature */
  2639. # `renderingBackendType`: _enum RenderingBackendType, default=RenderingBackendType::FirstAvailable_
  2640. # Select the wanted rendering backend type between `OpenGL3`, `Metal`, `Vulkan`, `DirectX11`, `DirectX12`.
  2641. # if `FirstAvailable`, it will be selected in the order of preference mentioned above.
  2642. # Only useful when multiple rendering backend are compiled and available.
  2643. renderer_backend_type: RendererBackendType = RendererBackendType.first_available
  2644. # --------------- Settings -------------------
  2645. # IniFolderType iniFolderType = IniFolderType::CurrentFolder; /* original C++ signature */
  2646. # `iniFolderType`: _IniFolderType, default = IniFolderType::CurrentFolder_
  2647. # Sets the folder where imgui will save its params.
  2648. # (possible values are:
  2649. # CurrentFolder, AppUserConfigFolder, DocumentsFolder,
  2650. # HomeFolder, TempFolder, AppExecutableFolder)
  2651. # AppUserConfigFolder is
  2652. # [Home]/AppData/Roaming under Windows,
  2653. # ~/.config under Linux,
  2654. # ~/Library/Application Support under macOS
  2655. ini_folder_type: IniFolderType = IniFolderType.current_folder
  2656. # `iniFilename`: _string, default = ""_
  2657. # Sets the ini filename under which imgui will save its params.
  2658. # Its path is relative to the path given by iniFolderType, and can include
  2659. # a subfolder (which will be created if needed).
  2660. # If iniFilename empty, then it will be derived from
  2661. # appWindowParams.windowTitle
  2662. # (if both are empty, the ini filename will be imgui.ini).
  2663. # std::string iniFilename = ""; /* original C++ signature */
  2664. ini_filename: str = "" # relative to iniFolderType
  2665. # bool iniFilename_useAppWindowTitle = true; /* original C++ signature */
  2666. # `iniFilename_useAppWindowTitle`: _bool, default = true_.
  2667. # Shall the iniFilename be derived from appWindowParams.windowTitle (if not empty)
  2668. ini_filename_use_app_window_title: bool = True
  2669. # bool iniDisable = false; /* original C++ signature */
  2670. # `iniDisable`: _bool, default = false_.
  2671. # If True, do not save or load any settings to or from an ini file.
  2672. ini_disable: bool = False
  2673. # bool iniClearPreviousSettings = false; /* original C++ signature */
  2674. # `iniClearPreviousSettings`: _bool, default = false_.
  2675. # If True, delete any previous settings ini file at application startup.
  2676. ini_clear_previous_settings: bool = False
  2677. # --------------- Exit -------------------
  2678. # bool appShallExit = false; /* original C++ signature */
  2679. # * `appShallExit`: _bool, default=false_.
  2680. # During execution, set this to True to exit the app.
  2681. # _Note: 'appShallExit' has no effect on Mobile Devices (iOS, Android)
  2682. # and under emscripten, since these apps shall not exit._
  2683. app_shall_exit: bool = False
  2684. # --------------- Idling -------------------
  2685. # FpsIdling fpsIdling; /* original C++ signature */
  2686. # `fpsIdling`: _FpsIdling_. Idling parameters
  2687. # (set fpsIdling.enableIdling to False to disable Idling)
  2688. fps_idling: FpsIdling
  2689. # DpiAwareParams dpiAwareParams; /* original C++ signature */
  2690. # --------------- DPI Handling -----------
  2691. # Hello ImGui will try its best to automatically handle DPI scaling for you.
  2692. # If it fails, look at DpiAwareParams (and the corresponding Ini file settings)
  2693. dpi_aware_params: DpiAwareParams
  2694. # --------------- Misc -------------------
  2695. # bool useImGuiTestEngine = false; /* original C++ signature */
  2696. # `useImGuiTestEngine`: _bool, default=false_.
  2697. # Set this to True if you intend to use Dear ImGui Test & Automation Engine
  2698. # ( https://github.com/ocornut/imgui_test_engine )
  2699. # HelloImGui must be compiled with the option -DHELLOIMGUI_WITH_TEST_ENGINE=ON
  2700. # See demo in src/hello_imgui_demos/hello_imgui_demo_test_engine.
  2701. # License:
  2702. # imgui_test_engine is subject to a specific license:
  2703. # https://github.com/ocornut/imgui_test_engine/blob/main/imgui_test_engine/LICENSE.txt)
  2704. # (TL;DR: free for individuals, educational, open-source and small businesses uses.
  2705. # Paid for larger businesses.)
  2706. use_imgui_test_engine: bool = False
  2707. # int emscripten_fps = 0; /* original C++ signature */
  2708. # `emscripten_fps`: _int, default = 0_.
  2709. # Set the application refresh rate
  2710. # (only used on emscripten: 0 stands for "let the app or the browser decide")
  2711. emscripten_fps: int = 0
  2712. # RunnerParams(RunnerCallbacks callbacks = RunnerCallbacks(), AppWindowParams appWindowParams = AppWindowParams(), ImGuiWindowParams imGuiWindowParams = ImGuiWindowParams(), DockingParams dockingParams = DockingParams(), std::vector<DockingParams> alternativeDockingLayouts = std::vector<DockingParams>(), bool rememberSelectedAlternativeLayout = true, BackendPointers backendPointers = BackendPointers(), RendererBackendOptions rendererBackendOptions = RendererBackendOptions(), PlatformBackendType platformBackendType = PlatformBackendType::FirstAvailable, RendererBackendType rendererBackendType = RendererBackendType::FirstAvailable, IniFolderType iniFolderType = IniFolderType::CurrentFolder, std::string iniFilename = "", bool iniFilename_useAppWindowTitle = true, bool iniDisable = false, bool iniClearPreviousSettings = false, bool appShallExit = false, FpsIdling fpsIdling = FpsIdling(), DpiAwareParams dpiAwareParams = DpiAwareParams(), bool useImGuiTestEngine = false, int emscripten_fps = 0); /* original C++ signature */
  2713. def __init__(
  2714. self,
  2715. callbacks: Optional[RunnerCallbacks] = None,
  2716. app_window_params: Optional[AppWindowParams] = None,
  2717. imgui_window_params: Optional[ImGuiWindowParams] = None,
  2718. docking_params: Optional[DockingParams] = None,
  2719. alternative_docking_layouts: Optional[List[DockingParams]] = None,
  2720. remember_selected_alternative_layout: bool = True,
  2721. backend_pointers: Optional[BackendPointers] = None,
  2722. renderer_backend_options: Optional[RendererBackendOptions] = None,
  2723. platform_backend_type: PlatformBackendType = PlatformBackendType.first_available,
  2724. renderer_backend_type: RendererBackendType = RendererBackendType.first_available,
  2725. ini_folder_type: IniFolderType = IniFolderType.current_folder,
  2726. ini_filename: str = "",
  2727. ini_filename_use_app_window_title: bool = True,
  2728. ini_disable: bool = False,
  2729. ini_clear_previous_settings: bool = False,
  2730. app_shall_exit: bool = False,
  2731. fps_idling: Optional[FpsIdling] = None,
  2732. dpi_aware_params: Optional[DpiAwareParams] = None,
  2733. use_imgui_test_engine: bool = False,
  2734. emscripten_fps: int = 0,
  2735. ) -> None:
  2736. """Auto-generated default constructor with named params
  2737. Python bindings defaults:
  2738. If any of the params below is None, then its default value below will be used:
  2739. * callbacks: RunnerCallbacks()
  2740. * appWindowParams: AppWindowParams()
  2741. * imGuiWindowParams: ImGuiWindowParams()
  2742. * dockingParams: DockingParams()
  2743. * alternativeDockingLayouts: List[DockingParams]()
  2744. * backendPointers: BackendPointers()
  2745. * rendererBackendOptions: RendererBackendOptions()
  2746. * fpsIdling: FpsIdling()
  2747. * dpiAwareParams: DpiAwareParams()
  2748. """
  2749. pass
  2750. # @@md
  2751. # @@md#IniIniSettingsLocation
  2752. # std::optional<std::string> IniSettingsLocation(const RunnerParams& runnerParams); /* original C++ signature */
  2753. def ini_settings_location(runner_params: RunnerParams) -> Optional[str]:
  2754. """IniSettingsLocation returns the path to the ini file for the application settings."""
  2755. pass
  2756. # bool HasIniSettings(const RunnerParams& runnerParams); /* original C++ signature */
  2757. def has_ini_settings(runner_params: RunnerParams) -> bool:
  2758. """HasIniSettings returns True if the ini file for the application settings exists."""
  2759. pass
  2760. # void DeleteIniSettings(const RunnerParams& runnerParams); /* original C++ signature */
  2761. def delete_ini_settings(runner_params: RunnerParams) -> None:
  2762. """DeleteIniSettings deletes the ini file for the application settings."""
  2763. pass
  2764. # @@md
  2765. # --------------------------------------------------------------------------------------------------------------------
  2766. # @@md#SimpleRunnerParams
  2767. class SimpleRunnerParams:
  2768. """SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.
  2769. For example, this is sufficient to run an application:
  2770. ```cpp
  2771. None MyGui() {
  2772. ImGui::Text("Hello, world");
  2773. if (ImGui::Button("Exit"))
  2774. HelloImGui::GetRunnerParams()->appShallExit = True;
  2775. }
  2776. int main(){
  2777. auto params = HelloImGui::SimpleRunnerParams {
  2778. .guiFunction = MyGui, .windowSizeAuto = True, .windowTitle = "Example"
  2779. };
  2780. HelloImGui::Run(params);
  2781. }
  2782. ```
  2783. """
  2784. # VoidFunction guiFunction = EmptyVoidFunction(); /* original C++ signature */
  2785. # `guiFunction`: _VoidFunction_.
  2786. # Function that renders the Gui.
  2787. gui_function: VoidFunction = empty_void_function()
  2788. # std::string windowTitle = ""; /* original C++ signature */
  2789. # `windowTitle`: _string, default=""_.
  2790. # Title of the application window
  2791. window_title: str = ""
  2792. # bool windowSizeAuto = false; /* original C++ signature */
  2793. # `windowSizeAuto`: _bool, default=false_.
  2794. # If True, the size of the window will be computed from its widgets.
  2795. window_size_auto: bool = False
  2796. # bool windowRestorePreviousGeometry = false; /* original C++ signature */
  2797. # `windowRestorePreviousGeometry`: _bool, default=true_.
  2798. # If True, restore the size and position of the window between runs.
  2799. window_restore_previous_geometry: bool = False
  2800. # ScreenSize windowSize = DefaultWindowSize; /* original C++ signature */
  2801. # `windowSize`: _ScreenSize, default={800, 600}_.
  2802. # Size of the window
  2803. # The size will be handled as if it was specified for a 96PPI screen
  2804. # (i.e. a given size will correspond to the same physical size on different screens, whatever their DPI)
  2805. window_size: ScreenSize = DefaultWindowSize
  2806. # float fpsIdle = 9.f; /* original C++ signature */
  2807. # `fpsIdle`: _float, default=9_.
  2808. # FPS of the application when idle (set to 0 for full speed).
  2809. fps_idle: float = 9.0
  2810. # bool enableIdling = true; /* original C++ signature */
  2811. # `enableIdling`: _bool, default=true_.
  2812. # Disable idling at startup by setting this to False
  2813. # When running, use:
  2814. # HelloImGui::GetRunnerParams()->fpsIdling.enableIdling = False;
  2815. enable_idling: bool = True
  2816. # bool topMost = false; /* original C++ signature */
  2817. # `topMost`: _bool, default=false_.
  2818. # If True, the window will stay on top of other windows (desktop platforms only).
  2819. # Useful especially when running from notebooks to keep the app visible above the browser.
  2820. top_most: bool = False
  2821. # bool iniDisable = false; /* original C++ signature */
  2822. # `iniDisable`: _bool, default=false_.
  2823. # If True, do not save or load any settings to or from an ini file.
  2824. ini_disable: bool = False
  2825. # RunnerParams ToRunnerParams() const; /* original C++ signature */
  2826. def to_runner_params(self) -> RunnerParams:
  2827. pass
  2828. # SimpleRunnerParams(VoidFunction guiFunction = EmptyVoidFunction(), std::string windowTitle = "", bool windowSizeAuto = false, bool windowRestorePreviousGeometry = false, ScreenSize windowSize = DefaultWindowSize, float fpsIdle = 9.f, bool enableIdling = true, bool topMost = false, bool iniDisable = false); /* original C++ signature */
  2829. def __init__(
  2830. self,
  2831. gui_function: Optional[VoidFunction] = None,
  2832. window_title: str = "",
  2833. window_size_auto: bool = False,
  2834. window_restore_previous_geometry: bool = False,
  2835. window_size: Optional[ScreenSize] = None,
  2836. fps_idle: float = 9.0,
  2837. enable_idling: bool = True,
  2838. top_most: bool = False,
  2839. ini_disable: bool = False,
  2840. ) -> None:
  2841. """Auto-generated default constructor with named params
  2842. Python bindings defaults:
  2843. If any of the params below is None, then its default value below will be used:
  2844. * guiFunction: EmptyVoidFunction()
  2845. * windowSize: DefaultWindowSize
  2846. """
  2847. pass
  2848. # @@md
  2849. # void BeginGroupColumn(); /* original C++ signature */
  2850. def begin_group_column() -> None:
  2851. """calls ImGui::BeginGroup()"""
  2852. pass
  2853. # void EndGroupColumn(); /* original C++ signature */
  2854. def end_group_column() -> None:
  2855. """calls ImGui::EndGroup() + ImGui::SameLine()"""
  2856. pass
  2857. # @@md#WidgetWithResizeHandle
  2858. # ImVec2 WidgetWithResizeHandle( /* original C++ signature */
  2859. # const char* id,
  2860. # VoidFunction widgetGuiFunction,
  2861. # float handleSizeEm = 1.0f,
  2862. # std::optional<VoidFunction> onItemResized = std::nullopt,
  2863. # std::optional<VoidFunction> onItemHovered = std::nullopt
  2864. # );
  2865. def widget_with_resize_handle(
  2866. id: str,
  2867. widget_gui_function: VoidFunction,
  2868. handle_size_em: float = 1.0,
  2869. on_item_resized: Optional[VoidFunction] = None,
  2870. on_item_hovered: Optional[VoidFunction] = None,
  2871. ) -> ImVec2:
  2872. """WidgetWithResizeHandle: adds a resize handle to a widget
  2873. Example usage with ImPlot:
  2874. None gui()
  2875. {
  2876. static ImVec2 widget_size(200, 200);
  2877. auto myWidgetFunction = []()
  2878. {
  2879. if (ImPlot::BeginPlot("My Plot", widget_size)) {
  2880. ImPlot::PlotLine("My Line", x.data(), y.data(), 1000);
  2881. ImPlot::EndPlot();
  2882. }
  2883. };
  2884. widget_size = widget_with_resize_handle("plot", myWidgetFunction);
  2885. }
  2886. """
  2887. pass
  2888. # @@md
  2889. # --------------------------------------------------------------------------------------------
  2890. # @@md#InputTextResizable
  2891. class InputTextData:
  2892. """`InputTextResizable`: displays a resizable text input widget
  2893. The `InputTextResizable` widget allows you to create a text input field that can be resized by the user.
  2894. It supports both single-line and multi-line text input.
  2895. Note: the size of the widget is expressed in em units.
  2896. **Usage example:**
  2897. C++:
  2898. ```cpp
  2899. // Somewhere in the application state
  2900. (static) InputTextData textInput("My text", True, ImVec2(10, 3));
  2901. // In the GUI function
  2902. bool changed = InputTextResizable("Label", &textInput);
  2903. ```
  2904. Python:
  2905. ```python
  2906. # Somewhere in the application state
  2907. text_input = hello_imgui.InputTextData("My text", multiline=True, size_em=ImVec2(10, 3))
  2908. # In the GUI function
  2909. changed = hello_imgui.input_text_resizable("Label", text_input)
  2910. ```
  2911. """
  2912. # std::string Text; /* original C++ signature */
  2913. # The text edited in the input field
  2914. text: str
  2915. # std::string Hint; /* original C++ signature */
  2916. # An optional hint displayed when the input field is empty
  2917. # (only works for single-line text input)
  2918. hint: str
  2919. # bool Multiline = false; /* original C++ signature */
  2920. # If True, the input field is multi-line
  2921. multiline: bool = False
  2922. # bool Resizable = true; /* original C++ signature */
  2923. # If True, the input field is resizable
  2924. resizable: bool = True
  2925. # ImVec2 SizeEm = ImVec2(0, 0); /* original C++ signature */
  2926. # The size of the input field in em units
  2927. size_em: ImVec2 = ImVec2(0, 0)
  2928. # InputTextData(const std::string& text = "", bool multiline = false, ImVec2 size_em = ImVec2(0, 0)) : Text(text), Multiline(multiline), SizeEm(size_em) {} /* original C++ signature */
  2929. def __init__(
  2930. self,
  2931. text: str = "",
  2932. multiline: bool = False,
  2933. size_em: Optional[ImVec2Like] = None,
  2934. ) -> None:
  2935. """Python bindings defaults:
  2936. If size_em is None, then its default value will be: ImVec2(0, 0)
  2937. """
  2938. pass
  2939. # bool InputTextResizable(const char* label, InputTextData* textInput); /* original C++ signature */
  2940. def input_text_resizable(label: str, text_input: InputTextData) -> bool:
  2941. pass
  2942. # DictTypeInputTextData InputTextDataToDict(const InputTextData& data); /* original C++ signature */
  2943. def input_text_data_to_dict(data: InputTextData) -> DictTypeInputTextData:
  2944. pass
  2945. # InputTextData InputTextDataFromDict(const DictTypeInputTextData& dict); /* original C++ signature */
  2946. def input_text_data_from_dict(dict: DictTypeInputTextData) -> InputTextData:
  2947. pass
  2948. # to/from string
  2949. # std::string InputTextDataToString(const InputTextData& data); /* original C++ signature */
  2950. def input_text_data_to_string(data: InputTextData) -> str:
  2951. pass
  2952. # InputTextData InputTextDataFromString(const std::string& str); /* original C++ signature */
  2953. def input_text_data_from_string(str: str) -> InputTextData:
  2954. pass
  2955. # @@md
  2956. # ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2957. # hello_imgui.h continued //
  2958. # //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2959. # =========================== HelloImGui::Run ==================================
  2960. # *
  2961. # @@md#HelloImGui::Run
  2962. #
  2963. # __HelloImGui::Run()__ will run an application with a single call.
  2964. #
  2965. # Three signatures are provided:
  2966. #
  2967. # * `HelloImGui::Run(RunnerParams &)`: full signature, the most customizable version.
  2968. # Runs an application whose params and Gui are provided by runnerParams.
  2969. #
  2970. # * `HelloImGui::Run(const SimpleRunnerParams&)`:
  2971. # Runs an application, using simpler params.
  2972. #
  2973. # * `HelloImGui::Run(guiFunction, windowTitle, windowSize, windowSizeAuto=False, restoreLastWindowGeometry=False, fpsIdle=10)`
  2974. # Runs an application, by providing the Gui function, the window title, etc.
  2975. #
  2976. # Although the API is extremely simple, it is highly customizable, and you can set many options by filling
  2977. # the elements in the `RunnerParams` struct, or in the simpler `SimpleRunnerParams`.
  2978. #
  2979. # __HelloImGui::GetRunnerParams()__ will return the runnerParams of the current application.
  2980. #
  2981. # @@md
  2982. #
  2983. # void Run(RunnerParams &runnerParams); /* original C++ signature */
  2984. @overload
  2985. def run(runner_params: RunnerParams) -> None:
  2986. """`HelloImGui::Run(RunnerParams &)`: full signature, the most customizable version.
  2987. Runs an application whose params and Gui are provided by runnerParams.
  2988. """
  2989. pass
  2990. # void Run(const SimpleRunnerParams &simpleParams); /* original C++ signature */
  2991. @overload
  2992. def run(simple_params: SimpleRunnerParams) -> None:
  2993. """`HelloImGui::Run(const SimpleRunnerParams&)`:
  2994. Runs an application, using simpler params.
  2995. """
  2996. pass
  2997. # void Run( /* original C++ signature */
  2998. # const VoidFunction &guiFunction,
  2999. # const std::string &windowTitle = "",
  3000. # bool windowSizeAuto = false,
  3001. # bool windowRestorePreviousGeometry = false,
  3002. # const ScreenSize &windowSize = DefaultWindowSize,
  3003. # float fpsIdle = 10.f,
  3004. # bool topMost = false
  3005. # );
  3006. @overload
  3007. def run(
  3008. gui_function: VoidFunction,
  3009. window_title: str = "",
  3010. window_size_auto: bool = False,
  3011. window_restore_previous_geometry: bool = False,
  3012. window_size: Optional[ScreenSize] = None,
  3013. fps_idle: float = 10.0,
  3014. top_most: bool = False,
  3015. ) -> None:
  3016. """Runs an application, by providing the Gui function, the window title, etc.
  3017. Python bindings defaults:
  3018. If windowSize is None, then its default value will be: DefaultWindowSize
  3019. """
  3020. pass
  3021. # =========================== HelloImGui::ManualRender ==================================
  3022. # @@md#HelloImGui::ManualRender
  3023. # @@md
  3024. # ============================== Utility functions ===============================
  3025. # @@md#UtilityFunctions
  3026. # RunnerParams* GetRunnerParams(); /* original C++ signature */
  3027. def get_runner_params() -> RunnerParams:
  3028. """`GetRunnerParams()`: a convenience function that will return the runnerParams
  3029. of the current application
  3030. """
  3031. pass
  3032. # bool IsUsingHelloImGui(); /* original C++ signature */
  3033. def is_using_hello_imgui() -> bool:
  3034. """`IsUsingHelloImGui()`: returns True if the application is using HelloImGui"""
  3035. pass
  3036. # bool InitGlLoader(); /* original C++ signature */
  3037. def init_gl_loader() -> bool:
  3038. """`InitGlLoader()`: initializes HelloImGui's OpenGL function loader (GLAD).
  3039. Required ONLY when using HelloImGui's image / texture helpers
  3040. (`ImageAndSizeFromAsset`, `CreateTextureGpuFromRgbaData`, anything that
  3041. uploads to a `TextureGpuOpenGl`) OUTSIDE a `HelloImGui::Run()` context.
  3042. Inside `Run()`, the loader is initialized automatically.
  3043. Typical use case: hosting `imgui_md` in a pure GLFW + PyOpenGL Python
  3044. backend, or in a vanilla Dear ImGui glfw+opengl3 C++ app.
  3045. Preconditions:
  3046. - A GL context must be current (created by your own GLFW/SDL2/etc).
  3047. - HelloImGui must be compiled with HELLOIMGUI_USE_GLFW3 or HELLOIMGUI_USE_SDL2.
  3048. Returns True on success, False if no supported platform backend was
  3049. compiled in. Idempotent: safe to call repeatedly.
  3050. Note: only the OpenGL3 standalone path is supported. Metal, Vulkan and
  3051. DirectX11/12 require device handles that HelloImGui's runner would
  3052. normally create — they are not usable outside `Run()`.
  3053. """
  3054. pass
  3055. # float FrameRate(float durationForMean = 0.5f); /* original C++ signature */
  3056. def frame_rate(duration_for_mean: float = 0.5) -> float:
  3057. """`FrameRate(durationForMean = 0.5)`: Returns the current FrameRate.
  3058. May differ from ImGui::GetIO().FrameRate, since one can choose the duration
  3059. for the calculation of the mean value of the fps
  3060. Returns the current FrameRate. May differ from ImGui::GetIO().FrameRate,
  3061. since one can choose the duration for the calculation of the mean value of the fps
  3062. (Will only lead to accurate values if you call it at each frame)
  3063. """
  3064. pass
  3065. # ImGuiTestEngine* GetImGuiTestEngine(); /* original C++ signature */
  3066. def get_imgui_test_engine() -> ImGuiTestEngine:
  3067. """`ImGuiTestEngine* GetImGuiTestEngine()`: returns a pointer to the global instance
  3068. of ImGuiTestEngine that was initialized by HelloImGui
  3069. (iif ImGui Test Engine is active).
  3070. """
  3071. pass
  3072. # std::string GetBackendDescription(); /* original C++ signature */
  3073. def get_backend_description() -> str:
  3074. """`GetBackendDescription()`: returns a string with the backend info
  3075. Could be for example:
  3076. "Glfw - OpenGL3"
  3077. "Glfw - Metal"
  3078. "Sdl - Vulkan"
  3079. """
  3080. pass
  3081. # void ChangeWindowSize(const ScreenSize &windowSize); /* original C++ signature */
  3082. def change_window_size(window_size: ScreenSize) -> None:
  3083. """`ChangeWindowSize(const ScreenSize &windowSize)`: sets the window size
  3084. (useful if you want to change the window size during execution)
  3085. """
  3086. pass
  3087. # void UseWindowFullMonitorWorkArea(); /* original C++ signature */
  3088. def use_window_full_monitor_work_area() -> None:
  3089. """`UseWindowFullMonitorWorkArea()`: sets the window size to the monitor work area
  3090. (useful if you want to change the window size during execution)
  3091. """
  3092. pass
  3093. # @@md
  3094. # ============================== Layout Utils =============================
  3095. # @@md#HelloImGui::Layouts
  3096. # In advanced cases when several layouts are available, you can switch between layouts.
  3097. # See demo inside
  3098. # https://github.com/pthom/hello_imgui/tree/master/src/hello_imgui_demos/hello_imgui_demodocking/hello_imgui_demodocking.main.cpp
  3099. # void SwitchLayout(const std::string& layoutName); /* original C++ signature */
  3100. def switch_layout(layout_name: str) -> None:
  3101. """`SwitchLayout(layoutName)`
  3102. Changes the application current layout. Only used in advanced cases
  3103. when several layouts are available, i.e. if you filled
  3104. runnerParams.alternativeDockingLayouts.
  3105. """
  3106. pass
  3107. # std::string CurrentLayoutName(); /* original C++ signature */
  3108. def current_layout_name() -> str:
  3109. """`CurrentLayoutName()`: returns the name of the current layout"""
  3110. pass
  3111. # void AddDockableWindow(const DockableWindow& dockableWindow, bool forceDockspace = false); /* original C++ signature */
  3112. def add_dockable_window(
  3113. dockable_window: DockableWindow, force_dockspace: bool = False
  3114. ) -> None:
  3115. """`AddDockableWindow()`: will add a dockable window to the current layout.
  3116. Will dock the window to the dockspace it belongs to if forceDockspace is True,
  3117. otherwise will dock it to the last space it was docked to (using saved settings)
  3118. """
  3119. pass
  3120. # void RemoveDockableWindow(const std::string& dockableWindowName); /* original C++ signature */
  3121. def remove_dockable_window(dockable_window_name: str) -> None:
  3122. """`RemoveDockableWindow()`: will remove a dockable window from the current layout.
  3123. (dockableWindowName is the label of the window, as provided in the DockableWindow struct)
  3124. """
  3125. pass
  3126. # @@md
  3127. # ============================== User prefs Utils =============================
  3128. # @@md#HelloImGui::UserPref
  3129. # You may store additional user settings in the application settings.
  3130. # This is provided as a convenience only, and it is not intended to store large
  3131. # quantities of text data. Use sparingly.
  3132. # void SaveUserPref(const std::string& userPrefName, const std::string& userPrefContent); /* original C++ signature */
  3133. def save_user_pref(user_pref_name: str, user_pref_content: str) -> None:
  3134. """`SaveUserPref(string userPrefName, string userPrefContent)`:
  3135. Shall be called in the callback runnerParams.callbacks.BeforeExit
  3136. """
  3137. pass
  3138. # std::string LoadUserPref(const std::string& userPrefName); /* original C++ signature */
  3139. def load_user_pref(user_pref_name: str) -> str:
  3140. """`string LoadUserPref(string& userPrefName)`
  3141. Shall be called in the callback runnerParams.callbacks.PostInit
  3142. """
  3143. pass
  3144. # @@md
  3145. # ============================== Menus defaults =============================
  3146. # *
  3147. # @@md#MenuIntro
  3148. #
  3149. # Hello ImGui provides a default menu and status bar, which you can customize by using the params:
  3150. # `RunnerParams.imGuiWindowParams.` `showMenuBar` / `showMenu_App` / `showMenu_View`
  3151. #
  3152. # If you want to fully customize the menu:
  3153. # * set `showMenuBar` to True, then set `showMenu_App` and `showMenu_View` params to False
  3154. # * implement the callback `RunnerParams.callbacks.ShowMenus`:
  3155. # it can optionally call `ShowViewMenu` and `ShowAppMenu` (see below).
  3156. #
  3157. # @@md
  3158. #
  3159. # @@md#MenuFunctions
  3160. # void ShowViewMenu(RunnerParams & runnerParams); /* original C++ signature */
  3161. def show_view_menu(runner_params: RunnerParams) -> None:
  3162. """`ShowViewMenu(RunnerParams & runnerParams)`:
  3163. shows the View menu (where you can select the layout and docked windows visibility
  3164. """
  3165. pass
  3166. # void ShowAppMenu(RunnerParams & runnerParams); /* original C++ signature */
  3167. def show_app_menu(runner_params: RunnerParams) -> None:
  3168. """`ShowAppMenu(RunnerParams & runnerParams)`:
  3169. shows the default App menu (including the Quit item)
  3170. """
  3171. pass
  3172. # @@md
  3173. # <submodule imgui_default_settings>
  3174. class imgui_default_settings: # Proxy class that introduces typings for the *submodule* imgui_default_settings
  3175. pass # (This corresponds to a C++ namespace. All methods are static!)
  3176. """ namespace ImGuiDefaultSettings"""
  3177. # void LoadDefaultFont_WithFontAwesomeIcons(); /* original C++ signature */
  3178. @staticmethod
  3179. def load_default_font_with_font_awesome_icons() -> None:
  3180. """LoadDefaultFont_WithFontAwesome will load from assets/fonts and reverts to the imgui embedded font if not found."""
  3181. pass
  3182. # void SetupDefaultImGuiConfig(); /* original C++ signature */
  3183. @staticmethod
  3184. def setup_default_imgui_config() -> None:
  3185. pass
  3186. # void SetupDefaultImGuiStyle(); /* original C++ signature */
  3187. # }
  3188. @staticmethod
  3189. def setup_default_imgui_style() -> None:
  3190. pass
  3191. # </submodule imgui_default_settings>
  3192. # <submodule manual_render>
  3193. class manual_render: # Proxy class that introduces typings for the *submodule* manual_render
  3194. pass # (This corresponds to a C++ namespace. All methods are static!)
  3195. """ namespace ManualRender"""
  3196. # HelloImGui::ManualRender is a namespace that groups functions, allowing fine-grained control over the rendering process:
  3197. # - It is customizable like HelloImGui::Run: initialize it with `RunnerParams` or `SimpleRunnerParams`
  3198. # - `ManualRender::Render()` will render the application for one frame:
  3199. # - Ensure that `ManualRender::Render()` is triggered regularly (e.g., through a loop or other mechanism)
  3200. # to maintain responsiveness. This method must be called on the main thread.
  3201. #
  3202. # A typical use case is:
  3203. # C++
  3204. # ```cpp
  3205. # HelloImGui::RunnerParams runnerParams;
  3206. # runnerParams.callbacks.ShowGui = ...; // your GUI function
  3207. # // Optionally, choose between Sleep, EarlyReturn, or Auto for fps idling mode:
  3208. # // runnerParams.fpsIdling.fpsIdlingMode = HelloImGui::FpsIdlingMode::Sleep; // or EarlyReturn, Auto
  3209. # HelloImGui::ManualRender::SetupFromRunnerParams(runnerParams);
  3210. # while (!HelloImGui::GetRunnerParams()->appShallExit)
  3211. # {
  3212. # HelloImGui::ManualRender::Render();
  3213. # }
  3214. # HelloImGui::ManualRender::TearDown();
  3215. # ```
  3216. # Python:
  3217. # ```python
  3218. # runnerParams = HelloImGui.RunnerParams()
  3219. # runnerParams.callbacks.show_gui = ... # your GUI function
  3220. # while not hello_imgui.get_runner_params().app_shall_exit:
  3221. # hello_imgui.manual_render.render()
  3222. # hello_imgui.manual_render.tear_down()
  3223. # ```
  3224. #
  3225. # **Notes:**
  3226. # 1. Depending on the configuration (`runnerParams.fpsIdling.fpsIdlingMode`), `HelloImGui` may enter
  3227. # an idle state to reduce CPU usage, if no events are received (e.g., no input or interaction).
  3228. # In this case, `Render()` will either sleep or return immediately.
  3229. # By default,
  3230. # - On Emscripten, `ManualRender::Render()` will return immediately to avoid blocking the main thread.
  3231. # - On other platforms, it will sleep
  3232. # 2. If initialized with `RunnerParams`, a reference to the user's `RunnerParams` is kept
  3233. # (which can be accessed with `HelloImGui::GetRunnerParams()`).
  3234. # void SetupFromRunnerParams(RunnerParams& runnerParams); /* original C++ signature */
  3235. @staticmethod
  3236. def setup_from_runner_params(runner_params: RunnerParams) -> None:
  3237. """Initializes the rendering with the full customizable `RunnerParams`.
  3238. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.).
  3239. A reference to the user's `RunnerParams` is kept internally (similar to HelloImGui::Run).
  3240. """
  3241. pass
  3242. # void SetupFromSimpleRunnerParams(const SimpleRunnerParams& simpleParams); /* original C++ signature */
  3243. @staticmethod
  3244. def setup_from_simple_runner_params(simple_params: SimpleRunnerParams) -> None:
  3245. """Initializes the rendering with `SimpleRunnerParams`.
  3246. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.).
  3247. """
  3248. pass
  3249. # void SetupFromGuiFunction( /* original C++ signature */
  3250. # const VoidFunction& guiFunction,
  3251. # const std::string& windowTitle = "",
  3252. # bool windowSizeAuto = false,
  3253. # bool windowRestorePreviousGeometry = false,
  3254. # const ScreenSize& windowSize = DefaultWindowSize,
  3255. # float fpsIdle = 10.f,
  3256. # bool topMost = false
  3257. # );
  3258. @staticmethod
  3259. def setup_from_gui_function(
  3260. gui_function: VoidFunction,
  3261. window_title: str = "",
  3262. window_size_auto: bool = False,
  3263. window_restore_previous_geometry: bool = False,
  3264. window_size: Optional[ScreenSize] = None,
  3265. fps_idle: float = 10.0,
  3266. top_most: bool = False,
  3267. ) -> None:
  3268. """Initializes the renderer with a simple GUI function and additional parameters.
  3269. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.).
  3270. Python bindings defaults:
  3271. If windowSize is None, then its default value will be: DefaultWindowSize
  3272. """
  3273. pass
  3274. # void Render(); /* original C++ signature */
  3275. @staticmethod
  3276. def render() -> None:
  3277. """Renders the current frame. Should be called regularly to maintain the application's responsiveness."""
  3278. pass
  3279. # void TearDown(); /* original C++ signature */
  3280. # }
  3281. @staticmethod
  3282. def tear_down() -> None:
  3283. """Tears down the renderer and releases all associated resources.
  3284. This will release the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.).
  3285. After calling `TearDown()`, the InitFromXXX can be called with new parameters.
  3286. """
  3287. pass
  3288. # </submodule manual_render>
  3289. def image_and_size_from_encoded_data(data: bytes, cache_key: str = "") -> ImageAndSize:
  3290. """Create a texture from encoded image data (PNG, JPEG, BMP, GIF, etc.).
  3291. - data: bytes containing the encoded image
  3292. - cache_key: if non-empty, the texture is cached and reused on subsequent calls with the same key
  3293. Returns an ImageAndSize with texture_id and size."""
  3294. pass
  3295. class TextureGpu:
  3296. """Opaque RAII handle owning a GPU texture.
  3297. The GPU resource is freed when the last reference to this object
  3298. is dropped (no separate `delete_texture` call). Hold the handle
  3299. in Python for as long as you want to display the texture.
  3300. Threading: must be created from the GUI thread, while a live
  3301. rendering backend (OpenGL/Metal/Vulkan/DirectX11) is initialized.
  3302. """
  3303. width: int
  3304. height: int
  3305. def texture_id(self) -> int:
  3306. """Returns the underlying ImTextureID as a Python int.
  3307. Pass it to imgui.image() etc."""
  3308. pass
  3309. def create_texture_gpu_from_rgba_data(rgba: np.ndarray) -> TextureGpu:
  3310. """Upload an HxWx4 uint8 RGBA numpy array to a new GPU texture.
  3311. - `rgba` must be a contiguous numpy array of dtype uint8 with
  3312. shape (height, width, 4). The pixel data is read once during
  3313. the upload; the numpy array does not need to outlive the call.
  3314. - Returns an owning `TextureGpu` handle. Drop the last reference
  3315. to free the GPU resource.
  3316. Threading: must be called from the GUI thread, while a live
  3317. rendering backend is initialized (i.e. inside the gui callback,
  3318. or after `hello_imgui.run` has set up the backend).
  3319. """
  3320. pass
  3321. #################### </generated_from:hello_imgui_amalgamation.h> ####################
  3322. # </litgen_stub>
  3323. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3324. # =========================== HelloImGui::run_async ==================================
  3325. # Async support for non-blocking GUI execution
  3326. @overload
  3327. async def run_async(runner_params: RunnerParams) -> None:
  3328. """Run a HelloImGui application asynchronously using RunnerParams.
  3329. This function will run until the application exits (user closes window or app_shall_exit is set).
  3330. Use this when you need full control over the async lifecycle.
  3331. Example:
  3332. async def my_app():
  3333. runner = hello_imgui.RunnerParams()
  3334. runner.callbacks.show_gui = my_gui_function
  3335. await hello_imgui.run_async(runner)
  3336. print("GUI closed")
  3337. asyncio.run(my_app())
  3338. """
  3339. ...
  3340. @overload
  3341. async def run_async(simple_params: SimpleRunnerParams) -> None:
  3342. """Run a HelloImGui application asynchronously using SimpleRunnerParams.
  3343. Example:
  3344. simple = hello_imgui.SimpleRunnerParams()
  3345. simple.gui_function = my_gui_function
  3346. simple.window_title = "My App"
  3347. await hello_imgui.run_async(simple)
  3348. """
  3349. ...
  3350. @overload
  3351. async def run_async(
  3352. gui_function: VoidFunction,
  3353. window_title: str = "",
  3354. window_size_auto: bool = False,
  3355. window_restore_previous_geometry: bool = False,
  3356. window_size: Optional[ScreenSize] = None,
  3357. fps_idle: float = 10.0,
  3358. top_most: bool = False,
  3359. ) -> None:
  3360. """Run a HelloImGui application asynchronously using a GUI function and parameters.
  3361. Args:
  3362. gui_function: The GUI function to call each frame
  3363. window_title: Window title
  3364. window_size_auto: Auto-size window to fit content
  3365. window_restore_previous_geometry: Restore window size/position from previous run
  3366. window_size: Window size in pixels (width, height)
  3367. fps_idle: FPS when application is idle
  3368. top_most: Keep window on top of others
  3369. Example:
  3370. await hello_imgui.run_async(
  3371. my_gui_function,
  3372. window_title="My App",
  3373. window_size_auto=True,
  3374. fps_idle=10.0
  3375. )
  3376. """
  3377. ...
  3378. # ============================== Screenshot Utils =============================
  3379. def final_app_window_screenshot() -> np.ndarray:
  3380. """Return a screenshot of the final screen of the last (exited) app"""
  3381. pass
  3382. def final_app_window_screenshot_framebuffer_scale() -> float:
  3383. """Returns the scale of the framebuffer used to take the screenshot"""
  3384. pass