Browse Source

Introjucer: App icons are now specified per-exporter type rather than globally for the project.

tags/2021-05-28
jules 13 years ago
parent
commit
4e77678299
11 changed files with 138 additions and 103 deletions
  1. +11
    -7
      extras/Introjucer/Introjucer.jucer
  2. +2
    -2
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  3. +71
    -36
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp
  4. +6
    -2
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h
  5. +14
    -36
      extras/Introjucer/Source/Project/jucer_Project.cpp
  6. +1
    -5
      extras/Introjucer/Source/Project/jucer_Project.h
  7. +2
    -0
      extras/Introjucer/Source/Utility/jucer_PresetIDs.h
  8. +12
    -9
      extras/JuceDemo/Juce Demo.jucer
  9. +8
    -6
      extras/the jucer/Jucer.jucer
  10. +6
    -0
      modules/juce_data_structures/values/juce_ValueTree.cpp
  11. +5
    -0
      modules/juce_data_structures/values/juce_ValueTree.h

+ 11
- 7
extras/Introjucer/Introjucer.jucer View File

@@ -10,11 +10,11 @@
pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0"
pluginSilenceInIsSilenceOut="0" pluginTailLength="0" pluginEditorRequiresKeys="0"
pluginAUExportPrefix="TheIntrojucerAU" pluginAUViewClass="TheIntrojucerAU_V1"
pluginRTASCategory="" bundleIdentifier="com.rawmaterialsoftware.introjucer"
bigIcon="rVgowdy">
pluginRTASCategory="" bundleIdentifier="com.rawmaterialsoftware.introjucer">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
juceFolder="../.." documentExtensions=".jucer" objCExtraSuffix="zNNCr">
juceFolder="../.." documentExtensions=".jucer" objCExtraSuffix="zNNCr"
bigIcon="rVgowdy">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Introjucer"
osxSDK="default" osxCompatibility="default" osxArchitecture="default"/>
@@ -23,27 +23,31 @@
</CONFIGURATIONS>
</XCODE_MAC>
<VS2005 targetFolder="Builds/VisualStudio2005" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../.." libraryType="1">
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../.." libraryType="1"
bigIcon="rVgowdy">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Introjucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="3" targetName="Introjucer"/>
</CONFIGURATIONS>
</VS2005>
<VS2008 targetFolder="Builds/VisualStudio2008" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../.." libraryType="1">
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../.." libraryType="1"
bigIcon="rVgowdy">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Introjucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="3" targetName="Introjucer"/>
</CONFIGURATIONS>
</VS2008>
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" juceFolder="../..">
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" juceFolder="../.."
bigIcon="rVgowdy">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Introjucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="3" targetName="Introjucer"/>
</CONFIGURATIONS>
</LINUX_MAKE>
<VS2010 targetFolder="Builds/VisualStudio2010" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" juceFolder="../..">
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" juceFolder="../.."
bigIcon="rVgowdy">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Introjucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="3" targetName="Introjucer"/>


