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.

120 lines
4.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #pragma once
  20. class ContentComponent;
  21. //==============================================================================
  22. class MainAppWindow : public DocumentWindow,
  23. private AsyncUpdater
  24. {
  25. public:
  26. //==============================================================================
  27. MainAppWindow();
  28. ~MainAppWindow();
  29. static MainAppWindow* getMainAppWindow(); // returns the MainWindow if it exists.
  30. // called by the OS when the window's close button is pressed.
  31. void closeButtonPressed() override;
  32. // (return the command manager object used to dispatch command events)
  33. static ApplicationCommandManager& getApplicationCommandManager();
  34. // (returns a shared AudioDeviceManager object that all the demos can use)
  35. static AudioDeviceManager& getSharedAudioDeviceManager();
  36. StringArray getRenderingEngines() const;
  37. int getActiveRenderingEngine() const;
  38. void setRenderingEngine (int index);
  39. void setOpenGLRenderingEngine();
  40. // (returns the exploding JUCE logo path)
  41. static Path getJUCELogoPath();
  42. /* Note: Be careful when overriding DocumentWindow methods - the base class
  43. uses a lot of them, so by overriding you might break its functionality.
  44. It's best to do all your work in you content component instead, but if
  45. you really have to override any DocumentWindow methods, make sure your
  46. implementation calls the superclass's method.
  47. */
  48. //==============================================================================
  49. enum CommandIDs
  50. {
  51. showPreviousDemo = 0x2100,
  52. showNextDemo = 0x2101,
  53. welcome = 0x2000,
  54. componentsAnimation = 0x2001,
  55. componentsDialogBoxes = 0x2002,
  56. componentsKeyMappings = 0x2003,
  57. componentsMDI = 0x2004,
  58. componentsPropertyEditors = 0x2005,
  59. componentsTransforms = 0x2006,
  60. componentsWebBrowsers = 0x2007,
  61. componentsWidgets = 0x2008,
  62. renderingEngineOne = 0x2300,
  63. renderingEngineTwo = 0x2301,
  64. renderingEngineThree = 0x2302, // these must be contiguous!
  65. useLookAndFeelV1 = 0x300a,
  66. useLookAndFeelV2 = 0x300b,
  67. useLookAndFeelV3 = 0x300c,
  68. useLookAndFeelV4Dark = 0x300d,
  69. useLookAndFeelV4Midnight = 0x300e,
  70. useLookAndFeelV4Grey = 0x300f,
  71. useLookAndFeelV4Light = 0x3010,
  72. toggleRepaintDebugging = 0x201a,
  73. useNativeTitleBar = 0x201d,
  74. goToKioskMode = 0x200f
  75. };
  76. private:
  77. static void runtimePermissionsCallback (bool wasGranted);
  78. ScopedPointer<ContentComponent> contentComponent;
  79. ScopedPointer<Component> taskbarIcon;
  80. ScopedPointer<BubbleMessageComponent> currentBubbleMessage;
  81. TooltipWindow tooltipWindow; // to add tooltips to an application, you
  82. // just need to create one of these and leave it
  83. // there to do its work..
  84. #if JUCE_OPENGL
  85. OpenGLContext openGLContext;
  86. #endif
  87. void handleAsyncUpdate() override;
  88. void showMessageBubble (const String&);
  89. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow)
  90. };