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.

119 lines
4.2KB

  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. #ifndef __MAINWINDOW_H_7DB41986__
  18. #define __MAINWINDOW_H_7DB41986__
  19. class ContentComponent;
  20. //==============================================================================
  21. class MainAppWindow : public DocumentWindow,
  22. private AsyncUpdater
  23. {
  24. public:
  25. //==============================================================================
  26. MainAppWindow();
  27. ~MainAppWindow();
  28. static MainAppWindow* getMainAppWindow(); // returns the MainWindow if it exists.
  29. // called by the OS when the window's close button is pressed.
  30. void closeButtonPressed() override;
  31. // (return the command manager object used to dispatch command events)
  32. static ApplicationCommandManager& getApplicationCommandManager();
  33. // (returns a shared AudioDeviceManager object that all the demos can use)
  34. static AudioDeviceManager& getSharedAudioDeviceManager();
  35. StringArray getRenderingEngines() const;
  36. int getActiveRenderingEngine() const;
  37. void setRenderingEngine (int index);
  38. void setOpenGLRenderingEngine();
  39. // (returns the exploding JUCE logo path)
  40. static Path getJUCELogoPath();
  41. /* Note: Be careful when overriding DocumentWindow methods - the base class
  42. uses a lot of them, so by overriding you might break its functionality.
  43. It's best to do all your work in you content component instead, but if
  44. you really have to override any DocumentWindow methods, make sure your
  45. implementation calls the superclass's method.
  46. */
  47. //==============================================================================
  48. enum CommandIDs
  49. {
  50. showPreviousDemo = 0x2100,
  51. showNextDemo = 0x2101,
  52. welcome = 0x2000,
  53. componentsAnimation = 0x2001,
  54. componentsDialogBoxes = 0x2002,
  55. componentsKeyMappings = 0x2003,
  56. componentsMDI = 0x2004,
  57. componentsPropertyEditors = 0x2005,
  58. componentsTransforms = 0x2006,
  59. componentsWebBrowsers = 0x2007,
  60. componentsWidgets = 0x2008,
  61. renderingEngineOne = 0x2300,
  62. renderingEngineTwo = 0x2301,
  63. renderingEngineThree = 0x2302, // these must be contiguous!
  64. useLookAndFeelV1 = 0x200b,
  65. useLookAndFeelV2 = 0x200c,
  66. useLookAndFeelV3 = 0x200d,
  67. toggleRepaintDebugging = 0x200e,
  68. useNativeTitleBar = 0x201d,
  69. goToKioskMode = 0x200f
  70. };
  71. private:
  72. static void runtimPermissionsCallback (bool wasGranted);
  73. ScopedPointer<ContentComponent> contentComponent;
  74. ScopedPointer<Component> taskbarIcon;
  75. ScopedPointer<BubbleMessageComponent> currentBubbleMessage;
  76. TooltipWindow tooltipWindow; // to add tooltips to an application, you
  77. // just need to create one of these and leave it
  78. // there to do its work..
  79. #if JUCE_OPENGL
  80. OpenGLContext openGLContext;
  81. #endif
  82. void handleAsyncUpdate() override;
  83. void showMessageBubble (const String&);
  84. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow)
  85. };
  86. #endif // __MAINWINDOW_H_7DB41986__