diff --git a/extras/Introjucer/Builds/Linux/Makefile b/extras/Introjucer/Builds/Linux/Makefile
index e13ca865ca..3e70d93421 100644
--- a/extras/Introjucer/Builds/Linux/Makefile
+++ b/extras/Introjucer/Builds/Linux/Makefile
@@ -58,6 +58,7 @@ OBJECTS := \
$(OBJDIR)/jucer_ProjectExporter_eed6e04b.o \
$(OBJDIR)/jucer_ProjectInformationComponent_4746e69b.o \
$(OBJDIR)/jucer_ProjectTreeViewBase_63c2bdbe.o \
+ $(OBJDIR)/jucer_ProjectType_1bc27a24.o \
$(OBJDIR)/jucer_ResourceFile_7e7734e3.o \
$(OBJDIR)/jucer_TreeViewTypes_4a765287.o \
$(OBJDIR)/jucer_CodeHelpers_c317179c.o \
@@ -161,6 +162,11 @@ $(OBJDIR)/jucer_ProjectTreeViewBase_63c2bdbe.o: ../../Source/Project/jucer_Proje
@echo "Compiling jucer_ProjectTreeViewBase.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
+$(OBJDIR)/jucer_ProjectType_1bc27a24.o: ../../Source/Project/jucer_ProjectType.cpp
+ -@mkdir -p $(OBJDIR)
+ @echo "Compiling jucer_ProjectType.cpp"
+ @$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
+
$(OBJDIR)/jucer_ResourceFile_7e7734e3.o: ../../Source/Project/jucer_ResourceFile.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling jucer_ResourceFile.cpp"
diff --git a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
index e273226183..08b56cef56 100644
--- a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
+++ b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
@@ -33,6 +33,7 @@
379C4FA4F9F4F856A245D8F1 = { isa = PBXBuildFile; fileRef = 296E0498784BF03FA18B164B; };
A70571C45ECEB18061181367 = { isa = PBXBuildFile; fileRef = 6746790735D492AB157E5F26; };
7B65A9D3D6D5798649D90FA0 = { isa = PBXBuildFile; fileRef = EB49FFAB3424D162D2105B2D; };
+ 257C8841AC7634499B0B3D0A = { isa = PBXBuildFile; fileRef = 1328E38A600B515CD2CFBB7A; };
85572197E35546BB69861758 = { isa = PBXBuildFile; fileRef = 41C18D8743BCACB15D27EE21; };
0E22757B983B4F600F1B7916 = { isa = PBXBuildFile; fileRef = 7D678D4FD5505D7FCE7DCC7F; };
1501CEE9D0FD3C1185F6413B = { isa = PBXBuildFile; fileRef = 169DB589B861F57CDF896A02; };
@@ -86,17 +87,19 @@
8CD4ABA478205AA127FB9BE1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_Project.h"; path = "../../Source/Project/jucer_Project.h"; sourceTree = "SOURCE_ROOT"; };
8E44AB32AEDABC7E1D3FC49F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectContentComponent.cpp"; path = "../../Source/Project/jucer_ProjectContentComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
F2F98DA41146390D05A44EAD = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectContentComponent.h"; path = "../../Source/Project/jucer_ProjectContentComponent.h"; sourceTree = "SOURCE_ROOT"; };
- 296E0498784BF03FA18B164B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectExporter.cpp"; path = "../../Source/Project/jucer_ProjectExporter.cpp"; sourceTree = "SOURCE_ROOT"; };
- 5DE419991013E7C0F203E99F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExporter.h"; path = "../../Source/Project/jucer_ProjectExporter.h"; sourceTree = "SOURCE_ROOT"; };
AB9EE4734D894FBF1CF62C5F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExport_Android.h"; path = "../../Source/Project/jucer_ProjectExport_Android.h"; sourceTree = "SOURCE_ROOT"; };
889715B0152919B2EAA1F5F9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExport_Make.h"; path = "../../Source/Project/jucer_ProjectExport_Make.h"; sourceTree = "SOURCE_ROOT"; };
907F302BB89308CDB2C5FD0E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExport_MSVC.h"; path = "../../Source/Project/jucer_ProjectExport_MSVC.h"; sourceTree = "SOURCE_ROOT"; };
D250274734D729D2E0389A20 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExport_XCode.h"; path = "../../Source/Project/jucer_ProjectExport_XCode.h"; sourceTree = "SOURCE_ROOT"; };
+ 296E0498784BF03FA18B164B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectExporter.cpp"; path = "../../Source/Project/jucer_ProjectExporter.cpp"; sourceTree = "SOURCE_ROOT"; };
+ 5DE419991013E7C0F203E99F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectExporter.h"; path = "../../Source/Project/jucer_ProjectExporter.h"; sourceTree = "SOURCE_ROOT"; };
6746790735D492AB157E5F26 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectInformationComponent.cpp"; path = "../../Source/Project/jucer_ProjectInformationComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
4727C2C16D17BE642A3F5838 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectInformationComponent.h"; path = "../../Source/Project/jucer_ProjectInformationComponent.h"; sourceTree = "SOURCE_ROOT"; };
ADF962F14A1FCBB05B499E6C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectSaver.h"; path = "../../Source/Project/jucer_ProjectSaver.h"; sourceTree = "SOURCE_ROOT"; };
EB49FFAB3424D162D2105B2D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectTreeViewBase.cpp"; path = "../../Source/Project/jucer_ProjectTreeViewBase.cpp"; sourceTree = "SOURCE_ROOT"; };
27D0B6991943D6AD88E42FE5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectTreeViewBase.h"; path = "../../Source/Project/jucer_ProjectTreeViewBase.h"; sourceTree = "SOURCE_ROOT"; };
+ 1328E38A600B515CD2CFBB7A = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ProjectType.cpp"; path = "../../Source/Project/jucer_ProjectType.cpp"; sourceTree = "SOURCE_ROOT"; };
+ D39F212C819794FECD373008 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectType.h"; path = "../../Source/Project/jucer_ProjectType.h"; sourceTree = "SOURCE_ROOT"; };
41C18D8743BCACB15D27EE21 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ResourceFile.cpp"; path = "../../Source/Project/jucer_ResourceFile.cpp"; sourceTree = "SOURCE_ROOT"; };
05564317BD19EBC8416976DD = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ResourceFile.h"; path = "../../Source/Project/jucer_ResourceFile.h"; sourceTree = "SOURCE_ROOT"; };
7D678D4FD5505D7FCE7DCC7F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_TreeViewTypes.cpp"; path = "../../Source/Project/jucer_TreeViewTypes.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -166,17 +169,19 @@
8CD4ABA478205AA127FB9BE1,
8E44AB32AEDABC7E1D3FC49F,
F2F98DA41146390D05A44EAD,
- 296E0498784BF03FA18B164B,
- 5DE419991013E7C0F203E99F,
AB9EE4734D894FBF1CF62C5F,
889715B0152919B2EAA1F5F9,
907F302BB89308CDB2C5FD0E,
D250274734D729D2E0389A20,
+ 296E0498784BF03FA18B164B,
+ 5DE419991013E7C0F203E99F,
6746790735D492AB157E5F26,
4727C2C16D17BE642A3F5838,
ADF962F14A1FCBB05B499E6C,
EB49FFAB3424D162D2105B2D,
27D0B6991943D6AD88E42FE5,
+ 1328E38A600B515CD2CFBB7A,
+ D39F212C819794FECD373008,
41C18D8743BCACB15D27EE21,
05564317BD19EBC8416976DD,
7D678D4FD5505D7FCE7DCC7F,
@@ -332,6 +337,7 @@
379C4FA4F9F4F856A245D8F1,
A70571C45ECEB18061181367,
7B65A9D3D6D5798649D90FA0,
+ 257C8841AC7634499B0B3D0A,
85572197E35546BB69861758,
0E22757B983B4F600F1B7916,
1501CEE9D0FD3C1185F6413B,
diff --git a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
index a0ada28247..4fd0765361 100644
--- a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
@@ -160,17 +160,19 @@
-
-
+
+
+
+
diff --git a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
index 583949dde6..e56def19c2 100644
--- a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
@@ -160,17 +160,19 @@
-
-
+
+
+
+
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
index 4b4aa6a3e2..5a6b0f8a4b 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
@@ -137,6 +137,7 @@
+
@@ -166,14 +167,15 @@
-
+
+
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
index cbf326191b..494f7330d5 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
@@ -70,6 +70,9 @@
The Introjucer\Project
+
+ The Introjucer\Project
+
The Introjucer\Project
@@ -180,9 +183,6 @@
The Introjucer\Project
-
- The Introjucer\Project
-
The Introjucer\Project
@@ -195,6 +195,9 @@
The Introjucer\Project
+
+ The Introjucer\Project
+
The Introjucer\Project
@@ -204,6 +207,9 @@
The Introjucer\Project
+
+ The Introjucer\Project
+
The Introjucer\Project
diff --git a/extras/Introjucer/Introjucer.jucer b/extras/Introjucer/Introjucer.jucer
index 41178e556d..04798859c4 100644
--- a/extras/Introjucer/Introjucer.jucer
+++ b/extras/Introjucer/Introjucer.jucer
@@ -88,10 +88,6 @@
resource="0" file="Source/Project/jucer_ProjectContentComponent.cpp"/>
-
-
+
+
+
+
= 0;)
project.getConfiguration(i).getTargetBinaryName() = File::createLegalFileName (appTitle);
@@ -104,8 +101,8 @@ public:
if (! FileHelpers::overwriteFileWithNewDataIfDifferent (mainWindowCpp, windowCpp))
failedFiles.add (mainWindowCpp.getFullPathName());
- group.addFile (mainWindowCpp, -1);
- group.addFile (mainWindowH, -1);
+ sourceGroup.addFile (mainWindowCpp, -1);
+ sourceGroup.addFile (mainWindowH, -1);
}
if (createMainCpp)
@@ -125,7 +122,7 @@ public:
if (! FileHelpers::overwriteFileWithNewDataIfDifferent (mainCppFile, mainCpp))
failedFiles.add (mainCppFile.getFullPathName());
- group.addFile (mainCppFile, -1);
+ sourceGroup.addFile (mainCppFile, -1);
}
return true;
@@ -140,7 +137,6 @@ class ConsoleAppWizard : public NewProjectWizard
{
public:
ConsoleAppWizard() {}
- ~ConsoleAppWizard() {}
String getName() { return "Console Application"; }
String getDescription() { return "Creates a command-line application with no GUI features"; }
@@ -174,11 +170,9 @@ public:
File mainCppFile = getSourceFilesFolder().getChildFile ("Main.cpp");
- project.getProjectType() = Project::commandLineApp;
+ project.getProjectTypeValue() = ProjectType_ConsoleApp::getTypeName();
- Project::Item group (project.createNewGroup());
- project.getMainGroup().addChild (group, 0);
- group.getName() = "Source";
+ Project::Item sourceGroup (project.getMainGroup().addNewSubGroup ("Source", 0));
for (int i = project.getNumConfigurations(); --i >= 0;)
project.getConfiguration(i).getTargetBinaryName() = File::createLegalFileName (appTitle);
@@ -193,7 +187,7 @@ public:
if (! FileHelpers::overwriteFileWithNewDataIfDifferent (mainCppFile, mainCpp))
failedFiles.add (mainCppFile.getFullPathName());
- group.addFile (mainCppFile, -1);
+ sourceGroup.addFile (mainCppFile, -1);
}
return true;
@@ -208,7 +202,6 @@ class AudioPluginAppWizard : public NewProjectWizard
{
public:
AudioPluginAppWizard() {}
- ~AudioPluginAppWizard() {}
String getName() { return "Audio Plug-In"; }
String getDescription() { return "Creates an audio plugin project"; }
@@ -236,11 +229,9 @@ public:
File editorCppFile = getSourceFilesFolder().getChildFile ("PluginEditor.cpp");
File editorHFile = editorCppFile.withFileExtension (".h");
- project.getProjectType() = Project::audioPlugin;
+ project.getProjectTypeValue() = ProjectType_AudioPlugin::getTypeName();
- Project::Item group (project.createNewGroup());
- project.getMainGroup().addChild (group, 0);
- group.getName() = "Source";
+ Project::Item sourceGroup (project.getMainGroup().addNewSubGroup ("Source", 0));
project.getJuceConfigFlag ("JUCE_QUICKTIME") = Project::configFlagDisabled; // disabled because it interferes with RTAS build on PC
for (int i = project.getNumConfigurations(); --i >= 0;)
@@ -284,10 +275,10 @@ public:
if (! FileHelpers::overwriteFileWithNewDataIfDifferent (editorHFile, editorH))
failedFiles.add (editorHFile.getFullPathName());
- group.addFile (filterCppFile, -1);
- group.addFile (filterHFile, -1);
- group.addFile (editorCppFile, -1);
- group.addFile (editorHFile, -1);
+ sourceGroup.addFile (filterCppFile, -1);
+ sourceGroup.addFile (filterHFile, -1);
+ sourceGroup.addFile (editorCppFile, -1);
+ sourceGroup.addFile (editorHFile, -1);
return true;
}
@@ -328,7 +319,7 @@ NewProjectWizard::~NewProjectWizard()
{
}
-const StringArray NewProjectWizard::getWizards()
+StringArray NewProjectWizard::getWizards()
{
StringArray s;
diff --git a/extras/Introjucer/Source/Project/jucer_NewProjectWizard.h b/extras/Introjucer/Source/Project/jucer_NewProjectWizard.h
index cfb2879d8c..53c1097b3c 100644
--- a/extras/Introjucer/Source/Project/jucer_NewProjectWizard.h
+++ b/extras/Introjucer/Source/Project/jucer_NewProjectWizard.h
@@ -37,7 +37,7 @@ public:
virtual ~NewProjectWizard();
//==============================================================================
- static const StringArray getWizards();
+ static StringArray getWizards();
static int getNumWizards();
static NewProjectWizard* createWizard (int index);
diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp
index 48ba7eec36..474faade12 100644
--- a/extras/Introjucer/Source/Project/jucer_Project.cpp
+++ b/extras/Introjucer/Source/Project/jucer_Project.cpp
@@ -24,6 +24,7 @@
*/
#include "jucer_Project.h"
+#include "jucer_ProjectType.h"
#include "jucer_ProjectExporter.h"
#include "jucer_ResourceFile.h"
#include "jucer_ProjectSaver.h"
@@ -105,7 +106,7 @@ void Project::setMissingDefaultValues()
setTitle ("Juce Project");
if (! projectRoot.hasProperty (Ids::projectType))
- getProjectType() = application;
+ getProjectTypeValue() = ProjectType_GUIApp::getTypeName();
if (! projectRoot.hasProperty (Ids::version))
getVersion() = "1.0.0";
@@ -211,7 +212,7 @@ void Project::setLastDocumentOpened (const File& file)
//==============================================================================
void Project::valueTreePropertyChanged (ValueTree& tree, const Identifier& property)
{
- if (isLibrary())
+ if (getProjectType().isLibrary())
getJuceLinkageModeValue() = notLinkedToJuce;
changed();
@@ -281,18 +282,26 @@ bool Project::shouldBeAddedToBinaryResourcesByDefault (const File& file)
return ! file.hasFileExtension (sourceOrHeaderFileExtensions);
}
-//==============================================================================
-const char* const Project::application = "guiapp";
-const char* const Project::commandLineApp = "consoleapp";
-const char* const Project::audioPlugin = "audioplug";
-const char* const Project::library = "library";
-const char* const Project::browserPlugin = "browserplug";
+bool Project::shouldAddVSTFolderToPath()
+{
+ return (getProjectType().isAudioPlugin()
+ && (bool) shouldBuildVST().getValue()) || getJuceConfigFlag ("JUCE_PLUGINHOST_VST").toString() == configFlagEnabled;
+}
-bool Project::isLibrary() const { return getProjectType().toString() == library; }
-bool Project::isGUIApplication() const { return getProjectType().toString() == application; }
-bool Project::isCommandLineApp() const { return getProjectType().toString() == commandLineApp; }
-bool Project::isAudioPlugin() const { return getProjectType().toString() == audioPlugin; }
-bool Project::isBrowserPlugin() const { return getProjectType().toString() == browserPlugin; }
+//==============================================================================
+const ProjectType& Project::getProjectType() const
+{
+ const ProjectType* type = ProjectType::findType (getProjectTypeValue().toString());
+ jassert (type != nullptr);
+
+ if (type == nullptr)
+ {
+ type = ProjectType::findType (ProjectType_GUIApp::getTypeName());
+ jassert (type != nullptr);
+ }
+
+ return *type;
+}
const char* const Project::notLinkedToJuce = "none";
const char* const Project::useLinkedJuce = "static";
@@ -324,9 +333,20 @@ void Project::createPropertyEditors (Array & props)
props.add (new TextPropertyComponent (getVersion(), "Project Version", 16, false));
props.getLast()->setTooltip ("The project's version number, This should be in the format major.minor.point");
- const char* projectTypes[] = { "Application (GUI)", "Application (Non-GUI)", "Audio Plug-in", "Static Library", 0 };
- const char* projectTypeValues[] = { application, commandLineApp, audioPlugin, library, 0 };
- props.add (new ChoicePropertyComponent (getProjectType(), "Project Type", StringArray (projectTypes), Array (projectTypeValues)));
+ {
+ StringArray projectTypeNames;
+ Array projectTypeCodes;
+
+ const Array& types = ProjectType::getAllTypes();
+
+ for (int i = 0; i < types.size(); ++i)
+ {
+ projectTypeNames.add (types.getUnchecked(i)->getDescription());
+ projectTypeCodes.add (types.getUnchecked(i)->getType());
+ }
+
+ props.add (new ChoicePropertyComponent (getProjectTypeValue(), "Project Type", projectTypeNames, projectTypeCodes));
+ }
const char* linkageTypes[] = { "Not linked to Juce", "Linked to Juce Static Library", "Include Juce Amalgamated Files", "Include Juce Source Code Directly (In a single file)", "Include Juce Source Code Directly (Split across several files)", 0 };
const char* linkageTypeValues[] = { notLinkedToJuce, useLinkedJuce, useAmalgamatedJuce, useAmalgamatedJuceViaSingleTemplate, useAmalgamatedJuceViaMultipleTemplates, 0 };
@@ -361,7 +381,7 @@ void Project::createPropertyEditors (Array & props)
props.getLast()->setTooltip ("Sets an icon to use for the executable.");
}
- if (isAudioPlugin())
+ if (getProjectType().isAudioPlugin())
{
props.add (new BooleanPropertyComponent (shouldBuildVST(), "Build VST", "Enabled"));
props.getLast()->setTooltip ("Whether the project should produce a VST plugin.");
@@ -371,7 +391,7 @@ void Project::createPropertyEditors (Array & props)
props.getLast()->setTooltip ("Whether the project should produce an RTAS plugin.");
}
- if (isAudioPlugin())
+ if (getProjectType().isAudioPlugin())
{
props.add (new TextPropertyComponent (getPluginName(), "Plugin Name", 128, false));
props.getLast()->setTooltip ("The name of your plugin (keep it short!)");
@@ -497,24 +517,6 @@ Project::Item Project::getMainGroup()
return Item (*this, projectRoot.getChildWithName (Tags::projectMainGroup));
}
-Project::Item Project::createNewGroup()
-{
- Item item (*this, ValueTree (Tags::group));
- item.initialiseNodeValues();
- item.getName() = "New Group";
- return item;
-}
-
-Project::Item Project::createNewItem (const File& file)
-{
- Item item (*this, ValueTree (Tags::file));
- item.initialiseNodeValues();
- item.getName() = file.getFileName();
- item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m;cc;cxx");
- item.getShouldAddToResourceValue() = shouldBeAddedToBinaryResourcesByDefault (file);
- return item;
-}
-
static void findImages (const Project::Item& item, OwnedArray& found)
{
if (item.isImageFile())
@@ -621,7 +623,7 @@ Value Project::Item::getShouldAddToResourceValue() const
File Project::Item::getFile() const
{
if (isFile())
- return project->resolveFilename (node [Ids::file].toString());
+ return getProject().resolveFilename (node [Ids::file].toString());
else
return File::nonexistent;
}
@@ -629,7 +631,7 @@ File Project::Item::getFile() const
void Project::Item::setFile (const File& file)
{
jassert (isFile());
- node.setProperty (Ids::file, project->getRelativePathForFile (file), getUndoManager());
+ node.setProperty (Ids::file, getProject().getRelativePathForFile (file), getUndoManager());
node.setProperty (Ids::name, file.getFileName(), getUndoManager());
jassert (getFile() == file);
@@ -665,7 +667,7 @@ Project::Item Project::Item::findItemForFile (const File& file) const
}
}
- return Item (*project, ValueTree::invalid);
+ return Item (getProject(), ValueTree::invalid);
}
File Project::Item::determineGroupFolder() const
@@ -691,7 +693,7 @@ File Project::Item::determineGroupFolder() const
}
else
{
- f = project->getFile().getParentDirectory();
+ f = getProject().getFile().getParentDirectory();
if (f.getChildFile ("Source").isDirectory())
f = f.getChildFile ("Source");
@@ -736,7 +738,7 @@ Project::Item Project::Item::getParent() const
if (isMainGroup() || ! isGroup())
return *this;
- return Item (*project, node.getParent());
+ return Item (getProject(), node.getParent());
}
struct ItemSorter
@@ -753,6 +755,17 @@ void Project::Item::sortAlphabetically()
node.sort (sorter, getUndoManager(), true);
}
+Project::Item Project::Item::addNewSubGroup (const String& name, int insertIndex)
+{
+ Item group (getProject(), ValueTree (Tags::group));
+ group.initialiseNodeValues();
+ group.getName() = name;
+
+ jassert (canContain (group));
+ addChild (group, insertIndex);
+ return group;
+}
+
bool Project::Item::addFile (const File& file, int insertIndex)
{
if (file == File::nonexistent || file.isHidden() || file.getFileName().startsWithChar ('.'))
@@ -760,18 +773,12 @@ bool Project::Item::addFile (const File& file, int insertIndex)
if (file.isDirectory())
{
- Item group (project->createNewGroup());
- group.getName() = file.getFileNameWithoutExtension();
-
- jassert (canContain (group));
-
- addChild (group, insertIndex);
- //group.setFile (file);
+ Item group (addNewSubGroup (file.getFileNameWithoutExtension(), insertIndex));
DirectoryIterator iter (file, false, "*", File::findFilesAndDirectories);
while (iter.next())
{
- if (! project->getMainGroup().findItemForFile (iter.getFile()).isValid())
+ if (! getProject().getMainGroup().findItemForFile (iter.getFile()).isValid())
group.addFile (iter.getFile(), -1);
}
@@ -779,9 +786,13 @@ bool Project::Item::addFile (const File& file, int insertIndex)
}
else if (file.existsAsFile())
{
- if (! project->getMainGroup().findItemForFile (file).isValid())
+ if (! getProject().getMainGroup().findItemForFile (file).isValid())
{
- Item item (project->createNewItem (file));
+ Item item (getProject(), ValueTree (Tags::file));
+ item.initialiseNodeValues();
+ item.getName() = file.getFileName();
+ item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m;cc;cxx");
+ item.getShouldAddToResourceValue() = getProject().shouldBeAddedToBinaryResourcesByDefault (file);
if (canContain (item))
{
@@ -1066,7 +1077,7 @@ StringPairArray Project::BuildConfiguration::getAllPreprocessorDefs() const
parsePreprocessorDefs (getBuildConfigPreprocessorDefs().toString()));
}
-const StringArray Project::BuildConfiguration::getHeaderSearchPaths() const
+StringArray Project::BuildConfiguration::getHeaderSearchPaths() const
{
StringArray s;
s.addTokens (getHeaderSearchPath().toString(), ";", String::empty);
diff --git a/extras/Introjucer/Source/Project/jucer_Project.h b/extras/Introjucer/Source/Project/jucer_Project.h
index 68fb391157..f8f91a7da6 100644
--- a/extras/Introjucer/Source/Project/jucer_Project.h
+++ b/extras/Introjucer/Source/Project/jucer_Project.h
@@ -28,6 +28,7 @@
#include "../jucer_Headers.h"
class ProjectExporter;
+class ProjectType;
//==============================================================================
class Project : public FileBasedDocument,
@@ -65,19 +66,8 @@ public:
//==============================================================================
// project types
- static const char* const application;
- static const char* const commandLineApp;
- static const char* const audioPlugin;
- static const char* const library;
- static const char* const browserPlugin;
-
- Value getProjectType() const { return getProjectValue ("projectType"); }
-
- bool isLibrary() const;
- bool isGUIApplication() const;
- bool isCommandLineApp() const;
- bool isAudioPlugin() const;
- bool isBrowserPlugin() const;
+ const ProjectType& getProjectType() const;
+ Value getProjectTypeValue() const { return getProjectValue ("projectType"); }
Value getVersion() const { return getProjectValue ("version"); }
Value getBundleIdentifier() const { return getProjectValue ("bundleIdentifier"); }
@@ -100,7 +90,7 @@ public:
bool isUsingMultipleTemplateFiles() const { return getJuceLinkageMode() == useAmalgamatedJuceViaMultipleTemplates; }
//==============================================================================
- Value getProjectValue (const Identifier& name) const { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); }
+ Value getProjectValue (const Identifier& name) const { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); }
Value getProjectPreprocessorDefs() const { return getProjectValue (Ids::defines); }
StringPairArray getPreprocessorDefs() const;
@@ -114,7 +104,7 @@ public:
Value shouldBuildVST() const { return getProjectValue ("buildVST"); }
Value shouldBuildRTAS() const { return getProjectValue ("buildRTAS"); }
Value shouldBuildAU() const { return getProjectValue ("buildAU"); }
- bool shouldAddVSTFolderToPath() { return (isAudioPlugin() && (bool) shouldBuildVST().getValue()) || getJuceConfigFlag ("JUCE_PLUGINHOST_VST").toString() == configFlagEnabled; }
+ bool shouldAddVSTFolderToPath();
Value getPluginName() const { return getProjectValue ("pluginName"); }
Value getPluginDesc() const { return getProjectValue ("pluginDesc"); }
@@ -133,9 +123,9 @@ public:
Value getPluginRTASCategory() const { return getProjectValue ("pluginRTASCategory"); }
//==============================================================================
- File getAppIncludeFile() const { return getWrapperFolder().getChildFile (getJuceSourceHFilename()); }
- File getWrapperFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
- File getPluginCharacteristicsFile() const { return getWrapperFolder().getChildFile (getPluginCharacteristicsFilename()); }
+ File getAppIncludeFile() const { return getWrapperFolder().getChildFile (getJuceSourceHFilename()); }
+ File getWrapperFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
+ File getPluginCharacteristicsFile() const { return getWrapperFolder().getChildFile (getPluginCharacteristicsFilename()); }
//==============================================================================
String getAmalgamatedHeaderFileName() const { return "juce_amalgamated.h"; }
@@ -195,7 +185,9 @@ public:
//==============================================================================
bool canContain (const Item& child) const;
int getNumChildren() const { return node.getNumChildren(); }
- Item getChild (int index) const { return Item (*project, node.getChild (index)); }
+ Item getChild (int index) const { return Item (getProject(), node.getChild (index)); }
+
+ Item addNewSubGroup (const String& name, int insertIndex);
void addChild (const Item& newChild, int insertIndex);
bool addFile (const File& file, int insertIndex);
void removeItemFromProject();
@@ -211,12 +203,10 @@ public:
Project* project;
ValueTree node;
- UndoManager* getUndoManager() const { return project->getUndoManagerFor (node); }
+ UndoManager* getUndoManager() const { return getProject().getUndoManagerFor (node); }
};
Item getMainGroup();
- Item createNewGroup();
- Item createNewItem (const File& file);
void findAllImageItems (OwnedArray- & items);
@@ -244,7 +234,7 @@ public:
Value getBuildConfigPreprocessorDefs() const { return getValue (Ids::defines); }
StringPairArray getAllPreprocessorDefs() const; // includes inherited definitions
Value getHeaderSearchPath() const { return getValue (Ids::headerPath); }
- const StringArray getHeaderSearchPaths() const;
+ StringArray getHeaderSearchPaths() const;
static const char* const osxVersionDefault;
static const char* const osxVersion10_4;
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h
index 2e7b2f783d..a38316e0e8 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h
@@ -74,7 +74,7 @@ public:
#endif
}
- bool isPossibleForCurrentProject() { return project.isGUIApplication(); }
+ bool isPossibleForCurrentProject() { return project.getProjectType().isGUIApplication(); }
bool usesMMFiles() const { return false; }
void launchProject()
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h
index 17de65a91d..2341c68391 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h
@@ -60,7 +60,7 @@ public:
{
ProjectExporter::createPropertyEditors (props);
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
{
const char* const libTypes[] = { "Static Library (.lib)", "Dynamic Library (.dll)", 0 };
const int libTypeValues[] = { 1, 2, 0 };
@@ -82,7 +82,7 @@ protected:
File getProjectFile (const String& extension) const { return getTargetFolder().getChildFile (project.getProjectFilenameRoot()).withFileExtension (extension); }
Value getLibraryType() const { return getSetting (Ids::libraryType); }
- bool isLibraryDLL() const { return project.isLibrary() && getLibraryType() == 2; }
+ bool isLibraryDLL() const { return project.getProjectType().isLibrary() && getLibraryType() == 2; }
//==============================================================================
const Array getRTASFilesRequired() const
@@ -123,11 +123,11 @@ protected:
String getTargetBinarySuffix() const
{
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
return ".lib";
else if (isRTAS())
return ".dpm";
- else if (project.isAudioPlugin() || project.isBrowserPlugin())
+ else if (project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin())
return ".dll";
return ".exe";
@@ -149,10 +149,10 @@ protected:
defines.set ("NDEBUG", "");
}
- if (project.isCommandLineApp())
+ if (project.getProjectType().isCommandLineApp())
defines.set ("_CONSOLE", "");
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
defines.set ("_LIB", "");
if (isRTAS())
@@ -179,14 +179,14 @@ protected:
return result.joinIntoString (joinString);
}
- const StringArray getHeaderSearchPaths (const Project::BuildConfiguration& config) const
+ StringArray getHeaderSearchPaths (const Project::BuildConfiguration& config) const
{
StringArray searchPaths (config.getHeaderSearchPaths());
if (project.shouldAddVSTFolderToPath() && getVSTFolder().toString().isNotEmpty())
searchPaths.add (rebaseFromProjectFolderToBuildTarget (RelativePath (getVSTFolder().toString(), RelativePath::projectFolder)).toWindowsStyle());
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
searchPaths.add (juceWrapperFolder.toWindowsStyle());
if (isRTAS())
@@ -599,8 +599,8 @@ protected:
xml.setAttribute ("Name", createConfigName (config));
xml.setAttribute ("OutputDirectory", FileHelpers::windowsStylePath (binariesPath));
xml.setAttribute ("IntermediateDirectory", FileHelpers::windowsStylePath (intermediatesPath));
- xml.setAttribute ("ConfigurationType", (project.isAudioPlugin() || project.isBrowserPlugin() || isLibraryDLL())
- ? "2" : (project.isLibrary() ? "4" : "1"));
+ xml.setAttribute ("ConfigurationType", (project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin() || isLibraryDLL())
+ ? "2" : (project.getProjectType().isLibrary() ? "4" : "1"));
xml.setAttribute ("UseOfMFC", "0");
xml.setAttribute ("ATLMinimizesCRunTimeLibraryUsage", "false");
xml.setAttribute ("CharacterSet", "2");
@@ -623,7 +623,7 @@ protected:
createToolElement (xml, "VCXMLDataGeneratorTool");
createToolElement (xml, "VCWebServiceProxyGeneratorTool");
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
{
XmlElement* midl = createToolElement (xml, "VCMIDLTool");
midl->setAttribute ("PreprocessorDefinitions", isDebug ? "_DEBUG" : "NDEBUG");
@@ -643,7 +643,7 @@ protected:
if (isDebug)
{
compiler->setAttribute ("BufferSecurityCheck", "");
- compiler->setAttribute ("DebugInformationFormat", project.isLibrary() ? "3" : "4");
+ compiler->setAttribute ("DebugInformationFormat", project.getProjectType().isLibrary() ? "3" : "4");
}
else
{
@@ -680,7 +680,7 @@ protected:
const String outputFileName (getBinaryFileForConfig (config));
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
{
XmlElement* linker = createToolElement (xml, "VCLinkerTool");
@@ -693,7 +693,7 @@ protected:
linker->setAttribute ("IgnoreDefaultLibraryNames", isDebug ? "libcmt.lib, msvcrt.lib" : "");
linker->setAttribute ("GenerateDebugInformation", isDebug ? "true" : "false");
linker->setAttribute ("ProgramDatabaseFile", FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".pdb"));
- linker->setAttribute ("SubSystem", project.isCommandLineApp() ? "1" : "2");
+ linker->setAttribute ("SubSystem", project.getProjectType().isCommandLineApp() ? "1" : "2");
if (! isDebug)
{
@@ -752,7 +752,7 @@ protected:
createToolElement (xml, "VCFxCopTool");
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
createToolElement (xml, "VCAppVerifierTool");
createToolElement (xml, "VCPostBuildEventTool");
@@ -873,13 +873,13 @@ private:
{
const String defaultConfigName (createConfigName (project.getConfiguration (0)));
- const bool isDLL = project.isAudioPlugin() || project.isBrowserPlugin();
+ const bool isDLL = project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin();
String targetType, targetCode;
- if (isDLL) { targetType = "\"Win32 (x86) Dynamic-Link Library\""; targetCode = "0x0102"; }
- else if (project.isLibrary()) { targetType = "\"Win32 (x86) Static Library\""; targetCode = "0x0104"; }
- else if (project.isCommandLineApp()) { targetType = "\"Win32 (x86) Console Application\""; targetCode = "0x0103"; }
- else { targetType = "\"Win32 (x86) Application\""; targetCode = "0x0101"; }
+ if (isDLL) { targetType = "\"Win32 (x86) Dynamic-Link Library\""; targetCode = "0x0102"; }
+ else if (project.getProjectType().isLibrary()) { targetType = "\"Win32 (x86) Static Library\""; targetCode = "0x0104"; }
+ else if (project.getProjectType().isCommandLineApp()) { targetType = "\"Win32 (x86) Console Application\""; targetCode = "0x0103"; }
+ else { targetType = "\"Win32 (x86) Application\""; targetCode = "0x0101"; }
out << "# Microsoft Developer Studio Project File - Name=\"" << project.getProjectName()
<< "\" - Package Owner=<4>" << newLine
@@ -950,7 +950,7 @@ private:
if (! isDebug)
out << "# SUBTRACT CPP /YX" << newLine;
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
out << "# ADD BASE MTL /nologo /D " << defines << " /mktyplib203 /win32" << newLine
<< "# ADD MTL /nologo /D " << defines << " /mktyplib203 /win32" << newLine;
@@ -960,7 +960,7 @@ private:
<< "# ADD BASE BSC32 /nologo" << newLine
<< "# ADD BSC32 /nologo" << newLine;
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
{
out << "LIB32=link.exe -lib" << newLine
<< "# ADD BASE LIB32 /nologo" << newLine
@@ -974,8 +974,8 @@ private:
<< "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "
<< (isDebug ? " /debug" : "")
<< " /nologo /machine:I386 /out:\"" << targetBinary << "\" "
- << (isDLL ? "/dll" : (project.isCommandLineApp() ? "/subsystem:console "
- : "/subsystem:windows "))
+ << (isDLL ? "/dll" : (project.getProjectType().isCommandLineApp() ? "/subsystem:console "
+ : "/subsystem:windows "))
<< replacePreprocessorTokens (config, getExtraLinkerFlags().toString()).trim() << newLine;
}
}
@@ -1309,7 +1309,7 @@ protected:
: "%(IgnoreSpecificDefaultLibraries)");
link->createNewChildElement ("GenerateDebugInformation")->addTextElement (isDebug ? "true" : "false");
link->createNewChildElement ("ProgramDatabaseFile")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".pdb"));
- link->createNewChildElement ("SubSystem")->addTextElement (project.isCommandLineApp() ? "Console" : "Windows");
+ link->createNewChildElement ("SubSystem")->addTextElement (project.getProjectType().isCommandLineApp() ? "Console" : "Windows");
link->createNewChildElement ("TargetMachine")->addTextElement ("MachineX86");
if (! isDebug)
@@ -1369,9 +1369,9 @@ protected:
String getProjectType() const
{
- if (project.isGUIApplication() || project.isCommandLineApp()) return "Application";
- else if (project.isAudioPlugin() || project.isBrowserPlugin()) return "DynamicLibrary";
- else if (project.isLibrary()) return "StaticLibrary";
+ if (project.getProjectType().isGUIApplication() || project.getProjectType().isCommandLineApp()) return "Application";
+ else if (project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin()) return "DynamicLibrary";
+ else if (project.getProjectType().isLibrary()) return "StaticLibrary";
jassertfalse;
return String::empty;
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h
index 644788a776..413c936005 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h
@@ -164,7 +164,7 @@ private:
{
out << " LDFLAGS += -L$(BINDIR) -L$(LIBDIR)";
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
out << " -shared";
{
@@ -214,7 +214,7 @@ private:
if (config.isDebug().getValue())
out << " -g -ggdb";
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
out << " -fPIC";
out << " -O" << config.getGCCOptimisationFlag() << newLine;
@@ -231,14 +231,14 @@ private:
String targetName (config.getTargetBinaryName().getValue().toString());
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
targetName = getLibbedFilename (targetName);
else if (isVST())
targetName = targetName.upToLastOccurrenceOf (".", false, false) + ".so";
out << " TARGET := " << escapeSpaces (targetName) << newLine;
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
out << " BLDCMD = ar -rcs $(OUTDIR)/$(TARGET) $(OBJECTS) $(TARGET_ARCH)" << newLine;
else
out << " BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)" << newLine;
@@ -268,7 +268,7 @@ private:
<< "endif" << newLine
<< newLine;
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
out << "ifeq ($(TARGET_ARCH),)" << newLine
<< " TARGET_ARCH := -march=native" << newLine
<< "endif" << newLine << newLine;
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h
index c0749d90df..c35a176c27 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h
@@ -91,7 +91,7 @@ public:
#endif
}
- bool isPossibleForCurrentProject() { return project.isGUIApplication() || ! iPhone; }
+ bool isPossibleForCurrentProject() { return project.getProjectType().isGUIApplication() || ! iPhone; }
bool usesMMFiles() const { return true; }
void createPropertyEditors (Array & props)
@@ -102,7 +102,7 @@ public:
props.getLast()->setTooltip ("Because objective-C linkage is done by string-matching, you can get horrible linkage mix-ups when different modules containing the "
"same class-names are loaded simultaneously. This setting lets you provide a unique string that will be used in naming the obj-C classes in your executable to avoid this.");
- if (project.isGUIApplication() && ! iPhone)
+ if (project.getProjectType().isGUIApplication() && ! iPhone)
{
props.add (new TextPropertyComponent (getSetting ("documentExtensions"), "Document file extensions", 128, false));
props.getLast()->setTooltip ("A comma-separated list of file extensions for documents that your app can open.");
@@ -163,22 +163,22 @@ private:
File getProjectBundle() const { return getTargetFolder().getChildFile (project.getProjectFilenameRoot()).withFileExtension (".xcodeproj"); }
- bool hasPList() const { return ! (project.isLibrary() || project.isCommandLineApp()); }
+ bool hasPList() const { return ! (project.getProjectType().isLibrary() || project.getProjectType().isCommandLineApp()); }
String getAudioPluginBundleExtension() const { return "component"; }
//==============================================================================
void createObjects()
{
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
addFrameworks();
const String productName (project.getConfiguration (0).getTargetBinaryName().toString());
- if (project.isGUIApplication()) addBuildProduct ("wrapper.application", productName + ".app");
- else if (project.isCommandLineApp()) addBuildProduct ("compiled.mach-o.executable", productName);
- else if (project.isLibrary()) addBuildProduct ("archive.ar", getLibbedFilename (productName));
- else if (project.isAudioPlugin()) addBuildProduct ("wrapper.cfbundle", productName + "." + getAudioPluginBundleExtension());
- else if (project.isBrowserPlugin()) addBuildProduct ("wrapper.cfbundle", productName + ".plugin");
+ if (project.getProjectType().isGUIApplication()) addBuildProduct ("wrapper.application", productName + ".app");
+ else if (project.getProjectType().isCommandLineApp()) addBuildProduct ("compiled.mach-o.executable", productName);
+ else if (project.getProjectType().isLibrary()) addBuildProduct ("archive.ar", getLibbedFilename (productName));
+ else if (project.getProjectType().isAudioPlugin()) addBuildProduct ("wrapper.cfbundle", productName + "." + getAudioPluginBundleExtension());
+ else if (project.getProjectType().isBrowserPlugin()) addBuildProduct ("wrapper.cfbundle", productName + ".plugin");
else jassert (productName.isEmpty());
if (hasPList())
@@ -209,7 +209,7 @@ private:
addConfigList (projectConfigs, createID ("__projList"));
addConfigList (targetConfigs, createID ("__configList"));
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
addBuildPhase ("PBXResourcesBuildPhase", resourceIDs);
if (rezFileIDs.size() > 0)
@@ -217,10 +217,10 @@ private:
addBuildPhase ("PBXSourcesBuildPhase", sourceIDs);
- if (! project.isLibrary())
+ if (! project.getProjectType().isLibrary())
addBuildPhase ("PBXFrameworksBuildPhase", frameworkIDs);
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
addPluginShellScriptPhase();
addTargetObject();
@@ -346,7 +346,7 @@ private:
addPlistDictionaryKey (dict, "CFBundleIdentifier", project.getBundleIdentifier().toString());
addPlistDictionaryKey (dict, "CFBundleName", project.getProjectName().toString());
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
{
addPlistDictionaryKey (dict, "CFBundlePackageType", "TDMw");
addPlistDictionaryKey (dict, "CFBundleSignature", "PTul");
@@ -397,14 +397,14 @@ private:
overwriteFileIfDifferentOrThrow (infoPlistFile, mo);
}
- const StringArray getHeaderSearchPaths (const Project::BuildConfiguration& config)
+ StringArray getHeaderSearchPaths (const Project::BuildConfiguration& config)
{
StringArray searchPaths (config.getHeaderSearchPaths());
if (project.shouldAddVSTFolderToPath() && getVSTFolder().toString().isNotEmpty())
searchPaths.add (rebaseFromProjectFolderToBuildTarget (RelativePath (getVSTFolder().toString(), RelativePath::projectFolder)).toUnixStyle());
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
{
if (isAU())
{
@@ -471,7 +471,7 @@ private:
void getLinkerFlags (const Project::BuildConfiguration& config, StringArray& flags, StringArray& librarySearchPaths)
{
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
{
flags.add ("-bundle");
@@ -495,7 +495,7 @@ private:
flags.removeEmptyStrings (true);
}
- const StringArray getProjectSettings (const Project::BuildConfiguration& config)
+ StringArray getProjectSettings (const Project::BuildConfiguration& config)
{
StringArray s;
s.add ("ALWAYS_SEARCH_USER_PATHS = NO");
@@ -509,7 +509,7 @@ private:
s.add ("WARNING_CFLAGS = -Wreorder");
s.add ("GCC_MODEL_TUNING = G5");
- if (project.isLibrary() || project.getJuceLinkageMode() == Project::useLinkedJuce)
+ if (project.getProjectType().isLibrary() || project.getJuceLinkageMode() == Project::useLinkedJuce)
{
s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = NO");
s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = NO");
@@ -535,7 +535,7 @@ private:
return s;
}
- const StringArray getTargetSettings (const Project::BuildConfiguration& config)
+ StringArray getTargetSettings (const Project::BuildConfiguration& config)
{
StringArray s;
@@ -554,11 +554,11 @@ private:
if (extraFlags.isNotEmpty())
s.add ("OTHER_CPLUSPLUSFLAGS = " + extraFlags);
- if (project.isGUIApplication())
+ if (project.getProjectType().isGUIApplication())
{
s.add ("INSTALL_PATH = \"$(HOME)/Applications\"");
}
- else if (project.isAudioPlugin())
+ else if (project.getProjectType().isAudioPlugin())
{
s.add ("LIBRARY_STYLE = Bundle");
s.add ("INSTALL_PATH = \"$(HOME)/Library/Audio/Plug-Ins/Components/\"");
@@ -568,12 +568,12 @@ private:
" -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers"
" -I \\\"$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUBase\\\"\"");
}
- else if (project.isBrowserPlugin())
+ else if (project.getProjectType().isBrowserPlugin())
{
s.add ("LIBRARY_STYLE = Bundle");
s.add ("INSTALL_PATH = \"/Library/Internet Plug-Ins/\"");
}
- else if (project.isLibrary())
+ else if (project.getProjectType().isLibrary())
{
if (config.getTargetBinaryRelativePath().toString().isNotEmpty())
{
@@ -587,7 +587,7 @@ private:
s.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\"");
s.add ("DEPLOYMENT_LOCATION = YES");
}
- else if (project.isCommandLineApp())
+ else if (project.getProjectType().isCommandLineApp())
{
}
else
@@ -1016,22 +1016,22 @@ private:
v->setProperty ("productName", project.getDocumentTitle(), 0);
v->setProperty ("productReference", createID ("__productFileID"), 0);
- if (project.isGUIApplication())
+ if (project.getProjectType().isGUIApplication())
{
v->setProperty ("productInstallPath", "$(HOME)/Applications", 0);
v->setProperty ("productType", "com.apple.product-type.application", 0);
}
- else if (project.isCommandLineApp())
+ else if (project.getProjectType().isCommandLineApp())
{
v->setProperty ("productInstallPath", "/usr/bin", 0);
v->setProperty ("productType", "com.apple.product-type.tool", 0);
}
- else if (project.isAudioPlugin() || project.isBrowserPlugin())
+ else if (project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin())
{
v->setProperty ("productInstallPath", "$(HOME)/Library/Audio/Plug-Ins/Components/", 0);
v->setProperty ("productType", "com.apple.product-type.bundle", 0);
}
- else if (project.isLibrary())
+ else if (project.getProjectType().isLibrary())
{
v->setProperty ("productType", "com.apple.product-type.library.static", 0);
}
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp b/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp
index f34ea03a9b..86b218d3e5 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp
@@ -46,7 +46,7 @@ int ProjectExporter::getNumExporters()
return 6;
}
-const StringArray ProjectExporter::getExporterNames()
+StringArray ProjectExporter::getExporterNames()
{
StringArray s;
s.add (XCodeProjectExporter::getNameMac());
@@ -150,12 +150,12 @@ String ProjectExporter::getIncludePathForFileInJuceFolder (const String& pathFro
}
}
-const RelativePath ProjectExporter::getJucePathFromTargetFolder() const
+RelativePath ProjectExporter::getJucePathFromTargetFolder() const
{
return rebaseFromProjectFolderToBuildTarget (RelativePath (getJuceFolder().toString(), RelativePath::projectFolder));
}
-const RelativePath ProjectExporter::rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const
+RelativePath ProjectExporter::rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const
{
return path.rebased (project.getFile().getParentDirectory(), getTargetFolder(), RelativePath::buildTargetFolder);
}
@@ -173,7 +173,7 @@ void ProjectExporter::createPropertyEditors (Array & props)
props.add (new TextPropertyComponent (getJuceFolder(), "Juce Location", 1024, false));
props.getLast()->setTooltip ("The location of the Juce library folder that the " + name + " project will use to when compiling. This can be an absolute path, or relative to the jucer project folder, but it must be valid on the filesystem of the machine you use to actually do the compiling.");
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
{
if (project.shouldAddVSTFolderToPath())
{
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExporter.h b/extras/Introjucer/Source/Project/jucer_ProjectExporter.h
index f3d903a229..49839e9647 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectExporter.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectExporter.h
@@ -28,6 +28,7 @@
#include "../jucer_Headers.h"
#include "jucer_Project.h"
+#include "jucer_ProjectType.h"
//==============================================================================
@@ -41,7 +42,7 @@ public:
virtual ~ProjectExporter();
static int getNumExporters();
- static const StringArray getExporterNames();
+ static StringArray getExporterNames();
static ProjectExporter* createNewExporter (Project& project, const int index);
static ProjectExporter* createExporter (Project& project, const ValueTree& settings);
@@ -71,9 +72,9 @@ public:
Value getRTASFolder() const { return getSetting (Ids::rtasFolder); }
Value getAUFolder() const { return getSetting (Ids::auFolder); }
- bool isVST() const { return (bool) project.isAudioPlugin() && (bool) project.shouldBuildVST().getValue(); }
- bool isRTAS() const { return (bool) project.isAudioPlugin() && (bool) project.shouldBuildRTAS().getValue(); }
- bool isAU() const { return (bool) project.isAudioPlugin() && (bool) project.shouldBuildAU().getValue(); }
+ bool isVST() const { return (bool) project.getProjectType().isAudioPlugin() && (bool) project.shouldBuildVST().getValue(); }
+ bool isRTAS() const { return (bool) project.getProjectType().isAudioPlugin() && (bool) project.shouldBuildRTAS().getValue(); }
+ bool isAU() const { return (bool) project.getProjectType().isAudioPlugin() && (bool) project.shouldBuildAU().getValue(); }
Value getExtraCompilerFlags() const { return getSetting (Ids::extraCompilerFlags); }
Value getExtraLinkerFlags() const { return getSetting (Ids::extraLinkerFlags); }
@@ -120,7 +121,7 @@ protected:
ValueTree settings;
String name;
- const RelativePath getJucePathFromTargetFolder() const;
+ RelativePath getJucePathFromTargetFolder() const;
static String getDefaultBuildsRootFolder() { return "Builds/"; }
@@ -135,7 +136,7 @@ protected:
return name;
}
- const RelativePath rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const;
+ RelativePath rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const;
//==============================================================================
static void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData)
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp b/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp
index fe0d76c534..3aa660469d 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp
+++ b/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp
@@ -248,13 +248,13 @@ void ProjectInformationComponent::rebuildConfigTabs()
}
}
- lastProjectType = project.getProjectType().getValue();
+ lastProjectType = project.getProjectTypeValue().getValue();
}
void ProjectInformationComponent::updateConfigTabs()
{
if (configTabBox.getNumTabs() != project.getNumConfigurations() + project.getNumExporters() + 2
- || lastProjectType != project.getProjectType().getValue())
+ || lastProjectType != project.getProjectTypeValue().getValue())
{
rebuildConfigTabs();
}
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectSaver.h b/extras/Introjucer/Source/Project/jucer_ProjectSaver.h
index e1b3697e87..110b0a5c22 100644
--- a/extras/Introjucer/Source/Project/jucer_ProjectSaver.h
+++ b/extras/Introjucer/Source/Project/jucer_ProjectSaver.h
@@ -36,7 +36,7 @@ public:
{
}
- const String save()
+ String save()
{
const File oldFile (project.getFile());
project.setFile (projectFile);
@@ -45,7 +45,7 @@ public:
if (linkageMode == Project::notLinkedToJuce)
{
- hasAppHeaderFile = ! project.isLibrary();
+ hasAppHeaderFile = ! project.getProjectType().isLibrary();
hasAppConfigFile = false;
numJuceSourceFiles = 0;
}
@@ -303,7 +303,7 @@ private:
return maxVal;
}
- static const String createVersionCode (const String& version)
+ static String createVersionCode (const String& version)
{
StringArray configs;
configs.addTokens (version, ",.", String::empty);
@@ -410,7 +410,7 @@ private:
binaryDataCpp.withFileExtension ("h").deleteFile();
}
- if (project.isLibrary())
+ if (project.getProjectType().isLibrary())
return;
if (! wrapperFolder.createDirectory())
@@ -430,7 +430,7 @@ private:
appConfigFile.deleteFile();
}
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
{
MemoryOutputStream mem;
writePluginCharacteristics (mem);
@@ -512,7 +512,7 @@ private:
}
}
- if (project.isAudioPlugin())
+ if (project.getProjectType().isAudioPlugin())
exporter->juceWrapperFiles.add (RelativePath (pluginCharacteristicsFile, targetFolder, RelativePath::buildTargetFolder));
try
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectType.cpp b/extras/Introjucer/Source/Project/jucer_ProjectType.cpp
new file mode 100644
index 0000000000..4f1e622da5
--- /dev/null
+++ b/extras/Introjucer/Source/Project/jucer_ProjectType.cpp
@@ -0,0 +1,87 @@
+/*
+ ==============================================================================
+
+ This file is part of the JUCE library - "Jules' Utility Class Extensions"
+ Copyright 2004-10 by Raw Material Software Ltd.
+
+ ------------------------------------------------------------------------------
+
+ JUCE can be redistributed and/or modified under the terms of the GNU General
+ Public License (Version 2), as published by the Free Software Foundation.
+ A copy of the license is included in the JUCE distribution, or can be found
+ online at www.gnu.org/licenses.
+
+ JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ ------------------------------------------------------------------------------
+
+ To release a closed-source product which uses JUCE, commercial licenses are
+ available: visit www.rawmaterialsoftware.com/juce for more information.
+
+ ==============================================================================
+*/
+
+#include "jucer_ProjectType.h"
+
+//==============================================================================
+static ProjectType_GUIApp guiType;
+static ProjectType_ConsoleApp consoleType;
+static ProjectType_StaticLibrary staticLibType;
+static ProjectType_AudioPlugin audioPluginType;
+
+//==============================================================================
+ProjectType::ProjectType (const String& type_, const String& desc_)
+ : type (type_), desc (desc_)
+{
+ getAllTypes().add (this);
+}
+
+ProjectType::~ProjectType()
+{
+ getAllTypes().removeValue (this);
+}
+
+Array& ProjectType::getAllTypes()
+{
+ static Array types;
+ return types;
+}
+
+const ProjectType* ProjectType::findType (const String& typeCode)
+{
+ const Array& types = getAllTypes();
+
+ for (int i = types.size(); --i >= 0;)
+ if (types.getUnchecked(i)->getType() == typeCode)
+ return types.getUnchecked(i);
+
+ jassertfalse;
+ return nullptr;
+}
+
+
+//==============================================================================
+Result ProjectType_GUIApp::createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const
+{
+ return Result::ok();
+}
+
+//==============================================================================
+Result ProjectType_ConsoleApp::createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const
+{
+ return Result::ok();
+}
+
+//==============================================================================
+Result ProjectType_StaticLibrary::createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const
+{
+ return Result::ok();
+}
+
+//==============================================================================
+Result ProjectType_AudioPlugin::createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const
+{
+ return Result::ok();
+}
diff --git a/extras/Introjucer/Source/Project/jucer_ProjectType.h b/extras/Introjucer/Source/Project/jucer_ProjectType.h
new file mode 100644
index 0000000000..2b500c23d3
--- /dev/null
+++ b/extras/Introjucer/Source/Project/jucer_ProjectType.h
@@ -0,0 +1,111 @@
+/*
+ ==============================================================================
+
+ This file is part of the JUCE library - "Jules' Utility Class Extensions"
+ Copyright 2004-10 by Raw Material Software Ltd.
+
+ ------------------------------------------------------------------------------
+
+ JUCE can be redistributed and/or modified under the terms of the GNU General
+ Public License (Version 2), as published by the Free Software Foundation.
+ A copy of the license is included in the JUCE distribution, or can be found
+ online at www.gnu.org/licenses.
+
+ JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ ------------------------------------------------------------------------------
+
+ To release a closed-source product which uses JUCE, commercial licenses are
+ available: visit www.rawmaterialsoftware.com/juce for more information.
+
+ ==============================================================================
+*/
+
+#ifndef __JUCER_PROJECTTYPE_JUCEHEADER__
+#define __JUCER_PROJECTTYPE_JUCEHEADER__
+
+#include "../jucer_Headers.h"
+#include "jucer_Project.h"
+
+
+//==============================================================================
+class ProjectType
+{
+public:
+ //==============================================================================
+ virtual ~ProjectType();
+
+ const String& getType() const noexcept { return type; }
+ const String& getDescription() const noexcept { return desc; }
+
+ //==============================================================================
+ static Array& getAllTypes();
+ static const ProjectType* findType (const String& typeCode);
+
+ //==============================================================================
+ virtual bool isLibrary() const { return false; }
+ virtual bool isGUIApplication() const { return false; }
+ virtual bool isCommandLineApp() const { return false; }
+ virtual bool isAudioPlugin() const { return false; }
+ virtual bool isBrowserPlugin() const { return false; }
+
+ virtual Result createRequiredFiles (Project::Item& projectRoot,
+ Array& filesCreated) const = 0;
+
+protected:
+ ProjectType (const String& type, const String& desc);
+
+private:
+ const String type, desc;
+
+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectType);
+};
+
+//==============================================================================
+class ProjectType_GUIApp : public ProjectType
+{
+public:
+ static const char* getTypeName() noexcept { return "guiapp"; }
+ ProjectType_GUIApp() : ProjectType (getTypeName(), "Application (GUI)") {}
+
+ bool isGUIApplication() const { return true; }
+ Result createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const;
+};
+
+//==============================================================================
+class ProjectType_ConsoleApp : public ProjectType
+{
+public:
+ static const char* getTypeName() noexcept { return "consoleapp"; }
+ ProjectType_ConsoleApp() : ProjectType (getTypeName(), "Application (Non-GUI)") {}
+
+ Result createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const;
+ bool isCommandLineApp() const { return true; }
+};
+
+//==============================================================================
+class ProjectType_StaticLibrary : public ProjectType
+{
+public:
+ static const char* getTypeName() noexcept { return "library"; }
+ ProjectType_StaticLibrary() : ProjectType (getTypeName(), "Static Library") {}
+
+ bool isLibrary() const { return true; }
+ Result createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const;
+};
+
+//==============================================================================
+class ProjectType_AudioPlugin : public ProjectType
+{
+public:
+ static const char* getTypeName() noexcept { return "library"; }
+ ProjectType_AudioPlugin() : ProjectType (getTypeName(), "Audio Plug-in") {}
+
+ bool isAudioPlugin() const { return true; }
+ Result createRequiredFiles (Project::Item& projectRoot, Array& filesCreated) const;
+};
+
+
+#endif // __JUCE_PROJECTTYPE_H_C1C6BC3E__
diff --git a/extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp b/extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp
index af05060a7f..1748c06fc2 100644
--- a/extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp
+++ b/extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp
@@ -43,9 +43,8 @@ GroupTreeViewItem::~GroupTreeViewItem()
void GroupTreeViewItem::addNewGroup()
{
- Project::Item group (item.getProject().createNewGroup());
- item.addChild (group, 0);
- triggerAsyncRename (group);
+ Project::Item newGroup (item.addNewSubGroup ("New Group", 0));
+ triggerAsyncRename (newGroup);
}
bool GroupTreeViewItem::acceptsDragItems (const OwnedArray & selectedNodes)
diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp
index 7fa3ac6989..c5a1ece8ed 100644
--- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp
+++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp
@@ -27,12 +27,12 @@
//==============================================================================
-const int64 hashCode64 (const String& s)
+int64 hashCode64 (const String& s)
{
return s.hashCode64() + s.length() * s.hashCode() + s.toUpperCase().hashCode();
}
-const String createAlphaNumericUID()
+String createAlphaNumericUID()
{
String uid;
static const char chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -49,7 +49,7 @@ const String createAlphaNumericUID()
return uid;
}
-const String randomHexString (Random& random, int numChars)
+String randomHexString (Random& random, int numChars)
{
String s;
const char hexChars[] = "0123456789ABCDEF";
@@ -60,12 +60,12 @@ const String randomHexString (Random& random, int numChars)
return s;
}
-const String hexString8Digits (int value)
+String hexString8Digits (int value)
{
return String::toHexString (value).paddedLeft ('0', 8);
}
-const String createGUID (const String& seed)
+String createGUID (const String& seed)
{
String guid;
Random r (hashCode64 (seed + "_jucersalt"));
@@ -77,7 +77,7 @@ const String createGUID (const String& seed)
return guid;
}
-const String escapeSpaces (const String& s)
+String escapeSpaces (const String& s)
{
return s.replace (" ", "\\ ");
}
@@ -134,7 +134,7 @@ StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const Stri
return inheritedDefs;
}
-const String createGCCPreprocessorFlags (const StringPairArray& defs)
+String createGCCPreprocessorFlags (const StringPairArray& defs)
{
String s;
@@ -151,7 +151,7 @@ const String createGCCPreprocessorFlags (const StringPairArray& defs)
return s;
}
-const String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString)
+String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString)
{
for (int i = 0; i < definitions.size(); ++i)
{
@@ -287,7 +287,7 @@ void PropertyPanelWithTooltips::timerCallback()
}
}
-const String PropertyPanelWithTooltips::findTip (Component* c)
+String PropertyPanelWithTooltips::findTip (Component* c)
{
while (c != nullptr && c != this)
{
diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h
index 4a10efd720..c70b61b8f4 100644
--- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h
+++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h
@@ -26,19 +26,19 @@
//==============================================================================
// String::hashCode64 actually hit some dupes, so this is a more powerful version.
-const int64 hashCode64 (const String& s);
-const String randomHexString (Random& random, int numChars);
-const String hexString8Digits (int value);
+int64 hashCode64 (const String& s);
+String randomHexString (Random& random, int numChars);
+String hexString8Digits (int value);
-const String createAlphaNumericUID();
-const String createGUID (const String& seed); // Turns a seed into a windows GUID
+String createAlphaNumericUID();
+String createGUID (const String& seed); // Turns a seed into a windows GUID
-const String escapeSpaces (const String& text); // replaces spaces with blackslash-space
+String escapeSpaces (const String& text); // replaces spaces with blackslash-space
StringPairArray parsePreprocessorDefs (const String& defs);
StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const StringPairArray& overridingDefs);
-const String createGCCPreprocessorFlags (const StringPairArray& defs);
-const String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString);
+String createGCCPreprocessorFlags (const StringPairArray& defs);
+String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString);
//==============================================================================
int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex);
@@ -69,7 +69,7 @@ private:
Component* lastComp;
String lastTip;
- const String findTip (Component* c);
+ String findTip (Component* c);
};
//==============================================================================
diff --git a/extras/Introjucer/Source/Utility/jucer_RelativePath.h b/extras/Introjucer/Source/Utility/jucer_RelativePath.h
index f25272b1c7..4499031132 100644
--- a/extras/Introjucer/Source/Utility/jucer_RelativePath.h
+++ b/extras/Introjucer/Source/Utility/jucer_RelativePath.h
@@ -69,7 +69,7 @@ public:
bool hasFileExtension (const String& extension) const { return getFakeFile().hasFileExtension (extension); }
bool isAbsolute() const { return isAbsolute (path); }
- const RelativePath withFileExtension (const String& extension) const
+ RelativePath withFileExtension (const String& extension) const
{
return RelativePath (path.upToLastOccurrenceOf (".", ! extension.startsWithChar ('.'), false) + extension, root);
}
diff --git a/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp b/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp
index 90c5c18500..15c553b061 100644
--- a/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp
+++ b/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp
@@ -122,7 +122,7 @@ void StoredSettings::flush()
}
}
-const Array StoredSettings::getLastProjects() const
+Array StoredSettings::getLastProjects() const
{
StringArray s;
s.addTokens (props->getValue ("lastProjects"), "|", "");
diff --git a/extras/Introjucer/Source/Utility/jucer_StoredSettings.h b/extras/Introjucer/Source/Utility/jucer_StoredSettings.h
index 0a1dcdc069..bb5061022f 100644
--- a/extras/Introjucer/Source/Utility/jucer_StoredSettings.h
+++ b/extras/Introjucer/Source/Utility/jucer_StoredSettings.h
@@ -47,7 +47,7 @@ public:
//==============================================================================
RecentlyOpenedFilesList recentFiles;
- const Array getLastProjects() const;
+ Array getLastProjects() const;
void setLastProjects (const Array& files);
File getLastKnownJuceFolder() const;
diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp
index 7d28dc7b1d..fdeeac489f 100644
--- a/juce_amalgamated.cpp
+++ b/juce_amalgamated.cpp
@@ -23654,11 +23654,13 @@ END_JUCE_NAMESPACE
#if JUCE_QUICKTIME && ! (JUCE_64BIT || JUCE_IOS)
#if ! JUCE_WINDOWS
+ #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
#include
#include
#include
#include
#include
+ #undef Point
#else
#if JUCE_MSVC
#pragma warning (push)
@@ -48559,10 +48561,13 @@ namespace CppTokeniser
"friend", "inline", "not_eq", "public", "sizeof", "static", "signed",
"switch", "typeid", "wchar_t", "xor_eq", 0};
+ static const char* const keywords7Char[] =
+ { "default", "mutable", "private", "typedef", "nullptr", "virtual", 0 };
+
static const char* const keywordsOther[] =
- { "const_cast", "continue", "default", "explicit", "mutable", "namespace",
- "operator", "private", "protected", "register", "reinterpret_cast", "static_cast",
- "template", "typedef", "typename", "unsigned", "virtual", "volatile",
+ { "noexcept", "const_cast", "continue", "explicit", "namespace",
+ "operator", "protected", "register", "reinterpret_cast", "static_cast",
+ "template", "typename", "unsigned", "volatile", "constexpr",
"@implementation", "@interface", "@end", "@synthesize", "@dynamic", "@public",
"@private", "@property", "@protected", "@class", 0 };
@@ -48575,6 +48580,7 @@ namespace CppTokeniser
case 4: k = keywords4Char; break;
case 5: k = keywords5Char; break;
case 6: k = keywords6Char; break;
+ case 7: k = keywords7Char; break;
default:
if (tokenLength < 2 || tokenLength > 16)
@@ -99015,6 +99021,7 @@ private:
const Image::BitmapData destData (image, Image::BitmapData::writeOnly);
uint8* p = destData.getPixelPointer (0, 0);
+ const bool hasAlpha = image.hasAlphaChannel();
for (;;)
{
@@ -99022,7 +99029,7 @@ private:
if (index < 0)
break;
- if (transparent >= 0)
+ if (hasAlpha)
((PixelARGB*) p)->set (palette [index]);
else
((PixelRGB*) p)->set (palette [index]);
diff --git a/juce_amalgamated.h b/juce_amalgamated.h
index 62d41e1db9..b1c5d10fbe 100644
--- a/juce_amalgamated.h
+++ b/juce_amalgamated.h
@@ -73,7 +73,7 @@ namespace JuceDummyNamespace {}
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 54
-#define JUCE_BUILDNUMBER 14
+#define JUCE_BUILDNUMBER 15
/** Current Juce version number.
diff --git a/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp b/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp
index 9b4f09f0ef..d4bac9d49e 100644
--- a/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp
+++ b/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp
@@ -29,11 +29,13 @@
#if JUCE_QUICKTIME && ! (JUCE_64BIT || JUCE_IOS)
#if ! JUCE_WINDOWS
+ #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
#include
#include
#include
#include
#include
+ #undef Point
#else
#if JUCE_MSVC
#pragma warning (push)
diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h
index e7e740cc5b..db212d87cf 100644
--- a/src/core/juce_StandardHeader.h
+++ b/src/core/juce_StandardHeader.h
@@ -33,7 +33,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 54
-#define JUCE_BUILDNUMBER 14
+#define JUCE_BUILDNUMBER 15
/** Current Juce version number.
diff --git a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp
index 7604fe32e1..aa4a2ad96e 100644
--- a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp
+++ b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp
@@ -75,10 +75,13 @@ namespace CppTokeniser
"friend", "inline", "not_eq", "public", "sizeof", "static", "signed",
"switch", "typeid", "wchar_t", "xor_eq", 0};
+ static const char* const keywords7Char[] =
+ { "default", "mutable", "private", "typedef", "nullptr", "virtual", 0 };
+
static const char* const keywordsOther[] =
- { "const_cast", "continue", "default", "explicit", "mutable", "namespace",
- "operator", "private", "protected", "register", "reinterpret_cast", "static_cast",
- "template", "typedef", "typename", "unsigned", "virtual", "volatile",
+ { "noexcept", "const_cast", "continue", "explicit", "namespace",
+ "operator", "protected", "register", "reinterpret_cast", "static_cast",
+ "template", "typename", "unsigned", "volatile", "constexpr",
"@implementation", "@interface", "@end", "@synthesize", "@dynamic", "@public",
"@private", "@property", "@protected", "@class", 0 };
@@ -91,6 +94,7 @@ namespace CppTokeniser
case 4: k = keywords4Char; break;
case 5: k = keywords5Char; break;
case 6: k = keywords6Char; break;
+ case 7: k = keywords7Char; break;
default:
if (tokenLength < 2 || tokenLength > 16)
diff --git a/src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp b/src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp
index cc7b21f960..1884be64e0 100644
--- a/src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp
+++ b/src/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp
@@ -372,6 +372,7 @@ private:
const Image::BitmapData destData (image, Image::BitmapData::writeOnly);
uint8* p = destData.getPixelPointer (0, 0);
+ const bool hasAlpha = image.hasAlphaChannel();
for (;;)
{
@@ -379,7 +380,7 @@ private:
if (index < 0)
break;
- if (transparent >= 0)
+ if (hasAlpha)
((PixelARGB*) p)->set (palette [index]);
else
((PixelRGB*) p)->set (palette [index]);