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.

122 lines
4.6KB

  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. LibraryModule (const var& moduleInfo);
  30. bool isValid() const;
  31. String getID() const { return moduleInfo ["id"].toString(); }
  32. String getVersion() const { return moduleInfo ["version"].toString(); }
  33. String getName() const { return moduleInfo ["name"].toString(); }
  34. String getDescription() const { return moduleInfo ["description"].toString(); }
  35. void writeIncludes (ProjectSaver& projectSaver, OutputStream& out);
  36. void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const;
  37. void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const;
  38. void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) const;
  39. static String getInfoFileName() { return "juce_module_info"; }
  40. var moduleInfo;
  41. private:
  42. File moduleFile, moduleFolder;
  43. mutable Array<File> sourceFiles;
  44. File getInclude (const File& folder) const;
  45. File getLocalIncludeFolder (ProjectSaver& projectSaver) const;
  46. static bool fileTargetMatches (ProjectExporter& exporter, const String& target);
  47. struct FileSorter
  48. {
  49. static int compareElements (const File& f1, const File& f2)
  50. {
  51. return f1.getFileName().compareIgnoreCase (f2.getFileName());
  52. }
  53. };
  54. void findWildcardMatches (const File& localModuleFolder, const String& wildcardPath, Array<File>& result) const;
  55. void addFileWithGroups (Project::Item& group, const RelativePath& file, const String& path) const;
  56. void findAndAddCompiledCode (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& localModuleFolder, Array<File>& result) const;
  57. void addBrowsableCode (ProjectExporter& exporter, const Array<File>& compiled, const File& localModuleFolder) const;
  58. void createLocalHeaderWrapper (ProjectSaver& projectSaver, const File& originalHeader, const File& localHeader) const;
  59. RelativePath getModuleRelativeToProject (ProjectExporter& exporter) const;
  60. bool isPluginClient() const;
  61. bool isAUPluginHost (const Project& project) const;
  62. bool isVSTPluginHost (const Project& project) const;
  63. };
  64. //==============================================================================
  65. class ModuleList
  66. {
  67. public:
  68. ModuleList();
  69. //==============================================================================
  70. void rescan();
  71. void loadFromWebsite();
  72. LibraryModule* loadModule (const String& uid) const;
  73. void getDependencies (const String& moduleID, StringArray& dependencies) const;
  74. void createDependencies (const String& moduleID, OwnedArray<LibraryModule>& modules) const;
  75. //==============================================================================
  76. struct Module
  77. {
  78. LibraryModule* create() const;
  79. String uid, version, name, description;
  80. File file;
  81. URL url;
  82. };
  83. const Module* findModuleInfo (const String& uid) const;
  84. OwnedArray<Module> modules;
  85. private:
  86. File moduleFolder;
  87. void sort();
  88. };
  89. #endif // __JUCER_MODULE_JUCEHEADER__