From 1fd27d7ed6dac86809012e096c88bcb23dbe9ec9 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 25 Jun 2012 16:07:58 +0100 Subject: [PATCH] Introjucer: fix for binary data file generation when no images are present. --- extras/Introjucer/JuceLibraryCode/BinaryData.cpp | 2 +- .../Source/Project Saving/jucer_ResourceFile.cpp | 11 ++++++----- .../Source/Utility/jucer_MiscUtilities.cpp | 14 -------------- .../Source/Utility/jucer_MiscUtilities.h | 12 ------------ extras/JuceDemo/JuceLibraryCode/BinaryData.cpp | 2 +- extras/the jucer/JuceLibraryCode/BinaryData.cpp | 2 +- 6 files changed, 9 insertions(+), 34 deletions(-) diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp index d18f7f1a0b..e493b7b1d0 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp @@ -1129,7 +1129,7 @@ const char* jucer_WindowTemplate_h = (const char*) temp_613d4455; const char* getNamedResource (const char*, int&) throw(); const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() { - int hash = 0; + unsigned int hash = 0; if (resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0) hash = 31 * hash + *resourceNameUTF8++; diff --git a/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp b/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp index f0d5524202..8a3870415e 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp +++ b/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp @@ -191,19 +191,20 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream& << newLine << "}" << newLine; + header << " // If you provide the name of one of the binary resource variables above, this function will" << newLine + << " // return the corresponding data and its size (or a null pointer if the name isn't found)." << newLine + << " const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();" << newLine; + if (containsAnyImages) { - header << " // If you provide the name of one of the binary resource variables above, this function will" << newLine - << " // return the corresponding data and its size (or a null pointer if the name isn't found)." << newLine - << " const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();" << newLine - << newLine + header << newLine << " //==============================================================================" << newLine << " // This class acts as an ImageProvider that will access the BinaryData images" << newLine << " class ImageProvider : public juce::ComponentBuilder::ImageProvider" << newLine << " {" << newLine << " public:" << newLine << " ImageProvider() noexcept {}" << newLine - << newLine + << newLine << " juce::Image getImageForIdentifier (const juce::var& imageIdentifier)" << newLine << " {" << newLine << " int dataSize = 0;" << newLine diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp index 109bff3832..aa27042104 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp @@ -305,20 +305,6 @@ String RolloverHelpComp::findTip (Component* c) return String::empty; } -//============================================================================== -PropertyPanelWithTooltips::PropertyPanelWithTooltips() -{ - addAndMakeVisible (&panel); - addAndMakeVisible (&rollover); -} - -void PropertyPanelWithTooltips::resized() -{ - panel.setBounds (0, 0, getWidth(), jmax (getHeight() - 60, proportionOfHeight (0.6f))); - rollover.setBounds (3, panel.getBottom() - 50, getWidth() - 6, - getHeight() - (panel.getBottom() - 50) - 4); -} - //============================================================================== FloatingLabelComponent::FloatingLabelComponent() : font (10.0f) diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h index 73b9645de2..59213faab6 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h @@ -74,18 +74,6 @@ private: static String findTip (Component*); }; -//============================================================================== -class PropertyPanelWithTooltips : public Component -{ -public: - PropertyPanelWithTooltips(); - - void resized(); - - PropertyPanel panel; - RolloverHelpComp rollover; -}; - //============================================================================== class PropertyListBuilder { diff --git a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp index 9b071de487..7eacc57e92 100644 --- a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp +++ b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp @@ -2145,7 +2145,7 @@ const char* treedemo_xml = (const char*) temp_816ae700; const char* getNamedResource (const char*, int&) throw(); const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() { - int hash = 0; + unsigned int hash = 0; if (resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0) hash = 31 * hash + *resourceNameUTF8++; diff --git a/extras/the jucer/JuceLibraryCode/BinaryData.cpp b/extras/the jucer/JuceLibraryCode/BinaryData.cpp index 343f00e53f..6c41440e81 100644 --- a/extras/the jucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/the jucer/JuceLibraryCode/BinaryData.cpp @@ -512,7 +512,7 @@ const char* prefs_misc_png = (const char*) temp_2dcb70c7; const char* getNamedResource (const char*, int&) throw(); const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() { - int hash = 0; + unsigned int hash = 0; if (resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0) hash = 31 * hash + *resourceNameUTF8++;