+ 2
- 2
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -388,11 +388,11 @@ private:
{
Array<Image> images;
Image bigIcon (project.getBigIcon());
Image bigIcon (getBigIcon());
if (bigIcon.isValid())
images.add (bigIcon);
Image smallIcon (project.getSmallIcon());
Image smallIcon (getSmallIcon());
if (smallIcon.isValid())
images.add (smallIcon);


+ 71
- 36
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -220,6 +220,31 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props)
"Extra command-line flags to be passed to the compiler. This string can contain references to preprocessor definitions in the form ${NAME_OF_DEFINITION}, which will be replaced with their values.");
props.add (new TextPropertyComponent (getExtraLinkerFlags(), "Extra linker flags", 2048, false),
"Extra command-line flags to be passed to the linker. You might want to use this for adding additional libraries. This string can contain references to preprocessor definitions in the form ${NAME_OF_VALUE}, which will be replaced with their values.");
{
OwnedArray<Project::Item> images;
project.findAllImageItems (images);
StringArray choices;
Array<var> ids;
choices.add ("<None>");
ids.add (var::null);
choices.add (String::empty);
ids.add (var::null);
for (int i = 0; i < images.size(); ++i)
{
choices.add (images.getUnchecked(i)->getName().toString());
ids.add (images.getUnchecked(i)->getID());
}
props.add (new ChoicePropertyComponent (getSmallIconImageItemID(), "Icon (small)", choices, ids),
"Sets an icon to use for the executable.");
props.add (new ChoicePropertyComponent (getBigIconImageItemID(), "Icon (large)", choices, ids),
"Sets an icon to use for the executable.");
}
}
StringPairArray ProjectExporter::getAllPreprocessorDefs (const ProjectExporter::BuildConfiguration& config) const
@@ -243,42 +268,6 @@ String ProjectExporter::replacePreprocessorTokens (const ProjectExporter::BuildC
return replacePreprocessorDefs (getAllPreprocessorDefs (config), sourceString);
}
Image ProjectExporter::getBestIconForSize (int size, bool returnNullIfNothingBigEnough)
{
Image im;
const Image im1 (project.getSmallIcon());
const Image im2 (project.getBigIcon());
if (im1.isValid() && im2.isValid())
{
if (im1.getWidth() >= size && im2.getWidth() >= size)
im = im1.getWidth() < im2.getWidth() ? im1 : im2;
else if (im1.getWidth() >= size)
im = im1;
else if (im2.getWidth() >= size)
im = im2;
else
return Image::null;
}
else
{
im = im1.isValid() ? im1 : im2;
}
if (size == im.getWidth() && size == im.getHeight())
return im;
if (returnNullIfNothingBigEnough && im.getWidth() < size && im.getHeight() < size)
return Image::null;
Image newIm (Image::ARGB, size, size, true, SoftwareImageType());
Graphics g (newIm);
g.drawImageWithin (im, 0, 0, size, size,
RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize, false);
return newIm;
}
Project::Item& ProjectExporter::getModulesGroup()
{
if (modulesGroup == nullptr)
@@ -389,6 +378,52 @@ void ProjectExporter::createDefaultConfigs()
}
}
Image ProjectExporter::getBigIcon()
{
return project.getMainGroup().findItemWithID (getBigIconImageItemID().toString()).loadAsImageFile();
}
Image ProjectExporter::getSmallIcon()
{
return project.getMainGroup().findItemWithID (getSmallIconImageItemID().toString()).loadAsImageFile();
}
Image ProjectExporter::getBestIconForSize (int size, bool returnNullIfNothingBigEnough)
{
Image im;
const Image im1 (getSmallIcon());
const Image im2 (getBigIcon());
if (im1.isValid() && im2.isValid())
{
if (im1.getWidth() >= size && im2.getWidth() >= size)
im = im1.getWidth() < im2.getWidth() ? im1 : im2;
else if (im1.getWidth() >= size)
im = im1;
else if (im2.getWidth() >= size)
im = im2;
else
return Image::null;
}
else
{
im = im1.isValid() ? im1 : im2;
}
if (size == im.getWidth() && size == im.getHeight())
return im;
if (returnNullIfNothingBigEnough && im.getWidth() < size && im.getHeight() < size)
return Image::null;
Image newIm (Image::ARGB, size, size, true, SoftwareImageType());
Graphics g (newIm);
g.drawImageWithin (im, 0, 0, size, size,
RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize, false);
return newIm;
}
//==============================================================================
ProjectExporter::ConfigIterator::ConfigIterator (ProjectExporter& exporter_)
: index (-1), exporter (exporter_)


+ 6
- 2
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h View File

