mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor Jucer updates. Fix for strange PNG problem. ICC and VC6 compilation changes.
This commit is contained in:
parent
4f704c4d33
commit
8de537e52c
29 changed files with 345 additions and 201 deletions
|
|
@ -50,6 +50,7 @@ OBJECTS := \
|
|||
$(OBJDIR)/jucer_ProjectExporter.o \
|
||||
$(OBJDIR)/jucer_ProjectWizard.o \
|
||||
$(OBJDIR)/jucer_ResourceFile.o \
|
||||
$(OBJDIR)/jucer_ComponentEditor.o \
|
||||
$(OBJDIR)/jucer_DrawableEditor.o \
|
||||
$(OBJDIR)/jucer_DocumentEditorComponent.o \
|
||||
$(OBJDIR)/jucer_GroupInformationComponent.o \
|
||||
|
|
@ -121,6 +122,11 @@ $(OBJDIR)/jucer_ResourceFile.o: ../../Source/model/jucer_ResourceFile.cpp
|
|||
@echo $(notdir $<)
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentEditor.o: ../../Source/ui/Component\ Editor/jucer_ComponentEditor.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo $(notdir $<)
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_DrawableEditor.o: ../../Source/ui/Drawable\ Editor/jucer_DrawableEditor.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo $(notdir $<)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
60CDC1358E84801B6526E434 = { isa = PBXBuildFile; fileRef = FE9A53032395E717F54AE85B; };
|
||||
EEC6FC8E546C88C825411DB2 = { isa = PBXBuildFile; fileRef = 0AD266A3E698D40DCD88A432; };
|
||||
B2B821DE12F1679A3ADA597A = { isa = PBXBuildFile; fileRef = DBE9A3BB502125C5D3433AE7; };
|
||||
D706C3B5016318D85FE452C2 = { isa = PBXBuildFile; fileRef = 3263F4099F45D6FACD28F08D; };
|
||||
E43D00B370F289420379B759 = { isa = PBXBuildFile; fileRef = 82F91CF84A296665177CB79A; };
|
||||
944CE0EADAD951F48EC77071 = { isa = PBXBuildFile; fileRef = 3B2C45064E85B3B631D4F921; };
|
||||
4E8860E0F8680956A6F5B493 = { isa = PBXBuildFile; fileRef = 8F731296532276CBF2B6190D; };
|
||||
|
|
@ -75,6 +76,8 @@
|
|||
91C67387B525014760F514C2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jucer_ProjectWizard.h; path = ../../Source/model/jucer_ProjectWizard.h; sourceTree = SOURCE_ROOT; };
|
||||
DBE9A3BB502125C5D3433AE7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = jucer_ResourceFile.cpp; path = ../../Source/model/jucer_ResourceFile.cpp; sourceTree = SOURCE_ROOT; };
|
||||
2DEE6D9FE17874DAB301648C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jucer_ResourceFile.h; path = ../../Source/model/jucer_ResourceFile.h; sourceTree = SOURCE_ROOT; };
|
||||
3263F4099F45D6FACD28F08D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = jucer_ComponentEditor.cpp; path = "../../Source/ui/Component Editor/jucer_ComponentEditor.cpp"; sourceTree = SOURCE_ROOT; };
|
||||
16328135EAE8536A5E2AB454 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jucer_ComponentEditor.h; path = "../../Source/ui/Component Editor/jucer_ComponentEditor.h"; sourceTree = SOURCE_ROOT; };
|
||||
82F91CF84A296665177CB79A = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = jucer_DrawableEditor.cpp; path = "../../Source/ui/Drawable Editor/jucer_DrawableEditor.cpp"; sourceTree = SOURCE_ROOT; };
|
||||
D1776C5F3E6BB7E8C698BAD6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jucer_DrawableEditor.h; path = "../../Source/ui/Drawable Editor/jucer_DrawableEditor.h"; sourceTree = SOURCE_ROOT; };
|
||||
F9EAFD5BC3E676BC59B326E0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jucer_DrawableObjectComponent.h; path = "../../Source/ui/Drawable Editor/jucer_DrawableObjectComponent.h"; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -151,7 +154,9 @@
|
|||
91C67387B525014760F514C2,
|
||||
DBE9A3BB502125C5D3433AE7,
|
||||
2DEE6D9FE17874DAB301648C ); name = Model; sourceTree = "<group>"; };
|
||||
3A0BE83502CB509D623C2C07 = { isa = PBXGroup; children = ( ); name = "Component Editor"; sourceTree = "<group>"; };
|
||||
3A0BE83502CB509D623C2C07 = { isa = PBXGroup; children = (
|
||||
3263F4099F45D6FACD28F08D,
|
||||
16328135EAE8536A5E2AB454 ); name = "Component Editor"; sourceTree = "<group>"; };
|
||||
E6053BD673F80E900DDA3593 = { isa = PBXGroup; children = (
|
||||
82F91CF84A296665177CB79A,
|
||||
D1776C5F3E6BB7E8C698BAD6,
|
||||
|
|
@ -314,6 +319,7 @@
|
|||
60CDC1358E84801B6526E434,
|
||||
EEC6FC8E546C88C825411DB2,
|
||||
B2B821DE12F1679A3ADA597A,
|
||||
D706C3B5016318D85FE452C2,
|
||||
E43D00B370F289420379B759,
|
||||
944CE0EADAD951F48EC77071,
|
||||
4E8860E0F8680956A6F5B493,
|
||||
|
|
|
|||
|
|
@ -153,7 +153,10 @@
|
|||
<File RelativePath="..\..\Source\model\jucer_ResourceFile.h"/>
|
||||
</Filter>
|
||||
<Filter Name="UI">
|
||||
<Filter Name="Component Editor"/>
|
||||
<Filter Name="Component Editor">
|
||||
<File RelativePath="..\..\Source\ui\Component Editor\jucer_ComponentEditor.cpp"/>
|
||||
<File RelativePath="..\..\Source\ui\Component Editor\jucer_ComponentEditor.h"/>
|
||||
</Filter>
|
||||
<Filter Name="Drawable Editor">
|
||||
<File RelativePath="..\..\Source\ui\Drawable Editor\jucer_DrawableEditor.cpp"/>
|
||||
<File RelativePath="..\..\Source\ui\Drawable Editor\jucer_DrawableEditor.h"/>
|
||||
|
|
|
|||
|
|
@ -153,7 +153,10 @@
|
|||
<File RelativePath="..\..\Source\model\jucer_ResourceFile.h"/>
|
||||
</Filter>
|
||||
<Filter Name="UI">
|
||||
<Filter Name="Component Editor"/>
|
||||
<Filter Name="Component Editor">
|
||||
<File RelativePath="..\..\Source\ui\Component Editor\jucer_ComponentEditor.cpp"/>
|
||||
<File RelativePath="..\..\Source\ui\Component Editor\jucer_ComponentEditor.h"/>
|
||||
</Filter>
|
||||
<Filter Name="Drawable Editor">
|
||||
<File RelativePath="..\..\Source\ui\Drawable Editor\jucer_DrawableEditor.cpp"/>
|
||||
<File RelativePath="..\..\Source\ui\Drawable Editor\jucer_DrawableEditor.h"/>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,12 @@
|
|||
file="Source/model/jucer_ResourceFile.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="8J0PD9iW5" name="UI">
|
||||
<GROUP id="d2joUoRvF" name="Component Editor"/>
|
||||
<GROUP id="d2joUoRvF" name="Component Editor">
|
||||
<FILE id="Q48V5uBKu" name="jucer_ComponentEditor.cpp" compile="1" resource="0"
|
||||
file="Source/ui/Component Editor/jucer_ComponentEditor.cpp"/>
|
||||
<FILE id="B1zNCvltV" name="jucer_ComponentEditor.h" compile="0" resource="0"
|
||||
file="Source/ui/Component Editor/jucer_ComponentEditor.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="VLkoRqu1c" name="Drawable Editor">
|
||||
<FILE id="0eWoa5Ttv" name="jucer_DrawableEditor.cpp" compile="1" resource="0"
|
||||
file="Source/ui/Drawable Editor/jucer_DrawableEditor.cpp"/>
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ public:
|
|||
/* Running a command-line of the form "Jucer --resave foobar.jucer" will try to load that
|
||||
jucer file and re-export all of its projects.
|
||||
*/
|
||||
if (commandLine.startsWithIgnoreCase (T("-resave ")) || commandLine.startsWithIgnoreCase (T("--resave ")))
|
||||
if (commandLine.startsWithIgnoreCase ("-resave ") || commandLine.startsWithIgnoreCase ("--resave "))
|
||||
{
|
||||
resaveJucerFile (File::getCurrentWorkingDirectory()
|
||||
.getChildFile (commandLine.fromFirstOccurrenceOf (T(" "), false, false).unquoted()));
|
||||
.getChildFile (commandLine.fromFirstOccurrenceOf (" ", false, false).unquoted()));
|
||||
quit();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ bool ComponentDocument::isComponentFile (const File& file)
|
|||
in->read (initialData, amountToRead);
|
||||
|
||||
return String::createStringFromData (initialData, amountToRead)
|
||||
.contains (String ("JUCER_" "COMPONENT")); // written like this to avoid thinking this file is a component!
|
||||
.contains ("JUCER_" "COMPONENT"); // written like this to avoid thinking this file is a component!
|
||||
}
|
||||
|
||||
bool ComponentDocument::save()
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@
|
|||
static bool fillInNewCppFileTemplate (const File& file, const Project::Item& item, const char* templateName)
|
||||
{
|
||||
String s = item.getProject().getFileTemplate (templateName)
|
||||
.replace (T("FILENAME"), file.getFileName(), false)
|
||||
.replace (T("DATE"), Time::getCurrentTime().toString (true, true, true), false)
|
||||
.replace (T("AUTHOR"), SystemStats::getFullUserName(), false)
|
||||
.replace (T("HEADERGUARD"), makeHeaderGuardName (file), false);
|
||||
.replace ("FILENAME", file.getFileName(), false)
|
||||
.replace ("DATE", Time::getCurrentTime().toString (true, true, true), false)
|
||||
.replace ("AUTHOR", SystemStats::getFullUserName(), false)
|
||||
.replace ("HEADERGUARD", makeHeaderGuardName (file), false);
|
||||
|
||||
return overwriteFileWithNewDataIfDifferent (file, s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -644,16 +644,16 @@ void Project::getJuceConfigFlags (OwnedArray <JuceConfigFlag>& flags)
|
|||
{
|
||||
String line (lines[i].trim());
|
||||
|
||||
if (line.startsWith (T("/** ")) && line.containsChar (':'))
|
||||
if (line.startsWith ("/** ") && line.containsChar (':'))
|
||||
{
|
||||
ScopedPointer <JuceConfigFlag> config (new JuceConfigFlag());
|
||||
config->symbol = line.substring (4).upToFirstOccurrenceOf (T(":"), false, false).trim();
|
||||
config->symbol = line.substring (4).upToFirstOccurrenceOf (":", false, false).trim();
|
||||
|
||||
if (config->symbol.length() > 4)
|
||||
{
|
||||
config->description = line.fromFirstOccurrenceOf (T(":"), false, false).trimStart();
|
||||
config->description = line.fromFirstOccurrenceOf (":", false, false).trimStart();
|
||||
++i;
|
||||
while (! (lines[i].contains (T("*/")) || lines[i].contains (T("@see"))))
|
||||
while (! (lines[i].contains ("*/") || lines[i].contains ("@see")))
|
||||
{
|
||||
if (lines[i].trim().isNotEmpty())
|
||||
config->description = config->description.trim() + " " + lines[i].trim();
|
||||
|
|
@ -661,7 +661,7 @@ void Project::getJuceConfigFlags (OwnedArray <JuceConfigFlag>& flags)
|
|||
++i;
|
||||
}
|
||||
|
||||
config->description = config->description.upToFirstOccurrenceOf (T("*/"), false, false);
|
||||
config->description = config->description.upToFirstOccurrenceOf ("*/", false, false);
|
||||
config->value.referTo (getJuceConfigFlag (config->symbol));
|
||||
flags.add (config.release());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ private:
|
|||
|
||||
static const String escapeSpaces (const String& s)
|
||||
{
|
||||
return s.replace (T(" "), T("\\ "));
|
||||
return s.replace (" ", "\\ ");
|
||||
}
|
||||
|
||||
const String getObjectFileFor (const RelativePath& file) const
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ private:
|
|||
|
||||
flags.add ("-l" + library.getFileNameWithoutExtension().substring (3));
|
||||
|
||||
String searchPath (library.toUnixStyle().upToLastOccurrenceOf (T("/"), false, false));
|
||||
String searchPath (library.toUnixStyle().upToLastOccurrenceOf ("/", false, false));
|
||||
if (! library.isAbsolute())
|
||||
searchPath = "$(SRCROOT)/" + searchPath;
|
||||
|
||||
|
|
@ -571,7 +571,7 @@ private:
|
|||
const var::identifier name (o.getPropertyName(j));
|
||||
String val (o.getProperty (name).toString());
|
||||
|
||||
if (val.isEmpty() || (val.containsAnyOf (T(" \t;<>()=,-\r\n"))
|
||||
if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,-\r\n")
|
||||
&& ! (val.trimStart().startsWithChar ('(')
|
||||
|| val.trimStart().startsWithChar ('{'))))
|
||||
val = val.quoted();
|
||||
|
|
@ -892,10 +892,10 @@ private:
|
|||
v->setProperty ("name", "Copy to the different plugin folders", 0);
|
||||
v->setProperty ("shellPath", "/bin/sh", 0);
|
||||
v->setProperty ("shellScript", String::fromUTF8 (BinaryData::AudioPluginXCodeScript_txt, BinaryData::AudioPluginXCodeScript_txtSize)
|
||||
.replace (T("\\"), T("\\\\"))
|
||||
.replace (T("\""), T("\\\""))
|
||||
.replace (T("\r\n"), T("\\n"))
|
||||
.replace (T("\n"), T("\\n")), 0);
|
||||
.replace ("\\", "\\\\")
|
||||
.replace ("\"", "\\\"")
|
||||
.replace ("\r\n", "\\n")
|
||||
.replace ("\n", "\\n"), 0);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ protected:
|
|||
|
||||
const String getLibbedFilename (String name) const
|
||||
{
|
||||
if (! name.startsWith (T("lib")))
|
||||
if (! name.startsWith ("lib"))
|
||||
name = "lib" + name;
|
||||
if (! name.endsWithIgnoreCase (T(".a")))
|
||||
if (! name.endsWithIgnoreCase (".a"))
|
||||
name = name + ".a";
|
||||
return name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
{
|
||||
createMainCpp = createWindow = false;
|
||||
|
||||
switch (aw.getComboBoxComponent("files")->getSelectedItemIndex())
|
||||
switch (aw.getComboBoxComponent ("files")->getSelectedItemIndex())
|
||||
{
|
||||
case 0: createMainCpp = true; break;
|
||||
case 1: createMainCpp = createWindow = true; break;
|
||||
|
|
@ -91,13 +91,13 @@ public:
|
|||
privateMembers = windowClassName + "* mainWindow;";
|
||||
|
||||
String windowH = project.getFileTemplate ("jucer_WindowTemplate_h")
|
||||
.replace (T("INCLUDES"), createIncludeStatement (project.getAppIncludeFile(), mainWindowH), false)
|
||||
.replace (T("WINDOWCLASS"), windowClassName, false)
|
||||
.replace (T("HEADERGUARD"), makeHeaderGuardName (mainWindowH), false);
|
||||
.replace ("INCLUDES", createIncludeStatement (project.getAppIncludeFile(), mainWindowH), false)
|
||||
.replace ("WINDOWCLASS", windowClassName, false)
|
||||
.replace ("HEADERGUARD", makeHeaderGuardName (mainWindowH), false);
|
||||
|
||||
String windowCpp = project.getFileTemplate ("jucer_WindowTemplate_cpp")
|
||||
.replace (T("INCLUDES"), createIncludeStatement (mainWindowH, mainWindowCpp), false)
|
||||
.replace (T("WINDOWCLASS"), windowClassName, false);
|
||||
.replace ("INCLUDES", createIncludeStatement (mainWindowH, mainWindowCpp), false)
|
||||
.replace ("WINDOWCLASS", windowClassName, false);
|
||||
|
||||
if (! overwriteFileWithNewDataIfDifferent (mainWindowH, windowH))
|
||||
failedFiles.add (mainWindowH.getFullPathName());
|
||||
|
|
@ -112,16 +112,16 @@ public:
|
|||
if (createMainCpp)
|
||||
{
|
||||
String mainCpp = project.getFileTemplate ("jucer_MainTemplate_cpp")
|
||||
.replace (T("APPHEADERS"), appHeaders, false)
|
||||
.replace (T("APPCLASSNAME"), makeValidCppIdentifier (appTitle + "Application", false, true, false), false)
|
||||
.replace (T("MEMBERINITIALISERS"), memberInitialisers, false)
|
||||
.replace (T("APPINITCODE"), initCode, false)
|
||||
.replace (T("APPSHUTDOWNCODE"), shutdownCode, false)
|
||||
.replace (T("APPNAME"), replaceCEscapeChars (appTitle), false)
|
||||
.replace (T("APPVERSION"), T("1.0"), false)
|
||||
.replace (T("ALLOWMORETHANONEINSTANCE"), T("true"), false)
|
||||
.replace (T("ANOTHERINSTANCECODE"), anotherInstanceStartedCode, false)
|
||||
.replace (T("PRIVATEMEMBERS"), privateMembers, false);
|
||||
.replace ("APPHEADERS", appHeaders, false)
|
||||
.replace ("APPCLASSNAME", makeValidCppIdentifier (appTitle + "Application", false, true, false), false)
|
||||
.replace ("MEMBERINITIALISERS", memberInitialisers, false)
|
||||
.replace ("APPINITCODE", initCode, false)
|
||||
.replace ("APPSHUTDOWNCODE", shutdownCode, false)
|
||||
.replace ("APPNAME", replaceCEscapeChars (appTitle), false)
|
||||
.replace ("APPVERSION", "1.0", false)
|
||||
.replace ("ALLOWMORETHANONEINSTANCE", "true", false)
|
||||
.replace ("ANOTHERINSTANCECODE", anotherInstanceStartedCode, false)
|
||||
.replace ("PRIVATEMEMBERS", privateMembers, false);
|
||||
|
||||
if (! overwriteFileWithNewDataIfDifferent (mainCppFile, mainCpp))
|
||||
failedFiles.add (mainCppFile.getFullPathName());
|
||||
|
|
@ -158,7 +158,7 @@ public:
|
|||
{
|
||||
createMainCpp = false;
|
||||
|
||||
switch (aw.getComboBoxComponent("files")->getSelectedItemIndex())
|
||||
switch (aw.getComboBoxComponent ("files")->getSelectedItemIndex())
|
||||
{
|
||||
case 0: createMainCpp = true; break;
|
||||
case 1: break;
|
||||
|
|
@ -189,7 +189,7 @@ public:
|
|||
String appHeaders (createIncludeStatement (project.getAppIncludeFile(), mainCppFile));
|
||||
|
||||
String mainCpp = project.getFileTemplate ("jucer_MainConsoleAppTemplate_cpp")
|
||||
.replace (T("APPHEADERS"), appHeaders, false);
|
||||
.replace ("APPHEADERS", appHeaders, false);
|
||||
|
||||
if (! overwriteFileWithNewDataIfDifferent (mainCppFile, mainCpp))
|
||||
failedFiles.add (mainCppFile.getFullPathName());
|
||||
|
|
@ -251,27 +251,27 @@ public:
|
|||
appHeaders << newLine << createIncludeStatement (project.getPluginCharacteristicsFile(), filterCppFile);
|
||||
|
||||
String filterCpp = project.getFileTemplate ("jucer_AudioPluginFilterTemplate_cpp")
|
||||
.replace (T("FILTERHEADERS"), createIncludeStatement (filterHFile, filterCppFile)
|
||||
.replace ("FILTERHEADERS", createIncludeStatement (filterHFile, filterCppFile)
|
||||
+ newLine + createIncludeStatement (editorHFile, filterCppFile), false)
|
||||
.replace (T("FILTERCLASSNAME"), filterClassName, false)
|
||||
.replace (T("EDITORCLASSNAME"), editorClassName, false);
|
||||
.replace ("FILTERCLASSNAME", filterClassName, false)
|
||||
.replace ("EDITORCLASSNAME", editorClassName, false);
|
||||
|
||||
String filterH = project.getFileTemplate ("jucer_AudioPluginFilterTemplate_h")
|
||||
.replace (T("APPHEADERS"), appHeaders, false)
|
||||
.replace (T("FILTERCLASSNAME"), filterClassName, false)
|
||||
.replace (T("HEADERGUARD"), makeHeaderGuardName (filterHFile), false);
|
||||
.replace ("APPHEADERS", appHeaders, false)
|
||||
.replace ("FILTERCLASSNAME", filterClassName, false)
|
||||
.replace ("HEADERGUARD", makeHeaderGuardName (filterHFile), false);
|
||||
|
||||
String editorCpp = project.getFileTemplate ("jucer_AudioPluginEditorTemplate_cpp")
|
||||
.replace (T("EDITORCPPHEADERS"), createIncludeStatement (filterHFile, filterCppFile)
|
||||
.replace ("EDITORCPPHEADERS", createIncludeStatement (filterHFile, filterCppFile)
|
||||
+ newLine + createIncludeStatement (editorHFile, filterCppFile), false)
|
||||
.replace (T("FILTERCLASSNAME"), filterClassName, false)
|
||||
.replace (T("EDITORCLASSNAME"), editorClassName, false);
|
||||
.replace ("FILTERCLASSNAME", filterClassName, false)
|
||||
.replace ("EDITORCLASSNAME", editorClassName, false);
|
||||
|
||||
String editorH = project.getFileTemplate ("jucer_AudioPluginEditorTemplate_h")
|
||||
.replace (T("EDITORHEADERS"), appHeaders + newLine + createIncludeStatement (filterHFile, filterCppFile), false)
|
||||
.replace (T("FILTERCLASSNAME"), filterClassName, false)
|
||||
.replace (T("EDITORCLASSNAME"), editorClassName, false)
|
||||
.replace (T("HEADERGUARD"), makeHeaderGuardName (editorHFile), false);
|
||||
.replace ("EDITORHEADERS", appHeaders + newLine + createIncludeStatement (filterHFile, filterCppFile), false)
|
||||
.replace ("FILTERCLASSNAME", filterClassName, false)
|
||||
.replace ("EDITORCLASSNAME", editorClassName, false)
|
||||
.replace ("HEADERGUARD", makeHeaderGuardName (editorHFile), false);
|
||||
|
||||
if (! overwriteFileWithNewDataIfDifferent (filterCppFile, filterCpp))
|
||||
failedFiles.add (filterCppFile.getFullPathName());
|
||||
|
|
@ -482,7 +482,7 @@ Project* ProjectWizard::runNewProjectWizard (Component* ownerWindow)
|
|||
|
||||
if (isJuceFolder (juceFolderSelector.getCurrentFile()))
|
||||
{
|
||||
wizard = createWizard (aw.getComboBoxComponent("type")->getSelectedItemIndex());
|
||||
wizard = createWizard (aw.getComboBoxComponent ("type")->getSelectedItemIndex());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include "../ui/jucer_ProjectTreeViewBase.h"
|
||||
#include "../ui/jucer_OpenDocumentManager.h"
|
||||
|
||||
static const tchar* resourceFileIdentifierString = T("JUCER_BINARY_RESOURCE");
|
||||
static const char* resourceFileIdentifierString = "JUCER_BINARY_RESOURCE";
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -211,8 +211,8 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream&
|
|||
for (i = 0; i < files.size(); ++i)
|
||||
{
|
||||
String variableNameRoot (makeValidCppIdentifier (files.getUnchecked(i)->getFileName()
|
||||
.replaceCharacters (T(" ."), T("__"))
|
||||
.retainCharacters (T("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789")),
|
||||
.replaceCharacters (" .", "__")
|
||||
.retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789"),
|
||||
false, true, false));
|
||||
String variableName (variableNameRoot);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-9 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_Headers.h"
|
||||
#include "jucer_ComponentEditor.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ComponentEditor::ComponentEditor (OpenDocumentManager::Document* document,
|
||||
Project* project_, ComponentDocument* componentDocument_)
|
||||
: DocumentEditorComponent (document),
|
||||
project (project_),
|
||||
componentDocument (componentDocument_)
|
||||
{
|
||||
jassert (componentDocument != 0);
|
||||
|
||||
setOpaque (true);
|
||||
}
|
||||
|
||||
ComponentEditor::~ComponentEditor()
|
||||
{
|
||||
deleteAllChildren();
|
||||
}
|
||||
|
||||
void ComponentEditor::paint (Graphics& g)
|
||||
{
|
||||
g.fillAll (Colours::white);
|
||||
}
|
||||
|
||||
void ComponentEditor::resized()
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-9 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 __JUCE_COMPONENTEDITOR_H_6CAE6B7E__
|
||||
#define __JUCE_COMPONENTEDITOR_H_6CAE6B7E__
|
||||
|
||||
#include "../../model/jucer_ComponentDocument.h"
|
||||
#include "../jucer_DocumentEditorComponent.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentEditor : public DocumentEditorComponent
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentEditor (OpenDocumentManager::Document* document,
|
||||
Project* project,
|
||||
ComponentDocument* componentDocument);
|
||||
|
||||
~ComponentEditor();
|
||||
|
||||
//==============================================================================
|
||||
void paint (Graphics& g);
|
||||
void resized();
|
||||
|
||||
ComponentDocument& getDocument() const { return *componentDocument; }
|
||||
|
||||
private:
|
||||
Project* project;
|
||||
ComponentDocument* componentDocument;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __JUCE_COMPONENTEDITOR_H_6CAE6B7E__
|
||||
|
|
@ -81,8 +81,8 @@ namespace CommandIDs
|
|||
|
||||
namespace CommandCategories
|
||||
{
|
||||
static const tchar* const general = T("General");
|
||||
static const tchar* const editing = T("Editing");
|
||||
static const tchar* const view = T("View");
|
||||
static const tchar* const windows = T("Windows");
|
||||
static const char* const general = "General";
|
||||
static const char* const editing = "Editing";
|
||||
static const char* const view = "View";
|
||||
static const char* const windows = "Windows";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,9 +329,9 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
|
|||
|
||||
PopupMenu m;
|
||||
for (int i = 0; i < numElementsInArray (snapSizes); ++i)
|
||||
m.addItem (300 + i, String (snapSizes[i]) + T(" pixels"), true, snapSizes[i] == currentSnapSize);
|
||||
m.addItem (300 + i, String (snapSizes[i]) + " pixels", true, snapSizes[i] == currentSnapSize);
|
||||
|
||||
menu.addSubMenu (T("Grid size"), m, getActiveDocument() != 0);*/
|
||||
menu.addSubMenu ("Grid size", m, getActiveDocument() != 0);*/
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addCommandItem (commandManager, CommandIDs::zoomIn);
|
||||
|
|
@ -344,7 +344,7 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
|
|||
overlays.addCommandItem (commandManager, CommandIDs::compOverlay33);
|
||||
overlays.addCommandItem (commandManager, CommandIDs::compOverlay66);
|
||||
overlays.addCommandItem (commandManager, CommandIDs::compOverlay100);
|
||||
menu.addSubMenu (T("Component Overlay"), overlays,
|
||||
menu.addSubMenu ("Component Overlay", overlays,
|
||||
getActiveDocument() != 0 && getActiveDocument()->getComponentLayout() != 0);*/
|
||||
|
||||
menu.addSeparator();
|
||||
|
|
|
|||
|
|
@ -182,15 +182,15 @@ ProjectInformationComponent::ProjectInformationComponent (Project& project_)
|
|||
configTabBox->setCurrentTabIndex (-1);
|
||||
|
||||
addAndMakeVisible (editConfigsButton = new TextButton (String::empty));
|
||||
editConfigsButton->setButtonText (T("Add/Remove Configurations..."));
|
||||
editConfigsButton->setButtonText ("Add/Remove Configurations...");
|
||||
editConfigsButton->addButtonListener (this);
|
||||
|
||||
addAndMakeVisible (openProjectButton = new TextButton (String::empty));
|
||||
openProjectButton->setButtonText (T("Open Project in "));
|
||||
openProjectButton->setButtonText ("Open Project in ");
|
||||
openProjectButton->addButtonListener (this);
|
||||
|
||||
addAndMakeVisible (editExportersButton = new TextButton (String::empty));
|
||||
editExportersButton->setButtonText (T("Add/Remove Exporters..."));
|
||||
editExportersButton->setButtonText ("Add/Remove Exporters...");
|
||||
editExportersButton->addButtonListener (this);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ private:
|
|||
defaultButton (0)
|
||||
{
|
||||
addAndMakeVisible (selector = new ColourSelectorWithSwatches());
|
||||
selector->setName (T("Colour"));
|
||||
selector->setName ("Colour");
|
||||
selector->setCurrentColour (owner->getColour());
|
||||
selector->addChangeListener (owner);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
const RelativePath withFileExtension (const String& extension) const
|
||||
{
|
||||
return RelativePath (path.upToLastOccurrenceOf (T("."), ! extension.startsWithChar ('.'), false) + extension, root);
|
||||
return RelativePath (path.upToLastOccurrenceOf (".", ! extension.startsWithChar ('.'), false) + extension, root);
|
||||
}
|
||||
|
||||
const RelativePath getParentDirectory() const
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
if (path.endsWithChar ('/'))
|
||||
p = p.dropLastCharacters (1);
|
||||
|
||||
return RelativePath (p.upToLastOccurrenceOf (T("/"), false, false), root);
|
||||
return RelativePath (p.upToLastOccurrenceOf ("/", false, false), root);
|
||||
}
|
||||
|
||||
const RelativePath getChildFile (const String& subpath) const
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ bool shouldPathsBeRelative (String path1, String path2)
|
|||
++commonBitLength;
|
||||
}
|
||||
|
||||
return path1.substring (0, commonBitLength).removeCharacters (T("/:")).isNotEmpty();
|
||||
return path1.substring (0, commonBitLength).removeCharacters ("/:").isNotEmpty();
|
||||
}
|
||||
|
||||
const String createIncludeStatement (const File& includeFile, const File& targetFile)
|
||||
|
|
@ -201,8 +201,8 @@ const String createIncludeStatement (const File& includeFile, const File& target
|
|||
const String makeHeaderGuardName (const File& file)
|
||||
{
|
||||
return "__" + file.getFileName().toUpperCase()
|
||||
.replaceCharacters (T(" ."), T("__"))
|
||||
.retainCharacters (T("_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
|
||||
.replaceCharacters (" .", "__")
|
||||
.retainCharacters ("_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
+ "_"
|
||||
+ String::toHexString (file.hashCode()).toUpperCase()
|
||||
+ "__";
|
||||
|
|
@ -211,7 +211,7 @@ const String makeHeaderGuardName (const File& file)
|
|||
//==============================================================================
|
||||
bool isJuceFolder (const File& folder)
|
||||
{
|
||||
return folder.getFileName().containsIgnoreCase (T("juce"))
|
||||
return folder.getFileName().containsIgnoreCase ("juce")
|
||||
&& folder.getChildFile ("juce.h").exists()
|
||||
&& folder.getChildFile ("juce_Config.h").exists();
|
||||
}
|
||||
|
|
@ -327,9 +327,9 @@ const String makeValidCppIdentifier (String s,
|
|||
const bool allowTemplates)
|
||||
{
|
||||
if (removeColons)
|
||||
s = s.replaceCharacters (T(".,;:/@"), T("______"));
|
||||
s = s.replaceCharacters (".,;:/@", "______");
|
||||
else
|
||||
s = s.replaceCharacters (T(".,;/@"), T("_____"));
|
||||
s = s.replaceCharacters (".,;/@", "_____");
|
||||
|
||||
int i;
|
||||
for (i = s.length(); --i > 0;)
|
||||
|
|
@ -337,7 +337,7 @@ const String makeValidCppIdentifier (String s,
|
|||
&& CharacterFunctions::isLetter (s[i - 1])
|
||||
&& CharacterFunctions::isUpperCase (s[i])
|
||||
&& ! CharacterFunctions::isUpperCase (s[i - 1]))
|
||||
s = s.substring (0, i) + T(" ") + s.substring (i);
|
||||
s = s.substring (0, i) + " " + s.substring (i);
|
||||
|
||||
String allowedChars ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789");
|
||||
if (allowTemplates)
|
||||
|
|
@ -474,7 +474,7 @@ const String justificationToCode (const Justification& justification)
|
|||
|
||||
const String castToFloat (const String& expression)
|
||||
{
|
||||
if (expression.containsOnly (T("0123456789.f")))
|
||||
if (expression.containsOnly ("0123456789.f"))
|
||||
{
|
||||
String s (expression.getFloatValue());
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ const String indentCode (const String& code, const int numSpaces)
|
|||
if (numSpaces == 0)
|
||||
return code;
|
||||
|
||||
const String space (String::repeatedString (T(" "), numSpaces));
|
||||
const String space (String::repeatedString (" ", numSpaces));
|
||||
|
||||
StringArray lines;
|
||||
lines.addLines (code);
|
||||
|
|
|
|||
|
|
@ -210833,14 +210833,12 @@ namespace PNGHelpers
|
|||
|
||||
static void readCallback (png_structp png, png_bytep data, png_size_t length)
|
||||
{
|
||||
if (png != 0 && png->io_ptr != 0)
|
||||
static_cast<InputStream*> (png->io_ptr)->read (data, (int) length);
|
||||
static_cast<InputStream*> (png_get_io_ptr (png))->read (data, (int) length);
|
||||
}
|
||||
|
||||
static void writeDataCallback (png_structp png, png_bytep data, png_size_t length)
|
||||
{
|
||||
if (png != 0 && png->io_ptr != 0)
|
||||
static_cast<OutputStream*> (png->io_ptr)->write (data, (int) length);
|
||||
static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length);
|
||||
}
|
||||
|
||||
struct PNGErrorStruct {};
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 51
|
||||
#define JUCE_BUILDNUMBER 12
|
||||
#define JUCE_BUILDNUMBER 13
|
||||
|
||||
#define JUCE_VERSION ((JUCE_MAJOR_VERSION << 16) + (JUCE_MINOR_VERSION << 8) + JUCE_BUILDNUMBER)
|
||||
|
||||
|
|
@ -842,6 +842,9 @@ inline int roundFloatToInt (const float value) throw()
|
|||
|
||||
namespace TypeHelpers
|
||||
{
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
#define PARAMETER_TYPE(a) a
|
||||
#else
|
||||
template <typename Type> struct ParameterType { typedef const Type& type; };
|
||||
template <typename Type> struct ParameterType <Type&> { typedef Type& type; };
|
||||
template <typename Type> struct ParameterType <Type*> { typedef Type* type; };
|
||||
|
|
@ -858,6 +861,9 @@ namespace TypeHelpers
|
|||
template <> struct ParameterType <bool> { typedef bool type; };
|
||||
template <> struct ParameterType <float> { typedef float type; };
|
||||
template <> struct ParameterType <double> { typedef double type; };
|
||||
|
||||
#define PARAMETER_TYPE(a) typename TypeHelpers::ParameterType<a>::type
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // __JUCE_MATHSFUNCTIONS_JUCEHEADER__
|
||||
|
|
@ -1953,6 +1959,13 @@ template <typename ElementType,
|
|||
typename TypeOfCriticalSectionToUse = DummyCriticalSection>
|
||||
class Array
|
||||
{
|
||||
private:
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
typedef const ElementType& ParameterType;
|
||||
#else
|
||||
typedef PARAMETER_TYPE (ElementType) ParameterType;
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
Array() throw()
|
||||
|
|
@ -2085,7 +2098,7 @@ public:
|
|||
: ElementType();
|
||||
}
|
||||
|
||||
int indexOf (typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
int indexOf (ParameterType elementToLookFor) const
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
const ElementType* e = data.elements.getData();
|
||||
|
|
@ -2102,7 +2115,7 @@ public:
|
|||
return -1;
|
||||
}
|
||||
|
||||
bool contains (typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
bool contains (ParameterType elementToLookFor) const
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
const ElementType* e = data.elements.getData();
|
||||
|
|
@ -2119,14 +2132,14 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void add (typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void add (ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
data.ensureAllocatedSize (numUsed + 1);
|
||||
new (data.elements + numUsed++) ElementType (newElement);
|
||||
}
|
||||
|
||||
void insert (int indexToInsertAt, typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void insert (int indexToInsertAt, ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
data.ensureAllocatedSize (numUsed + 1);
|
||||
|
|
@ -2148,7 +2161,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void insertMultiple (int indexToInsertAt, typename TypeHelpers::ParameterType<ElementType>::type newElement,
|
||||
void insertMultiple (int indexToInsertAt, ParameterType newElement,
|
||||
int numberOfTimesToInsertIt)
|
||||
{
|
||||
if (numberOfTimesToInsertIt > 0)
|
||||
|
|
@ -2203,7 +2216,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void addIfNotAlreadyThere (typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void addIfNotAlreadyThere (ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
|
||||
|
|
@ -2211,7 +2224,7 @@ public:
|
|||
add (newElement);
|
||||
}
|
||||
|
||||
void set (const int indexToChange, typename TypeHelpers::ParameterType<ElementType>::type newValue)
|
||||
void set (const int indexToChange, ParameterType newValue)
|
||||
{
|
||||
jassert (indexToChange >= 0);
|
||||
const ScopedLockType lock (getLock());
|
||||
|
|
@ -2227,7 +2240,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void setUnchecked (const int indexToChange, typename TypeHelpers::ParameterType<ElementType>::type newValue)
|
||||
void setUnchecked (const int indexToChange, ParameterType newValue)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
jassert (((unsigned int) indexToChange) < (unsigned int) numUsed);
|
||||
|
|
@ -2278,14 +2291,14 @@ public:
|
|||
}
|
||||
|
||||
template <class ElementComparator>
|
||||
void addSorted (ElementComparator& comparator, typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void addSorted (ElementComparator& comparator, ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed), newElement);
|
||||
}
|
||||
|
||||
template <class ElementComparator>
|
||||
int indexOfSorted (ElementComparator& comparator, typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
int indexOfSorted (ElementComparator& comparator, ParameterType elementToLookFor) const
|
||||
{
|
||||
(void) comparator; // if you pass in an object with a static compareElements() method, this
|
||||
// avoids getting warning messages about the parameter being unused
|
||||
|
|
@ -2345,7 +2358,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void removeValue (typename TypeHelpers::ParameterType<ElementType>::type valueToRemove)
|
||||
void removeValue (ParameterType valueToRemove)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
ElementType* e = data.elements;
|
||||
|
|
@ -6110,6 +6123,15 @@ template <class ListenerClass,
|
|||
class ArrayType = Array <ListenerClass*> >
|
||||
class ListenerList
|
||||
{
|
||||
// Horrible macros required to support VC6/7..
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
#define LL_TEMPLATE(a) typename P##a, typename Q##a
|
||||
#define LL_PARAM(a) Q##a& param##a
|
||||
#else
|
||||
#define LL_TEMPLATE(a) typename P##a
|
||||
#define LL_PARAM(a) PARAMETER_TYPE(P##a) param##a
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
ListenerList()
|
||||
|
|
@ -6165,106 +6187,85 @@ public:
|
|||
(iter.getListener()->*callbackFunction) ();
|
||||
}
|
||||
|
||||
template <typename P1>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1)
|
||||
template <LL_TEMPLATE(1)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1), LL_PARAM(1))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1);
|
||||
}
|
||||
|
||||
template <class BailOutCheckerType, typename P1>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1)
|
||||
LL_PARAM(1))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1);
|
||||
}
|
||||
|
||||
template <typename P1, typename P2>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2)
|
||||
LL_PARAM(1), LL_PARAM(2))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2);
|
||||
}
|
||||
|
||||
template <class BailOutCheckerType, typename P1, typename P2>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2)
|
||||
LL_PARAM(1), LL_PARAM(2))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2);
|
||||
}
|
||||
|
||||
template <typename P1, typename P2, typename P3>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3);
|
||||
}
|
||||
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3);
|
||||
}
|
||||
|
||||
template <typename P1, typename P2, typename P3, typename P4>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3, P4),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3, typename P4>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3, P4),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
template <typename P1, typename P2, typename P3, typename P4, typename P5>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4), LL_TEMPLATE(5)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3, P4, P5),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4,
|
||||
typename TypeHelpers::ParameterType<P5>::type param5)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4, param5);
|
||||
}
|
||||
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3, typename P4, typename P5>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4), LL_TEMPLATE(5)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3, P4, P5),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4,
|
||||
typename TypeHelpers::ParameterType<P5>::type param5)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4, param5);
|
||||
|
|
@ -6326,6 +6327,9 @@ private:
|
|||
|
||||
ListenerList (const ListenerList&);
|
||||
ListenerList& operator= (const ListenerList&);
|
||||
|
||||
#undef LL_TEMPLATE
|
||||
#undef LL_PARAM
|
||||
};
|
||||
|
||||
#endif // __JUCE_LISTENERLIST_JUCEHEADER__
|
||||
|
|
|
|||
|
|
@ -59,6 +59,13 @@ template <typename ElementType,
|
|||
typename TypeOfCriticalSectionToUse = DummyCriticalSection>
|
||||
class Array
|
||||
{
|
||||
private:
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
typedef const ElementType& ParameterType;
|
||||
#else
|
||||
typedef PARAMETER_TYPE (ElementType) ParameterType;
|
||||
#endif
|
||||
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates an empty array. */
|
||||
|
|
@ -279,7 +286,7 @@ public:
|
|||
@param elementToLookFor the value or object to look for
|
||||
@returns the index of the object, or -1 if it's not found
|
||||
*/
|
||||
int indexOf (typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
int indexOf (ParameterType elementToLookFor) const
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
const ElementType* e = data.elements.getData();
|
||||
|
|
@ -301,7 +308,7 @@ public:
|
|||
@param elementToLookFor the value or object to look for
|
||||
@returns true if the item is found
|
||||
*/
|
||||
bool contains (typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
bool contains (ParameterType elementToLookFor) const
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
const ElementType* e = data.elements.getData();
|
||||
|
|
@ -324,7 +331,7 @@ public:
|
|||
@param newElement the new object to add to the array
|
||||
@see set, insert, addIfNotAlreadyThere, addSorted, addArray
|
||||
*/
|
||||
void add (typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void add (ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
data.ensureAllocatedSize (numUsed + 1);
|
||||
|
|
@ -343,7 +350,7 @@ public:
|
|||
@param newElement the new object to add to the array
|
||||
@see add, addSorted, set
|
||||
*/
|
||||
void insert (int indexToInsertAt, typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void insert (int indexToInsertAt, ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
data.ensureAllocatedSize (numUsed + 1);
|
||||
|
|
@ -377,7 +384,7 @@ public:
|
|||
@param numberOfTimesToInsertIt how many copies of the value to insert
|
||||
@see insert, add, addSorted, set
|
||||
*/
|
||||
void insertMultiple (int indexToInsertAt, typename TypeHelpers::ParameterType<ElementType>::type newElement,
|
||||
void insertMultiple (int indexToInsertAt, ParameterType newElement,
|
||||
int numberOfTimesToInsertIt)
|
||||
{
|
||||
if (numberOfTimesToInsertIt > 0)
|
||||
|
|
@ -452,7 +459,7 @@ public:
|
|||
|
||||
@param newElement the new object to add to the array
|
||||
*/
|
||||
void addIfNotAlreadyThere (typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void addIfNotAlreadyThere (ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
|
||||
|
|
@ -469,7 +476,7 @@ public:
|
|||
@param newValue the new value to set for this index.
|
||||
@see add, insert
|
||||
*/
|
||||
void set (const int indexToChange, typename TypeHelpers::ParameterType<ElementType>::type newValue)
|
||||
void set (const int indexToChange, ParameterType newValue)
|
||||
{
|
||||
jassert (indexToChange >= 0);
|
||||
const ScopedLockType lock (getLock());
|
||||
|
|
@ -494,7 +501,7 @@ public:
|
|||
@param newValue the new value to set for this index.
|
||||
@see set, getUnchecked
|
||||
*/
|
||||
void setUnchecked (const int indexToChange, typename TypeHelpers::ParameterType<ElementType>::type newValue)
|
||||
void setUnchecked (const int indexToChange, ParameterType newValue)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
jassert (((unsigned int) indexToChange) < (unsigned int) numUsed);
|
||||
|
|
@ -576,7 +583,7 @@ public:
|
|||
@see add, sort
|
||||
*/
|
||||
template <class ElementComparator>
|
||||
void addSorted (ElementComparator& comparator, typename TypeHelpers::ParameterType<ElementType>::type newElement)
|
||||
void addSorted (ElementComparator& comparator, ParameterType newElement)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed), newElement);
|
||||
|
|
@ -595,7 +602,7 @@ public:
|
|||
@see addSorted, sort
|
||||
*/
|
||||
template <class ElementComparator>
|
||||
int indexOfSorted (ElementComparator& comparator, typename TypeHelpers::ParameterType<ElementType>::type elementToLookFor) const
|
||||
int indexOfSorted (ElementComparator& comparator, ParameterType elementToLookFor) const
|
||||
{
|
||||
(void) comparator; // if you pass in an object with a static compareElements() method, this
|
||||
// avoids getting warning messages about the parameter being unused
|
||||
|
|
@ -674,7 +681,7 @@ public:
|
|||
@param valueToRemove the object to try to remove
|
||||
@see remove, removeRange
|
||||
*/
|
||||
void removeValue (typename TypeHelpers::ParameterType<ElementType>::type valueToRemove)
|
||||
void removeValue (ParameterType valueToRemove)
|
||||
{
|
||||
const ScopedLockType lock (getLock());
|
||||
ElementType* e = data.elements;
|
||||
|
|
|
|||
|
|
@ -301,18 +301,25 @@ inline int roundFloatToInt (const float value) throw()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
/** The namespace contains a few template classes for helping work out class type variations.
|
||||
/** This namespace contains a few template classes for helping work out class type variations.
|
||||
*/
|
||||
namespace TypeHelpers
|
||||
{
|
||||
/** The ParameterType struct is used to find the best type to use when passing some kind
|
||||
of object as a parameter.
|
||||
|
||||
E.g. "myFunction (typename TypeHelpers::ParameterType<int>::type, typename TypeHelpers::ParameterType<MyObject>::type)"
|
||||
would evaluate to "myfunction (int, const MyObject&)", keeping primitive types passed-by-value, but passing
|
||||
objects as a const reference, to avoid copying. Of course, this is only useful in certain esoteric
|
||||
template situations.
|
||||
Of course, this is only likely to be useful in certain esoteric template situations.
|
||||
|
||||
Because "typename TypeHelpers::ParameterType<SomeClass>::type" is a bit of a mouthful, there's
|
||||
a PARAMETER_TYPE(SomeClass) macro that you can use to get the same effect.
|
||||
|
||||
E.g. "myFunction (PARAMETER_TYPE (int), PARAMETER_TYPE (MyObject))"
|
||||
would evaluate to "myfunction (int, const MyObject&)", keeping any primitive types as
|
||||
pass-by-value, but passing objects as a const reference, to avoid copying.
|
||||
*/
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
#define PARAMETER_TYPE(a) a
|
||||
#else
|
||||
template <typename Type> struct ParameterType { typedef const Type& type; };
|
||||
template <typename Type> struct ParameterType <Type&> { typedef Type& type; };
|
||||
template <typename Type> struct ParameterType <Type*> { typedef Type* type; };
|
||||
|
|
@ -329,6 +336,9 @@ namespace TypeHelpers
|
|||
template <> struct ParameterType <bool> { typedef bool type; };
|
||||
template <> struct ParameterType <float> { typedef float type; };
|
||||
template <> struct ParameterType <double> { typedef double type; };
|
||||
|
||||
#define PARAMETER_TYPE(a) typename TypeHelpers::ParameterType<a>::type
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 51
|
||||
#define JUCE_BUILDNUMBER 12
|
||||
#define JUCE_BUILDNUMBER 13
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,15 @@ template <class ListenerClass,
|
|||
class ArrayType = Array <ListenerClass*> >
|
||||
class ListenerList
|
||||
{
|
||||
// Horrible macros required to support VC6/7..
|
||||
#if defined (_MSC_VER) && _MSC_VER <= 1400
|
||||
#define LL_TEMPLATE(a) typename P##a, typename Q##a
|
||||
#define LL_PARAM(a) Q##a& param##a
|
||||
#else
|
||||
#define LL_TEMPLATE(a) typename P##a
|
||||
#define LL_PARAM(a) PARAMETER_TYPE(P##a) param##a
|
||||
#endif
|
||||
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates an empty list. */
|
||||
|
|
@ -146,9 +155,8 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** Calls a member function on each listener in the list, with 1 parameter. */
|
||||
template <typename P1>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1)
|
||||
template <LL_TEMPLATE(1)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1), LL_PARAM(1))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1);
|
||||
|
|
@ -156,10 +164,10 @@ public:
|
|||
|
||||
/** Calls a member function on each listener in the list, with one parameter and a bail-out-checker.
|
||||
See the class description for info about writing a bail-out checker. */
|
||||
template <class BailOutCheckerType, typename P1>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1)
|
||||
LL_PARAM(1))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1);
|
||||
|
|
@ -167,10 +175,9 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** Calls a member function on each listener in the list, with 2 parameters. */
|
||||
template <typename P1, typename P2>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2)
|
||||
LL_PARAM(1), LL_PARAM(2))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2);
|
||||
|
|
@ -178,11 +185,10 @@ public:
|
|||
|
||||
/** Calls a member function on each listener in the list, with 2 parameters and a bail-out-checker.
|
||||
See the class description for info about writing a bail-out checker. */
|
||||
template <class BailOutCheckerType, typename P1, typename P2>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2)
|
||||
LL_PARAM(1), LL_PARAM(2))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2);
|
||||
|
|
@ -190,11 +196,9 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** Calls a member function on each listener in the list, with 3 parameters. */
|
||||
template <typename P1, typename P2, typename P3>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3);
|
||||
|
|
@ -202,12 +206,10 @@ public:
|
|||
|
||||
/** Calls a member function on each listener in the list, with 3 parameters and a bail-out-checker.
|
||||
See the class description for info about writing a bail-out checker. */
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3);
|
||||
|
|
@ -215,12 +217,9 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** Calls a member function on each listener in the list, with 4 parameters. */
|
||||
template <typename P1, typename P2, typename P3, typename P4>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3, P4),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4);
|
||||
|
|
@ -228,13 +227,10 @@ public:
|
|||
|
||||
/** Calls a member function on each listener in the list, with 4 parameters and a bail-out-checker.
|
||||
See the class description for info about writing a bail-out checker. */
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3, typename P4>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3, P4),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4);
|
||||
|
|
@ -242,13 +238,9 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** Calls a member function on each listener in the list, with 5 parameters. */
|
||||
template <typename P1, typename P2, typename P3, typename P4, typename P5>
|
||||
template <LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4), LL_TEMPLATE(5)>
|
||||
void call (void (ListenerClass::*callbackFunction) (P1, P2, P3, P4, P5),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4,
|
||||
typename TypeHelpers::ParameterType<P5>::type param5)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
|
||||
{
|
||||
for (Iterator<DummyBailOutChecker, ThisType> iter (*this, DummyBailOutChecker()); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4, param5);
|
||||
|
|
@ -256,14 +248,10 @@ public:
|
|||
|
||||
/** Calls a member function on each listener in the list, with 5 parameters and a bail-out-checker.
|
||||
See the class description for info about writing a bail-out checker. */
|
||||
template <class BailOutCheckerType, typename P1, typename P2, typename P3, typename P4, typename P5>
|
||||
template <class BailOutCheckerType, LL_TEMPLATE(1), LL_TEMPLATE(2), LL_TEMPLATE(3), LL_TEMPLATE(4), LL_TEMPLATE(5)>
|
||||
void callChecked (const BailOutCheckerType& bailOutChecker,
|
||||
void (ListenerClass::*callbackFunction) (P1, P2, P3, P4, P5),
|
||||
typename TypeHelpers::ParameterType<P1>::type param1,
|
||||
typename TypeHelpers::ParameterType<P2>::type param2,
|
||||
typename TypeHelpers::ParameterType<P3>::type param3,
|
||||
typename TypeHelpers::ParameterType<P4>::type param4,
|
||||
typename TypeHelpers::ParameterType<P5>::type param5)
|
||||
LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
|
||||
{
|
||||
for (Iterator<BailOutCheckerType, ThisType> iter (*this, bailOutChecker); iter.next();)
|
||||
(iter.getListener()->*callbackFunction) (param1, param2, param3, param4, param5);
|
||||
|
|
@ -334,6 +322,9 @@ private:
|
|||
|
||||
ListenerList (const ListenerList&);
|
||||
ListenerList& operator= (const ListenerList&);
|
||||
|
||||
#undef LL_TEMPLATE
|
||||
#undef LL_PARAM
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -115,14 +115,12 @@ namespace PNGHelpers
|
|||
|
||||
static void readCallback (png_structp png, png_bytep data, png_size_t length)
|
||||
{
|
||||
if (png != 0 && png->io_ptr != 0)
|
||||
static_cast<InputStream*> (png->io_ptr)->read (data, (int) length);
|
||||
static_cast<InputStream*> (png_get_io_ptr (png))->read (data, (int) length);
|
||||
}
|
||||
|
||||
static void writeDataCallback (png_structp png, png_bytep data, png_size_t length)
|
||||
{
|
||||
if (png != 0 && png->io_ptr != 0)
|
||||
static_cast<OutputStream*> (png->io_ptr)->write (data, (int) length);
|
||||
static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length);
|
||||
}
|
||||
|
||||
struct PNGErrorStruct {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue