diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp index 24ca1fbf34..09655704d4 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp @@ -1244,4 +1244,32 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw return 0; } +const int namedResourceListSize = 22; + +const char* namedResourceList[] = +{ + "AudioPluginXCodeScript_txt", + "background_tile_png", + "colourscheme_dark_xml", + "colourscheme_light_xml", + "jucer_AudioPluginEditorTemplate_cpp", + "jucer_AudioPluginEditorTemplate_h", + "jucer_AudioPluginFilterTemplate_cpp", + "jucer_AudioPluginFilterTemplate_h", + "jucer_ComponentTemplate_cpp", + "jucer_ComponentTemplate_h", + "jucer_ContentCompTemplate_cpp", + "jucer_ContentCompTemplate_h", + "jucer_InlineComponentTemplate_h", + "jucer_MainConsoleAppTemplate_cpp", + "jucer_MainTemplate_NoWindow_cpp", + "jucer_MainTemplate_Window_cpp", + "jucer_NewComponentTemplate_cpp", + "jucer_NewComponentTemplate_h", + "jucer_NewCppFileTemplate_cpp", + "jucer_NewCppFileTemplate_h", + "jucer_NewInlineComponentTemplate_h", + "RecentFilesMenuTemplate_nib" +}; + } diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.h b/extras/Introjucer/JuceLibraryCode/BinaryData.h index 6fe7cbbca6..31abae8d15 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.h +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.h @@ -72,6 +72,12 @@ namespace BinaryData extern const char* RecentFilesMenuTemplate_nib; const int RecentFilesMenuTemplate_nibSize = 2842; + // Points to the start of a list of resource names. + extern const char* namedResourceList[]; + + // Number of elements in the namedResourceList array. + extern const int namedResourceListSize; + // If you provide the name of one of the binary resource variables above, this function will // return the corresponding data and its size (or a null pointer if the name isn't found). const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw(); diff --git a/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp b/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp index 64490a5612..dad63cf018 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp +++ b/extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp @@ -154,7 +154,13 @@ bool ResourceFile::writeHeader (MemoryOutputStream& header) } } - header << " // If you provide the name of one of the binary resource variables above, this function will" << newLine + header << " // Points to the start of a list of resource names." << newLine + << " extern const char* namedResourceList[];" << newLine + << newLine + << " // Number of elements in the namedResourceList array." << newLine + << " extern const int namedResourceListSize;" << newLine + << newLine + << " // 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; @@ -237,7 +243,17 @@ bool ResourceFile::writeCpp (MemoryOutputStream& cpp, const File& headerFile, in cpp << " numBytes = 0;" << newLine << " return 0;" << newLine - << "}" << newLine; + << "}" << newLine + << newLine + << "const int namedResourceListSize = " << files.size() << ";" << newLine + << newLine + << "const char* namedResourceList[] =" << newLine + << "{" << newLine; + + for (int j = 0; j < files.size(); ++j) + cpp << " " << variableNames[j].quoted() << (j < files.size() - 1 ? "," : "") << newLine; + + cpp << "};" << newLine; } cpp << newLine diff --git a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp index 106b6daee4..e756995c27 100644 --- a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp +++ b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp @@ -2163,4 +2163,15 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw return 0; } +const int namedResourceListSize = 5; + +const char* namedResourceList[] = +{ + "cello_wav", + "demo_table_data_xml", + "icons_zip", + "juce_png", + "treedemo_xml" +}; + } diff --git a/extras/JuceDemo/JuceLibraryCode/BinaryData.h b/extras/JuceDemo/JuceLibraryCode/BinaryData.h index 0dd4b696f0..d63ce9d406 100644 --- a/extras/JuceDemo/JuceLibraryCode/BinaryData.h +++ b/extras/JuceDemo/JuceLibraryCode/BinaryData.h @@ -21,6 +21,12 @@ namespace BinaryData extern const char* treedemo_xml; const int treedemo_xmlSize = 1126; + // Points to the start of a list of resource names. + extern const char* namedResourceList[]; + + // Number of elements in the namedResourceList array. + extern const int namedResourceListSize; + // If you provide the name of one of the binary resource variables above, this function will // return the corresponding data and its size (or a null pointer if the name isn't found). const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();