@@ -86,6 +86,12 @@ public:
RelativePath rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const;
void addToExtraSearchPaths (const RelativePath& pathFromProjectFolder);
Value getBigIconImageItemID() const { return getSetting (Ids::bigIcon); }
Value getSmallIconImageItemID() const { return getSetting (Ids::smallIcon); }
Image getBigIcon();
Image getSmallIcon();
Image getBestIconForSize (int size, bool returnNullIfNothingBigEnough);
String getExporterIdentifierMacro() const
{
return "JUCER_" + settings.getType().toString() + "_"
@@ -247,8 +253,6 @@ protected:
return name;
}
Image getBestIconForSize (int size, bool returnNullIfNothingBigEnough);
//==============================================================================
static void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData)
{


+ 14
- 36
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -111,6 +111,8 @@ void Project::setMissingDefaultValues()
getVersion() = "1.0.0";
updateOldStyleConfigList();
moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
moveOldPropertyFromProjectToAllExporters (Ids::smallIcon);
for (Project::ExporterIterator exporter (*this); exporter.next();)
if (exporter->getNumConfigurations() == 0)
@@ -160,6 +162,17 @@ void Project::updateOldStyleConfigList()
}
}
void Project::moveOldPropertyFromProjectToAllExporters (Identifier name)
{
if (projectRoot.hasProperty (name))
{
for (Project::ExporterIterator exporter (*this); exporter.next();)
exporter->settings.setProperty (name, projectRoot [name], nullptr);
projectRoot.removeProperty (name, nullptr);
}
}
void Project::addDefaultModules (bool shouldCopyFilesLocally)
{
addModule ("juce_core", shouldCopyFilesLocally);
@@ -337,32 +350,7 @@ void Project::createPropertyEditors (PropertyListBuilder& props)
props.add (new TextPropertyComponent (getBundleIdentifier(), "Bundle Identifier", 256, false),
"A unique identifier for this product, mainly for use in Mac builds. It should be something like 'com.yourcompanyname.yourproductname'");
{
OwnedArray<Project::Item> images;
findAllImageItems (images);
StringArray choices;
Array<var> ids;
choices.add ("<None>");
ids.add (var::null);
choices.add (String::empty);
ids.add (var::null);
for (int i = 0; i < images.size(); ++i)
{
choices.add (images.getUnchecked(i)->getName().toString());
ids.add (images.getUnchecked(i)->getID());
}
props.add (new ChoicePropertyComponent (getSmallIconImageItemID(), "Icon (small)", choices, ids),
"Sets an icon to use for the executable.");
props.add (new ChoicePropertyComponent (getBigIconImageItemID(), "Icon (large)", choices, ids),
"Sets an icon to use for the executable.");
}
getProjectType().createPropertyEditors(*this, props);
getProjectType().createPropertyEditors (*this, props);
props.add (new TextPropertyComponent (getProjectPreprocessorDefs(), "Preprocessor definitions", 32768, false),
"Extra preprocessor definitions. Use the form \"NAME1=value NAME2=value\", using whitespace or commas to separate the items - to include a space or comma in a definition, precede it with a backslash.");
@@ -385,16 +373,6 @@ String Project::getVersionAsHex() const
return "0x" + String::toHexString (value);
}
Image Project::getBigIcon()
{
return getMainGroup().findItemWithID (getBigIconImageItemID().toString()).loadAsImageFile();
}
Image Project::getSmallIcon()
{
return getMainGroup().findItemWithID (getSmallIconImageItemID().toString()).loadAsImageFile();
}
StringPairArray Project::getPreprocessorDefs() const
{
return parsePreprocessorDefs (getProjectPreprocessorDefs().toString());


+ 1
- 5
extras/Introjucer/Source/Project/jucer_Project.h View File

@@ -87,11 +87,6 @@ public:
Value getProjectPreprocessorDefs() const { return getProjectValue (Ids::defines); }
StringPairArray getPreprocessorDefs() const;
Value getBigIconImageItemID() const { return getProjectValue ("bigIcon"); }
Value getSmallIconImageItemID() const { return getProjectValue ("smallIcon"); }
Image getBigIcon();
Image getSmallIcon();
//==============================================================================
File getAppIncludeFile() const { return getGeneratedCodeFolder().getChildFile (getJuceSourceHFilename()); }
File getGeneratedCodeFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
@@ -268,6 +263,7 @@ private:
ValueTree getModulesNode();
void updateOldStyleConfigList();
void moveOldPropertyFromProjectToAllExporters (Identifier name);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project);
};


+ 2
- 0
extras/Introjucer/Source/Utility/jucer_PresetIDs.h View File

@@ -64,6 +64,8 @@ namespace Ids
DECLARE_ID (osxArchitecture);
DECLARE_ID (winArchitecture);
DECLARE_ID (winWarningLevel);
DECLARE_ID (bigIcon);
DECLARE_ID (smallIcon);
DECLARE_ID (jucerVersion);
DECLARE_ID (projectType);
DECLARE_ID (prebuildCommand);


+ 12
- 9
extras/JuceDemo/Juce Demo.jucer View File

