imgui_node_editor.pyi 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of imgui-node-editor
  3. # -----------------------------------------------------------------------------
  4. # imgui_node_editor.pyi: auto-generated bindings for imgui-node-editor,
  5. # a Node editor built using ImGui. See https://github.com/thedmd/imgui-node-editor
  6. #
  7. # Most of the code of this file is automatically generated (using https://pthom.github.io/litgen/),
  8. # and is generally very close to the C++ version. Comments, docs are identical.
  9. # Do not manually edit the autogenerated parts (look for "Autogenerated" comments)!
  10. ###############################################################################
  11. # ruff: noqa: B008
  12. from typing import Any, Optional, List, overload
  13. import enum
  14. from imgui_bundle.imgui import ImVec2, ImVec4, ImDrawList, ImVec2Like, ImVec4Like
  15. from imgui_bundle import imgui
  16. ImGuiMouseButton = imgui.MouseButton
  17. EditorContext = Any
  18. NodeEditorContext = Any
  19. class NodeId:
  20. def __init__(self, id: int = 0):
  21. pass
  22. def id(self) -> int:
  23. pass
  24. @staticmethod
  25. def create() -> NodeId:
  26. """Creates a new NodeId with a unique id
  27. Create your node once per session, not at each frame!
  28. """
  29. pass
  30. class LinkId:
  31. def __init__(self, id: int = 0):
  32. pass
  33. def id(self) -> int:
  34. pass
  35. @staticmethod
  36. def create() -> LinkId:
  37. """Creates a new LinkId with a unique id
  38. Create your node once per session, not at each frame!
  39. """
  40. pass
  41. class PinId:
  42. def __init__(self, id: int = 0):
  43. pass
  44. def id(self) -> int:
  45. pass
  46. @staticmethod
  47. def create() -> PinId:
  48. """Creates a new NodeId with a unique id
  49. Create your node once per session, not at each frame!
  50. """
  51. pass
  52. # Suspends canvas by returning to normal ImGui transformation space.
  53. # While suspended UI will not be drawn on canvas plane.
  54. #
  55. # Calls to Suspend()/Resume() are symmetrical. Each call to Suspend()
  56. # must be matched with call to Resume().
  57. def suspend_editor_canvas() -> None:
  58. pass
  59. def resume_editor_canvas() -> None:
  60. pass
  61. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  62. # <litgen_stub> // Autogenerated code below! Do not edit!
  63. #################### <generated_from:imgui_node_editor.h> ####################
  64. # ------------------------------------------------------------------------------
  65. # VERSION 0.9.1
  66. #
  67. # LICENSE
  68. # This software is dual-licensed to the public domain and under the following
  69. # license: you are granted a perpetual, irrevocable license to copy, modify,
  70. # publish, and distribute this file as you see fit.
  71. #
  72. # CREDITS
  73. # Written by Michal Cichon
  74. # ------------------------------------------------------------------------------
  75. # # ifndef __IMGUI_NODE_EDITOR_H__
  76. #
  77. #
  78. # Adaptations for ImGui Bundle are noted with [ADAPT_IMGUI_BUNDLE]
  79. #
  80. # [ADAPT_IMGUI_BUNDLE]
  81. # #ifdef IMGUI_BUNDLE_PYTHON_API
  82. #
  83. # #endif
  84. #
  85. # ------------------------------------------------------------------------------
  86. # ------------------------------------------------------------------------------
  87. # ------------------------------------------------------------------------------
  88. # ------------------------------------------------------------------------------
  89. # ------------------------------------------------------------------------------
  90. class PinKind(enum.IntEnum):
  91. """------------------------------------------------------------------------------"""
  92. # Input, /* original C++ signature */
  93. input = enum.auto() # (= 0)
  94. # Output /* original C++ signature */
  95. # }
  96. output = enum.auto() # (= 1)
  97. class FlowDirection(enum.IntEnum):
  98. # Forward, /* original C++ signature */
  99. forward = enum.auto() # (= 0)
  100. # Backward /* original C++ signature */
  101. # }
  102. backward = enum.auto() # (= 1)
  103. class CanvasSizeMode(enum.IntEnum):
  104. # FitVerticalView, /* original C++ signature */
  105. fit_vertical_view = (
  106. enum.auto()
  107. ) # (= 0) # Previous view will be scaled to fit new view on Y axis
  108. # FitHorizontalView, /* original C++ signature */
  109. fit_horizontal_view = (
  110. enum.auto()
  111. ) # (= 1) # Previous view will be scaled to fit new view on X axis
  112. # CenterOnly, /* original C++ signature */
  113. center_only = enum.auto() # (= 2) # Previous view will be centered on new view
  114. class SaveReasonFlags(enum.IntEnum):
  115. """------------------------------------------------------------------------------"""
  116. # None = 0x00000000, /* original C++ signature */
  117. none = enum.auto() # (= 0x00000000)
  118. # Navigation = 0x00000001, /* original C++ signature */
  119. navigation = enum.auto() # (= 0x00000001)
  120. # Position = 0x00000002, /* original C++ signature */
  121. position = enum.auto() # (= 0x00000002)
  122. # Size = 0x00000004, /* original C++ signature */
  123. size = enum.auto() # (= 0x00000004)
  124. # Selection = 0x00000008, /* original C++ signature */
  125. selection = enum.auto() # (= 0x00000008)
  126. # AddNode = 0x00000010, /* original C++ signature */
  127. add_node = enum.auto() # (= 0x00000010)
  128. # RemoveNode = 0x00000020, /* original C++ signature */
  129. remove_node = enum.auto() # (= 0x00000020)
  130. # User = 0x00000040 /* original C++ signature */
  131. # }
  132. user = enum.auto() # (= 0x00000040)
  133. class Config:
  134. # std::string SettingsFile; /* original C++ signature */
  135. settings_file: str
  136. # void* UserPointer; /* original C++ signature */
  137. user_pointer: Any
  138. # CanvasSizeModeAlias CanvasSizeMode; /* original C++ signature */
  139. canvas_size_mode: CanvasSizeMode
  140. # int DragButtonIndex; /* original C++ signature */
  141. drag_button_index: (
  142. int # Mouse button index drag action will react to (0-left, 1-right, 2-middle)
  143. )
  144. # int SelectButtonIndex; /* original C++ signature */
  145. select_button_index: int # Mouse button index select action will react to (0-left, 1-right, 2-middle)
  146. # int NavigateButtonIndex; /* original C++ signature */
  147. navigate_button_index: int # Mouse button index navigate action will react to (0-left, 1-right, 2-middle)
  148. # int ContextMenuButtonIndex; /* original C++ signature */
  149. context_menu_button_index: int # Mouse button index context menu action will react to (0-left, 1-right, 2-middle)
  150. # bool EnableSmoothZoom; /* original C++ signature */
  151. enable_smooth_zoom: bool
  152. # float SmoothZoomPower; /* original C++ signature */
  153. smooth_zoom_power: float
  154. # bool ForceWindowContentWidthToNodeWidth; /* original C++ signature */
  155. # [ADAPT_IMGUI_BUNDLE]
  156. #
  157. # By default, ImGui::TextWrapped() and ImGui::Separator(), and ImGui::SliderXXX
  158. # will not work in a Node because they will not respect the node's bounds.
  159. # Instead, they will use the width of the whole window.
  160. # Set ForceWindowContentWidthToNodeWidth to True to fix this (this is disabled by default).
  161. force_window_content_width_to_node_width: bool
  162. # Config() /* original C++ signature */
  163. # : SettingsFile("NodeEditor.json")
  164. # , BeginSaveSession(nullptr)
  165. # , EndSaveSession(nullptr)
  166. # , SaveSettings(nullptr)
  167. # , LoadSettings(nullptr)
  168. # , SaveNodeSettings(nullptr)
  169. # , LoadNodeSettings(nullptr)
  170. # , UserPointer(nullptr)
  171. # , CustomZoomLevels()
  172. # , CanvasSizeMode(CanvasSizeModeAlias::FitVerticalView)
  173. # , DragButtonIndex(0)
  174. # , SelectButtonIndex(0)
  175. # , NavigateButtonIndex(1)
  176. # , ContextMenuButtonIndex(1)
  177. # , EnableSmoothZoom(true)
  178. # # ifdef __APPLE__
  179. # , SmoothZoomPower(1.1f)
  180. # # else
  181. # , SmoothZoomPower(1.3f)
  182. # # endif
  183. # , ForceWindowContentWidthToNodeWidth(false)
  184. # {
  185. # }
  186. def __init__(self) -> None:
  187. pass
  188. class StyleColor(enum.IntEnum):
  189. """------------------------------------------------------------------------------"""
  190. # StyleColor_Bg, /* original C++ signature */
  191. bg = enum.auto() # (= 0)
  192. # StyleColor_Grid, /* original C++ signature */
  193. grid = enum.auto() # (= 1)
  194. # StyleColor_NodeBg, /* original C++ signature */
  195. node_bg = enum.auto() # (= 2)
  196. # StyleColor_NodeBorder, /* original C++ signature */
  197. node_border = enum.auto() # (= 3)
  198. # StyleColor_HovNodeBorder, /* original C++ signature */
  199. hov_node_border = enum.auto() # (= 4)
  200. # StyleColor_SelNodeBorder, /* original C++ signature */
  201. sel_node_border = enum.auto() # (= 5)
  202. # StyleColor_NodeSelRect, /* original C++ signature */
  203. node_sel_rect = enum.auto() # (= 6)
  204. # StyleColor_NodeSelRectBorder, /* original C++ signature */
  205. node_sel_rect_border = enum.auto() # (= 7)
  206. # StyleColor_HovLinkBorder, /* original C++ signature */
  207. hov_link_border = enum.auto() # (= 8)
  208. # StyleColor_SelLinkBorder, /* original C++ signature */
  209. sel_link_border = enum.auto() # (= 9)
  210. # StyleColor_HighlightLinkBorder, /* original C++ signature */
  211. highlight_link_border = enum.auto() # (= 10)
  212. # StyleColor_LinkSelRect, /* original C++ signature */
  213. link_sel_rect = enum.auto() # (= 11)
  214. # StyleColor_LinkSelRectBorder, /* original C++ signature */
  215. link_sel_rect_border = enum.auto() # (= 12)
  216. # StyleColor_PinRect, /* original C++ signature */
  217. pin_rect = enum.auto() # (= 13)
  218. # StyleColor_PinRectBorder, /* original C++ signature */
  219. pin_rect_border = enum.auto() # (= 14)
  220. # StyleColor_Flow, /* original C++ signature */
  221. flow = enum.auto() # (= 15)
  222. # StyleColor_FlowMarker, /* original C++ signature */
  223. flow_marker = enum.auto() # (= 16)
  224. # StyleColor_GroupBg, /* original C++ signature */
  225. group_bg = enum.auto() # (= 17)
  226. # StyleColor_GroupBorder, /* original C++ signature */
  227. group_border = enum.auto() # (= 18)
  228. # StyleColor_Count /* original C++ signature */
  229. # }
  230. count = enum.auto() # (= 19)
  231. class StyleVar(enum.IntEnum):
  232. # StyleVar_NodePadding, /* original C++ signature */
  233. node_padding = enum.auto() # (= 0)
  234. # StyleVar_NodeRounding, /* original C++ signature */
  235. node_rounding = enum.auto() # (= 1)
  236. # StyleVar_NodeBorderWidth, /* original C++ signature */
  237. node_border_width = enum.auto() # (= 2)
  238. # StyleVar_HoveredNodeBorderWidth, /* original C++ signature */
  239. hovered_node_border_width = enum.auto() # (= 3)
  240. # StyleVar_SelectedNodeBorderWidth, /* original C++ signature */
  241. selected_node_border_width = enum.auto() # (= 4)
  242. # StyleVar_PinRounding, /* original C++ signature */
  243. pin_rounding = enum.auto() # (= 5)
  244. # StyleVar_PinBorderWidth, /* original C++ signature */
  245. pin_border_width = enum.auto() # (= 6)
  246. # StyleVar_LinkStrength, /* original C++ signature */
  247. link_strength = enum.auto() # (= 7)
  248. # StyleVar_SourceDirection, /* original C++ signature */
  249. source_direction = enum.auto() # (= 8)
  250. # StyleVar_TargetDirection, /* original C++ signature */
  251. target_direction = enum.auto() # (= 9)
  252. # StyleVar_ScrollDuration, /* original C++ signature */
  253. scroll_duration = enum.auto() # (= 10)
  254. # StyleVar_FlowMarkerDistance, /* original C++ signature */
  255. flow_marker_distance = enum.auto() # (= 11)
  256. # StyleVar_FlowSpeed, /* original C++ signature */
  257. flow_speed = enum.auto() # (= 12)
  258. # StyleVar_FlowDuration, /* original C++ signature */
  259. flow_duration = enum.auto() # (= 13)
  260. # StyleVar_PivotAlignment, /* original C++ signature */
  261. pivot_alignment = enum.auto() # (= 14)
  262. # StyleVar_PivotSize, /* original C++ signature */
  263. pivot_size = enum.auto() # (= 15)
  264. # StyleVar_PivotScale, /* original C++ signature */
  265. pivot_scale = enum.auto() # (= 16)
  266. # StyleVar_PinCorners, /* original C++ signature */
  267. pin_corners = enum.auto() # (= 17)
  268. # StyleVar_PinRadius, /* original C++ signature */
  269. pin_radius = enum.auto() # (= 18)
  270. # StyleVar_PinArrowSize, /* original C++ signature */
  271. pin_arrow_size = enum.auto() # (= 19)
  272. # StyleVar_PinArrowWidth, /* original C++ signature */
  273. pin_arrow_width = enum.auto() # (= 20)
  274. # StyleVar_GroupRounding, /* original C++ signature */
  275. group_rounding = enum.auto() # (= 21)
  276. # StyleVar_GroupBorderWidth, /* original C++ signature */
  277. group_border_width = enum.auto() # (= 22)
  278. # StyleVar_HighlightConnectedLinks, /* original C++ signature */
  279. highlight_connected_links = enum.auto() # (= 23)
  280. # StyleVar_SnapLinkToPinDir, /* original C++ signature */
  281. snap_link_to_pin_dir = enum.auto() # (= 24)
  282. # StyleVar_HoveredNodeBorderOffset, /* original C++ signature */
  283. hovered_node_border_offset = enum.auto() # (= 25)
  284. # StyleVar_SelectedNodeBorderOffset, /* original C++ signature */
  285. selected_node_border_offset = enum.auto() # (= 26)
  286. # StyleVar_Count /* original C++ signature */
  287. # }
  288. count = enum.auto() # (= 27)
  289. class Style:
  290. # ImVec4 NodePadding; /* original C++ signature */
  291. node_padding: ImVec4
  292. # float NodeRounding; /* original C++ signature */
  293. node_rounding: float
  294. # float NodeBorderWidth; /* original C++ signature */
  295. node_border_width: float
  296. # float HoveredNodeBorderWidth; /* original C++ signature */
  297. hovered_node_border_width: float
  298. # float HoverNodeBorderOffset; /* original C++ signature */
  299. hover_node_border_offset: float
  300. # float SelectedNodeBorderWidth; /* original C++ signature */
  301. selected_node_border_width: float
  302. # float SelectedNodeBorderOffset; /* original C++ signature */
  303. selected_node_border_offset: float
  304. # float PinRounding; /* original C++ signature */
  305. pin_rounding: float
  306. # float PinBorderWidth; /* original C++ signature */
  307. pin_border_width: float
  308. # float LinkStrength; /* original C++ signature */
  309. link_strength: float
  310. # ImVec2 SourceDirection; /* original C++ signature */
  311. source_direction: ImVec2
  312. # ImVec2 TargetDirection; /* original C++ signature */
  313. target_direction: ImVec2
  314. # float ScrollDuration; /* original C++ signature */
  315. scroll_duration: float
  316. # float FlowMarkerDistance; /* original C++ signature */
  317. flow_marker_distance: float
  318. # float FlowSpeed; /* original C++ signature */
  319. flow_speed: float
  320. # float FlowDuration; /* original C++ signature */
  321. flow_duration: float
  322. # ImVec2 PivotAlignment; /* original C++ signature */
  323. pivot_alignment: ImVec2
  324. # ImVec2 PivotSize; /* original C++ signature */
  325. pivot_size: ImVec2
  326. # ImVec2 PivotScale; /* original C++ signature */
  327. pivot_scale: ImVec2
  328. # float PinCorners; /* original C++ signature */
  329. pin_corners: float
  330. # float PinRadius; /* original C++ signature */
  331. pin_radius: float
  332. # float PinArrowSize; /* original C++ signature */
  333. pin_arrow_size: float
  334. # float PinArrowWidth; /* original C++ signature */
  335. pin_arrow_width: float
  336. # float GroupRounding; /* original C++ signature */
  337. group_rounding: float
  338. # float GroupBorderWidth; /* original C++ signature */
  339. group_border_width: float
  340. # float HighlightConnectedLinks; /* original C++ signature */
  341. highlight_connected_links: float
  342. # float SnapLinkToPinDir; /* original C++ signature */
  343. snap_link_to_pin_dir: (
  344. float # when True link will start on the line defined by pin direction
  345. )
  346. # [ADAPT_IMGUI_BUNDLE]
  347. # #ifdef IMGUI_BUNDLE_PYTHON_API
  348. #
  349. # python adapter for Style::Colors[StyleColor_Count]
  350. # You can query and modify those values (0 <= idxColor < StyleColor.count)
  351. # inline IMGUI_NODE_EDITOR_API ImVec4& Color_(StyleColor idxColor) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); return Colors[idxColor]; } /* original C++ signature */
  352. def color_(self, idx_color: StyleColor) -> ImVec4:
  353. pass
  354. # inline IMGUI_NODE_EDITOR_API void SetColor_(StyleColor idxColor, ImVec4 color) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); Colors[idxColor] = color; } /* original C++ signature */
  355. def set_color_(self, idx_color: StyleColor, color: ImVec4Like) -> None:
  356. pass
  357. # #endif
  358. #
  359. # Style() /* original C++ signature */
  360. # {
  361. # NodePadding = ImVec4(8, 8, 8, 8);
  362. # NodeRounding = 12.0f;
  363. # NodeBorderWidth = 1.5f;
  364. # HoveredNodeBorderWidth = 3.5f;
  365. # HoverNodeBorderOffset = 0.0f;
  366. # SelectedNodeBorderWidth = 3.5f;
  367. # SelectedNodeBorderOffset = 0.0f;
  368. # PinRounding = 4.0f;
  369. # PinBorderWidth = 0.0f;
  370. # LinkStrength = 100.0f;
  371. # SourceDirection = ImVec2(1.0f, 0.0f);
  372. # TargetDirection = ImVec2(-1.0f, 0.0f);
  373. # ScrollDuration = 0.35f;
  374. # FlowMarkerDistance = 30.0f;
  375. # FlowSpeed = 150.0f;
  376. # FlowDuration = 2.0f;
  377. # PivotAlignment = ImVec2(0.5f, 0.5f);
  378. # PivotSize = ImVec2(0.0f, 0.0f);
  379. # PivotScale = ImVec2(1, 1);
  380. # PinCorners = ImDrawFlags_RoundCornersAll;
  381. # PinRadius = 0.0f;
  382. # PinArrowSize = 0.0f;
  383. # PinArrowWidth = 0.0f;
  384. # GroupRounding = 6.0f;
  385. # GroupBorderWidth = 1.0f;
  386. # HighlightConnectedLinks = 0.0f;
  387. # SnapLinkToPinDir = 0.0f;
  388. #
  389. # Colors[StyleColor_Bg] = ImColor( 60, 60, 70, 200);
  390. # Colors[StyleColor_Grid] = ImColor(120, 120, 120, 40);
  391. # Colors[StyleColor_NodeBg] = ImColor( 32, 32, 32, 200);
  392. # Colors[StyleColor_NodeBorder] = ImColor(255, 255, 255, 96);
  393. # Colors[StyleColor_HovNodeBorder] = ImColor( 50, 176, 255, 255);
  394. # Colors[StyleColor_SelNodeBorder] = ImColor(255, 176, 50, 255);
  395. # Colors[StyleColor_NodeSelRect] = ImColor( 5, 130, 255, 64);
  396. # Colors[StyleColor_NodeSelRectBorder] = ImColor( 5, 130, 255, 128);
  397. # Colors[StyleColor_HovLinkBorder] = ImColor( 50, 176, 255, 255);
  398. # Colors[StyleColor_SelLinkBorder] = ImColor(255, 176, 50, 255);
  399. # Colors[StyleColor_HighlightLinkBorder]= ImColor(204, 105, 0, 255);
  400. # Colors[StyleColor_LinkSelRect] = ImColor( 5, 130, 255, 64);
  401. # Colors[StyleColor_LinkSelRectBorder] = ImColor( 5, 130, 255, 128);
  402. # Colors[StyleColor_PinRect] = ImColor( 60, 180, 255, 100);
  403. # Colors[StyleColor_PinRectBorder] = ImColor( 60, 180, 255, 128);
  404. # Colors[StyleColor_Flow] = ImColor(255, 128, 64, 255);
  405. # Colors[StyleColor_FlowMarker] = ImColor(255, 128, 64, 255);
  406. # Colors[StyleColor_GroupBg] = ImColor( 0, 0, 0, 160);
  407. # Colors[StyleColor_GroupBorder] = ImColor(255, 255, 255, 32);
  408. # }
  409. def __init__(self) -> None:
  410. pass
  411. # ------------------------------------------------------------------------------
  412. # --- Editor context lifecycle --------------------------------------------
  413. # You may keep multiple editors and switch between them with SetCurrentEditor.
  414. # Pass a Config to CreateEditor to set e.g. SettingsFile (where node positions
  415. # are persisted) or to override the default mouse buttons.
  416. # IMGUI_NODE_EDITOR_API void SetCurrentEditor(EditorContext* ctx); /* original C++ signature */
  417. def set_current_editor(ctx: EditorContext) -> None:
  418. pass
  419. # IMGUI_NODE_EDITOR_API EditorContext* GetCurrentEditor(); /* original C++ signature */
  420. def get_current_editor() -> EditorContext:
  421. pass
  422. # IMGUI_NODE_EDITOR_API EditorContext* CreateEditor(const Config* config = nullptr); /* original C++ signature */
  423. def create_editor(config: Optional[Config] = None) -> EditorContext:
  424. pass
  425. # IMGUI_NODE_EDITOR_API void DestroyEditor(EditorContext* ctx); /* original C++ signature */
  426. def destroy_editor(ctx: EditorContext) -> None:
  427. pass
  428. # IMGUI_NODE_EDITOR_API const Config& GetConfig(EditorContext* ctx = nullptr); /* original C++ signature */
  429. def get_config(ctx: Optional[EditorContext] = None) -> Config:
  430. pass
  431. # --- Style ----------------------------------------------------------------
  432. # Editor-specific style, separate from ImGui::GetStyle().
  433. # Push/PopStyleColor and Push/PopStyleVar work like the ImGui equivalents.
  434. # IMGUI_NODE_EDITOR_API Style& GetStyle(); /* original C++ signature */
  435. def get_style() -> Style:
  436. pass
  437. # IMGUI_NODE_EDITOR_API const char* GetStyleColorName(StyleColor colorIndex); /* original C++ signature */
  438. def get_style_color_name(color_index: StyleColor) -> str:
  439. pass
  440. # IMGUI_NODE_EDITOR_API void PushStyleColor(StyleColor colorIndex, const ImVec4& color); /* original C++ signature */
  441. def push_style_color(color_index: StyleColor, color: ImVec4Like) -> None:
  442. pass
  443. # IMGUI_NODE_EDITOR_API void PopStyleColor(int count = 1); /* original C++ signature */
  444. def pop_style_color(count: int = 1) -> None:
  445. pass
  446. # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, float value); /* original C++ signature */
  447. @overload
  448. def push_style_var(var_index: StyleVar, value: float) -> None:
  449. pass
  450. # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, const ImVec2& value); /* original C++ signature */
  451. @overload
  452. def push_style_var(var_index: StyleVar, value: ImVec2Like) -> None:
  453. pass
  454. # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, const ImVec4& value); /* original C++ signature */
  455. @overload
  456. def push_style_var(var_index: StyleVar, value: ImVec4Like) -> None:
  457. pass
  458. # IMGUI_NODE_EDITOR_API void PopStyleVar(int count = 1); /* original C++ signature */
  459. def pop_style_var(count: int = 1) -> None:
  460. pass
  461. # --- Frame ----------------------------------------------------------------
  462. # All node-editor calls (BeginNode, Link, BeginCreate, ...) must be made
  463. # between Begin() and End(), and Begin() must be called inside a real ImGui
  464. # window. `id` distinguishes editor instances inside the same window;
  465. # `size` matches ImGui::BeginChild semantics (0 = available).
  466. # IMGUI_NODE_EDITOR_API void Begin(const char* id, const ImVec2& size = ImVec2(0, 0)); /* original C++ signature */
  467. def begin(id: str, size: Optional[ImVec2Like] = None) -> None:
  468. """Python bindings defaults:
  469. If size is None, then its default value will be: ImVec2(0, 0)
  470. """
  471. pass
  472. # IMGUI_NODE_EDITOR_API void End(); /* original C++ signature */
  473. def end() -> None:
  474. pass
  475. # --- Nodes & pins ---------------------------------------------------------
  476. # Inside Begin/End: declare each node with BeginNode(id) ... EndNode(),
  477. # and (optionally) declare its pins with BeginPin(id, kind) ... EndPin()
  478. # in between. Anything you draw between the Begin/End is rendered inside
  479. # the node; pins are typically wrapped around a Text/Button so the user
  480. # has something to grab onto.
  481. # IMGUI_NODE_EDITOR_API void BeginNode(NodeId id); /* original C++ signature */
  482. def begin_node(id: NodeId) -> None:
  483. pass
  484. # IMGUI_NODE_EDITOR_API void BeginPin(PinId id, PinKind kind); /* original C++ signature */
  485. def begin_pin(id: PinId, kind: PinKind) -> None:
  486. pass
  487. # --- Pin geometry overrides (advanced) -----------------------------------
  488. # By default the pin's own item rectangle is used both as the hover area
  489. # and as the place where links attach (the "pivot"). Use these calls to
  490. # customize either independently, between BeginPin and EndPin.
  491. #
  492. # PinRect(a, b) : override the pin's hover/visual rectangle
  493. # (otherwise inferred from drawn content).
  494. # PinPivotRect(a, b) : override the rectangle used to compute where
  495. # a link attaches.
  496. # PinPivotSize(size) : set the pivot rect's size; -1 on a component
  497. # means "use the pin's size on that axis".
  498. # PinPivotScale(scale) : multiplicative scale applied to PivotSize.
  499. # PinPivotAlignment(al) : where in the pin's rect the pivot is anchored;
  500. # (0,0)=top-left, (1,1)=bottom-right, (0.5,0.5)=center.
  501. #
  502. # You will rarely need these unless you draw custom-shaped pins (e.g. a
  503. # triangle whose tip should be the link attach point).
  504. # IMGUI_NODE_EDITOR_API void PinRect(const ImVec2& a, const ImVec2& b); /* original C++ signature */
  505. def pin_rect(a: ImVec2Like, b: ImVec2Like) -> None:
  506. pass
  507. # IMGUI_NODE_EDITOR_API void PinPivotRect(const ImVec2& a, const ImVec2& b); /* original C++ signature */
  508. def pin_pivot_rect(a: ImVec2Like, b: ImVec2Like) -> None:
  509. pass
  510. # IMGUI_NODE_EDITOR_API void PinPivotSize(const ImVec2& size); /* original C++ signature */
  511. def pin_pivot_size(size: ImVec2Like) -> None:
  512. pass
  513. # IMGUI_NODE_EDITOR_API void PinPivotScale(const ImVec2& scale); /* original C++ signature */
  514. def pin_pivot_scale(scale: ImVec2Like) -> None:
  515. pass
  516. # IMGUI_NODE_EDITOR_API void PinPivotAlignment(const ImVec2& alignment); /* original C++ signature */
  517. def pin_pivot_alignment(alignment: ImVec2Like) -> None:
  518. pass
  519. # IMGUI_NODE_EDITOR_API void EndPin(); /* original C++ signature */
  520. def end_pin() -> None:
  521. pass
  522. # --- Group nodes ----------------------------------------------------------
  523. #
  524. # Calling Group(size) inside a BeginNode/EndNode block turns the node into a
  525. # "Group node": a tinted, resizable rectangle (StyleColor_GroupBg / GroupBorder)
  526. # that can act as a labeled container for other nodes.
  527. #
  528. # Behavior:
  529. # - The user can resize the group by dragging its bottom-right corner.
  530. # - Dragging the group drags every node whose bounds fall inside it
  531. # (handled internally by the editor's DragAction).
  532. # - `size` is only the INITIAL size, applied on the very first frame the
  533. # group exists. Subsequent user resizes are persisted by the editor and
  534. # override `size`. To resize a group programmatically afterwards, use
  535. # SetGroupSize(node_id, size).
  536. # - Anything drawn between BeginNode and Group(size) lands in the group's
  537. # "title strip" above the colored rectangle: title text, buttons, and
  538. # even pins via BeginPin/EndPin (useful for "summary" pins on a
  539. # collapsed group).
  540. #
  541. # Minimal example (C++):
  542. #
  543. # ed::BeginNode(groupId);
  544. # ImGui::TextUnformatted("My Group");
  545. # ed::Group(ImVec2(300, 200)); // initial size only
  546. # ed::EndNode();
  547. #
  548. # Minimal example (Python):
  549. #
  550. # ed.begin_node(group_id)
  551. # imgui.text_unformatted("My Group")
  552. # ed.group(imgui.ImVec2(300, 200)) # initial size only
  553. # ed.end_node()
  554. #
  555. # To find the nodes contained in a group, use the editor's geometry getters
  556. # (no internal API needed): get the group's GetNodePosition / GetNodeSize,
  557. # then for each candidate node test whether its center sits inside the
  558. # group's rectangle.
  559. #
  560. # IMGUI_NODE_EDITOR_API void Group(const ImVec2& size); /* original C++ signature */
  561. def group(size: ImVec2Like) -> None:
  562. pass
  563. # IMGUI_NODE_EDITOR_API void EndNode(); /* original C++ signature */
  564. def end_node() -> None:
  565. pass
  566. # --- Group hints ----------------------------------------------------------
  567. #
  568. # A "group hint" is overlay UI that the editor renders ONLY when zoomed out
  569. # far enough that the in-node title becomes hard to read. BeginGroupHint
  570. # returns False at normal zoom; it returns True and fades in below ~0.75x.
  571. # The intended use is to draw a large title above the group so users can
  572. # still identify it at low zoom.
  573. #
  574. # GetGroupMin / GetGroupMax return the targeted group's bounds in SCREEN
  575. # coordinates so you can position your overlay relative to it.
  576. # GetHintForegroundDrawList / GetHintBackgroundDrawList return draw lists
  577. # that sit above (foreground) and below (background) the editor's normal
  578. # content, so your overlay isn't clipped by the canvas.
  579. #
  580. # Minimal example (C++):
  581. #
  582. # if (ed::BeginGroupHint(groupId))
  583. # {
  584. # ImVec2 min = ed::GetGroupMin();
  585. # auto* fg = ed::GetHintForegroundDrawList();
  586. # fg->AddText(ImVec2(min.x, min.y - 24.0),
  587. # ImGui::GetColorU32(ImGuiCol_Text),
  588. # "My Group");
  589. # }
  590. # ed::EndGroupHint();
  591. #
  592. # Minimal example (Python):
  593. #
  594. # if ed.begin_group_hint(group_id):
  595. # min_ = ed.get_group_min()
  596. # fg = ed.get_hint_foreground_draw_list()
  597. # fg.add_text(imgui.ImVec2(min_.x, min_.y - 24.0),
  598. # imgui.get_color_u32(imgui.Col_.text.value),
  599. # "My Group")
  600. # ed.end_group_hint()
  601. #
  602. # IMGUI_NODE_EDITOR_API bool BeginGroupHint(NodeId nodeId); /* original C++ signature */
  603. def begin_group_hint(node_id: NodeId) -> bool:
  604. pass
  605. # IMGUI_NODE_EDITOR_API ImVec2 GetGroupMin(); /* original C++ signature */
  606. def get_group_min() -> ImVec2:
  607. pass
  608. # IMGUI_NODE_EDITOR_API ImVec2 GetGroupMax(); /* original C++ signature */
  609. def get_group_max() -> ImVec2:
  610. pass
  611. # IMGUI_NODE_EDITOR_API ImDrawList* GetHintForegroundDrawList(); /* original C++ signature */
  612. def get_hint_foreground_draw_list() -> ImDrawList:
  613. pass
  614. # IMGUI_NODE_EDITOR_API ImDrawList* GetHintBackgroundDrawList(); /* original C++ signature */
  615. def get_hint_background_draw_list() -> ImDrawList:
  616. pass
  617. # IMGUI_NODE_EDITOR_API void EndGroupHint(); /* original C++ signature */
  618. def end_group_hint() -> None:
  619. pass
  620. # IMGUI_NODE_EDITOR_API ImDrawList* GetNodeBackgroundDrawList(NodeId nodeId); /* original C++ signature */
  621. def get_node_background_draw_list(node_id: NodeId) -> ImDrawList:
  622. """Returns the draw list used for the node's BACKGROUND layer (drawn under
  623. the node's content). Useful to add badges, highlights, etc. behind a node.
  624. TODO: Add a way to manage node background channels
  625. """
  626. pass
  627. # IMGUI_NODE_EDITOR_API bool Link(LinkId id, PinId startPinId, PinId endPinId, const ImVec4& color = ImVec4(0, 0, 0, 0), float thickness = 1.0f); /* original C++ signature */
  628. def link(
  629. id: LinkId,
  630. start_pin_id: PinId,
  631. end_pin_id: PinId,
  632. color: Optional[ImVec4Like] = None,
  633. thickness: float = 1.0,
  634. ) -> bool:
  635. """Declares an existing link between two pins. Call once per frame for every
  636. link you want shown. Returns True if the link is currently visible/active.
  637. `color` default is the sentinel ImVec4(0,0,0,0) ("auto"): when alpha is 0
  638. the implementation substitutes the current ImGuiCol_Text, so links stay
  639. readable on both light and dark themes. Pass any non-zero-alpha color to
  640. override.
  641. Python bindings defaults:
  642. If color is None, then its default value will be: ImVec4(0, 0, 0, 0)
  643. """
  644. pass
  645. # IMGUI_NODE_EDITOR_API void Flow(LinkId linkId, FlowDirection direction = FlowDirection::Forward); /* original C++ signature */
  646. def flow(link_id: LinkId, direction: FlowDirection = FlowDirection.forward) -> None:
  647. """Trigger a one-shot animated "flow" pulse along a link. Calling this once
  648. is enough; the editor handles the time-bounded animation internally.
  649. """
  650. pass
  651. # --- Item creation (drag-out new link / new node) ------------------------
  652. # Interaction protocol fired while the user drags a link from a pin:
  653. #
  654. # if (BeginCreate()) {
  655. # PinId a, b;
  656. # if (QueryNewLink(&a, &b)) { // user is hovering a candidate endpoint
  657. # if (/* link a->b is invalid */)
  658. # RejectNewItem(); // shows red feedback
  659. # else if (AcceptNewItem()) // returns True on mouse-release
  660. # /* commit the new link to your data model */;
  661. # }
  662. # if (QueryNewNode(&a)) { // user dragged a link into empty space
  663. # if (AcceptNewItem()) // -> typical UX: open a "Add node" popup
  664. # /* spawn a new node and connect pin `a` to one of its pins */;
  665. # }
  666. # }
  667. # EndCreate();
  668. #
  669. # The QueryNewLink/QueryNewNode/AcceptNewItem overloads taking a color and
  670. # thickness customize the in-progress link's drawing while the user drags.
  671. # IMGUI_NODE_EDITOR_API bool BeginCreate(const ImVec4& color = ImVec4(0, 0, 0, 0), float thickness = 1.0f); /* original C++ signature */
  672. def begin_create(color: Optional[ImVec4Like] = None, thickness: float = 1.0) -> bool:
  673. """Python bindings defaults:
  674. If color is None, then its default value will be: ImVec4(0, 0, 0, 0)
  675. """
  676. pass
  677. # IMGUI_NODE_EDITOR_API bool QueryNewLink(PinId* startId, PinId* endId); /* original C++ signature */
  678. @overload
  679. def query_new_link(start_id: PinId, end_id: PinId) -> bool:
  680. pass
  681. # IMGUI_NODE_EDITOR_API bool QueryNewLink(PinId* startId, PinId* endId, const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
  682. @overload
  683. def query_new_link(
  684. start_id: PinId, end_id: PinId, color: ImVec4Like, thickness: float = 1.0
  685. ) -> bool:
  686. pass
  687. # IMGUI_NODE_EDITOR_API bool QueryNewNode(PinId* pinId); /* original C++ signature */
  688. @overload
  689. def query_new_node(pin_id: PinId) -> bool:
  690. pass
  691. # IMGUI_NODE_EDITOR_API bool QueryNewNode(PinId* pinId, const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
  692. @overload
  693. def query_new_node(pin_id: PinId, color: ImVec4Like, thickness: float = 1.0) -> bool:
  694. pass
  695. # IMGUI_NODE_EDITOR_API bool AcceptNewItem(); /* original C++ signature */
  696. @overload
  697. def accept_new_item() -> bool:
  698. pass
  699. # IMGUI_NODE_EDITOR_API bool AcceptNewItem(const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
  700. @overload
  701. def accept_new_item(color: ImVec4Like, thickness: float = 1.0) -> bool:
  702. pass
  703. # IMGUI_NODE_EDITOR_API void RejectNewItem(); /* original C++ signature */
  704. @overload
  705. def reject_new_item() -> None:
  706. pass
  707. # IMGUI_NODE_EDITOR_API void RejectNewItem(const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
  708. @overload
  709. def reject_new_item(color: ImVec4Like, thickness: float = 1.0) -> None:
  710. pass
  711. # IMGUI_NODE_EDITOR_API void EndCreate(); /* original C++ signature */
  712. def end_create() -> None:
  713. pass
  714. # --- Item deletion (Delete key, "Delete" context-menu, etc.) -------------
  715. # Interaction protocol that yields the things the user wants to delete this
  716. # frame. You decide whether to honor each one:
  717. #
  718. # if (BeginDelete()) {
  719. # LinkId l;
  720. # while (QueryDeletedLink(&l))
  721. # if (AcceptDeletedItem()) /* remove link from your model */;
  722. # NodeId n;
  723. # while (QueryDeletedNode(&n))
  724. # if (AcceptDeletedItem()) /* remove node and its links */;
  725. # }
  726. # EndDelete();
  727. #
  728. # `deleteDependencies = True` (the default for AcceptDeletedItem) tells the
  729. # editor to also enqueue links touching the accepted node, so a subsequent
  730. # QueryDeletedLink call yields them too.
  731. # IMGUI_NODE_EDITOR_API bool BeginDelete(); /* original C++ signature */
  732. def begin_delete() -> bool:
  733. pass
  734. # IMGUI_NODE_EDITOR_API bool QueryDeletedLink(LinkId* linkId, PinId* startId = nullptr, PinId* endId = nullptr); /* original C++ signature */
  735. def query_deleted_link(
  736. link_id: LinkId, start_id: Optional[PinId] = None, end_id: Optional[PinId] = None
  737. ) -> bool:
  738. pass
  739. # IMGUI_NODE_EDITOR_API bool QueryDeletedNode(NodeId* nodeId); /* original C++ signature */
  740. def query_deleted_node(node_id: NodeId) -> bool:
  741. pass
  742. # IMGUI_NODE_EDITOR_API bool AcceptDeletedItem(bool deleteDependencies = true); /* original C++ signature */
  743. def accept_deleted_item(delete_dependencies: bool = True) -> bool:
  744. pass
  745. # IMGUI_NODE_EDITOR_API void RejectDeletedItem(); /* original C++ signature */
  746. def reject_deleted_item() -> None:
  747. pass
  748. # IMGUI_NODE_EDITOR_API void EndDelete(); /* original C++ signature */
  749. def end_delete() -> None:
  750. pass
  751. # --- Node geometry --------------------------------------------------------
  752. # Positions and sizes are in EDITOR (canvas) space, not screen space. Use
  753. # CanvasToScreen / ScreenToCanvas to convert.
  754. # GetNodeSize returns (0,0) on the very first frame a node is drawn (the
  755. # editor has no measurement yet). It stabilizes immediately after.
  756. # CenterNodeOnScreen moves the node so it lands at the center of the view.
  757. # IMGUI_NODE_EDITOR_API void SetNodePosition(NodeId nodeId, const ImVec2& editorPosition); /* original C++ signature */
  758. def set_node_position(node_id: NodeId, editor_position: ImVec2Like) -> None:
  759. pass
  760. # IMGUI_NODE_EDITOR_API void SetGroupSize(NodeId nodeId, const ImVec2& size); /* original C++ signature */
  761. def set_group_size(node_id: NodeId, size: ImVec2Like) -> None:
  762. pass
  763. # IMGUI_NODE_EDITOR_API ImVec2 GetNodePosition(NodeId nodeId); /* original C++ signature */
  764. def get_node_position(node_id: NodeId) -> ImVec2:
  765. pass
  766. # IMGUI_NODE_EDITOR_API ImVec2 GetNodeSize(NodeId nodeId); /* original C++ signature */
  767. def get_node_size(node_id: NodeId) -> ImVec2:
  768. pass
  769. # IMGUI_NODE_EDITOR_API void CenterNodeOnScreen(NodeId nodeId); /* original C++ signature */
  770. def center_node_on_screen(node_id: NodeId) -> None:
  771. pass
  772. # IMGUI_NODE_EDITOR_API void SetNodeZPosition(NodeId nodeId, float z); /* original C++ signature */
  773. def set_node_z_position(node_id: NodeId, z: float) -> None:
  774. """Sets node z position, nodes with higher value are drawn over nodes with lower value"""
  775. pass
  776. # IMGUI_NODE_EDITOR_API float GetNodeZPosition(NodeId nodeId); /* original C++ signature */
  777. def get_node_z_position(node_id: NodeId) -> float:
  778. """Returns node z position, defaults is 0.0"""
  779. pass
  780. # IMGUI_NODE_EDITOR_API void RestoreNodeState(NodeId nodeId); /* original C++ signature */
  781. def restore_node_state(node_id: NodeId) -> None:
  782. """Re-load the node's position/size from the editor's persisted settings
  783. (the SettingsFile, if any). Useful right after creating a node whose
  784. previous layout you want to bring back without the user having to drag it.
  785. """
  786. pass
  787. # --- Suspend / Resume -----------------------------------------------------
  788. # Temporarily disable the editor's input/canvas state machine. You MUST
  789. # suspend before calling ImGui popup APIs like ImGui::OpenPopup or
  790. # ImGui::BeginPopup that should appear ABOVE the canvas (otherwise the
  791. # popup's coordinates and event capture will be wrong). Resume() restores
  792. # editor input handling. See the ShowNodeContextMenu example below.
  793. # IMGUI_NODE_EDITOR_API void Suspend(); /* original C++ signature */
  794. def suspend() -> None:
  795. pass
  796. # IMGUI_NODE_EDITOR_API void Resume(); /* original C++ signature */
  797. def resume() -> None:
  798. pass
  799. # IMGUI_NODE_EDITOR_API bool IsSuspended(); /* original C++ signature */
  800. def is_suspended() -> bool:
  801. pass
  802. # IMGUI_NODE_EDITOR_API bool IsActive(); /* original C++ signature */
  803. def is_active() -> bool:
  804. """True while the editor is processing user input this frame (drag, select,
  805. pan, zoom, link-create, etc.).
  806. """
  807. pass
  808. # --- Selection ------------------------------------------------------------
  809. # HasSelectionChanged returns True for one frame after the selection set
  810. # changed (use it to react to selection changes once, not every frame).
  811. # SelectNode/SelectLink with append=False replaces the current selection.
  812. # IMGUI_NODE_EDITOR_API bool HasSelectionChanged(); /* original C++ signature */
  813. def has_selection_changed() -> bool:
  814. pass
  815. # IMGUI_NODE_EDITOR_API int GetSelectedObjectCount(); /* original C++ signature */
  816. def get_selected_object_count() -> int:
  817. pass
  818. # #ifdef IMGUI_BUNDLE_PYTHON_API
  819. #
  820. # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetSelectedNodes(); /* original C++ signature */
  821. def get_selected_nodes() -> List[NodeId]:
  822. pass
  823. # IMGUI_NODE_EDITOR_API std::vector<LinkId> GetSelectedLinks(); /* original C++ signature */
  824. def get_selected_links() -> List[LinkId]:
  825. pass
  826. # #endif
  827. #
  828. # IMGUI_NODE_EDITOR_API bool IsNodeSelected(NodeId nodeId); /* original C++ signature */
  829. def is_node_selected(node_id: NodeId) -> bool:
  830. pass
  831. # IMGUI_NODE_EDITOR_API bool IsLinkSelected(LinkId linkId); /* original C++ signature */
  832. def is_link_selected(link_id: LinkId) -> bool:
  833. pass
  834. # IMGUI_NODE_EDITOR_API void ClearSelection(); /* original C++ signature */
  835. def clear_selection() -> None:
  836. pass
  837. # IMGUI_NODE_EDITOR_API void SelectNode(NodeId nodeId, bool append = false); /* original C++ signature */
  838. def select_node(node_id: NodeId, append: bool = False) -> None:
  839. pass
  840. # IMGUI_NODE_EDITOR_API void SelectLink(LinkId linkId, bool append = false); /* original C++ signature */
  841. def select_link(link_id: LinkId, append: bool = False) -> None:
  842. pass
  843. # IMGUI_NODE_EDITOR_API void DeselectNode(NodeId nodeId); /* original C++ signature */
  844. def deselect_node(node_id: NodeId) -> None:
  845. pass
  846. # IMGUI_NODE_EDITOR_API void DeselectLink(LinkId linkId); /* original C++ signature */
  847. def deselect_link(link_id: LinkId) -> None:
  848. pass
  849. # Programmatically queue a node/link for deletion. The next BeginDelete()
  850. # loop will yield it via QueryDeletedNode/QueryDeletedLink.
  851. # IMGUI_NODE_EDITOR_API bool DeleteNode(NodeId nodeId); /* original C++ signature */
  852. def delete_node(node_id: NodeId) -> bool:
  853. pass
  854. # IMGUI_NODE_EDITOR_API bool DeleteLink(LinkId linkId); /* original C++ signature */
  855. def delete_link(link_id: LinkId) -> bool:
  856. pass
  857. # IMGUI_NODE_EDITOR_API bool HasAnyLinks(NodeId nodeId); /* original C++ signature */
  858. @overload
  859. def has_any_links(node_id: NodeId) -> bool:
  860. """Returns True if node has any link connected"""
  861. pass
  862. # IMGUI_NODE_EDITOR_API bool HasAnyLinks(PinId pinId); /* original C++ signature */
  863. @overload
  864. def has_any_links(pin_id: PinId) -> bool:
  865. """Return True if pin has any link connected"""
  866. pass
  867. # IMGUI_NODE_EDITOR_API int BreakLinks(NodeId nodeId); /* original C++ signature */
  868. @overload
  869. def break_links(node_id: NodeId) -> int:
  870. """Break all links connected to this node"""
  871. pass
  872. # IMGUI_NODE_EDITOR_API int BreakLinks(PinId pinId); /* original C++ signature */
  873. @overload
  874. def break_links(pin_id: PinId) -> int:
  875. """Break all links connected to this pin"""
  876. pass
  877. # --- Navigation -----------------------------------------------------------
  878. # Programmatic equivalents of pressing F (with no modifier and with Shift).
  879. # `duration` is the animation length in seconds; -1 means "use the editor
  880. # default". NavigateToSelection requires a non-empty selection.
  881. # IMGUI_NODE_EDITOR_API void NavigateToContent(float duration = -1); /* original C++ signature */
  882. def navigate_to_content(duration: float = -1) -> None:
  883. pass
  884. # IMGUI_NODE_EDITOR_API void NavigateToSelection(bool zoomIn = false, float duration = -1); /* original C++ signature */
  885. def navigate_to_selection(zoom_in: bool = False, duration: float = -1) -> None:
  886. pass
  887. # Shows context menu for node, link or background
  888. # Typical usage (this should happen inside ed::Begin/ed::End block):
  889. # ed::Begin();
  890. # ... (Show nodes)
  891. # ed::Suspend();
  892. # if (ed::ShowNodeContextMenu(&contextNodeId))
  893. # ImGui::OpenPopup("Node Context Menu");
  894. # ed::Resume();
  895. # ...
  896. # ed::Suspend();
  897. # if (ImGui::BeginPopup("Node Context Menu"))
  898. # {
  899. # ImGui::Text("Node Context Menu, node ID: %d", contextNodeId);
  900. # ImGui::EndPopup();
  901. # }
  902. # ed::Resume();
  903. # ...
  904. # ed::End();
  905. # IMGUI_NODE_EDITOR_API bool ShowNodeContextMenu(NodeId* nodeId); /* original C++ signature */
  906. def show_node_context_menu(node_id: NodeId) -> bool:
  907. pass
  908. # IMGUI_NODE_EDITOR_API bool ShowPinContextMenu(PinId* pinId); /* original C++ signature */
  909. def show_pin_context_menu(pin_id: PinId) -> bool:
  910. pass
  911. # IMGUI_NODE_EDITOR_API bool ShowLinkContextMenu(LinkId* linkId); /* original C++ signature */
  912. def show_link_context_menu(link_id: LinkId) -> bool:
  913. pass
  914. # IMGUI_NODE_EDITOR_API bool ShowBackgroundContextMenu(); /* original C++ signature */
  915. def show_background_context_menu() -> bool:
  916. pass
  917. # --- Keyboard shortcuts ---------------------------------------------------
  918. # Master switch: when disabled the editor never reacts to F / Ctrl+X /
  919. # Ctrl+C / Ctrl+V / Ctrl+D / Space etc. Useful when an ImGui text input
  920. # has focus and you want shortcuts ignored.
  921. # IMGUI_NODE_EDITOR_API void EnableShortcuts(bool enable); /* original C++ signature */
  922. def enable_shortcuts(enable: bool) -> None:
  923. pass
  924. # IMGUI_NODE_EDITOR_API bool AreShortcutsEnabled(); /* original C++ signature */
  925. def are_shortcuts_enabled() -> bool:
  926. pass
  927. # --- Shortcut handling protocol ------------------------------------------
  928. # Lets you ASK the editor which keyboard shortcut fired this frame and
  929. # respond to it. Pattern (inside Begin/End):
  930. #
  931. # if (BeginShortcut()) {
  932. # if (AcceptCopy()) /* user pressed Ctrl+C: copy selection */;
  933. # if (AcceptPaste()) /* user pressed Ctrl+V: paste at mouse */;
  934. # if (AcceptCut()) /* user pressed Ctrl+X */;
  935. # if (AcceptDuplicate()) /* user pressed Ctrl+D */;
  936. # if (AcceptCreateNode()) /* user dragged a link out into empty space */;
  937. # }
  938. # EndShortcut();
  939. #
  940. # GetActionContextNodes / GetActionContextLinks return the objects the
  941. # shortcut applies to (typically the current selection at the moment the
  942. # shortcut fired). They are valid only between Begin/EndShortcut.
  943. # IMGUI_NODE_EDITOR_API bool BeginShortcut(); /* original C++ signature */
  944. def begin_shortcut() -> bool:
  945. pass
  946. # IMGUI_NODE_EDITOR_API bool AcceptCut(); /* original C++ signature */
  947. def accept_cut() -> bool:
  948. pass
  949. # IMGUI_NODE_EDITOR_API bool AcceptCopy(); /* original C++ signature */
  950. def accept_copy() -> bool:
  951. pass
  952. # IMGUI_NODE_EDITOR_API bool AcceptPaste(); /* original C++ signature */
  953. def accept_paste() -> bool:
  954. pass
  955. # IMGUI_NODE_EDITOR_API bool AcceptDuplicate(); /* original C++ signature */
  956. def accept_duplicate() -> bool:
  957. pass
  958. # IMGUI_NODE_EDITOR_API bool AcceptCreateNode(); /* original C++ signature */
  959. def accept_create_node() -> bool:
  960. pass
  961. # IMGUI_NODE_EDITOR_API int GetActionContextSize(); /* original C++ signature */
  962. def get_action_context_size() -> int:
  963. pass
  964. # #ifdef IMGUI_BUNDLE_PYTHON_API
  965. #
  966. # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetActionContextNodes(); /* original C++ signature */
  967. def get_action_context_nodes() -> List[NodeId]:
  968. pass
  969. # IMGUI_NODE_EDITOR_API std::vector<LinkId> GetActionContextLinks(); /* original C++ signature */
  970. def get_action_context_links() -> List[LinkId]:
  971. pass
  972. # #endif
  973. #
  974. # IMGUI_NODE_EDITOR_API void EndShortcut(); /* original C++ signature */
  975. def end_shortcut() -> None:
  976. pass
  977. # IMGUI_NODE_EDITOR_API float GetCurrentZoom(); /* original C++ signature */
  978. def get_current_zoom() -> float:
  979. """Current canvas zoom factor; 1.0 = 100%."""
  980. pass
  981. # --- Input queries (call between Begin and End) ---------------------------
  982. # These return the object under the mouse this frame (NodeId/PinId/LinkId,
  983. # 0 if none) and which buttons were clicked or double-clicked on the empty
  984. # background. The "BackgroundClick" pair returns -1 when no click happened.
  985. # IMGUI_NODE_EDITOR_API NodeId GetHoveredNode(); /* original C++ signature */
  986. def get_hovered_node() -> NodeId:
  987. pass
  988. # IMGUI_NODE_EDITOR_API PinId GetHoveredPin(); /* original C++ signature */
  989. def get_hovered_pin() -> PinId:
  990. pass
  991. # IMGUI_NODE_EDITOR_API LinkId GetHoveredLink(); /* original C++ signature */
  992. def get_hovered_link() -> LinkId:
  993. pass
  994. # IMGUI_NODE_EDITOR_API NodeId GetDoubleClickedNode(); /* original C++ signature */
  995. def get_double_clicked_node() -> NodeId:
  996. pass
  997. # IMGUI_NODE_EDITOR_API PinId GetDoubleClickedPin(); /* original C++ signature */
  998. def get_double_clicked_pin() -> PinId:
  999. pass
  1000. # IMGUI_NODE_EDITOR_API LinkId GetDoubleClickedLink(); /* original C++ signature */
  1001. def get_double_clicked_link() -> LinkId:
  1002. pass
  1003. # IMGUI_NODE_EDITOR_API bool IsBackgroundClicked(); /* original C++ signature */
  1004. def is_background_clicked() -> bool:
  1005. pass
  1006. # IMGUI_NODE_EDITOR_API bool IsBackgroundDoubleClicked(); /* original C++ signature */
  1007. def is_background_double_clicked() -> bool:
  1008. pass
  1009. # IMGUI_NODE_EDITOR_API ImGuiMouseButton GetBackgroundClickButtonIndex(); /* original C++ signature */
  1010. def get_background_click_button_index() -> ImGuiMouseButton:
  1011. """-1 if none"""
  1012. pass
  1013. # IMGUI_NODE_EDITOR_API ImGuiMouseButton GetBackgroundDoubleClickButtonIndex(); /* original C++ signature */
  1014. def get_background_double_click_button_index() -> ImGuiMouseButton:
  1015. """-1 if none"""
  1016. pass
  1017. # IMGUI_NODE_EDITOR_API bool GetLinkPins(LinkId linkId, PinId* startPinId, PinId* endPinId); /* original C++ signature */
  1018. def get_link_pins(link_id: LinkId, start_pin_id: PinId, end_pin_id: PinId) -> bool:
  1019. """pass None if particular pin do not interest you"""
  1020. pass
  1021. # IMGUI_NODE_EDITOR_API bool PinHadAnyLinks(PinId pinId); /* original C++ signature */
  1022. def pin_had_any_links(pin_id: PinId) -> bool:
  1023. """True if the pin was ever connected to a link in its lifetime, even if it
  1024. is currently disconnected.
  1025. """
  1026. pass
  1027. # --- Coordinate conversion ------------------------------------------------
  1028. # SCREEN coords are pixels in the OS window. CANVAS coords are the editor's
  1029. # virtual space (what GetNodePosition / SetNodePosition use). The two
  1030. # differ by the current pan + zoom transform.
  1031. # IMGUI_NODE_EDITOR_API ImVec2 GetScreenSize(); /* original C++ signature */
  1032. def get_screen_size() -> ImVec2:
  1033. pass
  1034. # IMGUI_NODE_EDITOR_API ImVec2 ScreenToCanvas(const ImVec2& pos); /* original C++ signature */
  1035. def screen_to_canvas(pos: ImVec2Like) -> ImVec2:
  1036. pass
  1037. # IMGUI_NODE_EDITOR_API ImVec2 CanvasToScreen(const ImVec2& pos); /* original C++ signature */
  1038. def canvas_to_screen(pos: ImVec2Like) -> ImVec2:
  1039. pass
  1040. # IMGUI_NODE_EDITOR_API int GetNodeCount(); /* original C++ signature */
  1041. def get_node_count() -> int:
  1042. """Returns number of submitted nodes since Begin() call"""
  1043. pass
  1044. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1045. #
  1046. # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetOrderedNodeIds(); /* original C++ signature */
  1047. def get_ordered_node_ids() -> List[NodeId]:
  1048. """Fills an array with node id's in order they're drawn"""
  1049. pass
  1050. # #endif
  1051. #
  1052. # ------------------------------------------------------------------------------
  1053. # ------------------------------------------------------------------------------
  1054. # ------------------------------------------------------------------------------
  1055. # # endif
  1056. #################### </generated_from:imgui_node_editor.h> ####################
  1057. #################### <generated_from:node_editor_default_context.h> ####################
  1058. # IMGUI_NODE_EDITOR_API NodeEditorContext* DefaultNodeEditorContext_Immapp(); /* original C++ signature */
  1059. def default_node_editor_context_immapp() -> NodeEditorContext:
  1060. pass
  1061. # IMGUI_NODE_EDITOR_API void SuspendNodeEditorCanvas_Immapp(); /* original C++ signature */
  1062. def suspend_node_editor_canvas_immapp() -> None:
  1063. pass
  1064. # IMGUI_NODE_EDITOR_API void ResumeNodeEditorCanvas_Immapp(); /* original C++ signature */
  1065. def resume_node_editor_canvas_immapp() -> None:
  1066. pass
  1067. # IMGUI_NODE_EDITOR_API void DisableUserInputThisFrame(); /* original C++ signature */
  1068. def disable_user_input_this_frame() -> None:
  1069. pass
  1070. # IMGUI_NODE_EDITOR_API void UpdateNodeEditorColorsFromImguiColors(); /* original C++ signature */
  1071. def update_node_editor_colors_from_imgui_colors() -> None:
  1072. pass
  1073. #################### </generated_from:node_editor_default_context.h> ####################
  1074. # </litgen_stub> // Autogenerated code end!