imgui_command_palette.pyi 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of imgui-command-palette
  3. # -----------------------------------------------------------------------------
  4. # imgui_command_palette.pyi: auto-generated bindings
  5. # imgui-command-palette is a Sublime Text or VSCode style command palette in ImGui
  6. # https://github.com/hnOsmium0001/imgui-command-palette
  7. #
  8. # Most of the code of this file is automatically generated (using https://pthom.github.io/litgen/),
  9. # and is generally very close to the C++ version. Comments, docs are identical.
  10. # Do not manually edit the autogenerated parts (look for "Autogenerated" comments)!
  11. ###############################################################################
  12. from typing import List, Callable
  13. import enum
  14. from imgui_bundle.imgui import ImFont, ImU32
  15. ImGuiCond = int
  16. class Context:
  17. pass
  18. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  19. # <litgen_stub> // Autogenerated code below! Do not edit!
  20. #################### <generated_from:imcmd_command_palette.h> ####################
  21. # TODO support std::string_view
  22. # TODO support function pointer callback in addition to std::function
  23. class ImCmdTextType(enum.IntEnum):
  24. regular = enum.auto() # (= 0)
  25. highlight = enum.auto() # (= 1)
  26. count = enum.auto() # (= 2)
  27. class ImCmdTextFlag(enum.IntEnum):
  28. #/ Whether the text is underlined. Default False.
  29. underline = enum.auto() # (= 0)
  30. count = enum.auto() # (= 1)
  31. class Command:
  32. name: str
  33. initial_callback: Callable[[], None]
  34. subsequent_callback: Callable[[int], None]
  35. terminating_callback: Callable[[], None]
  36. def __init__(self) -> None:
  37. """Autogenerated default constructor"""
  38. pass
  39. #/ Destroys the currently bound context.
  40. # Command management
  41. def add_command(command: Command) -> None:
  42. pass
  43. def remove_command(name: str) -> None:
  44. pass
  45. # Styling
  46. def get_style_flag(type: ImCmdTextType, flag: ImCmdTextFlag) -> bool:
  47. pass
  48. def set_style_flag(type: ImCmdTextType, flag: ImCmdTextFlag, enabled: bool) -> None:
  49. pass
  50. def get_style_font(type: ImCmdTextType) -> ImFont:
  51. pass
  52. def set_style_font(type: ImCmdTextType, font: ImFont) -> None:
  53. pass
  54. def get_style_color(type: ImCmdTextType) -> ImU32:
  55. pass
  56. def set_style_color(type: ImCmdTextType, color: ImU32) -> None:
  57. pass
  58. def clear_style_color(type: ImCmdTextType) -> None:
  59. """< Clear the style color for the given type, defaulting to ImGuiCol_Text"""
  60. pass
  61. # Command palette widget
  62. def set_next_command_palette_search(text: str) -> None:
  63. pass
  64. def set_next_command_palette_search_box_focused() -> None:
  65. pass
  66. def command_palette(name: str) -> None:
  67. pass
  68. def is_any_item_selected() -> bool:
  69. pass
  70. def remove_cache(name: str) -> None:
  71. pass
  72. def remove_all_caches() -> None:
  73. pass
  74. # Command palette widget in a window helper
  75. def set_next_window_affixed_top(cond: ImGuiCond = 0) -> None:
  76. pass
  77. def command_palette_window(name: str, p_open: bool) -> bool:
  78. pass
  79. def prompt(options: List[str]) -> None:
  80. """ Command responses, only call these in command callbacks (except TerminatingCallback)"""
  81. pass
  82. #################### </generated_from:imcmd_command_palette.h> ####################
  83. #################### <generated_from:imgui-command-palette-py-wrapper.h> ####################
  84. # Workaround for ImCmd::Context, since pybind11 stubbornly fails on perfect encapsulation
  85. # ImCmd::Context is perfectly encapsulated, since it is only defined privately in a C++ file, and not in a header.
  86. # See https://github.com/pybind/pybind11/issues/2770
  87. class ContextWrapper:
  88. def __init__(self) -> None:
  89. pass
  90. #################### </generated_from:imgui-command-palette-py-wrapper.h> ####################
  91. # </litgen_stub> // Autogenerated code end!