@@ -7,11 +7,10 @@
pluginCode="Abcd" pluginChannelConfigs="{ {1, 1}, {2, 2} }" pluginIsSynth="0"
pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginSilenceInIsSilenceOut="0"
pluginTailLength="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="JuceDemoAU"
pluginAUViewClass="JuceDemoAU_V1" pluginRTASCategory="" icon="Duj062Top"
bigIcon="f4hwldS">
pluginAUViewClass="JuceDemoAU_V1" pluginRTASCategory="" icon="Duj062Top">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
juceFolder="../../../juce" objCExtraSuffix="JSLvvV6j">
juceFolder="../../../juce" objCExtraSuffix="JSLvvV6j" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
osxSDK="default" osxCompatibility="default" defines="JUCE_UNIT_TESTS=1"
@@ -22,7 +21,7 @@
</CONFIGURATIONS>
</XCODE_MAC>
<XCODE_IPHONE targetFolder="Builds/iOS" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
juceFolder="../../../juce" objCExtraSuffix="JSLvvV6j">
juceFolder="../../../juce" objCExtraSuffix="JSLvvV6j" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
osxSDK="default" osxCompatibility="default" defines="JUCE_UNIT_TESTS=1"
@@ -33,7 +32,8 @@
</CONFIGURATIONS>
</XCODE_IPHONE>
<VS2005 targetFolder="Builds/VisualStudio2005" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../../../juce" libraryType="1">
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../../../juce" libraryType="1"
bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1"/>
@@ -42,7 +42,8 @@
</CONFIGURATIONS>
</VS2005>
<VS2008 targetFolder="Builds/VisualStudio2008" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../../../juce" libraryType="1">
rtasFolder="c:\SDKs\PT_80_SDK" juceFolder="../../../juce" libraryType="1"
bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1"/>
@@ -50,7 +51,8 @@
defines="JUCE_UNIT_TESTS=1"/>
</CONFIGURATIONS>
</VS2008>
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" juceFolder="../../../juce">
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" juceFolder="../../../juce"
bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1"/>
@@ -59,7 +61,8 @@
</CONFIGURATIONS>
</LINUX_MAKE>
<VS2010 targetFolder="Builds/VisualStudio2010" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" juceFolder="../../../juce">
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" juceFolder="../../../juce"
bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winArchitecture="32-bit"/>
@@ -69,7 +72,7 @@
</VS2010>
<ANDROID targetFolder="Builds/Android" androidSDKPath="${user.home}/SDKs/android-sdk-macosx"
androidNDKPath="${user.home}/SDKs/android-ndk-r7" juceFolder="../../../juce"
androidInternetNeeded="1">
androidInternetNeeded="1" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1"/>


+ 8
- 6
extras/the jucer/Jucer.jucer View File

@@ -1,28 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="Uy86Nk" name="Jucer" projectType="guiapp" version="1.0.0"
bundleIdentifier="com.yourcompany.Jucer" jucerVersion="3.0.0"
bigIcon="HFdB13">
bundleIdentifier="com.yourcompany.Jucer" jucerVersion="3.0.0">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" objCExtraSuffix="wQBvzo" juceFolder="../..">
<XCODE_MAC targetFolder="Builds/MacOSX" objCExtraSuffix="wQBvzo" juceFolder="../.."
bigIcon="HFdB13">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
</CONFIGURATIONS>
</XCODE_MAC>
<VS2008 targetFolder="Builds/VisualStudio2008" libraryType="1" juceFolder="../..">
<VS2008 targetFolder="Builds/VisualStudio2008" libraryType="1" juceFolder="../.."
bigIcon="HFdB13">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
</CONFIGURATIONS>
</VS2008>
<VS2010 targetFolder="Builds/VisualStudio2010" libraryType="1" juceFolder="../..">
<VS2010 targetFolder="Builds/VisualStudio2010" libraryType="1" juceFolder="../.."
bigIcon="HFdB13">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
</CONFIGURATIONS>
</VS2010>
<LINUX_MAKE targetFolder="Builds/Linux" juceFolder="../..">
<LINUX_MAKE targetFolder="Builds/Linux" juceFolder="../.." bigIcon="HFdB13">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>


+ 6
- 0
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -1009,6 +1009,12 @@ ValueTree ValueTree::readFromData (const void* const data, const size_t numBytes
return readFromStream (in);
}
ValueTree ValueTree::readFromGZIPData (const void* const data, const size_t numBytes)
{
MemoryInputStream in (data, numBytes, false);
GZIPDecompressorInputStream gzipStream (in);
return readFromStream (gzipStream);
}
//==============================================================================
#if JUCE_UNIT_TESTS


+ 5
- 0
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -345,6 +345,11 @@ public:
/** Reloads a tree from a data block that was written with writeToStream(). */
static ValueTree readFromData (const void* data, size_t numBytes);
/** Reloads a tree from a data block that was written with writeToStream() and
then zipped using GZIPCompressorOutputStream.
*/
static ValueTree readFromGZIPData (const void* data, size_t numBytes);
//==============================================================================
/** Listener class for events that happen to a ValueTree.


Loading…
Cancel
Save