| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244 |
- ###############################################################################
- # This file is a part of Dear ImGui Bundle, NOT a part of imgui-node-editor
- # -----------------------------------------------------------------------------
- # imgui_node_editor.pyi: auto-generated bindings for imgui-node-editor,
- # a Node editor built using ImGui. See https://github.com/thedmd/imgui-node-editor
- #
- # Most of the code of this file is automatically generated (using https://pthom.github.io/litgen/),
- # and is generally very close to the C++ version. Comments, docs are identical.
- # Do not manually edit the autogenerated parts (look for "Autogenerated" comments)!
- ###############################################################################
- # ruff: noqa: B008
- from typing import Any, Optional, List, overload
- import enum
- from imgui_bundle.imgui import ImVec2, ImVec4, ImDrawList, ImVec2Like, ImVec4Like
- from imgui_bundle import imgui
- ImGuiMouseButton = imgui.MouseButton
- EditorContext = Any
- NodeEditorContext = Any
- class NodeId:
- def __init__(self, id: int = 0):
- pass
- def id(self) -> int:
- pass
- @staticmethod
- def create() -> NodeId:
- """Creates a new NodeId with a unique id
- Create your node once per session, not at each frame!
- """
- pass
- class LinkId:
- def __init__(self, id: int = 0):
- pass
- def id(self) -> int:
- pass
- @staticmethod
- def create() -> LinkId:
- """Creates a new LinkId with a unique id
- Create your node once per session, not at each frame!
- """
- pass
- class PinId:
- def __init__(self, id: int = 0):
- pass
- def id(self) -> int:
- pass
- @staticmethod
- def create() -> PinId:
- """Creates a new NodeId with a unique id
- Create your node once per session, not at each frame!
- """
- pass
- # Suspends canvas by returning to normal ImGui transformation space.
- # While suspended UI will not be drawn on canvas plane.
- #
- # Calls to Suspend()/Resume() are symmetrical. Each call to Suspend()
- # must be matched with call to Resume().
- def suspend_editor_canvas() -> None:
- pass
- def resume_editor_canvas() -> None:
- pass
- # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- # <litgen_stub> // Autogenerated code below! Do not edit!
- #################### <generated_from:imgui_node_editor.h> ####################
- # ------------------------------------------------------------------------------
- # VERSION 0.9.1
- #
- # LICENSE
- # This software is dual-licensed to the public domain and under the following
- # license: you are granted a perpetual, irrevocable license to copy, modify,
- # publish, and distribute this file as you see fit.
- #
- # CREDITS
- # Written by Michal Cichon
- # ------------------------------------------------------------------------------
- # # ifndef __IMGUI_NODE_EDITOR_H__
- #
- #
- # Adaptations for ImGui Bundle are noted with [ADAPT_IMGUI_BUNDLE]
- #
- # [ADAPT_IMGUI_BUNDLE]
- # #ifdef IMGUI_BUNDLE_PYTHON_API
- #
- # #endif
- #
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- class PinKind(enum.IntEnum):
- """------------------------------------------------------------------------------"""
- # Input, /* original C++ signature */
- input = enum.auto() # (= 0)
- # Output /* original C++ signature */
- # }
- output = enum.auto() # (= 1)
- class FlowDirection(enum.IntEnum):
- # Forward, /* original C++ signature */
- forward = enum.auto() # (= 0)
- # Backward /* original C++ signature */
- # }
- backward = enum.auto() # (= 1)
- class CanvasSizeMode(enum.IntEnum):
- # FitVerticalView, /* original C++ signature */
- fit_vertical_view = (
- enum.auto()
- ) # (= 0) # Previous view will be scaled to fit new view on Y axis
- # FitHorizontalView, /* original C++ signature */
- fit_horizontal_view = (
- enum.auto()
- ) # (= 1) # Previous view will be scaled to fit new view on X axis
- # CenterOnly, /* original C++ signature */
- center_only = enum.auto() # (= 2) # Previous view will be centered on new view
- class SaveReasonFlags(enum.IntEnum):
- """------------------------------------------------------------------------------"""
- # None = 0x00000000, /* original C++ signature */
- none = enum.auto() # (= 0x00000000)
- # Navigation = 0x00000001, /* original C++ signature */
- navigation = enum.auto() # (= 0x00000001)
- # Position = 0x00000002, /* original C++ signature */
- position = enum.auto() # (= 0x00000002)
- # Size = 0x00000004, /* original C++ signature */
- size = enum.auto() # (= 0x00000004)
- # Selection = 0x00000008, /* original C++ signature */
- selection = enum.auto() # (= 0x00000008)
- # AddNode = 0x00000010, /* original C++ signature */
- add_node = enum.auto() # (= 0x00000010)
- # RemoveNode = 0x00000020, /* original C++ signature */
- remove_node = enum.auto() # (= 0x00000020)
- # User = 0x00000040 /* original C++ signature */
- # }
- user = enum.auto() # (= 0x00000040)
- class Config:
- # std::string SettingsFile; /* original C++ signature */
- settings_file: str
- # void* UserPointer; /* original C++ signature */
- user_pointer: Any
- # CanvasSizeModeAlias CanvasSizeMode; /* original C++ signature */
- canvas_size_mode: CanvasSizeMode
- # int DragButtonIndex; /* original C++ signature */
- drag_button_index: (
- int # Mouse button index drag action will react to (0-left, 1-right, 2-middle)
- )
- # int SelectButtonIndex; /* original C++ signature */
- select_button_index: int # Mouse button index select action will react to (0-left, 1-right, 2-middle)
- # int NavigateButtonIndex; /* original C++ signature */
- navigate_button_index: int # Mouse button index navigate action will react to (0-left, 1-right, 2-middle)
- # int ContextMenuButtonIndex; /* original C++ signature */
- context_menu_button_index: int # Mouse button index context menu action will react to (0-left, 1-right, 2-middle)
- # bool EnableSmoothZoom; /* original C++ signature */
- enable_smooth_zoom: bool
- # float SmoothZoomPower; /* original C++ signature */
- smooth_zoom_power: float
- # bool ForceWindowContentWidthToNodeWidth; /* original C++ signature */
- # [ADAPT_IMGUI_BUNDLE]
- #
- # By default, ImGui::TextWrapped() and ImGui::Separator(), and ImGui::SliderXXX
- # will not work in a Node because they will not respect the node's bounds.
- # Instead, they will use the width of the whole window.
- # Set ForceWindowContentWidthToNodeWidth to True to fix this (this is disabled by default).
- force_window_content_width_to_node_width: bool
- # Config() /* original C++ signature */
- # : SettingsFile("NodeEditor.json")
- # , BeginSaveSession(nullptr)
- # , EndSaveSession(nullptr)
- # , SaveSettings(nullptr)
- # , LoadSettings(nullptr)
- # , SaveNodeSettings(nullptr)
- # , LoadNodeSettings(nullptr)
- # , UserPointer(nullptr)
- # , CustomZoomLevels()
- # , CanvasSizeMode(CanvasSizeModeAlias::FitVerticalView)
- # , DragButtonIndex(0)
- # , SelectButtonIndex(0)
- # , NavigateButtonIndex(1)
- # , ContextMenuButtonIndex(1)
- # , EnableSmoothZoom(true)
- # # ifdef __APPLE__
- # , SmoothZoomPower(1.1f)
- # # else
- # , SmoothZoomPower(1.3f)
- # # endif
- # , ForceWindowContentWidthToNodeWidth(false)
- # {
- # }
- def __init__(self) -> None:
- pass
- class StyleColor(enum.IntEnum):
- """------------------------------------------------------------------------------"""
- # StyleColor_Bg, /* original C++ signature */
- bg = enum.auto() # (= 0)
- # StyleColor_Grid, /* original C++ signature */
- grid = enum.auto() # (= 1)
- # StyleColor_NodeBg, /* original C++ signature */
- node_bg = enum.auto() # (= 2)
- # StyleColor_NodeBorder, /* original C++ signature */
- node_border = enum.auto() # (= 3)
- # StyleColor_HovNodeBorder, /* original C++ signature */
- hov_node_border = enum.auto() # (= 4)
- # StyleColor_SelNodeBorder, /* original C++ signature */
- sel_node_border = enum.auto() # (= 5)
- # StyleColor_NodeSelRect, /* original C++ signature */
- node_sel_rect = enum.auto() # (= 6)
- # StyleColor_NodeSelRectBorder, /* original C++ signature */
- node_sel_rect_border = enum.auto() # (= 7)
- # StyleColor_HovLinkBorder, /* original C++ signature */
- hov_link_border = enum.auto() # (= 8)
- # StyleColor_SelLinkBorder, /* original C++ signature */
- sel_link_border = enum.auto() # (= 9)
- # StyleColor_HighlightLinkBorder, /* original C++ signature */
- highlight_link_border = enum.auto() # (= 10)
- # StyleColor_LinkSelRect, /* original C++ signature */
- link_sel_rect = enum.auto() # (= 11)
- # StyleColor_LinkSelRectBorder, /* original C++ signature */
- link_sel_rect_border = enum.auto() # (= 12)
- # StyleColor_PinRect, /* original C++ signature */
- pin_rect = enum.auto() # (= 13)
- # StyleColor_PinRectBorder, /* original C++ signature */
- pin_rect_border = enum.auto() # (= 14)
- # StyleColor_Flow, /* original C++ signature */
- flow = enum.auto() # (= 15)
- # StyleColor_FlowMarker, /* original C++ signature */
- flow_marker = enum.auto() # (= 16)
- # StyleColor_GroupBg, /* original C++ signature */
- group_bg = enum.auto() # (= 17)
- # StyleColor_GroupBorder, /* original C++ signature */
- group_border = enum.auto() # (= 18)
- # StyleColor_Count /* original C++ signature */
- # }
- count = enum.auto() # (= 19)
- class StyleVar(enum.IntEnum):
- # StyleVar_NodePadding, /* original C++ signature */
- node_padding = enum.auto() # (= 0)
- # StyleVar_NodeRounding, /* original C++ signature */
- node_rounding = enum.auto() # (= 1)
- # StyleVar_NodeBorderWidth, /* original C++ signature */
- node_border_width = enum.auto() # (= 2)
- # StyleVar_HoveredNodeBorderWidth, /* original C++ signature */
- hovered_node_border_width = enum.auto() # (= 3)
- # StyleVar_SelectedNodeBorderWidth, /* original C++ signature */
- selected_node_border_width = enum.auto() # (= 4)
- # StyleVar_PinRounding, /* original C++ signature */
- pin_rounding = enum.auto() # (= 5)
- # StyleVar_PinBorderWidth, /* original C++ signature */
- pin_border_width = enum.auto() # (= 6)
- # StyleVar_LinkStrength, /* original C++ signature */
- link_strength = enum.auto() # (= 7)
- # StyleVar_SourceDirection, /* original C++ signature */
- source_direction = enum.auto() # (= 8)
- # StyleVar_TargetDirection, /* original C++ signature */
- target_direction = enum.auto() # (= 9)
- # StyleVar_ScrollDuration, /* original C++ signature */
- scroll_duration = enum.auto() # (= 10)
- # StyleVar_FlowMarkerDistance, /* original C++ signature */
- flow_marker_distance = enum.auto() # (= 11)
- # StyleVar_FlowSpeed, /* original C++ signature */
- flow_speed = enum.auto() # (= 12)
- # StyleVar_FlowDuration, /* original C++ signature */
- flow_duration = enum.auto() # (= 13)
- # StyleVar_PivotAlignment, /* original C++ signature */
- pivot_alignment = enum.auto() # (= 14)
- # StyleVar_PivotSize, /* original C++ signature */
- pivot_size = enum.auto() # (= 15)
- # StyleVar_PivotScale, /* original C++ signature */
- pivot_scale = enum.auto() # (= 16)
- # StyleVar_PinCorners, /* original C++ signature */
- pin_corners = enum.auto() # (= 17)
- # StyleVar_PinRadius, /* original C++ signature */
- pin_radius = enum.auto() # (= 18)
- # StyleVar_PinArrowSize, /* original C++ signature */
- pin_arrow_size = enum.auto() # (= 19)
- # StyleVar_PinArrowWidth, /* original C++ signature */
- pin_arrow_width = enum.auto() # (= 20)
- # StyleVar_GroupRounding, /* original C++ signature */
- group_rounding = enum.auto() # (= 21)
- # StyleVar_GroupBorderWidth, /* original C++ signature */
- group_border_width = enum.auto() # (= 22)
- # StyleVar_HighlightConnectedLinks, /* original C++ signature */
- highlight_connected_links = enum.auto() # (= 23)
- # StyleVar_SnapLinkToPinDir, /* original C++ signature */
- snap_link_to_pin_dir = enum.auto() # (= 24)
- # StyleVar_HoveredNodeBorderOffset, /* original C++ signature */
- hovered_node_border_offset = enum.auto() # (= 25)
- # StyleVar_SelectedNodeBorderOffset, /* original C++ signature */
- selected_node_border_offset = enum.auto() # (= 26)
- # StyleVar_Count /* original C++ signature */
- # }
- count = enum.auto() # (= 27)
- class Style:
- # ImVec4 NodePadding; /* original C++ signature */
- node_padding: ImVec4
- # float NodeRounding; /* original C++ signature */
- node_rounding: float
- # float NodeBorderWidth; /* original C++ signature */
- node_border_width: float
- # float HoveredNodeBorderWidth; /* original C++ signature */
- hovered_node_border_width: float
- # float HoverNodeBorderOffset; /* original C++ signature */
- hover_node_border_offset: float
- # float SelectedNodeBorderWidth; /* original C++ signature */
- selected_node_border_width: float
- # float SelectedNodeBorderOffset; /* original C++ signature */
- selected_node_border_offset: float
- # float PinRounding; /* original C++ signature */
- pin_rounding: float
- # float PinBorderWidth; /* original C++ signature */
- pin_border_width: float
- # float LinkStrength; /* original C++ signature */
- link_strength: float
- # ImVec2 SourceDirection; /* original C++ signature */
- source_direction: ImVec2
- # ImVec2 TargetDirection; /* original C++ signature */
- target_direction: ImVec2
- # float ScrollDuration; /* original C++ signature */
- scroll_duration: float
- # float FlowMarkerDistance; /* original C++ signature */
- flow_marker_distance: float
- # float FlowSpeed; /* original C++ signature */
- flow_speed: float
- # float FlowDuration; /* original C++ signature */
- flow_duration: float
- # ImVec2 PivotAlignment; /* original C++ signature */
- pivot_alignment: ImVec2
- # ImVec2 PivotSize; /* original C++ signature */
- pivot_size: ImVec2
- # ImVec2 PivotScale; /* original C++ signature */
- pivot_scale: ImVec2
- # float PinCorners; /* original C++ signature */
- pin_corners: float
- # float PinRadius; /* original C++ signature */
- pin_radius: float
- # float PinArrowSize; /* original C++ signature */
- pin_arrow_size: float
- # float PinArrowWidth; /* original C++ signature */
- pin_arrow_width: float
- # float GroupRounding; /* original C++ signature */
- group_rounding: float
- # float GroupBorderWidth; /* original C++ signature */
- group_border_width: float
- # float HighlightConnectedLinks; /* original C++ signature */
- highlight_connected_links: float
- # float SnapLinkToPinDir; /* original C++ signature */
- snap_link_to_pin_dir: (
- float # when True link will start on the line defined by pin direction
- )
- # [ADAPT_IMGUI_BUNDLE]
- # #ifdef IMGUI_BUNDLE_PYTHON_API
- #
- # python adapter for Style::Colors[StyleColor_Count]
- # You can query and modify those values (0 <= idxColor < StyleColor.count)
- # inline IMGUI_NODE_EDITOR_API ImVec4& Color_(StyleColor idxColor) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); return Colors[idxColor]; } /* original C++ signature */
- def color_(self, idx_color: StyleColor) -> ImVec4:
- pass
- # inline IMGUI_NODE_EDITOR_API void SetColor_(StyleColor idxColor, ImVec4 color) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); Colors[idxColor] = color; } /* original C++ signature */
- def set_color_(self, idx_color: StyleColor, color: ImVec4Like) -> None:
- pass
- # #endif
- #
- # Style() /* original C++ signature */
- # {
- # NodePadding = ImVec4(8, 8, 8, 8);
- # NodeRounding = 12.0f;
- # NodeBorderWidth = 1.5f;
- # HoveredNodeBorderWidth = 3.5f;
- # HoverNodeBorderOffset = 0.0f;
- # SelectedNodeBorderWidth = 3.5f;
- # SelectedNodeBorderOffset = 0.0f;
- # PinRounding = 4.0f;
- # PinBorderWidth = 0.0f;
- # LinkStrength = 100.0f;
- # SourceDirection = ImVec2(1.0f, 0.0f);
- # TargetDirection = ImVec2(-1.0f, 0.0f);
- # ScrollDuration = 0.35f;
- # FlowMarkerDistance = 30.0f;
- # FlowSpeed = 150.0f;
- # FlowDuration = 2.0f;
- # PivotAlignment = ImVec2(0.5f, 0.5f);
- # PivotSize = ImVec2(0.0f, 0.0f);
- # PivotScale = ImVec2(1, 1);
- # PinCorners = ImDrawFlags_RoundCornersAll;
- # PinRadius = 0.0f;
- # PinArrowSize = 0.0f;
- # PinArrowWidth = 0.0f;
- # GroupRounding = 6.0f;
- # GroupBorderWidth = 1.0f;
- # HighlightConnectedLinks = 0.0f;
- # SnapLinkToPinDir = 0.0f;
- #
- # Colors[StyleColor_Bg] = ImColor( 60, 60, 70, 200);
- # Colors[StyleColor_Grid] = ImColor(120, 120, 120, 40);
- # Colors[StyleColor_NodeBg] = ImColor( 32, 32, 32, 200);
- # Colors[StyleColor_NodeBorder] = ImColor(255, 255, 255, 96);
- # Colors[StyleColor_HovNodeBorder] = ImColor( 50, 176, 255, 255);
- # Colors[StyleColor_SelNodeBorder] = ImColor(255, 176, 50, 255);
- # Colors[StyleColor_NodeSelRect] = ImColor( 5, 130, 255, 64);
- # Colors[StyleColor_NodeSelRectBorder] = ImColor( 5, 130, 255, 128);
- # Colors[StyleColor_HovLinkBorder] = ImColor( 50, 176, 255, 255);
- # Colors[StyleColor_SelLinkBorder] = ImColor(255, 176, 50, 255);
- # Colors[StyleColor_HighlightLinkBorder]= ImColor(204, 105, 0, 255);
- # Colors[StyleColor_LinkSelRect] = ImColor( 5, 130, 255, 64);
- # Colors[StyleColor_LinkSelRectBorder] = ImColor( 5, 130, 255, 128);
- # Colors[StyleColor_PinRect] = ImColor( 60, 180, 255, 100);
- # Colors[StyleColor_PinRectBorder] = ImColor( 60, 180, 255, 128);
- # Colors[StyleColor_Flow] = ImColor(255, 128, 64, 255);
- # Colors[StyleColor_FlowMarker] = ImColor(255, 128, 64, 255);
- # Colors[StyleColor_GroupBg] = ImColor( 0, 0, 0, 160);
- # Colors[StyleColor_GroupBorder] = ImColor(255, 255, 255, 32);
- # }
- def __init__(self) -> None:
- pass
- # ------------------------------------------------------------------------------
- # --- Editor context lifecycle --------------------------------------------
- # You may keep multiple editors and switch between them with SetCurrentEditor.
- # Pass a Config to CreateEditor to set e.g. SettingsFile (where node positions
- # are persisted) or to override the default mouse buttons.
- # IMGUI_NODE_EDITOR_API void SetCurrentEditor(EditorContext* ctx); /* original C++ signature */
- def set_current_editor(ctx: EditorContext) -> None:
- pass
- # IMGUI_NODE_EDITOR_API EditorContext* GetCurrentEditor(); /* original C++ signature */
- def get_current_editor() -> EditorContext:
- pass
- # IMGUI_NODE_EDITOR_API EditorContext* CreateEditor(const Config* config = nullptr); /* original C++ signature */
- def create_editor(config: Optional[Config] = None) -> EditorContext:
- pass
- # IMGUI_NODE_EDITOR_API void DestroyEditor(EditorContext* ctx); /* original C++ signature */
- def destroy_editor(ctx: EditorContext) -> None:
- pass
- # IMGUI_NODE_EDITOR_API const Config& GetConfig(EditorContext* ctx = nullptr); /* original C++ signature */
- def get_config(ctx: Optional[EditorContext] = None) -> Config:
- pass
- # --- Style ----------------------------------------------------------------
- # Editor-specific style, separate from ImGui::GetStyle().
- # Push/PopStyleColor and Push/PopStyleVar work like the ImGui equivalents.
- # IMGUI_NODE_EDITOR_API Style& GetStyle(); /* original C++ signature */
- def get_style() -> Style:
- pass
- # IMGUI_NODE_EDITOR_API const char* GetStyleColorName(StyleColor colorIndex); /* original C++ signature */
- def get_style_color_name(color_index: StyleColor) -> str:
- pass
- # IMGUI_NODE_EDITOR_API void PushStyleColor(StyleColor colorIndex, const ImVec4& color); /* original C++ signature */
- def push_style_color(color_index: StyleColor, color: ImVec4Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PopStyleColor(int count = 1); /* original C++ signature */
- def pop_style_color(count: int = 1) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, float value); /* original C++ signature */
- @overload
- def push_style_var(var_index: StyleVar, value: float) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, const ImVec2& value); /* original C++ signature */
- @overload
- def push_style_var(var_index: StyleVar, value: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PushStyleVar(StyleVar varIndex, const ImVec4& value); /* original C++ signature */
- @overload
- def push_style_var(var_index: StyleVar, value: ImVec4Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PopStyleVar(int count = 1); /* original C++ signature */
- def pop_style_var(count: int = 1) -> None:
- pass
- # --- Frame ----------------------------------------------------------------
- # All node-editor calls (BeginNode, Link, BeginCreate, ...) must be made
- # between Begin() and End(), and Begin() must be called inside a real ImGui
- # window. `id` distinguishes editor instances inside the same window;
- # `size` matches ImGui::BeginChild semantics (0 = available).
- # IMGUI_NODE_EDITOR_API void Begin(const char* id, const ImVec2& size = ImVec2(0, 0)); /* original C++ signature */
- def begin(id: str, size: Optional[ImVec2Like] = None) -> None:
- """Python bindings defaults:
- If size is None, then its default value will be: ImVec2(0, 0)
- """
- pass
- # IMGUI_NODE_EDITOR_API void End(); /* original C++ signature */
- def end() -> None:
- pass
- # --- Nodes & pins ---------------------------------------------------------
- # Inside Begin/End: declare each node with BeginNode(id) ... EndNode(),
- # and (optionally) declare its pins with BeginPin(id, kind) ... EndPin()
- # in between. Anything you draw between the Begin/End is rendered inside
- # the node; pins are typically wrapped around a Text/Button so the user
- # has something to grab onto.
- # IMGUI_NODE_EDITOR_API void BeginNode(NodeId id); /* original C++ signature */
- def begin_node(id: NodeId) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void BeginPin(PinId id, PinKind kind); /* original C++ signature */
- def begin_pin(id: PinId, kind: PinKind) -> None:
- pass
- # --- Pin geometry overrides (advanced) -----------------------------------
- # By default the pin's own item rectangle is used both as the hover area
- # and as the place where links attach (the "pivot"). Use these calls to
- # customize either independently, between BeginPin and EndPin.
- #
- # PinRect(a, b) : override the pin's hover/visual rectangle
- # (otherwise inferred from drawn content).
- # PinPivotRect(a, b) : override the rectangle used to compute where
- # a link attaches.
- # PinPivotSize(size) : set the pivot rect's size; -1 on a component
- # means "use the pin's size on that axis".
- # PinPivotScale(scale) : multiplicative scale applied to PivotSize.
- # PinPivotAlignment(al) : where in the pin's rect the pivot is anchored;
- # (0,0)=top-left, (1,1)=bottom-right, (0.5,0.5)=center.
- #
- # You will rarely need these unless you draw custom-shaped pins (e.g. a
- # triangle whose tip should be the link attach point).
- # IMGUI_NODE_EDITOR_API void PinRect(const ImVec2& a, const ImVec2& b); /* original C++ signature */
- def pin_rect(a: ImVec2Like, b: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PinPivotRect(const ImVec2& a, const ImVec2& b); /* original C++ signature */
- def pin_pivot_rect(a: ImVec2Like, b: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PinPivotSize(const ImVec2& size); /* original C++ signature */
- def pin_pivot_size(size: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PinPivotScale(const ImVec2& scale); /* original C++ signature */
- def pin_pivot_scale(scale: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void PinPivotAlignment(const ImVec2& alignment); /* original C++ signature */
- def pin_pivot_alignment(alignment: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void EndPin(); /* original C++ signature */
- def end_pin() -> None:
- pass
- # --- Group nodes ----------------------------------------------------------
- #
- # Calling Group(size) inside a BeginNode/EndNode block turns the node into a
- # "Group node": a tinted, resizable rectangle (StyleColor_GroupBg / GroupBorder)
- # that can act as a labeled container for other nodes.
- #
- # Behavior:
- # - The user can resize the group by dragging its bottom-right corner.
- # - Dragging the group drags every node whose bounds fall inside it
- # (handled internally by the editor's DragAction).
- # - `size` is only the INITIAL size, applied on the very first frame the
- # group exists. Subsequent user resizes are persisted by the editor and
- # override `size`. To resize a group programmatically afterwards, use
- # SetGroupSize(node_id, size).
- # - Anything drawn between BeginNode and Group(size) lands in the group's
- # "title strip" above the colored rectangle: title text, buttons, and
- # even pins via BeginPin/EndPin (useful for "summary" pins on a
- # collapsed group).
- #
- # Minimal example (C++):
- #
- # ed::BeginNode(groupId);
- # ImGui::TextUnformatted("My Group");
- # ed::Group(ImVec2(300, 200)); // initial size only
- # ed::EndNode();
- #
- # Minimal example (Python):
- #
- # ed.begin_node(group_id)
- # imgui.text_unformatted("My Group")
- # ed.group(imgui.ImVec2(300, 200)) # initial size only
- # ed.end_node()
- #
- # To find the nodes contained in a group, use the editor's geometry getters
- # (no internal API needed): get the group's GetNodePosition / GetNodeSize,
- # then for each candidate node test whether its center sits inside the
- # group's rectangle.
- #
- # IMGUI_NODE_EDITOR_API void Group(const ImVec2& size); /* original C++ signature */
- def group(size: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void EndNode(); /* original C++ signature */
- def end_node() -> None:
- pass
- # --- Group hints ----------------------------------------------------------
- #
- # A "group hint" is overlay UI that the editor renders ONLY when zoomed out
- # far enough that the in-node title becomes hard to read. BeginGroupHint
- # returns False at normal zoom; it returns True and fades in below ~0.75x.
- # The intended use is to draw a large title above the group so users can
- # still identify it at low zoom.
- #
- # GetGroupMin / GetGroupMax return the targeted group's bounds in SCREEN
- # coordinates so you can position your overlay relative to it.
- # GetHintForegroundDrawList / GetHintBackgroundDrawList return draw lists
- # that sit above (foreground) and below (background) the editor's normal
- # content, so your overlay isn't clipped by the canvas.
- #
- # Minimal example (C++):
- #
- # if (ed::BeginGroupHint(groupId))
- # {
- # ImVec2 min = ed::GetGroupMin();
- # auto* fg = ed::GetHintForegroundDrawList();
- # fg->AddText(ImVec2(min.x, min.y - 24.0),
- # ImGui::GetColorU32(ImGuiCol_Text),
- # "My Group");
- # }
- # ed::EndGroupHint();
- #
- # Minimal example (Python):
- #
- # if ed.begin_group_hint(group_id):
- # min_ = ed.get_group_min()
- # fg = ed.get_hint_foreground_draw_list()
- # fg.add_text(imgui.ImVec2(min_.x, min_.y - 24.0),
- # imgui.get_color_u32(imgui.Col_.text.value),
- # "My Group")
- # ed.end_group_hint()
- #
- # IMGUI_NODE_EDITOR_API bool BeginGroupHint(NodeId nodeId); /* original C++ signature */
- def begin_group_hint(node_id: NodeId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 GetGroupMin(); /* original C++ signature */
- def get_group_min() -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 GetGroupMax(); /* original C++ signature */
- def get_group_max() -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API ImDrawList* GetHintForegroundDrawList(); /* original C++ signature */
- def get_hint_foreground_draw_list() -> ImDrawList:
- pass
- # IMGUI_NODE_EDITOR_API ImDrawList* GetHintBackgroundDrawList(); /* original C++ signature */
- def get_hint_background_draw_list() -> ImDrawList:
- pass
- # IMGUI_NODE_EDITOR_API void EndGroupHint(); /* original C++ signature */
- def end_group_hint() -> None:
- pass
- # IMGUI_NODE_EDITOR_API ImDrawList* GetNodeBackgroundDrawList(NodeId nodeId); /* original C++ signature */
- def get_node_background_draw_list(node_id: NodeId) -> ImDrawList:
- """Returns the draw list used for the node's BACKGROUND layer (drawn under
- the node's content). Useful to add badges, highlights, etc. behind a node.
- TODO: Add a way to manage node background channels
- """
- pass
- # 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 */
- def link(
- id: LinkId,
- start_pin_id: PinId,
- end_pin_id: PinId,
- color: Optional[ImVec4Like] = None,
- thickness: float = 1.0,
- ) -> bool:
- """Declares an existing link between two pins. Call once per frame for every
- link you want shown. Returns True if the link is currently visible/active.
- `color` default is the sentinel ImVec4(0,0,0,0) ("auto"): when alpha is 0
- the implementation substitutes the current ImGuiCol_Text, so links stay
- readable on both light and dark themes. Pass any non-zero-alpha color to
- override.
- Python bindings defaults:
- If color is None, then its default value will be: ImVec4(0, 0, 0, 0)
- """
- pass
- # IMGUI_NODE_EDITOR_API void Flow(LinkId linkId, FlowDirection direction = FlowDirection::Forward); /* original C++ signature */
- def flow(link_id: LinkId, direction: FlowDirection = FlowDirection.forward) -> None:
- """Trigger a one-shot animated "flow" pulse along a link. Calling this once
- is enough; the editor handles the time-bounded animation internally.
- """
- pass
- # --- Item creation (drag-out new link / new node) ------------------------
- # Interaction protocol fired while the user drags a link from a pin:
- #
- # if (BeginCreate()) {
- # PinId a, b;
- # if (QueryNewLink(&a, &b)) { // user is hovering a candidate endpoint
- # if (/* link a->b is invalid */)
- # RejectNewItem(); // shows red feedback
- # else if (AcceptNewItem()) // returns True on mouse-release
- # /* commit the new link to your data model */;
- # }
- # if (QueryNewNode(&a)) { // user dragged a link into empty space
- # if (AcceptNewItem()) // -> typical UX: open a "Add node" popup
- # /* spawn a new node and connect pin `a` to one of its pins */;
- # }
- # }
- # EndCreate();
- #
- # The QueryNewLink/QueryNewNode/AcceptNewItem overloads taking a color and
- # thickness customize the in-progress link's drawing while the user drags.
- # IMGUI_NODE_EDITOR_API bool BeginCreate(const ImVec4& color = ImVec4(0, 0, 0, 0), float thickness = 1.0f); /* original C++ signature */
- def begin_create(color: Optional[ImVec4Like] = None, thickness: float = 1.0) -> bool:
- """Python bindings defaults:
- If color is None, then its default value will be: ImVec4(0, 0, 0, 0)
- """
- pass
- # IMGUI_NODE_EDITOR_API bool QueryNewLink(PinId* startId, PinId* endId); /* original C++ signature */
- @overload
- def query_new_link(start_id: PinId, end_id: PinId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool QueryNewLink(PinId* startId, PinId* endId, const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
- @overload
- def query_new_link(
- start_id: PinId, end_id: PinId, color: ImVec4Like, thickness: float = 1.0
- ) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool QueryNewNode(PinId* pinId); /* original C++ signature */
- @overload
- def query_new_node(pin_id: PinId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool QueryNewNode(PinId* pinId, const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
- @overload
- def query_new_node(pin_id: PinId, color: ImVec4Like, thickness: float = 1.0) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptNewItem(); /* original C++ signature */
- @overload
- def accept_new_item() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptNewItem(const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
- @overload
- def accept_new_item(color: ImVec4Like, thickness: float = 1.0) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API void RejectNewItem(); /* original C++ signature */
- @overload
- def reject_new_item() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void RejectNewItem(const ImVec4& color, float thickness = 1.0f); /* original C++ signature */
- @overload
- def reject_new_item(color: ImVec4Like, thickness: float = 1.0) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void EndCreate(); /* original C++ signature */
- def end_create() -> None:
- pass
- # --- Item deletion (Delete key, "Delete" context-menu, etc.) -------------
- # Interaction protocol that yields the things the user wants to delete this
- # frame. You decide whether to honor each one:
- #
- # if (BeginDelete()) {
- # LinkId l;
- # while (QueryDeletedLink(&l))
- # if (AcceptDeletedItem()) /* remove link from your model */;
- # NodeId n;
- # while (QueryDeletedNode(&n))
- # if (AcceptDeletedItem()) /* remove node and its links */;
- # }
- # EndDelete();
- #
- # `deleteDependencies = True` (the default for AcceptDeletedItem) tells the
- # editor to also enqueue links touching the accepted node, so a subsequent
- # QueryDeletedLink call yields them too.
- # IMGUI_NODE_EDITOR_API bool BeginDelete(); /* original C++ signature */
- def begin_delete() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool QueryDeletedLink(LinkId* linkId, PinId* startId = nullptr, PinId* endId = nullptr); /* original C++ signature */
- def query_deleted_link(
- link_id: LinkId, start_id: Optional[PinId] = None, end_id: Optional[PinId] = None
- ) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool QueryDeletedNode(NodeId* nodeId); /* original C++ signature */
- def query_deleted_node(node_id: NodeId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptDeletedItem(bool deleteDependencies = true); /* original C++ signature */
- def accept_deleted_item(delete_dependencies: bool = True) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API void RejectDeletedItem(); /* original C++ signature */
- def reject_deleted_item() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void EndDelete(); /* original C++ signature */
- def end_delete() -> None:
- pass
- # --- Node geometry --------------------------------------------------------
- # Positions and sizes are in EDITOR (canvas) space, not screen space. Use
- # CanvasToScreen / ScreenToCanvas to convert.
- # GetNodeSize returns (0,0) on the very first frame a node is drawn (the
- # editor has no measurement yet). It stabilizes immediately after.
- # CenterNodeOnScreen moves the node so it lands at the center of the view.
- # IMGUI_NODE_EDITOR_API void SetNodePosition(NodeId nodeId, const ImVec2& editorPosition); /* original C++ signature */
- def set_node_position(node_id: NodeId, editor_position: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void SetGroupSize(NodeId nodeId, const ImVec2& size); /* original C++ signature */
- def set_group_size(node_id: NodeId, size: ImVec2Like) -> None:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 GetNodePosition(NodeId nodeId); /* original C++ signature */
- def get_node_position(node_id: NodeId) -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 GetNodeSize(NodeId nodeId); /* original C++ signature */
- def get_node_size(node_id: NodeId) -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API void CenterNodeOnScreen(NodeId nodeId); /* original C++ signature */
- def center_node_on_screen(node_id: NodeId) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void SetNodeZPosition(NodeId nodeId, float z); /* original C++ signature */
- def set_node_z_position(node_id: NodeId, z: float) -> None:
- """Sets node z position, nodes with higher value are drawn over nodes with lower value"""
- pass
- # IMGUI_NODE_EDITOR_API float GetNodeZPosition(NodeId nodeId); /* original C++ signature */
- def get_node_z_position(node_id: NodeId) -> float:
- """Returns node z position, defaults is 0.0"""
- pass
- # IMGUI_NODE_EDITOR_API void RestoreNodeState(NodeId nodeId); /* original C++ signature */
- def restore_node_state(node_id: NodeId) -> None:
- """Re-load the node's position/size from the editor's persisted settings
- (the SettingsFile, if any). Useful right after creating a node whose
- previous layout you want to bring back without the user having to drag it.
- """
- pass
- # --- Suspend / Resume -----------------------------------------------------
- # Temporarily disable the editor's input/canvas state machine. You MUST
- # suspend before calling ImGui popup APIs like ImGui::OpenPopup or
- # ImGui::BeginPopup that should appear ABOVE the canvas (otherwise the
- # popup's coordinates and event capture will be wrong). Resume() restores
- # editor input handling. See the ShowNodeContextMenu example below.
- # IMGUI_NODE_EDITOR_API void Suspend(); /* original C++ signature */
- def suspend() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void Resume(); /* original C++ signature */
- def resume() -> None:
- pass
- # IMGUI_NODE_EDITOR_API bool IsSuspended(); /* original C++ signature */
- def is_suspended() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool IsActive(); /* original C++ signature */
- def is_active() -> bool:
- """True while the editor is processing user input this frame (drag, select,
- pan, zoom, link-create, etc.).
- """
- pass
- # --- Selection ------------------------------------------------------------
- # HasSelectionChanged returns True for one frame after the selection set
- # changed (use it to react to selection changes once, not every frame).
- # SelectNode/SelectLink with append=False replaces the current selection.
- # IMGUI_NODE_EDITOR_API bool HasSelectionChanged(); /* original C++ signature */
- def has_selection_changed() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API int GetSelectedObjectCount(); /* original C++ signature */
- def get_selected_object_count() -> int:
- pass
- # #ifdef IMGUI_BUNDLE_PYTHON_API
- #
- # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetSelectedNodes(); /* original C++ signature */
- def get_selected_nodes() -> List[NodeId]:
- pass
- # IMGUI_NODE_EDITOR_API std::vector<LinkId> GetSelectedLinks(); /* original C++ signature */
- def get_selected_links() -> List[LinkId]:
- pass
- # #endif
- #
- # IMGUI_NODE_EDITOR_API bool IsNodeSelected(NodeId nodeId); /* original C++ signature */
- def is_node_selected(node_id: NodeId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool IsLinkSelected(LinkId linkId); /* original C++ signature */
- def is_link_selected(link_id: LinkId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API void ClearSelection(); /* original C++ signature */
- def clear_selection() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void SelectNode(NodeId nodeId, bool append = false); /* original C++ signature */
- def select_node(node_id: NodeId, append: bool = False) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void SelectLink(LinkId linkId, bool append = false); /* original C++ signature */
- def select_link(link_id: LinkId, append: bool = False) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void DeselectNode(NodeId nodeId); /* original C++ signature */
- def deselect_node(node_id: NodeId) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void DeselectLink(LinkId linkId); /* original C++ signature */
- def deselect_link(link_id: LinkId) -> None:
- pass
- # Programmatically queue a node/link for deletion. The next BeginDelete()
- # loop will yield it via QueryDeletedNode/QueryDeletedLink.
- # IMGUI_NODE_EDITOR_API bool DeleteNode(NodeId nodeId); /* original C++ signature */
- def delete_node(node_id: NodeId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool DeleteLink(LinkId linkId); /* original C++ signature */
- def delete_link(link_id: LinkId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool HasAnyLinks(NodeId nodeId); /* original C++ signature */
- @overload
- def has_any_links(node_id: NodeId) -> bool:
- """Returns True if node has any link connected"""
- pass
- # IMGUI_NODE_EDITOR_API bool HasAnyLinks(PinId pinId); /* original C++ signature */
- @overload
- def has_any_links(pin_id: PinId) -> bool:
- """Return True if pin has any link connected"""
- pass
- # IMGUI_NODE_EDITOR_API int BreakLinks(NodeId nodeId); /* original C++ signature */
- @overload
- def break_links(node_id: NodeId) -> int:
- """Break all links connected to this node"""
- pass
- # IMGUI_NODE_EDITOR_API int BreakLinks(PinId pinId); /* original C++ signature */
- @overload
- def break_links(pin_id: PinId) -> int:
- """Break all links connected to this pin"""
- pass
- # --- Navigation -----------------------------------------------------------
- # Programmatic equivalents of pressing F (with no modifier and with Shift).
- # `duration` is the animation length in seconds; -1 means "use the editor
- # default". NavigateToSelection requires a non-empty selection.
- # IMGUI_NODE_EDITOR_API void NavigateToContent(float duration = -1); /* original C++ signature */
- def navigate_to_content(duration: float = -1) -> None:
- pass
- # IMGUI_NODE_EDITOR_API void NavigateToSelection(bool zoomIn = false, float duration = -1); /* original C++ signature */
- def navigate_to_selection(zoom_in: bool = False, duration: float = -1) -> None:
- pass
- # Shows context menu for node, link or background
- # Typical usage (this should happen inside ed::Begin/ed::End block):
- # ed::Begin();
- # ... (Show nodes)
- # ed::Suspend();
- # if (ed::ShowNodeContextMenu(&contextNodeId))
- # ImGui::OpenPopup("Node Context Menu");
- # ed::Resume();
- # ...
- # ed::Suspend();
- # if (ImGui::BeginPopup("Node Context Menu"))
- # {
- # ImGui::Text("Node Context Menu, node ID: %d", contextNodeId);
- # ImGui::EndPopup();
- # }
- # ed::Resume();
- # ...
- # ed::End();
- # IMGUI_NODE_EDITOR_API bool ShowNodeContextMenu(NodeId* nodeId); /* original C++ signature */
- def show_node_context_menu(node_id: NodeId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool ShowPinContextMenu(PinId* pinId); /* original C++ signature */
- def show_pin_context_menu(pin_id: PinId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool ShowLinkContextMenu(LinkId* linkId); /* original C++ signature */
- def show_link_context_menu(link_id: LinkId) -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool ShowBackgroundContextMenu(); /* original C++ signature */
- def show_background_context_menu() -> bool:
- pass
- # --- Keyboard shortcuts ---------------------------------------------------
- # Master switch: when disabled the editor never reacts to F / Ctrl+X /
- # Ctrl+C / Ctrl+V / Ctrl+D / Space etc. Useful when an ImGui text input
- # has focus and you want shortcuts ignored.
- # IMGUI_NODE_EDITOR_API void EnableShortcuts(bool enable); /* original C++ signature */
- def enable_shortcuts(enable: bool) -> None:
- pass
- # IMGUI_NODE_EDITOR_API bool AreShortcutsEnabled(); /* original C++ signature */
- def are_shortcuts_enabled() -> bool:
- pass
- # --- Shortcut handling protocol ------------------------------------------
- # Lets you ASK the editor which keyboard shortcut fired this frame and
- # respond to it. Pattern (inside Begin/End):
- #
- # if (BeginShortcut()) {
- # if (AcceptCopy()) /* user pressed Ctrl+C: copy selection */;
- # if (AcceptPaste()) /* user pressed Ctrl+V: paste at mouse */;
- # if (AcceptCut()) /* user pressed Ctrl+X */;
- # if (AcceptDuplicate()) /* user pressed Ctrl+D */;
- # if (AcceptCreateNode()) /* user dragged a link out into empty space */;
- # }
- # EndShortcut();
- #
- # GetActionContextNodes / GetActionContextLinks return the objects the
- # shortcut applies to (typically the current selection at the moment the
- # shortcut fired). They are valid only between Begin/EndShortcut.
- # IMGUI_NODE_EDITOR_API bool BeginShortcut(); /* original C++ signature */
- def begin_shortcut() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptCut(); /* original C++ signature */
- def accept_cut() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptCopy(); /* original C++ signature */
- def accept_copy() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptPaste(); /* original C++ signature */
- def accept_paste() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptDuplicate(); /* original C++ signature */
- def accept_duplicate() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool AcceptCreateNode(); /* original C++ signature */
- def accept_create_node() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API int GetActionContextSize(); /* original C++ signature */
- def get_action_context_size() -> int:
- pass
- # #ifdef IMGUI_BUNDLE_PYTHON_API
- #
- # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetActionContextNodes(); /* original C++ signature */
- def get_action_context_nodes() -> List[NodeId]:
- pass
- # IMGUI_NODE_EDITOR_API std::vector<LinkId> GetActionContextLinks(); /* original C++ signature */
- def get_action_context_links() -> List[LinkId]:
- pass
- # #endif
- #
- # IMGUI_NODE_EDITOR_API void EndShortcut(); /* original C++ signature */
- def end_shortcut() -> None:
- pass
- # IMGUI_NODE_EDITOR_API float GetCurrentZoom(); /* original C++ signature */
- def get_current_zoom() -> float:
- """Current canvas zoom factor; 1.0 = 100%."""
- pass
- # --- Input queries (call between Begin and End) ---------------------------
- # These return the object under the mouse this frame (NodeId/PinId/LinkId,
- # 0 if none) and which buttons were clicked or double-clicked on the empty
- # background. The "BackgroundClick" pair returns -1 when no click happened.
- # IMGUI_NODE_EDITOR_API NodeId GetHoveredNode(); /* original C++ signature */
- def get_hovered_node() -> NodeId:
- pass
- # IMGUI_NODE_EDITOR_API PinId GetHoveredPin(); /* original C++ signature */
- def get_hovered_pin() -> PinId:
- pass
- # IMGUI_NODE_EDITOR_API LinkId GetHoveredLink(); /* original C++ signature */
- def get_hovered_link() -> LinkId:
- pass
- # IMGUI_NODE_EDITOR_API NodeId GetDoubleClickedNode(); /* original C++ signature */
- def get_double_clicked_node() -> NodeId:
- pass
- # IMGUI_NODE_EDITOR_API PinId GetDoubleClickedPin(); /* original C++ signature */
- def get_double_clicked_pin() -> PinId:
- pass
- # IMGUI_NODE_EDITOR_API LinkId GetDoubleClickedLink(); /* original C++ signature */
- def get_double_clicked_link() -> LinkId:
- pass
- # IMGUI_NODE_EDITOR_API bool IsBackgroundClicked(); /* original C++ signature */
- def is_background_clicked() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API bool IsBackgroundDoubleClicked(); /* original C++ signature */
- def is_background_double_clicked() -> bool:
- pass
- # IMGUI_NODE_EDITOR_API ImGuiMouseButton GetBackgroundClickButtonIndex(); /* original C++ signature */
- def get_background_click_button_index() -> ImGuiMouseButton:
- """-1 if none"""
- pass
- # IMGUI_NODE_EDITOR_API ImGuiMouseButton GetBackgroundDoubleClickButtonIndex(); /* original C++ signature */
- def get_background_double_click_button_index() -> ImGuiMouseButton:
- """-1 if none"""
- pass
- # IMGUI_NODE_EDITOR_API bool GetLinkPins(LinkId linkId, PinId* startPinId, PinId* endPinId); /* original C++ signature */
- def get_link_pins(link_id: LinkId, start_pin_id: PinId, end_pin_id: PinId) -> bool:
- """pass None if particular pin do not interest you"""
- pass
- # IMGUI_NODE_EDITOR_API bool PinHadAnyLinks(PinId pinId); /* original C++ signature */
- def pin_had_any_links(pin_id: PinId) -> bool:
- """True if the pin was ever connected to a link in its lifetime, even if it
- is currently disconnected.
- """
- pass
- # --- Coordinate conversion ------------------------------------------------
- # SCREEN coords are pixels in the OS window. CANVAS coords are the editor's
- # virtual space (what GetNodePosition / SetNodePosition use). The two
- # differ by the current pan + zoom transform.
- # IMGUI_NODE_EDITOR_API ImVec2 GetScreenSize(); /* original C++ signature */
- def get_screen_size() -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 ScreenToCanvas(const ImVec2& pos); /* original C++ signature */
- def screen_to_canvas(pos: ImVec2Like) -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API ImVec2 CanvasToScreen(const ImVec2& pos); /* original C++ signature */
- def canvas_to_screen(pos: ImVec2Like) -> ImVec2:
- pass
- # IMGUI_NODE_EDITOR_API int GetNodeCount(); /* original C++ signature */
- def get_node_count() -> int:
- """Returns number of submitted nodes since Begin() call"""
- pass
- # #ifdef IMGUI_BUNDLE_PYTHON_API
- #
- # IMGUI_NODE_EDITOR_API std::vector<NodeId> GetOrderedNodeIds(); /* original C++ signature */
- def get_ordered_node_ids() -> List[NodeId]:
- """Fills an array with node id's in order they're drawn"""
- pass
- # #endif
- #
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # # endif
- #################### </generated_from:imgui_node_editor.h> ####################
- #################### <generated_from:node_editor_default_context.h> ####################
- # IMGUI_NODE_EDITOR_API NodeEditorContext* DefaultNodeEditorContext_Immapp(); /* original C++ signature */
- def default_node_editor_context_immapp() -> NodeEditorContext:
- pass
- # IMGUI_NODE_EDITOR_API void SuspendNodeEditorCanvas_Immapp(); /* original C++ signature */
- def suspend_node_editor_canvas_immapp() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void ResumeNodeEditorCanvas_Immapp(); /* original C++ signature */
- def resume_node_editor_canvas_immapp() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void DisableUserInputThisFrame(); /* original C++ signature */
- def disable_user_input_this_frame() -> None:
- pass
- # IMGUI_NODE_EDITOR_API void UpdateNodeEditorColorsFromImguiColors(); /* original C++ signature */
- def update_node_editor_colors_from_imgui_colors() -> None:
- pass
- #################### </generated_from:node_editor_default_context.h> ####################
- # </litgen_stub> // Autogenerated code end!
|