The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
4.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. class ContentComponent;
  19. //==============================================================================
  20. class MainAppWindow : public DocumentWindow,
  21. private AsyncUpdater
  22. {
  23. public:
  24. //==============================================================================
  25. MainAppWindow();
  26. ~MainAppWindow();
  27. static MainAppWindow* getMainAppWindow(); // returns the MainWindow if it exists.
  28. // called by the OS when the window's close button is pressed.
  29. void closeButtonPressed() override;
  30. // (return the command manager object used to dispatch command events)
  31. static ApplicationCommandManager& getApplicationCommandManager();
  32. // (returns a shared AudioDeviceManager object that all the demos can use)
  33. static AudioDeviceManager& getSharedAudioDeviceManager();
  34. StringArray getRenderingEngines() const;
  35. int getActiveRenderingEngine() const;
  36. void setRenderingEngine (int index);
  37. void setOpenGLRenderingEngine();
  38. // (returns the exploding JUCE logo path)
  39. static Path getJUCELogoPath();
  40. /* Note: Be careful when overriding DocumentWindow methods - the base class
  41. uses a lot of them, so by overriding you might break its functionality.
  42. It's best to do all your work in you content component instead, but if
  43. you really have to override any DocumentWindow methods, make sure your
  44. implementation calls the superclass's method.
  45. */
  46. //==============================================================================
  47. enum CommandIDs
  48. {
  49. showPreviousDemo = 0x2100,
  50. showNextDemo = 0x2101,
  51. welcome = 0x2000,
  52. componentsAnimation = 0x2001,
  53. componentsDialogBoxes = 0x2002,
  54. componentsKeyMappings = 0x2003,
  55. componentsMDI = 0x2004,
  56. componentsPropertyEditors = 0x2005,
  57. componentsTransforms = 0x2006,
  58. componentsWebBrowsers = 0x2007,
  59. componentsWidgets = 0x2008,
  60. renderingEngineOne = 0x2300,
  61. renderingEngineTwo = 0x2301,
  62. renderingEngineThree = 0x2302, // these must be contiguous!
  63. useLookAndFeelV1 = 0x200b,
  64. useLookAndFeelV2 = 0x200c,
  65. useLookAndFeelV3 = 0x200d,
  66. toggleRepaintDebugging = 0x200e,
  67. useNativeTitleBar = 0x201d,
  68. goToKioskMode = 0x200f
  69. };
  70. private:
  71. static void runtimePermissionsCallback (bool wasGranted);
  72. ScopedPointer<ContentComponent> contentComponent;
  73. ScopedPointer<Component> taskbarIcon;
  74. ScopedPointer<BubbleMessageComponent> currentBubbleMessage;
  75. TooltipWindow tooltipWindow; // to add tooltips to an application, you
  76. // just need to create one of these and leave it
  77. // there to do its work..
  78. #if JUCE_OPENGL
  79. OpenGLContext openGLContext;
  80. #endif
  81. void handleAsyncUpdate() override;
  82. void showMessageBubble (const String&);
  83. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow)
  84. };