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.

112 lines
4.1KB

  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 getLocalIncludeFolder (ProjectSaver& projectSaver) const;
  41. static bool fileTargetMatches (ProjectExporter& exporter, const String& target);
  42. struct FileSorter
  43. {
  44. static int compareElements (const File& f1, const File& f2)
  45. {
  46. return f1.getFileName().compareIgnoreCase (f2.getFileName());
  47. }
  48. };
  49. void findWildcardMatches (const File& localModuleFolder, const String& wildcardPath, Array<File>& result) const;
  50. void addFileWithGroups (Project::Item& group, const RelativePath& file, const String& path) const;
  51. void findAndAddCompiledCode (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& localModuleFolder, Array<File>& result) const;
  52. void addBrowsableCode (ProjectExporter& exporter, const Array<File>& compiled, const File& localModuleFolder) const;
  53. void createLocalHeaderWrapper (ProjectSaver& projectSaver, const File& originalHeader, const File& localHeader) const;
  54. RelativePath getModuleRelativeToProject (ProjectExporter& exporter) const;
  55. bool isPluginClient() const;
  56. bool isAUPluginHost (const Project& project) const;
  57. bool isVSTPluginHost (const Project& project) const;
  58. };
  59. //==============================================================================
  60. class ModuleList
  61. {
  62. public:
  63. ModuleList();
  64. static ModuleList& getInstance();
  65. //==============================================================================
  66. void rescan();
  67. LibraryModule* loadModule (const String& uid) const;
  68. void getDependencies (const String& moduleID, StringArray& dependencies) const;
  69. void createDependencies (const String& moduleID, OwnedArray<LibraryModule>& modules) const;
  70. //==============================================================================
  71. struct Module
  72. {
  73. LibraryModule* create() const;
  74. String uid, name, description;
  75. File file;
  76. };
  77. const Module* findModuleInfo (const String& uid) const;
  78. OwnedArray<Module> modules;
  79. private:
  80. File moduleFolder;
  81. };
  82. #endif // __JUCER_MODULE_JUCEHEADER__