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.

115 lines
4.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 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_MODULE_JUCEHEADER__
  19. #define __JUCER_MODULE_JUCEHEADER__
  20. #include "../jucer_Headers.h"
  21. #include "jucer_Project.h"
  22. class ProjectExporter;
  23. class ProjectSaver;
  24. //==============================================================================
  25. class LibraryModule
  26. {
  27. public:
  28. LibraryModule (const File& file);
  29. String getID() const;
  30. bool isValid() const;
  31. void writeIncludes (ProjectSaver& projectSaver, OutputStream& out);
  32. void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const;
  33. void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const;
  34. void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) const;
  35. var moduleInfo;
  36. private:
  37. File moduleFile, moduleFolder;
  38. mutable Array<File> sourceFiles;
  39. File getInclude (const File& folder) const;
  40. File getModuleTargetFolder (ProjectSaver& projectSaver) const;
  41. String getPathToModuleFile (ProjectSaver& projectSaver, const File& file) const;
  42. static bool fileTargetMatches (ProjectExporter& exporter, const String& target);
  43. struct FileSorter
  44. {
  45. static int compareElements (const File& f1, const File& f2)
  46. {
  47. return f1.getFileName().compareIgnoreCase (f2.getFileName());
  48. }
  49. };
  50. void findWildcardMatches (const File& localModuleFolder, const String& wildcardPath, Array<File>& result) const;
  51. void addFileWithGroups (Project::Item& group, const File& file, const String& path) const;
  52. void findAndAddCompiledCode (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& localModuleFolder, Array<File>& result) const;
  53. void addBrowsableCode (ProjectExporter& exporter, const Array<File>& compiled, const File& localModuleFolder) const;
  54. static void writeSourceWrapper (OutputStream& out, Project& project, const String& pathFromJuceFolder);
  55. static void createMultipleIncludes (Project& project, const String& pathFromLibraryFolder, StringArray& paths, StringArray& guards);
  56. static void writeInclude (Project& project, OutputStream& out, const String& pathFromJuceFolder);
  57. bool isPluginClient() const;
  58. bool isAUPluginHost (const Project& project) const;
  59. bool isVSTPluginHost (const Project& project) const;
  60. };
  61. //==============================================================================
  62. class ModuleList
  63. {
  64. public:
  65. ModuleList();
  66. static ModuleList& getInstance();
  67. //==============================================================================
  68. void rescan();
  69. LibraryModule* loadModule (const String& uid) const;
  70. void getDependencies (const String& moduleID, StringArray& dependencies) const;
  71. void createDependencies (const String& moduleID, OwnedArray<LibraryModule>& modules) const;
  72. //==============================================================================
  73. struct Module
  74. {
  75. LibraryModule* create() const;
  76. String uid, name, description;
  77. File file;
  78. };
  79. const Module* findModuleInfo (const String& uid) const;
  80. OwnedArray<Module> modules;
  81. private:
  82. File moduleFolder;
  83. };
  84. #endif // __JUCER_MODULE_JUCEHEADER__