__init__.py 875 B

123456789101112131415161718192021222324252627
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import TYPE_CHECKING
  4. from cura.API.Interface.Settings import Settings
  5. if TYPE_CHECKING:
  6. from cura.CuraApplication import CuraApplication
  7. ## The Interface class serves as a common root for the specific API
  8. # methods for each interface element.
  9. #
  10. # Usage:
  11. # ``from cura.API import CuraAPI
  12. # api = CuraAPI()
  13. # api.interface.settings.addContextMenuItem()
  14. # api.interface.viewport.addOverlay() # Not implemented, just a hypothetical
  15. # api.interface.toolbar.getToolButtonCount() # Not implemented, just a hypothetical
  16. # # etc.``
  17. class Interface:
  18. def __init__(self, application: "CuraApplication") -> None:
  19. # API methods specific to the settings portion of the UI
  20. self.settings = Settings(application)