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.

678 lines
26KB

  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. #include <typeinfo>
  18. #include "JuceDemoHeader.h"
  19. //==============================================================================
  20. struct AlphabeticDemoSorter
  21. {
  22. static int compareElements (const JuceDemoTypeBase* first, const JuceDemoTypeBase* second)
  23. {
  24. return first->name.compare (second->name);
  25. }
  26. };
  27. JuceDemoTypeBase::JuceDemoTypeBase (const String& demoName) : name (demoName)
  28. {
  29. AlphabeticDemoSorter sorter;
  30. getDemoTypeList().addSorted (sorter, this);
  31. }
  32. JuceDemoTypeBase::~JuceDemoTypeBase()
  33. {
  34. getDemoTypeList().removeFirstMatchingValue (this);
  35. }
  36. Array<JuceDemoTypeBase*>& JuceDemoTypeBase::getDemoTypeList()
  37. {
  38. static Array<JuceDemoTypeBase*> list;
  39. return list;
  40. }
  41. //==============================================================================
  42. #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC
  43. // Just add a simple icon to the Window system tray area or Mac menu bar..
  44. class DemoTaskbarComponent : public SystemTrayIconComponent,
  45. private Timer
  46. {
  47. public:
  48. DemoTaskbarComponent()
  49. {
  50. setIconImage (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize));
  51. setIconTooltip ("Juce Demo App!");
  52. }
  53. void mouseDown (const MouseEvent&) override
  54. {
  55. // On OSX, there can be problems launching a menu when we're not the foreground
  56. // process, so just in case, we'll first make our process active, and then use a
  57. // timer to wait a moment before opening our menu, which gives the OS some time to
  58. // get its act together and bring our windows to the front.
  59. Process::makeForegroundProcess();
  60. startTimer (50);
  61. }
  62. // This is invoked when the menu is clicked or dismissed
  63. static void menuInvocationCallback (int chosenItemID, DemoTaskbarComponent*)
  64. {
  65. if (chosenItemID == 1)
  66. JUCEApplication::getInstance()->systemRequestedQuit();
  67. }
  68. private:
  69. void timerCallback() override
  70. {
  71. stopTimer();
  72. PopupMenu m;
  73. m.addItem (1, "Quit the Juce demo");
  74. // It's always better to open menus asynchronously when possible.
  75. m.showMenuAsync (PopupMenu::Options(),
  76. ModalCallbackFunction::forComponent (menuInvocationCallback, this));
  77. }
  78. };
  79. #endif
  80. bool juceDemoRepaintDebuggingActive = false;
  81. //==============================================================================
  82. class ContentComponent : public Component,
  83. public ListBoxModel,
  84. public ApplicationCommandTarget
  85. {
  86. public:
  87. ContentComponent()
  88. {
  89. // set lookAndFeel colour properties
  90. lookAndFeelV3.setColour (Label::textColourId, Colours::white);
  91. lookAndFeelV3.setColour (Label::textColourId, Colours::white);
  92. lookAndFeelV3.setColour (ToggleButton::textColourId, Colours::white);
  93. LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3);
  94. demoList.setModel (this);
  95. demoList.setColour (ListBox::backgroundColourId, Colour::greyLevel (0.2f));
  96. demoList.selectRow (0);
  97. addAndMakeVisible (demoList);
  98. }
  99. void clearCurrentDemo()
  100. {
  101. currentDemo = nullptr;
  102. }
  103. void resized() override
  104. {
  105. Rectangle<int> r (getLocalBounds());
  106. if (r.getWidth() > 600)
  107. {
  108. demoList.setBounds (r.removeFromLeft (210));
  109. demoList.setRowHeight (20);
  110. }
  111. else
  112. {
  113. demoList.setBounds (r.removeFromLeft (130));
  114. demoList.setRowHeight (30);
  115. }
  116. if (currentDemo != nullptr)
  117. currentDemo->setBounds (r);
  118. }
  119. int getNumRows() override
  120. {
  121. return JuceDemoTypeBase::getDemoTypeList().size();
  122. }
  123. void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected) override
  124. {
  125. if (rowIsSelected)
  126. g.fillAll (Colours::deepskyblue);
  127. if (JuceDemoTypeBase* type = JuceDemoTypeBase::getDemoTypeList() [rowNumber])
  128. {
  129. String name (type->name.trimCharactersAtStart ("0123456789").trimStart());
  130. AttributedString a;
  131. a.setJustification (Justification::centredLeft);
  132. String category;
  133. if (name.containsChar (':'))
  134. {
  135. category = name.upToFirstOccurrenceOf (":", true, false);
  136. name = name.fromFirstOccurrenceOf (":", false, false).trim();
  137. if (height > 20)
  138. category << "\n";
  139. else
  140. category << " ";
  141. }
  142. if (category.isNotEmpty())
  143. a.append (category, Font (10.0f), Colour::greyLevel (0.5f));
  144. a.append (name, Font (13.0f), Colours::white.withAlpha (0.9f));
  145. a.draw (g, Rectangle<int> (width + 10, height).reduced (6, 0).toFloat());
  146. }
  147. }
  148. void selectedRowsChanged (int lastRowSelected) override
  149. {
  150. if (JuceDemoTypeBase* selectedDemoType = JuceDemoTypeBase::getDemoTypeList() [lastRowSelected])
  151. {
  152. currentDemo = nullptr;
  153. addAndMakeVisible (currentDemo = selectedDemoType->createComponent());
  154. currentDemo->setName (selectedDemoType->name);
  155. resized();
  156. }
  157. }
  158. MouseCursor getMouseCursorForRow (int /*row*/) override
  159. {
  160. return MouseCursor::PointingHandCursor;
  161. }
  162. int getCurrentPageIndex() const noexcept
  163. {
  164. if (currentDemo == nullptr)
  165. return -1;
  166. Array<JuceDemoTypeBase*>& demos (JuceDemoTypeBase::getDemoTypeList());
  167. for (int i = demos.size(); --i >= 0;)
  168. if (demos.getUnchecked (i)->name == currentDemo->getName())
  169. return i;
  170. return -1;
  171. }
  172. void moveDemoPages (int numPagesToMove)
  173. {
  174. const int newIndex = negativeAwareModulo (getCurrentPageIndex() + numPagesToMove,
  175. JuceDemoTypeBase::getDemoTypeList().size());
  176. demoList.selectRow (newIndex);
  177. // we have to go through our demo list here or it won't be updated to reflect the current demo
  178. }
  179. bool isShowingOpenGLDemo() const
  180. {
  181. return currentDemo != nullptr
  182. && currentDemo->getName().contains ("OpenGL")
  183. && ! isShowingOpenGL2DDemo();
  184. }
  185. bool isShowingOpenGL2DDemo() const
  186. {
  187. return currentDemo != nullptr && currentDemo->getName().contains ("OpenGL 2D");
  188. }
  189. private:
  190. ListBox demoList;
  191. ScopedPointer<Component> currentDemo;
  192. LookAndFeel_V1 lookAndFeelV1;
  193. LookAndFeel_V2 lookAndFeelV2;
  194. LookAndFeel_V3 lookAndFeelV3;
  195. //==============================================================================
  196. // The following methods implement the ApplicationCommandTarget interface, allowing
  197. // this window to publish a set of actions it can perform, and which can be mapped
  198. // onto menus, keypresses, etc.
  199. ApplicationCommandTarget* getNextCommandTarget() override
  200. {
  201. // this will return the next parent component that is an ApplicationCommandTarget (in this
  202. // case, there probably isn't one, but it's best to use this method in your own apps).
  203. return findFirstTargetParentComponent();
  204. }
  205. void getAllCommands (Array<CommandID>& commands) override
  206. {
  207. // this returns the set of all commands that this target can perform..
  208. const CommandID ids[] = { MainAppWindow::showPreviousDemo,
  209. MainAppWindow::showNextDemo,
  210. MainAppWindow::welcome,
  211. MainAppWindow::componentsAnimation,
  212. MainAppWindow::componentsDialogBoxes,
  213. MainAppWindow::componentsKeyMappings,
  214. MainAppWindow::componentsMDI,
  215. MainAppWindow::componentsPropertyEditors,
  216. MainAppWindow::componentsTransforms,
  217. MainAppWindow::componentsWebBrowsers,
  218. MainAppWindow::componentsWidgets,
  219. MainAppWindow::useLookAndFeelV1,
  220. MainAppWindow::useLookAndFeelV2,
  221. MainAppWindow::useLookAndFeelV3,
  222. MainAppWindow::toggleRepaintDebugging,
  223. #if ! JUCE_LINUX
  224. MainAppWindow::goToKioskMode,
  225. #endif
  226. MainAppWindow::useNativeTitleBar
  227. };
  228. commands.addArray (ids, numElementsInArray (ids));
  229. const CommandID engineIDs[] = { MainAppWindow::renderingEngineOne,
  230. MainAppWindow::renderingEngineTwo,
  231. MainAppWindow::renderingEngineThree };
  232. StringArray renderingEngines (MainAppWindow::getMainAppWindow()->getRenderingEngines());
  233. commands.addArray (engineIDs, renderingEngines.size());
  234. }
  235. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override
  236. {
  237. const String generalCategory ("General");
  238. const String demosCategory ("Demos");
  239. switch (commandID)
  240. {
  241. case MainAppWindow::showPreviousDemo:
  242. result.setInfo ("Previous Demo", "Shows the previous demo in the list", demosCategory, 0);
  243. result.addDefaultKeypress ('-', ModifierKeys::commandModifier);
  244. break;
  245. case MainAppWindow::showNextDemo:
  246. result.setInfo ("Next Demo", "Shows the next demo in the list", demosCategory, 0);
  247. result.addDefaultKeypress ('=', ModifierKeys::commandModifier);
  248. break;
  249. case MainAppWindow::welcome:
  250. result.setInfo ("Welcome Demo", "Shows the 'Welcome' demo", demosCategory, 0);
  251. result.addDefaultKeypress ('1', ModifierKeys::commandModifier);
  252. break;
  253. case MainAppWindow::componentsAnimation:
  254. result.setInfo ("Animation Demo", "Shows the 'Animation' demo", demosCategory, 0);
  255. result.addDefaultKeypress ('2', ModifierKeys::commandModifier);
  256. break;
  257. case MainAppWindow::componentsDialogBoxes:
  258. result.setInfo ("Dialog Boxes Demo", "Shows the 'Dialog Boxes' demo", demosCategory, 0);
  259. result.addDefaultKeypress ('3', ModifierKeys::commandModifier);
  260. break;
  261. case MainAppWindow::componentsKeyMappings:
  262. result.setInfo ("Key Mappings Demo", "Shows the 'Key Mappings' demo", demosCategory, 0);
  263. result.addDefaultKeypress ('4', ModifierKeys::commandModifier);
  264. break;
  265. case MainAppWindow::componentsMDI:
  266. result.setInfo ("Multi-Document Demo", "Shows the 'Multi-Document' demo", demosCategory, 0);
  267. result.addDefaultKeypress ('5', ModifierKeys::commandModifier);
  268. break;
  269. case MainAppWindow::componentsPropertyEditors:
  270. result.setInfo ("Property Editor Demo", "Shows the 'Property Editor' demo", demosCategory, 0);
  271. result.addDefaultKeypress ('6', ModifierKeys::commandModifier);
  272. break;
  273. case MainAppWindow::componentsTransforms:
  274. result.setInfo ("Component Transforms Demo", "Shows the 'Transforms' demo", demosCategory, 0);
  275. result.addDefaultKeypress ('7', ModifierKeys::commandModifier);
  276. break;
  277. case MainAppWindow::componentsWebBrowsers:
  278. result.setInfo ("Web Browser Demo", "Shows the 'Web Browser' demo", demosCategory, 0);
  279. result.addDefaultKeypress ('8', ModifierKeys::commandModifier);
  280. break;
  281. case MainAppWindow::componentsWidgets:
  282. result.setInfo ("Widgets Demo", "Shows the 'Widgets' demo", demosCategory, 0);
  283. result.addDefaultKeypress ('9', ModifierKeys::commandModifier);
  284. break;
  285. case MainAppWindow::renderingEngineOne:
  286. case MainAppWindow::renderingEngineTwo:
  287. case MainAppWindow::renderingEngineThree:
  288. {
  289. MainAppWindow& mainWindow = *MainAppWindow::getMainAppWindow();
  290. const StringArray engines (mainWindow.getRenderingEngines());
  291. const int index = commandID - MainAppWindow::renderingEngineOne;
  292. result.setInfo ("Use " + engines[index], "Uses the " + engines[index] + " engine to render the UI", generalCategory, 0);
  293. result.setTicked (mainWindow.getActiveRenderingEngine() == index);
  294. result.addDefaultKeypress ('1' + index, ModifierKeys::noModifiers);
  295. break;
  296. }
  297. case MainAppWindow::useLookAndFeelV1:
  298. result.setInfo ("Use LookAndFeel_V1", String(), generalCategory, 0);
  299. result.addDefaultKeypress ('i', ModifierKeys::commandModifier);
  300. result.setTicked (isLookAndFeelSelected<LookAndFeel_V1>());
  301. break;
  302. case MainAppWindow::useLookAndFeelV2:
  303. result.setInfo ("Use LookAndFeel_V2", String(), generalCategory, 0);
  304. result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
  305. result.setTicked (isLookAndFeelSelected<LookAndFeel_V2>());
  306. break;
  307. case MainAppWindow::useLookAndFeelV3:
  308. result.setInfo ("Use LookAndFeel_V3", String(), generalCategory, 0);
  309. result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
  310. result.setTicked (isLookAndFeelSelected<LookAndFeel_V3>());
  311. break;
  312. case MainAppWindow::toggleRepaintDebugging:
  313. result.setInfo ("Toggle repaint display", String(), generalCategory, 0);
  314. result.addDefaultKeypress ('r', ModifierKeys());
  315. result.setTicked (juceDemoRepaintDebuggingActive);
  316. break;
  317. case MainAppWindow::useNativeTitleBar:
  318. {
  319. result.setInfo ("Use native window title bar", String(), generalCategory, 0);
  320. result.addDefaultKeypress ('n', ModifierKeys::commandModifier);
  321. bool nativeTitlebar = false;
  322. if (MainAppWindow* map = MainAppWindow::getMainAppWindow())
  323. nativeTitlebar = map->isUsingNativeTitleBar();
  324. result.setTicked (nativeTitlebar);
  325. break;
  326. }
  327. #if ! JUCE_LINUX
  328. case MainAppWindow::goToKioskMode:
  329. result.setInfo ("Show full-screen kiosk mode", String(), generalCategory, 0);
  330. result.addDefaultKeypress ('f', ModifierKeys::commandModifier);
  331. result.setTicked (Desktop::getInstance().getKioskModeComponent() != 0);
  332. break;
  333. #endif
  334. default:
  335. break;
  336. }
  337. }
  338. bool perform (const InvocationInfo& info) override
  339. {
  340. MainAppWindow* mainWindow = MainAppWindow::getMainAppWindow();
  341. if (mainWindow == nullptr)
  342. return true;
  343. switch (info.commandID)
  344. {
  345. case MainAppWindow::showPreviousDemo: moveDemoPages (-1); break;
  346. case MainAppWindow::showNextDemo: moveDemoPages ( 1); break;
  347. case MainAppWindow::welcome:
  348. case MainAppWindow::componentsAnimation:
  349. case MainAppWindow::componentsDialogBoxes:
  350. case MainAppWindow::componentsKeyMappings:
  351. case MainAppWindow::componentsMDI:
  352. case MainAppWindow::componentsPropertyEditors:
  353. case MainAppWindow::componentsTransforms:
  354. case MainAppWindow::componentsWebBrowsers:
  355. case MainAppWindow::componentsWidgets:
  356. demoList.selectRow (info.commandID - MainAppWindow::welcome);
  357. break;
  358. case MainAppWindow::renderingEngineOne:
  359. case MainAppWindow::renderingEngineTwo:
  360. case MainAppWindow::renderingEngineThree:
  361. mainWindow->setRenderingEngine (info.commandID - MainAppWindow::renderingEngineOne);
  362. break;
  363. case MainAppWindow::useLookAndFeelV1: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1); break;
  364. case MainAppWindow::useLookAndFeelV2: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV2); break;
  365. case MainAppWindow::useLookAndFeelV3: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); break;
  366. case MainAppWindow::toggleRepaintDebugging:
  367. juceDemoRepaintDebuggingActive = ! juceDemoRepaintDebuggingActive;
  368. mainWindow->repaint();
  369. break;
  370. case MainAppWindow::useNativeTitleBar:
  371. mainWindow->setUsingNativeTitleBar (! mainWindow->isUsingNativeTitleBar());
  372. break;
  373. #if ! JUCE_LINUX
  374. case MainAppWindow::goToKioskMode:
  375. {
  376. Desktop& desktop = Desktop::getInstance();
  377. if (desktop.getKioskModeComponent() == nullptr)
  378. desktop.setKioskModeComponent (getTopLevelComponent());
  379. else
  380. desktop.setKioskModeComponent (nullptr);
  381. break;
  382. }
  383. #endif
  384. default:
  385. return false;
  386. }
  387. return true;
  388. }
  389. template <typename LookAndFeelType>
  390. bool isLookAndFeelSelected()
  391. {
  392. LookAndFeel& lf = getLookAndFeel();
  393. return typeid (LookAndFeelType) == typeid (lf);
  394. }
  395. };
  396. //==============================================================================
  397. static ScopedPointer<ApplicationCommandManager> applicationCommandManager;
  398. static ScopedPointer<AudioDeviceManager> sharedAudioDeviceManager;
  399. MainAppWindow::MainAppWindow()
  400. : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
  401. Colours::lightgrey,
  402. DocumentWindow::allButtons)
  403. {
  404. setUsingNativeTitleBar (true);
  405. setResizable (true, false);
  406. setResizeLimits (400, 400, 10000, 10000);
  407. #if JUCE_IOS || JUCE_ANDROID
  408. setFullScreen (true);
  409. #else
  410. setBounds ((int) (0.1f * getParentWidth()),
  411. (int) (0.1f * getParentHeight()),
  412. jmax (850, (int) (0.5f * getParentWidth())),
  413. jmax (600, (int) (0.7f * getParentHeight())));
  414. #endif
  415. contentComponent = new ContentComponent();
  416. setContentNonOwned (contentComponent, false);
  417. setVisible (true);
  418. // this lets the command manager use keypresses that arrive in our window to send out commands
  419. addKeyListener (getApplicationCommandManager().getKeyMappings());
  420. #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC
  421. taskbarIcon = new DemoTaskbarComponent();
  422. #endif
  423. #if JUCE_ANDROID
  424. setOpenGLRenderingEngine();
  425. #endif
  426. triggerAsyncUpdate();
  427. }
  428. MainAppWindow::~MainAppWindow()
  429. {
  430. contentComponent->clearCurrentDemo();
  431. clearContentComponent();
  432. contentComponent = nullptr;
  433. applicationCommandManager = nullptr;
  434. sharedAudioDeviceManager = nullptr;
  435. #if JUCE_OPENGL
  436. openGLContext.detach();
  437. #endif
  438. }
  439. void MainAppWindow::closeButtonPressed()
  440. {
  441. JUCEApplication::getInstance()->systemRequestedQuit();
  442. }
  443. ApplicationCommandManager& MainAppWindow::getApplicationCommandManager()
  444. {
  445. if (applicationCommandManager == nullptr)
  446. applicationCommandManager = new ApplicationCommandManager();
  447. return *applicationCommandManager;
  448. }
  449. AudioDeviceManager& MainAppWindow::getSharedAudioDeviceManager()
  450. {
  451. if (sharedAudioDeviceManager == nullptr)
  452. {
  453. sharedAudioDeviceManager = new AudioDeviceManager();
  454. RuntimePermissions::request (RuntimePermissions::recordAudio, runtimPermissionsCallback);
  455. }
  456. return *sharedAudioDeviceManager;
  457. }
  458. void MainAppWindow::runtimPermissionsCallback (bool wasGranted)
  459. {
  460. int numInputChannels = wasGranted ? 2 : 0;
  461. sharedAudioDeviceManager->initialise (numInputChannels, 2, nullptr, true, String(), nullptr);
  462. }
  463. MainAppWindow* MainAppWindow::getMainAppWindow()
  464. {
  465. for (int i = TopLevelWindow::getNumTopLevelWindows(); --i >= 0;)
  466. if (MainAppWindow* maw = dynamic_cast<MainAppWindow*> (TopLevelWindow::getTopLevelWindow (i)))
  467. return maw;
  468. return nullptr;
  469. }
  470. void MainAppWindow::handleAsyncUpdate()
  471. {
  472. // This registers all of our commands with the command manager but has to be done after the window has
  473. // been created so we can find the number of rendering engines available
  474. ApplicationCommandManager& commandManager = MainAppWindow::getApplicationCommandManager();
  475. commandManager.registerAllCommandsForTarget (contentComponent);
  476. commandManager.registerAllCommandsForTarget (JUCEApplication::getInstance());
  477. }
  478. void MainAppWindow::showMessageBubble (const String& text)
  479. {
  480. currentBubbleMessage = new BubbleMessageComponent (500);
  481. getContentComponent()->addChildComponent (currentBubbleMessage);
  482. AttributedString attString;
  483. attString.append (text, Font (15.0f));
  484. currentBubbleMessage->showAt (Rectangle<int> (getLocalBounds().getCentreX(), 10, 1, 1),
  485. attString,
  486. 500, // numMillisecondsBeforeRemoving
  487. true, // removeWhenMouseClicked
  488. false); // deleteSelfAfterUse
  489. }
  490. static const char* openGLRendererName = "OpenGL Renderer";
  491. StringArray MainAppWindow::getRenderingEngines() const
  492. {
  493. StringArray renderingEngines;
  494. if (ComponentPeer* peer = getPeer())
  495. renderingEngines = peer->getAvailableRenderingEngines();
  496. #if JUCE_OPENGL
  497. renderingEngines.add (openGLRendererName);
  498. #endif
  499. return renderingEngines;
  500. }
  501. void MainAppWindow::setRenderingEngine (int index)
  502. {
  503. showMessageBubble (getRenderingEngines()[index]);
  504. #if JUCE_OPENGL
  505. if (getRenderingEngines()[index] == openGLRendererName
  506. && contentComponent != nullptr
  507. && ! contentComponent->isShowingOpenGLDemo())
  508. {
  509. openGLContext.attachTo (*getTopLevelComponent());
  510. return;
  511. }
  512. openGLContext.detach();
  513. #endif
  514. if (ComponentPeer* peer = getPeer())
  515. peer->setCurrentRenderingEngine (index);
  516. }
  517. void MainAppWindow::setOpenGLRenderingEngine()
  518. {
  519. setRenderingEngine (getRenderingEngines().indexOf (openGLRendererName));
  520. }
  521. int MainAppWindow::getActiveRenderingEngine() const
  522. {
  523. #if JUCE_OPENGL
  524. if (openGLContext.isAttached())
  525. return getRenderingEngines().indexOf (openGLRendererName);
  526. #endif
  527. if (ComponentPeer* peer = getPeer())
  528. return peer->getCurrentRenderingEngine();
  529. return 0;
  530. }
  531. Path MainAppWindow::getJUCELogoPath()
  532. {
  533. return Drawable::parseSVGPath (
  534. "M250,301.3c-37.2,0-67.5-30.3-67.5-67.5s30.3-67.5,67.5-67.5s67.5,30.3,67.5,67.5S287.2,301.3,250,301.3zM250,170.8c-34.7,0-63,28.3-63,63s28.3,63,63,63s63-28.3,63-63S284.7,170.8,250,170.8z"
  535. "M247.8,180.4c0-2.3-1.8-4.1-4.1-4.1c-0.2,0-0.3,0-0.5,0c-10.6,1.2-20.6,5.4-29,12c-1,0.8-1.5,1.8-1.6,2.9c-0.1,1.2,0.4,2.3,1.3,3.2l32.5,32.5c0.5,0.5,1.4,0.1,1.4-0.6V180.4z"
  536. "M303.2,231.6c1.2,0,2.3-0.4,3.1-1.2c0.9-0.9,1.3-2.1,1.1-3.3c-1.2-10.6-5.4-20.6-12-29c-0.8-1-1.9-1.6-3.2-1.6c-1.1,0-2.1,0.5-3,1.3l-32.5,32.5c-0.5,0.5-0.1,1.4,0.6,1.4L303.2,231.6z"
  537. "M287.4,191.3c-0.1-1.1-0.6-2.2-1.6-2.9c-8.4-6.6-18.4-10.8-29-12c-0.2,0-0.3,0-0.5,0c-2.3,0-4.1,1.9-4.1,4.1v46c0,0.7,0.9,1.1,1.4,0.6l32.5-32.5C287,193.6,287.5,192.5,287.4,191.3z"
  538. "M252.2,287.2c0,2.3,1.8,4.1,4.1,4.1c0.2,0,0.3,0,0.5,0c10.6-1.2,20.6-5.4,29-12c1-0.8,1.5-1.8,1.6-2.9c0.1-1.2-0.4-2.3-1.3-3.2l-32.5-32.5c-0.5-0.5-1.4-0.1-1.4,0.6V287.2z"
  539. "M292.3,271.2L292.3,271.2c1.2,0,2.4-0.6,3.2-1.6c6.6-8.4,10.8-18.4,12-29c0.1-1.2-0.3-2.4-1.1-3.3c-0.8-0.8-1.9-1.2-3.1-1.2l-45.9,0c-0.7,0-1.1,0.9-0.6,1.4l32.5,32.5C290.2,270.8,291.2,271.2,292.3,271.2z"
  540. "M207.7,196.4c-1.2,0-2.4,0.6-3.2,1.6c-6.6,8.4-10.8,18.4-12,29c-0.1,1.2,0.3,2.4,1.1,3.3c0.8,0.8,1.9,1.2,3.1,1.2l45.9,0c0.7,0,1.1-0.9,0.6-1.4l-32.5-32.5C209.8,196.8,208.8,196.4,207.7,196.4z"
  541. "M242.6,236.1l-45.9,0c-1.2,0-2.3,0.4-3.1,1.2c-0.9,0.9-1.3,2.1-1.1,3.3c1.2,10.6,5.4,20.6,12,29c0.8,1,1.9,1.6,3.2,1.6c1.1,0,2.1-0.5,3-1.3c0,0,0,0,0,0l32.5-32.5C243.7,236.9,243.4,236.1,242.6,236.1z"
  542. "M213.8,273.1L213.8,273.1c-0.9,0.9-1.3,2-1.3,3.2c0.1,1.1,0.6,2.2,1.6,2.9c8.4,6.6,18.4,10.8,29,12c0.2,0,0.3,0,0.5,0h0c1.2,0,2.3-0.5,3.1-1.4c0.7-0.8,1-1.8,1-2.9v-45.9c0-0.7-0.9-1.1-1.4-0.6l-13.9,13.9L213.8,273.1z"
  543. "M197.2,353c-4.1,0-7.4-1.5-10.4-5.4l4-3.5c2,2.6,3.9,3.6,6.4,3.6c4.4,0,7.4-3.3,7.4-8.3v-24.7h5.6v24.7C210.2,347.5,204.8,353,197.2,353z"
  544. "M232.4,353c-8.1,0-15-6-15-15.8v-22.5h5.6v22.2c0,6.6,3.9,10.8,9.5,10.8c5.6,0,9.5-4.3,9.5-10.8v-22.2h5.6v22.5C247.5,347,240.5,353,232.4,353z"
  545. "M272,353c-10.8,0-19.5-8.6-19.5-19.3c0-10.8,8.8-19.3,19.5-19.3c4.8,0,9,1.6,12.3,4.4l-3.3,4.1c-3.4-2.4-5.7-3.2-8.9-3.2c-7.7,0-13.8,6.2-13.8,14.1c0,7.9,6.1,14.1,13.8,14.1c3.1,0,5.6-1,8.8-3.2l3.3,4.1C280.1,351.9,276.4,353,272,353z"
  546. "M290.4,352.5v-37.8h22.7v5H296v11.2h16.5v5H296v11.6h17.2v5H290.4z");
  547. };