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.

91 lines
3.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-9 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCER_MAINWINDOW_JUCEHEADER__
  19. #define __JUCER_MAINWINDOW_JUCEHEADER__
  20. #include "jucer_ProjectContentComponent.h"
  21. #include "Component Editor/jucer_ComponentEditor.h"
  22. //==============================================================================
  23. /**
  24. The big top-level window where everything happens.
  25. */
  26. class MainWindow : public DocumentWindow,
  27. public MenuBarModel,
  28. public ApplicationCommandTarget,
  29. public FileDragAndDropTarget,
  30. public DragAndDropContainer
  31. {
  32. public:
  33. //==============================================================================
  34. MainWindow();
  35. ~MainWindow();
  36. //==============================================================================
  37. void closeButtonPressed();
  38. //==============================================================================
  39. void askUserToOpenFile();
  40. bool canOpenFile (const File& file) const;
  41. bool openFile (const File& file);
  42. void createNewProject();
  43. void setProject (Project* newProject);
  44. void reloadLastProject();
  45. bool closeProject (Project* project);
  46. bool closeCurrentProject();
  47. bool closeAllDocuments (bool askUserToSave);
  48. bool isInterestedInFileDrag (const StringArray& files);
  49. void filesDropped (const StringArray& filenames, int mouseX, int mouseY);
  50. void activeWindowStatusChanged();
  51. void updateTitle (const String& documentName);
  52. //==============================================================================
  53. const StringArray getMenuBarNames();
  54. const PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
  55. void menuItemSelected (int menuItemID, int topLevelMenuIndex);
  56. //==============================================================================
  57. ApplicationCommandTarget* getNextCommandTarget();
  58. void getAllCommands (Array <CommandID>& commands);
  59. void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
  60. bool perform (const InvocationInfo& info);
  61. //==============================================================================
  62. juce_UseDebuggingNewOperator
  63. private:
  64. ScopedPointer <Project> currentProject;
  65. ProjectContentComponent* getProjectContentComponent() const;
  66. };
  67. #endif // __JUCER_MAINWINDOW_JUCEHEADER__