mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Updated the ChangeBroadcaster class - sendChangeMessage() now has no parameters, and ChangeListener::changeListenerCallback() no longer provides a void*, it provides the ChangeBroadcaster* that triggered the callback. Also deleted the ChangeListenerList class, as it didn't offer anything that ChangeBroadcaster doesn't do. Changed the new jucer to expand preprocessor tokens in the header search path string.
This commit is contained in:
parent
51b5570292
commit
4cfdcb69fd
110 changed files with 1325 additions and 1606 deletions
|
|
@ -122,7 +122,6 @@ OBJECTS := \
|
|||
$(OBJDIR)/juce_ActionListenerList_9e099ae4.o \
|
||||
$(OBJDIR)/juce_AsyncUpdater_a7e1cb89.o \
|
||||
$(OBJDIR)/juce_ChangeBroadcaster_3eb8fecc.o \
|
||||
$(OBJDIR)/juce_ChangeListenerList_c2dafc5e.o \
|
||||
$(OBJDIR)/juce_InterprocessConnection_13086b6d.o \
|
||||
$(OBJDIR)/juce_InterprocessConnectionServer_a4d7b350.o \
|
||||
$(OBJDIR)/juce_Message_ac79f635.o \
|
||||
|
|
@ -779,11 +778,6 @@ $(OBJDIR)/juce_ChangeBroadcaster_3eb8fecc.o: ../../src/events/juce_ChangeBroadca
|
|||
@echo "Compiling juce_ChangeBroadcaster.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_ChangeListenerList_c2dafc5e.o: ../../src/events/juce_ChangeListenerList.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_ChangeListenerList.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_InterprocessConnection_13086b6d.o: ../../src/events/juce_InterprocessConnection.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_InterprocessConnection.cpp"
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@
|
|||
5BE4BAA99FDC6F1B3177096F = { isa = PBXBuildFile; fileRef = 5A46476E16BA4F9DA95E9E6A; };
|
||||
55737E2F1817DE642AA7DA05 = { isa = PBXBuildFile; fileRef = 1617348BBF5D103619D76911; };
|
||||
6D2C50B0A69855A7F8C062E7 = { isa = PBXBuildFile; fileRef = B80F8CD026033ACCCE11A1A4; };
|
||||
769227C780221EE89081BDFF = { isa = PBXBuildFile; fileRef = F978BD0E708FA56FD1EAE238; };
|
||||
70EE7A1273945B62B013DB43 = { isa = PBXBuildFile; fileRef = AE68ECB6E063BD8D4984C0B3; };
|
||||
9DF800566462E24A14246EAE = { isa = PBXBuildFile; fileRef = 843A7B398E9411F0AF28D65D; };
|
||||
89F0DA39878F8A41E60B8C67 = { isa = PBXBuildFile; fileRef = 9CF077D3ED7B7B56F351AAF6; };
|
||||
|
|
@ -563,8 +562,6 @@
|
|||
B80F8CD026033ACCCE11A1A4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ChangeBroadcaster.cpp; path = ../../src/events/juce_ChangeBroadcaster.cpp; sourceTree = SOURCE_ROOT; };
|
||||
5F454A6B5A82ECE2396C5716 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeBroadcaster.h; path = ../../src/events/juce_ChangeBroadcaster.h; sourceTree = SOURCE_ROOT; };
|
||||
B2D08C8EEE3E22026533D2EA = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeListener.h; path = ../../src/events/juce_ChangeListener.h; sourceTree = SOURCE_ROOT; };
|
||||
F978BD0E708FA56FD1EAE238 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ChangeListenerList.cpp; path = ../../src/events/juce_ChangeListenerList.cpp; sourceTree = SOURCE_ROOT; };
|
||||
4D15D2E39EAC0DDFCFC2FCE6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeListenerList.h; path = ../../src/events/juce_ChangeListenerList.h; sourceTree = SOURCE_ROOT; };
|
||||
AE68ECB6E063BD8D4984C0B3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_InterprocessConnection.cpp; path = ../../src/events/juce_InterprocessConnection.cpp; sourceTree = SOURCE_ROOT; };
|
||||
4B935D7360C9F166C80A158D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_InterprocessConnection.h; path = ../../src/events/juce_InterprocessConnection.h; sourceTree = SOURCE_ROOT; };
|
||||
843A7B398E9411F0AF28D65D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_InterprocessConnectionServer.cpp; path = ../../src/events/juce_InterprocessConnectionServer.cpp; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -1293,8 +1290,6 @@
|
|||
B80F8CD026033ACCCE11A1A4,
|
||||
5F454A6B5A82ECE2396C5716,
|
||||
B2D08C8EEE3E22026533D2EA,
|
||||
F978BD0E708FA56FD1EAE238,
|
||||
4D15D2E39EAC0DDFCFC2FCE6,
|
||||
AE68ECB6E063BD8D4984C0B3,
|
||||
4B935D7360C9F166C80A158D,
|
||||
843A7B398E9411F0AF28D65D,
|
||||
|
|
@ -2016,7 +2011,6 @@
|
|||
5BE4BAA99FDC6F1B3177096F,
|
||||
55737E2F1817DE642AA7DA05,
|
||||
6D2C50B0A69855A7F8C062E7,
|
||||
769227C780221EE89081BDFF,
|
||||
70EE7A1273945B62B013DB43,
|
||||
9DF800566462E24A14246EAE,
|
||||
89F0DA39878F8A41E60B8C67,
|
||||
|
|
|
|||
|
|
@ -430,8 +430,6 @@
|
|||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListener.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnectionServer.cpp"/>
|
||||
|
|
|
|||
|
|
@ -430,8 +430,6 @@
|
|||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListener.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnectionServer.cpp"/>
|
||||
|
|
|
|||
|
|
@ -432,8 +432,6 @@
|
|||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeBroadcaster.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListener.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_ChangeListenerList.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.cpp"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnection.h"/>
|
||||
<File RelativePath="..\..\src\events\juce_InterprocessConnectionServer.cpp"/>
|
||||
|
|
|
|||
|
|
@ -205,7 +205,6 @@
|
|||
<ClCompile Include="..\..\src\events\juce_ActionListenerList.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_AsyncUpdater.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_ChangeBroadcaster.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_ChangeListenerList.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_InterprocessConnection.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_InterprocessConnectionServer.cpp"/>
|
||||
<ClCompile Include="..\..\src\events\juce_Message.cpp"/>
|
||||
|
|
@ -556,7 +555,6 @@
|
|||
<ClInclude Include="..\..\src\events\juce_CallbackMessage.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_ChangeBroadcaster.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_ChangeListener.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_ChangeListenerList.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_InterprocessConnection.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_InterprocessConnectionServer.h"/>
|
||||
<ClInclude Include="..\..\src\events\juce_ListenerList.h"/>
|
||||
|
|
|
|||
|
|
@ -463,9 +463,6 @@
|
|||
<ClCompile Include="..\..\src\events\juce_ChangeBroadcaster.cpp">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\events\juce_ChangeListenerList.cpp">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\events\juce_InterprocessConnection.cpp">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1590,9 +1587,6 @@
|
|||
<ClInclude Include="..\..\src\events\juce_ChangeListener.h">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\events\juce_ChangeListenerList.h">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\events\juce_InterprocessConnection.h">
|
||||
<Filter>Juce\Source\events</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@
|
|||
5BE4BAA99FDC6F1B3177096F = { isa = PBXBuildFile; fileRef = 5A46476E16BA4F9DA95E9E6A; };
|
||||
55737E2F1817DE642AA7DA05 = { isa = PBXBuildFile; fileRef = 1617348BBF5D103619D76911; };
|
||||
6D2C50B0A69855A7F8C062E7 = { isa = PBXBuildFile; fileRef = B80F8CD026033ACCCE11A1A4; };
|
||||
769227C780221EE89081BDFF = { isa = PBXBuildFile; fileRef = F978BD0E708FA56FD1EAE238; };
|
||||
70EE7A1273945B62B013DB43 = { isa = PBXBuildFile; fileRef = AE68ECB6E063BD8D4984C0B3; };
|
||||
9DF800566462E24A14246EAE = { isa = PBXBuildFile; fileRef = 843A7B398E9411F0AF28D65D; };
|
||||
89F0DA39878F8A41E60B8C67 = { isa = PBXBuildFile; fileRef = 9CF077D3ED7B7B56F351AAF6; };
|
||||
|
|
@ -563,8 +562,6 @@
|
|||
B80F8CD026033ACCCE11A1A4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ChangeBroadcaster.cpp; path = ../../src/events/juce_ChangeBroadcaster.cpp; sourceTree = SOURCE_ROOT; };
|
||||
5F454A6B5A82ECE2396C5716 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeBroadcaster.h; path = ../../src/events/juce_ChangeBroadcaster.h; sourceTree = SOURCE_ROOT; };
|
||||
B2D08C8EEE3E22026533D2EA = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeListener.h; path = ../../src/events/juce_ChangeListener.h; sourceTree = SOURCE_ROOT; };
|
||||
F978BD0E708FA56FD1EAE238 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ChangeListenerList.cpp; path = ../../src/events/juce_ChangeListenerList.cpp; sourceTree = SOURCE_ROOT; };
|
||||
4D15D2E39EAC0DDFCFC2FCE6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ChangeListenerList.h; path = ../../src/events/juce_ChangeListenerList.h; sourceTree = SOURCE_ROOT; };
|
||||
AE68ECB6E063BD8D4984C0B3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_InterprocessConnection.cpp; path = ../../src/events/juce_InterprocessConnection.cpp; sourceTree = SOURCE_ROOT; };
|
||||
4B935D7360C9F166C80A158D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_InterprocessConnection.h; path = ../../src/events/juce_InterprocessConnection.h; sourceTree = SOURCE_ROOT; };
|
||||
843A7B398E9411F0AF28D65D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_InterprocessConnectionServer.cpp; path = ../../src/events/juce_InterprocessConnectionServer.cpp; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -1293,8 +1290,6 @@
|
|||
B80F8CD026033ACCCE11A1A4,
|
||||
5F454A6B5A82ECE2396C5716,
|
||||
B2D08C8EEE3E22026533D2EA,
|
||||
F978BD0E708FA56FD1EAE238,
|
||||
4D15D2E39EAC0DDFCFC2FCE6,
|
||||
AE68ECB6E063BD8D4984C0B3,
|
||||
4B935D7360C9F166C80A158D,
|
||||
843A7B398E9411F0AF28D65D,
|
||||
|
|
@ -2016,7 +2011,6 @@
|
|||
5BE4BAA99FDC6F1B3177096F,
|
||||
55737E2F1817DE642AA7DA05,
|
||||
6D2C50B0A69855A7F8C062E7,
|
||||
769227C780221EE89081BDFF,
|
||||
70EE7A1273945B62B013DB43,
|
||||
9DF800566462E24A14246EAE,
|
||||
89F0DA39878F8A41E60B8C67,
|
||||
|
|
|
|||
|
|
@ -507,10 +507,6 @@
|
|||
file="src/events/juce_ChangeBroadcaster.h"/>
|
||||
<FILE id="NAVM1VUrE" name="juce_ChangeListener.h" compile="0" resource="0"
|
||||
file="src/events/juce_ChangeListener.h"/>
|
||||
<FILE id="i5XTQIbi" name="juce_ChangeListenerList.cpp" compile="1"
|
||||
resource="0" file="src/events/juce_ChangeListenerList.cpp"/>
|
||||
<FILE id="8NN9Zgr8a" name="juce_ChangeListenerList.h" compile="0" resource="0"
|
||||
file="src/events/juce_ChangeListenerList.h"/>
|
||||
<FILE id="RxIz7qEOV" name="juce_InterprocessConnection.cpp" compile="1"
|
||||
resource="0" file="src/events/juce_InterprocessConnection.cpp"/>
|
||||
<FILE id="qOQS6siYg" name="juce_InterprocessConnection.h" compile="0"
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@
|
|||
#include "../src/events/juce_ActionListenerList.cpp"
|
||||
#include "../src/events/juce_AsyncUpdater.cpp"
|
||||
#include "../src/events/juce_ChangeBroadcaster.cpp"
|
||||
#include "../src/events/juce_ChangeListenerList.cpp"
|
||||
#include "../src/events/juce_InterprocessConnection.cpp"
|
||||
#include "../src/events/juce_InterprocessConnectionServer.cpp"
|
||||
#include "../src/events/juce_Message.cpp"
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void ProjectContentComponent::setProject (Project* newProject)
|
|||
}
|
||||
}
|
||||
|
||||
void ProjectContentComponent::changeListenerCallback (void*)
|
||||
void ProjectContentComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateMissingFileStatuses();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
void updateMissingFileStatuses();
|
||||
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void hasBeenMoved();
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ protected:
|
|||
compiler->setAttribute ("StringPooling", "true");
|
||||
}
|
||||
|
||||
compiler->setAttribute ("AdditionalIncludeDirectories", getHeaderSearchPaths (config).joinIntoString (";"));
|
||||
compiler->setAttribute ("AdditionalIncludeDirectories", replacePreprocessorTokens (config, getHeaderSearchPaths (config).joinIntoString (";")));
|
||||
compiler->setAttribute ("PreprocessorDefinitions", getPreprocessorDefs (config, ";"));
|
||||
compiler->setAttribute ("RuntimeLibrary", isRTAS() ? (isDebug ? 3 : 2) // MT DLL
|
||||
: (isDebug ? 1 : 0)); // MT static
|
||||
|
|
@ -988,7 +988,7 @@ private:
|
|||
<< "# ADD BASE CPP /nologo /W3 /GX /" << optimisationFlag << " /D " << defines
|
||||
<< " /YX /FD /c " << extraDebugFlags << " /Zm1024" << newLine
|
||||
<< "# ADD CPP /nologo " << (isDebug ? "/MTd" : "/MT") << " /W3 /GR /GX /" << optimisationFlag
|
||||
<< " /I " << getHeaderSearchPaths (config).joinIntoString (" /I ")
|
||||
<< " /I " << replacePreprocessorTokens (config, getHeaderSearchPaths (config).joinIntoString (" /I "))
|
||||
<< " /D " << defines << " /D \"_UNICODE\" /D \"UNICODE\" /FD /c /Zm1024 " << extraDebugFlags
|
||||
<< " " << replacePreprocessorTokens (config, getExtraCompilerFlags().toString()).trim() << newLine;
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ private:
|
|||
headerPaths.insert (0, juceWrapperFolder.toUnixStyle());
|
||||
|
||||
for (int i = 0; i < headerPaths.size(); ++i)
|
||||
out << " -I " << FileHelpers::unixStylePath (headerPaths[i]).quoted();
|
||||
out << " -I " << FileHelpers::unixStylePath (replacePreprocessorTokens (config, headerPaths[i])).quoted();
|
||||
}
|
||||
|
||||
void writeCppFlags (OutputStream& out, const Project::BuildConfiguration& config)
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ private:
|
|||
StringArray s;
|
||||
s.add ("ARCHS = \"$(ARCHS_STANDARD_32_BIT)\"");
|
||||
s.add ("PREBINDING = NO");
|
||||
s.add ("HEADER_SEARCH_PATHS = \"" + getHeaderSearchPaths (config).joinIntoString (" ") + " $(inherited)\"");
|
||||
s.add ("HEADER_SEARCH_PATHS = \"" + replacePreprocessorTokens (config, getHeaderSearchPaths (config).joinIntoString (" ")) + " $(inherited)\"");
|
||||
s.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag());
|
||||
s.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName());
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ ProjectInformationComponent::ProjectInformationComponent (Project& project_)
|
|||
#if JUCE_MAC || JUCE_WINDOWS
|
||||
openProjectButton.setCommandToTrigger (commandManager, CommandIDs::openInIDE, true);
|
||||
openProjectButton.setButtonText (commandManager->getNameOfCommand (CommandIDs::openInIDE));
|
||||
|
||||
|
||||
saveAndOpenButton.setCommandToTrigger (commandManager, CommandIDs::saveAndOpenInIDE, true);
|
||||
saveAndOpenButton.setButtonText (commandManager->getNameOfCommand (CommandIDs::saveAndOpenInIDE));
|
||||
#else
|
||||
|
|
@ -341,7 +341,7 @@ void ProjectInformationComponent::showExporterMenu()
|
|||
project.addNewExporter (r - 10000);
|
||||
}
|
||||
|
||||
void ProjectInformationComponent::changeListenerCallback (void*)
|
||||
void ProjectInformationComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateConfigTabs();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
//[UserMethods] -- You can add your own custom methods in this section.
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void rebuildConfigTabs();
|
||||
//[/UserMethods]
|
||||
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ public:
|
|||
|
||||
void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message);
|
||||
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
//==============================================================================
|
||||
static int compareElements (FilterInGraph* const first, FilterInGraph* const second) throw();
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ void GraphEditorPanel::resized()
|
|||
updateComponents();
|
||||
}
|
||||
|
||||
void GraphEditorPanel::changeListenerCallback (void*)
|
||||
void GraphEditorPanel::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateComponents();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
PinComponent* findPinAt (const int x, const int y) const;
|
||||
|
||||
void resized();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void updateComponents();
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ bool MainHostWindow::tryToQuitApplication()
|
|||
return false;
|
||||
}
|
||||
|
||||
void MainHostWindow::changeListenerCallback (void*)
|
||||
void MainHostWindow::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
menuItemsChanged();
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
void closeButtonPressed();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
bool isInterestedInFileDrag (const StringArray& files);
|
||||
void fileDragEnter (const StringArray& files, int, int);
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
|
@ -99,7 +99,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
// this method is called by the thumbnail when it has changed, so we should repaint it..
|
||||
repaint();
|
||||
|
|
|
|||
|
|
@ -271,14 +271,11 @@ public:
|
|||
callOut.runModalLoop();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void* source)
|
||||
void changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
ColourSelector* cs = static_cast <ColourSelector*> (source);
|
||||
ColourSelector* cs = dynamic_cast <ColourSelector*> (source);
|
||||
|
||||
if (cs->getName() == "text")
|
||||
setColour (TextButton::textColourOffId, cs->getCurrentColour());
|
||||
else
|
||||
setColour (TextButton::buttonColourId, cs->getCurrentColour());
|
||||
setColour (TextButton::buttonColourId, cs->getCurrentColour());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ private:
|
|||
return group->getTextLabelPosition();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
GroupComponent* const group;
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ public:
|
|||
|
||||
void resetToDefault() {}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ private:
|
|||
return component->findFile();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ private:
|
|||
return label->getJustificationType();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
|
|
@ -466,7 +466,7 @@ private:
|
|||
return label->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
|
|
@ -535,7 +535,7 @@ private:
|
|||
return label->getFont().getHeight();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
|
|
@ -621,7 +621,7 @@ private:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ private:
|
|||
return component->getTabBarDepth();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -868,7 +868,7 @@ private:
|
|||
jassertfalse // shouldn't get called
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
TabbedComponent* component;
|
||||
|
|
@ -1002,7 +1002,7 @@ private:
|
|||
return document.getFile().getSiblingFile (getTabJucerFile (component, tabIndex));
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
TabbedComponent* const component;
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ private:
|
|||
return component->getScrollBarThickness();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -533,7 +533,7 @@ private:
|
|||
return document.getFile().getSiblingFile (filename);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -211,7 +211,7 @@ public:
|
|||
jassertfalse // option shouldn't be visible
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -297,7 +297,7 @@ public:
|
|||
void setState (bool newState) { owner->enableStroke (newState, true); }
|
||||
bool getState() const { return owner->isStrokeEnabled(); }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
ColouredElement* const owner;
|
||||
|
|
@ -332,7 +332,7 @@ public:
|
|||
|
||||
double getValue() const { return owner->getStrokeType().stroke.getStrokeThickness(); }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
ColouredElement* const owner;
|
||||
|
|
@ -391,7 +391,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
ColouredElement* const owner;
|
||||
|
|
@ -450,7 +450,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
ColouredElement* const owner;
|
||||
|
|
@ -594,7 +594,7 @@ public:
|
|||
return element->getFillType().imageOpacity;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
|
||||
//==============================================================================
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updatePosition();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public:
|
|||
return choices.indexOf (getResource());
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ void PaintElement::getCurrentAbsoluteBoundsDouble (double& x, double& y, double&
|
|||
position.getRectangleDouble (x, y, w, h, area, getDocument()->getComponentLayout());
|
||||
}
|
||||
|
||||
void PaintElement::changeListenerCallback (void*)
|
||||
void PaintElement::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
const bool nowSelected = owner != 0 && owner->getSelectedElements().isSelected (this);
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ void PaintElement::createSiblingComponents()
|
|||
void PaintElement::siblingComponentsChanged()
|
||||
{
|
||||
siblingComponents.clear();
|
||||
selfChangeListenerList.sendChangeMessage (0);
|
||||
selfChangeListenerList.sendChangeMessage();
|
||||
}
|
||||
|
||||
void PaintElement::updateSiblingComps()
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public:
|
|||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void parentHierarchyChanged();
|
||||
|
||||
int borderThickness;
|
||||
|
|
@ -130,7 +130,7 @@ private:
|
|||
String typeName;
|
||||
bool selected, dragging, mouseDownSelectStatus;
|
||||
double originalAspectRatio;
|
||||
ChangeListenerList selfChangeListenerList;
|
||||
ChangeBroadcaster selfChangeListenerList;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ private:
|
|||
return element->getOpacity();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ private:
|
|||
return (int) element->getStretchMode();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public:
|
|||
void setIndex (int newIndex) { owner->setNonZeroWinding (newIndex == 0, true); }
|
||||
int getIndex() const { return owner->isNonZeroWinding() ? 0 : 1; }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementPath* const owner;
|
||||
|
|
@ -1276,7 +1276,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -1345,7 +1345,7 @@ public:
|
|||
owner->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -1671,7 +1671,7 @@ void PathPointComponent::mouseUp (const MouseEvent& e)
|
|||
mouseDownSelectStatus);
|
||||
}
|
||||
|
||||
void PathPointComponent::changeListenerCallback (void* source)
|
||||
void PathPointComponent::changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
ElementSiblingComponent::changeListenerCallback (source);
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ public:
|
|||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
//==============================================================================
|
||||
juce_UseDebuggingNewOperator
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ private:
|
|||
|
||||
double getValue() const { return owner->getCornerSize(); }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementRoundedRectangle* const owner;
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ private:
|
|||
void setText (const String& newText) { element->setText (newText, true); }
|
||||
const String getText() const { return element->getText(); }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
|
|
@ -413,7 +413,7 @@ private:
|
|||
void setTypefaceName (const String& newFontName) { element->setTypefaceName (newFontName, true); }
|
||||
const String getTypefaceName() const { return element->getTypefaceName(); }
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
|
|
@ -463,7 +463,7 @@ private:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
|
|
@ -501,7 +501,7 @@ private:
|
|||
return element->getFont().getHeight();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
|
|
@ -534,7 +534,7 @@ private:
|
|||
return element->getJustification();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*) { refresh(); }
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public:
|
|||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ void ComponentLayoutEditor::visibilityChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void ComponentLayoutEditor::changeListenerCallback (void*)
|
||||
void ComponentLayoutEditor::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refreshAllComponents();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
void paint (Graphics& g);
|
||||
void resized();
|
||||
void visibilityChanged();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
propsPanel->setBounds (4, 4, getWidth() - 8, getHeight() - 8);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ ComponentOverlayComponent::~ComponentOverlayComponent()
|
|||
delete border;
|
||||
}
|
||||
|
||||
void ComponentOverlayComponent::changeListenerCallback (void*)
|
||||
void ComponentOverlayComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
const bool nowSelected = layout.getSelectedSet().isSelected (target);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
void componentMovedOrResized (Component& component, bool wasMoved, bool wasResized);
|
||||
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
void resizeStart();
|
||||
void resizeEnd();
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public:
|
|||
listBox->repaint();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ public:
|
|||
panel2->setBounds (panel1->getRight() + 20, panel1->getY(), pw, panel1->getHeight());
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
panel1->refreshAll();
|
||||
panel2->refreshAll();
|
||||
|
|
@ -505,7 +505,7 @@ void JucerDocumentHolder::resized()
|
|||
tabbedComponent->setBounds (0, 0, getWidth(), getHeight());
|
||||
}
|
||||
|
||||
void JucerDocumentHolder::changeListenerCallback (void*)
|
||||
void JucerDocumentHolder::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
setName (document->getClassName());
|
||||
updateTabs();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public:
|
|||
//==============================================================================
|
||||
void paint (Graphics& g);
|
||||
void resized();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
//==============================================================================
|
||||
ApplicationCommandTarget* getNextCommandTarget();
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ void PaintRoutineEditor::refreshAllElements()
|
|||
}
|
||||
}
|
||||
|
||||
void PaintRoutineEditor::changeListenerCallback (void* source)
|
||||
void PaintRoutineEditor::changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
refreshAllElements();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
void paint (Graphics& g);
|
||||
void paintOverChildren (Graphics& g);
|
||||
void resized();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ public:
|
|||
propsPanel->setBounds (4, 4, getWidth() - 8, getHeight() - 8);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ void ResourceEditorPanel::visibilityChanged()
|
|||
listBox->updateContent();
|
||||
}
|
||||
|
||||
void ResourceEditorPanel::changeListenerCallback (void*)
|
||||
void ResourceEditorPanel::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
if (isVisible())
|
||||
listBox->updateContent();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
|
||||
void resized();
|
||||
void visibilityChanged();
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void buttonClicked (Button*);
|
||||
|
||||
int getNumRows();
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
m.showAt (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void* source)
|
||||
void changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
const ColourSelector* const cs = (const ColourSelector*) source;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -64,7 +64,7 @@
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 52
|
||||
#define JUCE_BUILDNUMBER 92
|
||||
#define JUCE_BUILDNUMBER 93
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
@ -798,6 +798,13 @@
|
|||
/** This macro is added to all juce public function declarations. */
|
||||
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
|
||||
|
||||
/** This turns on some non-essential bits of code that should prevent old code from compiling
|
||||
in cases where method signatures have changed, etc.
|
||||
*/
|
||||
#if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
|
||||
#define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
|
||||
#endif
|
||||
|
||||
// Now include some basics that are needed by most of the Juce classes...
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
|
|
@ -12585,6 +12592,12 @@ public:
|
|||
return listeners.size() == 0;
|
||||
}
|
||||
|
||||
/** Clears the list. */
|
||||
void clear()
|
||||
{
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
/** Returns true if the specified listener has been added to the list. */
|
||||
bool contains (ListenerClass* const listener) const throw()
|
||||
{
|
||||
|
|
@ -12993,27 +13006,24 @@ typedef Value::Listener ValueListener;
|
|||
#define __JUCE_CHANGEBROADCASTER_JUCEHEADER__
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ChangeListenerList.h ***/
|
||||
#ifndef __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
#define __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ChangeListener.h ***/
|
||||
#ifndef __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
#define __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
|
||||
/**
|
||||
Receives callbacks about changes to some kind of object.
|
||||
class ChangeBroadcaster;
|
||||
|
||||
Many objects use a ChangeListenerList to keep a set of listeners which they
|
||||
will inform when something changes. A subclass of ChangeListener
|
||||
is used to receive these callbacks.
|
||||
/**
|
||||
Receives change event callbacks that are sent out by a ChangeBroadcaster.
|
||||
|
||||
A ChangeBroadcaster keeps a set of listeners to which it broadcasts a message when
|
||||
the ChangeBroadcaster::sendChangeMessage() method is called. A subclass of
|
||||
ChangeListener is used to receive these callbacks.
|
||||
|
||||
Note that the major difference between an ActionListener and a ChangeListener
|
||||
is that for a ChangeListener, multiple changes will be coalesced into fewer
|
||||
callbacks, but ActionListeners perform one callback for every event posted.
|
||||
|
||||
@see ChangeListenerList, ChangeBroadcaster, ActionListener
|
||||
@see ChangeBroadcaster, ActionListener
|
||||
*/
|
||||
class JUCE_API ChangeListener
|
||||
{
|
||||
|
|
@ -13021,238 +13031,24 @@ public:
|
|||
/** Destructor. */
|
||||
virtual ~ChangeListener() {}
|
||||
|
||||
/** Overridden by your subclass to receive the callback.
|
||||
|
||||
@param objectThatHasChanged the value that was passed to the
|
||||
ChangeListenerList::sendChangeMessage() method
|
||||
/** Your subclass should implement this method to receive the callback.
|
||||
@param source the ChangeBroadcaster that triggered the callback.
|
||||
*/
|
||||
virtual void changeListenerCallback (void* objectThatHasChanged) = 0;
|
||||
virtual void changeListenerCallback (ChangeBroadcaster* source) = 0;
|
||||
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This method's signature has changed to take a ChangeBroadcaster parameter - please update your code!
|
||||
private: virtual int changeListenerCallback (void*) { return 0; }
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
/*** End of inlined file: juce_ChangeListener.h ***/
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ScopedLock.h ***/
|
||||
#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
#define __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
|
||||
/**
|
||||
Automatically locks and unlocks a CriticalSection object.
|
||||
Holds a list of ChangeListeners, and sends messages to them when instructed.
|
||||
|
||||
Use one of these as a local variable to control access to a CriticalSection.
|
||||
|
||||
e.g. @code
|
||||
|
||||
CriticalSection myCriticalSection;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const ScopedLock myScopedLock (myCriticalSection);
|
||||
// myCriticalSection is now locked
|
||||
|
||||
...do some stuff...
|
||||
|
||||
// myCriticalSection gets unlocked here.
|
||||
}
|
||||
@endcode
|
||||
|
||||
@see CriticalSection, ScopedUnlock
|
||||
*/
|
||||
class JUCE_API ScopedLock
|
||||
{
|
||||
public:
|
||||
|
||||
/** Creates a ScopedLock.
|
||||
|
||||
As soon as it is created, this will lock the CriticalSection, and
|
||||
when the ScopedLock object is deleted, the CriticalSection will
|
||||
be unlocked.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen! Best just to use it
|
||||
as a local stack object, rather than creating one with the new() operator.
|
||||
*/
|
||||
inline explicit ScopedLock (const CriticalSection& lock) throw() : lock_ (lock) { lock.enter(); }
|
||||
|
||||
/** Destructor.
|
||||
|
||||
The CriticalSection will be unlocked when the destructor is called.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen!
|
||||
*/
|
||||
inline ~ScopedLock() throw() { lock_.exit(); }
|
||||
|
||||
private:
|
||||
|
||||
const CriticalSection& lock_;
|
||||
|
||||
ScopedLock (const ScopedLock&);
|
||||
ScopedLock& operator= (const ScopedLock&);
|
||||
};
|
||||
|
||||
/**
|
||||
Automatically unlocks and re-locks a CriticalSection object.
|
||||
|
||||
This is the reverse of a ScopedLock object - instead of locking the critical
|
||||
section for the lifetime of this object, it unlocks it.
|
||||
|
||||
Make sure you don't try to unlock critical sections that aren't actually locked!
|
||||
|
||||
e.g. @code
|
||||
|
||||
CriticalSection myCriticalSection;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const ScopedLock myScopedLock (myCriticalSection);
|
||||
// myCriticalSection is now locked
|
||||
|
||||
... do some stuff with it locked ..
|
||||
|
||||
while (xyz)
|
||||
{
|
||||
... do some stuff with it locked ..
|
||||
|
||||
const ScopedUnlock unlocker (myCriticalSection);
|
||||
|
||||
// myCriticalSection is now unlocked for the remainder of this block,
|
||||
// and re-locked at the end.
|
||||
|
||||
...do some stuff with it unlocked ...
|
||||
}
|
||||
|
||||
// myCriticalSection gets unlocked here.
|
||||
}
|
||||
@endcode
|
||||
|
||||
@see CriticalSection, ScopedLock
|
||||
*/
|
||||
class ScopedUnlock
|
||||
{
|
||||
public:
|
||||
|
||||
/** Creates a ScopedUnlock.
|
||||
|
||||
As soon as it is created, this will unlock the CriticalSection, and
|
||||
when the ScopedLock object is deleted, the CriticalSection will
|
||||
be re-locked.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen! Best just to use it
|
||||
as a local stack object, rather than creating one with the new() operator.
|
||||
*/
|
||||
inline explicit ScopedUnlock (const CriticalSection& lock) throw() : lock_ (lock) { lock.exit(); }
|
||||
|
||||
/** Destructor.
|
||||
|
||||
The CriticalSection will be unlocked when the destructor is called.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen!
|
||||
*/
|
||||
inline ~ScopedUnlock() throw() { lock_.enter(); }
|
||||
|
||||
private:
|
||||
|
||||
const CriticalSection& lock_;
|
||||
|
||||
ScopedUnlock (const ScopedLock&);
|
||||
ScopedUnlock& operator= (const ScopedUnlock&);
|
||||
};
|
||||
|
||||
#endif // __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
/*** End of inlined file: juce_ScopedLock.h ***/
|
||||
|
||||
/**
|
||||
A set of ChangeListeners.
|
||||
|
||||
Listeners can be added and removed from the list, and change messages can be
|
||||
broadcast to all the listeners.
|
||||
|
||||
@see ChangeListener, ChangeBroadcaster
|
||||
*/
|
||||
class JUCE_API ChangeListenerList : public MessageListener
|
||||
{
|
||||
public:
|
||||
|
||||
/** Creates an empty list. */
|
||||
ChangeListenerList();
|
||||
|
||||
/** Destructor. */
|
||||
~ChangeListenerList();
|
||||
|
||||
/** Adds a listener to the list.
|
||||
|
||||
(Trying to add a listener that's already on the list will have no effect).
|
||||
*/
|
||||
void addChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes a listener from the list.
|
||||
|
||||
If the listener isn't on the list, this won't have any effect.
|
||||
*/
|
||||
void removeChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes all listeners from the list. */
|
||||
void removeAllChangeListeners();
|
||||
|
||||
/** Posts an asynchronous change message to all the listeners.
|
||||
|
||||
If a message has already been sent and hasn't yet been delivered, this
|
||||
method won't send another - in this way it coalesces multiple frequent
|
||||
changes into fewer actual callbacks to the ChangeListeners. Contrast this
|
||||
with the ActionListener, which posts a new event for every call to its
|
||||
sendActionMessage() method.
|
||||
|
||||
Only listeners which are on the list when the change event is delivered
|
||||
will receive the event - and this may include listeners that weren't on
|
||||
the list when the change message was sent.
|
||||
|
||||
@param objectThatHasChanged this pointer is passed to the
|
||||
ChangeListener::changeListenerCallback() method,
|
||||
and can be any value the application needs
|
||||
@see sendSynchronousChangeMessage
|
||||
*/
|
||||
void sendChangeMessage (void* objectThatHasChanged);
|
||||
|
||||
/** This will synchronously callback all the ChangeListeners.
|
||||
|
||||
Use this if you need to synchronously force a call to all the
|
||||
listeners' ChangeListener::changeListenerCallback() methods.
|
||||
*/
|
||||
void sendSynchronousChangeMessage (void* objectThatHasChanged);
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will
|
||||
use sendSynchronousChangeMessage() to make the callback immediately.
|
||||
*/
|
||||
void dispatchPendingMessages();
|
||||
|
||||
/** @internal */
|
||||
void handleMessage (const Message&);
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
|
||||
private:
|
||||
SortedSet <void*> listeners;
|
||||
CriticalSection lock;
|
||||
void* lastChangedObject;
|
||||
bool messagePending;
|
||||
|
||||
ChangeListenerList (const ChangeListenerList&);
|
||||
ChangeListenerList& operator= (const ChangeListenerList&);
|
||||
};
|
||||
|
||||
#endif // __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
/*** End of inlined file: juce_ChangeListenerList.h ***/
|
||||
|
||||
/** Manages a list of ChangeListeners, and can send them messages.
|
||||
|
||||
To quickly add methods to your class that can add/remove change
|
||||
listeners and broadcast to them, you can derive from this.
|
||||
|
||||
@see ChangeListenerList, ChangeListener
|
||||
@see ChangeListener
|
||||
*/
|
||||
class JUCE_API ChangeBroadcaster
|
||||
{
|
||||
|
|
@ -13264,14 +13060,12 @@ public:
|
|||
/** Destructor. */
|
||||
virtual ~ChangeBroadcaster();
|
||||
|
||||
/** Adds a listener to the list.
|
||||
|
||||
(Trying to add a listener that's already on the list will have no effect).
|
||||
/** Registers a listener to receive change callbacks from this broadcaster.
|
||||
Trying to add a listener that's already on the list will have no effect.
|
||||
*/
|
||||
void addChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes a listener from the list.
|
||||
|
||||
/** Unregisters a listener from the list.
|
||||
If the listener isn't on the list, this won't have any effect.
|
||||
*/
|
||||
void removeChangeListener (ChangeListener* listener);
|
||||
|
|
@ -13279,30 +13073,39 @@ public:
|
|||
/** Removes all listeners from the list. */
|
||||
void removeAllChangeListeners();
|
||||
|
||||
/** Broadcasts a change message to all the registered listeners.
|
||||
/** Causes an asynchronous change message to be sent to all the registered listeners.
|
||||
|
||||
The message will be delivered asynchronously by the event thread, so this
|
||||
method will not directly call any of the listeners. For a synchronous
|
||||
message, use sendSynchronousChangeMessage().
|
||||
|
||||
@see ChangeListenerList::sendActionMessage
|
||||
The message will be delivered asynchronously by the main message thread, so this
|
||||
method will return immediately. To call the listeners synchronously use
|
||||
sendSynchronousChangeMessage().
|
||||
*/
|
||||
void sendChangeMessage (void* objectThatHasChanged);
|
||||
void sendChangeMessage();
|
||||
|
||||
/** Sends a synchronous change message to all the registered listeners.
|
||||
|
||||
@see ChangeListenerList::sendSynchronousChangeMessage
|
||||
*/
|
||||
void sendSynchronousChangeMessage (void* objectThatHasChanged);
|
||||
This will immediately call all the listeners that are registered. For thread-safety
|
||||
reasons, you must only call this method on the main message thread.
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will
|
||||
use sendSynchronousChangeMessage() to make the callback immediately.
|
||||
@see dispatchPendingMessages
|
||||
*/
|
||||
void sendSynchronousChangeMessage();
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will call
|
||||
sendSynchronousChangeMessage() to make the callback immediately.
|
||||
|
||||
For thread-safety reasons, you must only call this method on the main message thread.
|
||||
*/
|
||||
void dispatchPendingMessages();
|
||||
|
||||
private:
|
||||
|
||||
ChangeListenerList changeListenerList;
|
||||
class ChangeBroadcasterMessage;
|
||||
friend class ChangeBroadcasterMessage;
|
||||
|
||||
Atomic<ChangeBroadcasterMessage*> pendingMessage;
|
||||
ListenerList <ChangeListener> changeListeners;
|
||||
|
||||
void invalidatePendingMessage();
|
||||
|
||||
ChangeBroadcaster (const ChangeBroadcaster&);
|
||||
ChangeBroadcaster& operator= (const ChangeBroadcaster&);
|
||||
|
|
@ -14833,6 +14636,139 @@ private:
|
|||
#ifndef __JUCE_SINGLETON_JUCEHEADER__
|
||||
#define __JUCE_SINGLETON_JUCEHEADER__
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ScopedLock.h ***/
|
||||
#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
#define __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
|
||||
/**
|
||||
Automatically locks and unlocks a CriticalSection object.
|
||||
|
||||
Use one of these as a local variable to control access to a CriticalSection.
|
||||
|
||||
e.g. @code
|
||||
|
||||
CriticalSection myCriticalSection;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const ScopedLock myScopedLock (myCriticalSection);
|
||||
// myCriticalSection is now locked
|
||||
|
||||
...do some stuff...
|
||||
|
||||
// myCriticalSection gets unlocked here.
|
||||
}
|
||||
@endcode
|
||||
|
||||
@see CriticalSection, ScopedUnlock
|
||||
*/
|
||||
class JUCE_API ScopedLock
|
||||
{
|
||||
public:
|
||||
|
||||
/** Creates a ScopedLock.
|
||||
|
||||
As soon as it is created, this will lock the CriticalSection, and
|
||||
when the ScopedLock object is deleted, the CriticalSection will
|
||||
be unlocked.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen! Best just to use it
|
||||
as a local stack object, rather than creating one with the new() operator.
|
||||
*/
|
||||
inline explicit ScopedLock (const CriticalSection& lock) throw() : lock_ (lock) { lock.enter(); }
|
||||
|
||||
/** Destructor.
|
||||
|
||||
The CriticalSection will be unlocked when the destructor is called.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen!
|
||||
*/
|
||||
inline ~ScopedLock() throw() { lock_.exit(); }
|
||||
|
||||
private:
|
||||
|
||||
const CriticalSection& lock_;
|
||||
|
||||
ScopedLock (const ScopedLock&);
|
||||
ScopedLock& operator= (const ScopedLock&);
|
||||
};
|
||||
|
||||
/**
|
||||
Automatically unlocks and re-locks a CriticalSection object.
|
||||
|
||||
This is the reverse of a ScopedLock object - instead of locking the critical
|
||||
section for the lifetime of this object, it unlocks it.
|
||||
|
||||
Make sure you don't try to unlock critical sections that aren't actually locked!
|
||||
|
||||
e.g. @code
|
||||
|
||||
CriticalSection myCriticalSection;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const ScopedLock myScopedLock (myCriticalSection);
|
||||
// myCriticalSection is now locked
|
||||
|
||||
... do some stuff with it locked ..
|
||||
|
||||
while (xyz)
|
||||
{
|
||||
... do some stuff with it locked ..
|
||||
|
||||
const ScopedUnlock unlocker (myCriticalSection);
|
||||
|
||||
// myCriticalSection is now unlocked for the remainder of this block,
|
||||
// and re-locked at the end.
|
||||
|
||||
...do some stuff with it unlocked ...
|
||||
}
|
||||
|
||||
// myCriticalSection gets unlocked here.
|
||||
}
|
||||
@endcode
|
||||
|
||||
@see CriticalSection, ScopedLock
|
||||
*/
|
||||
class ScopedUnlock
|
||||
{
|
||||
public:
|
||||
|
||||
/** Creates a ScopedUnlock.
|
||||
|
||||
As soon as it is created, this will unlock the CriticalSection, and
|
||||
when the ScopedLock object is deleted, the CriticalSection will
|
||||
be re-locked.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen! Best just to use it
|
||||
as a local stack object, rather than creating one with the new() operator.
|
||||
*/
|
||||
inline explicit ScopedUnlock (const CriticalSection& lock) throw() : lock_ (lock) { lock.exit(); }
|
||||
|
||||
/** Destructor.
|
||||
|
||||
The CriticalSection will be unlocked when the destructor is called.
|
||||
|
||||
Make sure this object is created and deleted by the same thread,
|
||||
otherwise there are no guarantees what will happen!
|
||||
*/
|
||||
inline ~ScopedUnlock() throw() { lock_.enter(); }
|
||||
|
||||
private:
|
||||
|
||||
const CriticalSection& lock_;
|
||||
|
||||
ScopedUnlock (const ScopedLock&);
|
||||
ScopedUnlock& operator= (const ScopedUnlock&);
|
||||
};
|
||||
|
||||
#endif // __JUCE_SCOPEDLOCK_JUCEHEADER__
|
||||
/*** End of inlined file: juce_ScopedLock.h ***/
|
||||
|
||||
/**
|
||||
Macro to declare member variables and methods for a singleton class.
|
||||
|
||||
|
|
@ -25137,10 +25073,20 @@ public:
|
|||
So if you call setOrigin (100, 100), then the position that was previously
|
||||
referred to as (100, 100) will subsequently be considered to be (0, 0).
|
||||
|
||||
@see reduceClipRegion
|
||||
@see reduceClipRegion, addTransform
|
||||
*/
|
||||
void setOrigin (int newOriginX, int newOriginY);
|
||||
|
||||
/** Adds a transformation which will be performed on all the graphics operations that
|
||||
the context subsequently performs.
|
||||
|
||||
After calling this, all the coordinates that are passed into the context will be
|
||||
transformed by this matrix.
|
||||
|
||||
@see setOrigin
|
||||
*/
|
||||
void addTransform (const AffineTransform& transform);
|
||||
|
||||
/** Resets the current colour, brush, and font to default settings. */
|
||||
void resetToDefaultState();
|
||||
|
||||
|
|
@ -28003,16 +27949,13 @@ public:
|
|||
};
|
||||
|
||||
#ifndef DOXYGEN
|
||||
/** @internal
|
||||
This method is deprecated - use localPointToGlobal instead. */
|
||||
/** This method is deprecated - use localPointToGlobal instead. */
|
||||
const Point<int> relativePositionToGlobal (const Point<int>& relativePosition) const;
|
||||
|
||||
/** @internal
|
||||
This method is deprecated - use getLocalPoint instead. */
|
||||
/** This method is deprecated - use getLocalPoint instead. */
|
||||
const Point<int> globalPositionToRelative (const Point<int>& screenPosition) const;
|
||||
|
||||
/** @internal
|
||||
This method is deprecated - use getLocalPoint instead. */
|
||||
/** This method is deprecated - use getLocalPoint instead. */
|
||||
const Point<int> relativePositionToOtherComponent (const Component* targetComponent,
|
||||
const Point<int>& positionRelativeToThis) const;
|
||||
#endif
|
||||
|
|
@ -28103,13 +28046,19 @@ private:
|
|||
void grabFocusInternal (const FocusChangeType cause, bool canTryParent = true);
|
||||
static void giveAwayFocus();
|
||||
void sendEnablementChangeMessage();
|
||||
void subtractObscuredRegions (RectangleList& result, const Point<int>& delta,
|
||||
const Rectangle<int>& clipRect, const Component* const compToAvoid) const;
|
||||
void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, int deltaX, int deltaY) const;
|
||||
|
||||
void sendVisibilityChangeMessage();
|
||||
const Rectangle<int> getParentOrMainMonitorBounds() const;
|
||||
|
||||
class ComponentHelpers;
|
||||
friend class ComponentHelpers;
|
||||
|
||||
/* Components aren't allowed to have copy constructors, as this would mess up parent hierarchies.
|
||||
You might need to give your subclasses a private dummy constructor like this one to avoid
|
||||
compiler warnings.
|
||||
*/
|
||||
Component (const Component&);
|
||||
Component& operator= (const Component&);
|
||||
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This is included here just to cause a compile error if your code is still handling
|
||||
// drag-and-drop with this method. If so, just update it to use the new FileDragAndDropTarget
|
||||
// class, which is easy (just make your class inherit from FileDragAndDropTarget, and
|
||||
|
|
@ -28119,15 +28068,10 @@ private:
|
|||
// This is included here to cause an error if you use or overload it - it has been deprecated in
|
||||
// favour of contains (const Point<int>&)
|
||||
void contains (int, int);
|
||||
|
||||
/* Components aren't allowed to have copy constructors, as this would mess up parent hierarchies.
|
||||
You might need to give your subclasses a private dummy constructor like this one to avoid
|
||||
compiler warnings.
|
||||
*/
|
||||
Component (const Component&);
|
||||
Component& operator= (const Component&);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
/** @internal */
|
||||
virtual void internalRepaint (int x, int y, int w, int h);
|
||||
/** @internal */
|
||||
|
|
@ -29727,9 +29671,11 @@ private:
|
|||
void handleAsyncUpdate();
|
||||
void globalFocusChanged (Component*);
|
||||
|
||||
// xxx this is just here to cause a compile error in old code that hasn't been changed to use the new
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This is just here to cause a compile error in old code that hasn't been changed to use the new
|
||||
// version of this method.
|
||||
virtual short getFirstCommandTarget() { return 0; }
|
||||
#endif
|
||||
|
||||
ApplicationCommandManager (const ApplicationCommandManager&);
|
||||
ApplicationCommandManager& operator= (const ApplicationCommandManager&);
|
||||
|
|
@ -42087,7 +42033,7 @@ public:
|
|||
/** @internal */
|
||||
void buttonClicked (Button* b);
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
void timerCallback();
|
||||
|
||||
|
|
@ -43292,8 +43238,10 @@ protected:
|
|||
int midiNoteNumber,
|
||||
float velocity);
|
||||
|
||||
/** xxx Temporary method here to cause a compiler error - note the new parameters for this method. */
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// Temporary method here to cause a compiler error - note the new parameters for this method.
|
||||
int findFreeVoice (const bool) const { return 0; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
double sampleRate;
|
||||
|
|
@ -43623,9 +43571,6 @@ private:
|
|||
#endif
|
||||
#ifndef __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
|
||||
#endif
|
||||
#ifndef __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
|
||||
#endif
|
||||
#ifndef __JUCE_INTERPROCESSCONNECTION_JUCEHEADER__
|
||||
|
||||
|
|
@ -51954,7 +51899,7 @@ public:
|
|||
void scrollToTop();
|
||||
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
int getNumRows();
|
||||
/** @internal */
|
||||
|
|
@ -56186,9 +56131,9 @@ public:
|
|||
void changed (const bool synchronous = false)
|
||||
{
|
||||
if (synchronous)
|
||||
sendSynchronousChangeMessage (this);
|
||||
sendSynchronousChangeMessage();
|
||||
else
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
|
|
@ -56981,8 +56926,6 @@ public:
|
|||
/** @internal */
|
||||
void refresh();
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
/** @internal */
|
||||
void sliderValueChanged (Slider*);
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
|
|
@ -57249,7 +57192,7 @@ public:
|
|||
/** @internal */
|
||||
void buttonClicked (Button*);
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
void childBoundsChanged (Component*);
|
||||
|
||||
|
|
@ -57659,10 +57602,11 @@ private:
|
|||
ColourSelector (const ColourSelector&);
|
||||
ColourSelector& operator= (const ColourSelector&);
|
||||
|
||||
// this constructor is here temporarily to prevent old code compiling, because the parameters
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This constructor is here temporarily to prevent old code compiling, because the parameters
|
||||
// have changed - if you get an error here, update your code to use the new constructor instead..
|
||||
// (xxx - note to self: remember to remove this at some point in the future)
|
||||
ColourSelector (bool);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // __JUCE_COLOURSELECTOR_JUCEHEADER__
|
||||
|
|
|
|||
|
|
@ -327,9 +327,11 @@ private:
|
|||
void handleAsyncUpdate();
|
||||
void globalFocusChanged (Component*);
|
||||
|
||||
// xxx this is just here to cause a compile error in old code that hasn't been changed to use the new
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This is just here to cause a compile error in old code that hasn't been changed to use the new
|
||||
// version of this method.
|
||||
virtual short getFirstCommandTarget() { return 0; }
|
||||
#endif
|
||||
|
||||
ApplicationCommandManager (const ApplicationCommandManager&);
|
||||
ApplicationCommandManager& operator= (const ApplicationCommandManager&);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ void AudioThumbnail::setSource (InputSource* const newSource)
|
|||
}
|
||||
}
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
bool AudioThumbnail::useTimeSlice()
|
||||
|
|
@ -105,7 +105,7 @@ bool AudioThumbnail::useTimeSlice()
|
|||
readNextBlockFromAudioFile (*reader);
|
||||
stopTimer();
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
|
||||
const bool justFinished = isFullyLoaded();
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ void AudioTransportSource::start()
|
|||
inputStreamEOF = false;
|
||||
}
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ void AudioTransportSource::stop()
|
|||
while (--n >= 0 && ! stopped)
|
||||
Thread::sleep (2);
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ void AudioTransportSource::getNextAudioBlock (const AudioSourceChannelInfo& info
|
|||
{
|
||||
playing = false;
|
||||
inputStreamEOF = true;
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
stopped = ! playing;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ void AudioDeviceManager::setCurrentAudioDeviceType (const String& type,
|
|||
|
||||
setAudioDeviceSetup (s, treatAsChosenDevice);
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -363,7 +363,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
|
|||
return String::empty;
|
||||
|
||||
if (! (newSetup == currentSetup))
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
|
||||
stopDevice();
|
||||
|
||||
|
|
@ -729,14 +729,14 @@ void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device
|
|||
callbacks.getUnchecked(i)->audioDeviceAboutToStart (device);
|
||||
}
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
void AudioDeviceManager::audioDeviceStoppedInt()
|
||||
{
|
||||
cpuUsageMs = 0;
|
||||
timeToCpuScale = 0;
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
|
||||
const ScopedLock sl (audioCallbackLock);
|
||||
for (int i = callbacks.size(); --i >= 0;)
|
||||
|
|
@ -777,7 +777,7 @@ void AudioDeviceManager::setMidiInputEnabled (const String& name,
|
|||
}
|
||||
|
||||
updateXml();
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -887,7 +887,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName)
|
|||
}
|
||||
|
||||
updateXml();
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void KnownPluginList::clear()
|
|||
if (types.size() > 0)
|
||||
{
|
||||
types.clear();
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,14 +83,14 @@ bool KnownPluginList::addType (const PluginDescription& type)
|
|||
}
|
||||
|
||||
types.add (new PluginDescription (type));
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
return true;
|
||||
}
|
||||
|
||||
void KnownPluginList::removeType (const int index)
|
||||
{
|
||||
types.remove (index);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
@ -249,7 +249,7 @@ void KnownPluginList::sort (const SortMethod method)
|
|||
sorter.method = method;
|
||||
types.sort (sorter, true);
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ void PluginListComponent::resized()
|
|||
optionsButton.setTopLeftPosition (8, getHeight() - 28);
|
||||
}
|
||||
|
||||
void PluginListComponent::changeListenerCallback (void*)
|
||||
void PluginListComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
listBox.updateContent();
|
||||
listBox.repaint();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public:
|
|||
/** @internal */
|
||||
void buttonClicked (Button* b);
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
void timerCallback();
|
||||
|
||||
|
|
|
|||
|
|
@ -468,8 +468,10 @@ protected:
|
|||
int midiNoteNumber,
|
||||
float velocity);
|
||||
|
||||
/** xxx Temporary method here to cause a compiler error - note the new parameters for this method. */
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// Temporary method here to cause a compiler error - note the new parameters for this method.
|
||||
int findFreeVoice (const bool) const { return 0; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
double sampleRate;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 52
|
||||
#define JUCE_BUILDNUMBER 92
|
||||
#define JUCE_BUILDNUMBER 93
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
@ -154,6 +154,12 @@
|
|||
/** This macro is added to all juce public function declarations. */
|
||||
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
|
||||
|
||||
/** This turns on some non-essential bits of code that should prevent old code from compiling
|
||||
in cases where method signatures have changed, etc.
|
||||
*/
|
||||
#if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
|
||||
#define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
// Now include some basics that are needed by most of the Juce classes...
|
||||
|
|
|
|||
|
|
@ -31,6 +31,24 @@ BEGIN_JUCE_NAMESPACE
|
|||
#include "juce_MessageManager.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
class ChangeBroadcaster::ChangeBroadcasterMessage : public CallbackMessage
|
||||
{
|
||||
public:
|
||||
ChangeBroadcasterMessage (ChangeBroadcaster* const owner_)
|
||||
: owner (owner_)
|
||||
{
|
||||
}
|
||||
|
||||
void messageCallback()
|
||||
{
|
||||
if (owner != 0 && owner->pendingMessage.value == this)
|
||||
owner->sendSynchronousChangeMessage();
|
||||
}
|
||||
|
||||
ChangeBroadcaster* owner;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
ChangeBroadcaster::ChangeBroadcaster() throw()
|
||||
{
|
||||
|
|
@ -42,39 +60,65 @@ ChangeBroadcaster::~ChangeBroadcaster()
|
|||
{
|
||||
// all event-based objects must be deleted BEFORE juce is shut down!
|
||||
jassert (MessageManager::instance != 0);
|
||||
|
||||
invalidatePendingMessage();
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::addChangeListener (ChangeListener* const listener)
|
||||
{
|
||||
changeListenerList.addChangeListener (listener);
|
||||
// Listeners can only be safely added when the event thread is locked...
|
||||
jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());
|
||||
|
||||
changeListeners.add (listener);
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::removeChangeListener (ChangeListener* const listener)
|
||||
{
|
||||
jassert (changeListenerList.isValidMessageListener());
|
||||
// Listeners can only be safely added when the event thread is locked...
|
||||
jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());
|
||||
|
||||
if (changeListenerList.isValidMessageListener())
|
||||
changeListenerList.removeChangeListener (listener);
|
||||
changeListeners.remove (listener);
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::removeAllChangeListeners()
|
||||
{
|
||||
changeListenerList.removeAllChangeListeners();
|
||||
// Listeners can only be safely added when the event thread is locked...
|
||||
jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());
|
||||
|
||||
changeListeners.clear();
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::sendChangeMessage (void* objectThatHasChanged)
|
||||
void ChangeBroadcaster::invalidatePendingMessage()
|
||||
{
|
||||
changeListenerList.sendChangeMessage (objectThatHasChanged);
|
||||
ChangeBroadcasterMessage* const oldMessage = pendingMessage.exchange (0);
|
||||
if (oldMessage != 0)
|
||||
oldMessage->owner = 0;
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::sendSynchronousChangeMessage (void* objectThatHasChanged)
|
||||
void ChangeBroadcaster::sendChangeMessage()
|
||||
{
|
||||
changeListenerList.sendSynchronousChangeMessage (objectThatHasChanged);
|
||||
if (pendingMessage.value == 0 && changeListeners.size() > 0)
|
||||
{
|
||||
ScopedPointer<ChangeBroadcasterMessage> pending (new ChangeBroadcasterMessage (this));
|
||||
|
||||
if (pendingMessage.compareAndSetBool (pending, 0))
|
||||
pending.release()->post();
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::sendSynchronousChangeMessage()
|
||||
{
|
||||
// This can only be called by the event thread.
|
||||
jassert (MessageManager::getInstance()->isThisTheMessageThread());
|
||||
|
||||
invalidatePendingMessage();
|
||||
changeListeners.call (&ChangeListener::changeListenerCallback, this);
|
||||
}
|
||||
|
||||
void ChangeBroadcaster::dispatchPendingMessages()
|
||||
{
|
||||
changeListenerList.dispatchPendingMessages();
|
||||
if (pendingMessage.get() != 0)
|
||||
sendSynchronousChangeMessage();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,16 @@
|
|||
#ifndef __JUCE_CHANGEBROADCASTER_JUCEHEADER__
|
||||
#define __JUCE_CHANGEBROADCASTER_JUCEHEADER__
|
||||
|
||||
#include "juce_ChangeListenerList.h"
|
||||
#include "juce_ChangeListener.h"
|
||||
#include "juce_ListenerList.h"
|
||||
#include "../core/juce_Atomic.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/** Manages a list of ChangeListeners, and can send them messages.
|
||||
/**
|
||||
Holds a list of ChangeListeners, and sends messages to them when instructed.
|
||||
|
||||
To quickly add methods to your class that can add/remove change
|
||||
listeners and broadcast to them, you can derive from this.
|
||||
|
||||
@see ChangeListenerList, ChangeListener
|
||||
@see ChangeListener
|
||||
*/
|
||||
class JUCE_API ChangeBroadcaster
|
||||
{
|
||||
|
|
@ -48,14 +48,12 @@ public:
|
|||
virtual ~ChangeBroadcaster();
|
||||
|
||||
//==============================================================================
|
||||
/** Adds a listener to the list.
|
||||
|
||||
(Trying to add a listener that's already on the list will have no effect).
|
||||
/** Registers a listener to receive change callbacks from this broadcaster.
|
||||
Trying to add a listener that's already on the list will have no effect.
|
||||
*/
|
||||
void addChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes a listener from the list.
|
||||
|
||||
/** Unregisters a listener from the list.
|
||||
If the listener isn't on the list, this won't have any effect.
|
||||
*/
|
||||
void removeChangeListener (ChangeListener* listener);
|
||||
|
|
@ -64,31 +62,39 @@ public:
|
|||
void removeAllChangeListeners();
|
||||
|
||||
//==============================================================================
|
||||
/** Broadcasts a change message to all the registered listeners.
|
||||
/** Causes an asynchronous change message to be sent to all the registered listeners.
|
||||
|
||||
The message will be delivered asynchronously by the event thread, so this
|
||||
method will not directly call any of the listeners. For a synchronous
|
||||
message, use sendSynchronousChangeMessage().
|
||||
|
||||
@see ChangeListenerList::sendActionMessage
|
||||
The message will be delivered asynchronously by the main message thread, so this
|
||||
method will return immediately. To call the listeners synchronously use
|
||||
sendSynchronousChangeMessage().
|
||||
*/
|
||||
void sendChangeMessage (void* objectThatHasChanged);
|
||||
void sendChangeMessage();
|
||||
|
||||
/** Sends a synchronous change message to all the registered listeners.
|
||||
|
||||
@see ChangeListenerList::sendSynchronousChangeMessage
|
||||
*/
|
||||
void sendSynchronousChangeMessage (void* objectThatHasChanged);
|
||||
This will immediately call all the listeners that are registered. For thread-safety
|
||||
reasons, you must only call this method on the main message thread.
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will
|
||||
use sendSynchronousChangeMessage() to make the callback immediately.
|
||||
@see dispatchPendingMessages
|
||||
*/
|
||||
void sendSynchronousChangeMessage();
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will call
|
||||
sendSynchronousChangeMessage() to make the callback immediately.
|
||||
|
||||
For thread-safety reasons, you must only call this method on the main message thread.
|
||||
*/
|
||||
void dispatchPendingMessages();
|
||||
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
ChangeListenerList changeListenerList;
|
||||
class ChangeBroadcasterMessage;
|
||||
friend class ChangeBroadcasterMessage;
|
||||
|
||||
Atomic<ChangeBroadcasterMessage*> pendingMessage;
|
||||
ListenerList <ChangeListener> changeListeners;
|
||||
|
||||
void invalidatePendingMessage();
|
||||
|
||||
ChangeBroadcaster (const ChangeBroadcaster&);
|
||||
ChangeBroadcaster& operator= (const ChangeBroadcaster&);
|
||||
|
|
|
|||
|
|
@ -26,20 +26,21 @@
|
|||
#ifndef __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
#define __JUCE_CHANGELISTENER_JUCEHEADER__
|
||||
|
||||
class ChangeBroadcaster;
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Receives callbacks about changes to some kind of object.
|
||||
Receives change event callbacks that are sent out by a ChangeBroadcaster.
|
||||
|
||||
Many objects use a ChangeListenerList to keep a set of listeners which they
|
||||
will inform when something changes. A subclass of ChangeListener
|
||||
is used to receive these callbacks.
|
||||
A ChangeBroadcaster keeps a set of listeners to which it broadcasts a message when
|
||||
the ChangeBroadcaster::sendChangeMessage() method is called. A subclass of
|
||||
ChangeListener is used to receive these callbacks.
|
||||
|
||||
Note that the major difference between an ActionListener and a ChangeListener
|
||||
is that for a ChangeListener, multiple changes will be coalesced into fewer
|
||||
callbacks, but ActionListeners perform one callback for every event posted.
|
||||
|
||||
@see ChangeListenerList, ChangeBroadcaster, ActionListener
|
||||
@see ChangeBroadcaster, ActionListener
|
||||
*/
|
||||
class JUCE_API ChangeListener
|
||||
{
|
||||
|
|
@ -47,12 +48,17 @@ public:
|
|||
/** Destructor. */
|
||||
virtual ~ChangeListener() {}
|
||||
|
||||
/** Overridden by your subclass to receive the callback.
|
||||
|
||||
@param objectThatHasChanged the value that was passed to the
|
||||
ChangeListenerList::sendChangeMessage() method
|
||||
/** Your subclass should implement this method to receive the callback.
|
||||
@param source the ChangeBroadcaster that triggered the callback.
|
||||
*/
|
||||
virtual void changeListenerCallback (void* objectThatHasChanged) = 0;
|
||||
virtual void changeListenerCallback (ChangeBroadcaster* source) = 0;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This method's signature has changed to take a ChangeBroadcaster parameter - please update your code!
|
||||
private: virtual int changeListenerCallback (void*) { return 0; }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,107 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-10 by Raw Material Software Ltd.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
JUCE can be redistributed and/or modified under the terms of the GNU General
|
||||
Public License (Version 2), as published by the Free Software Foundation.
|
||||
A copy of the license is included in the JUCE distribution, or can be found
|
||||
online at www.gnu.org/licenses.
|
||||
|
||||
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
To release a closed-source product which uses JUCE, commercial licenses are
|
||||
available: visit www.rawmaterialsoftware.com/juce for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../core/juce_StandardHeader.h"
|
||||
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
#include "juce_ChangeListenerList.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ChangeListenerList::ChangeListenerList()
|
||||
: lastChangedObject (0),
|
||||
messagePending (false)
|
||||
{
|
||||
}
|
||||
|
||||
ChangeListenerList::~ChangeListenerList()
|
||||
{
|
||||
}
|
||||
|
||||
void ChangeListenerList::addChangeListener (ChangeListener* const listener)
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
|
||||
jassert (listener != 0);
|
||||
|
||||
if (listener != 0)
|
||||
listeners.add (listener);
|
||||
}
|
||||
|
||||
void ChangeListenerList::removeChangeListener (ChangeListener* const listener)
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
listeners.removeValue (listener);
|
||||
}
|
||||
|
||||
void ChangeListenerList::removeAllChangeListeners()
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
void ChangeListenerList::sendChangeMessage (void* const objectThatHasChanged)
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
|
||||
if ((! messagePending) && (listeners.size() > 0))
|
||||
{
|
||||
lastChangedObject = objectThatHasChanged;
|
||||
postMessage (new Message (0, 0, 0, objectThatHasChanged));
|
||||
messagePending = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeListenerList::handleMessage (const Message& message)
|
||||
{
|
||||
sendSynchronousChangeMessage (message.pointerParameter);
|
||||
}
|
||||
|
||||
void ChangeListenerList::sendSynchronousChangeMessage (void* const objectThatHasChanged)
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
messagePending = false;
|
||||
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
ChangeListener* const l = static_cast <ChangeListener*> (listeners.getUnchecked (i));
|
||||
|
||||
{
|
||||
const ScopedUnlock tempUnlocker (lock);
|
||||
l->changeListenerCallback (objectThatHasChanged);
|
||||
}
|
||||
|
||||
i = jmin (i, listeners.size());
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeListenerList::dispatchPendingMessages()
|
||||
{
|
||||
if (messagePending)
|
||||
sendSynchronousChangeMessage (lastChangedObject);
|
||||
}
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-10 by Raw Material Software Ltd.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
JUCE can be redistributed and/or modified under the terms of the GNU General
|
||||
Public License (Version 2), as published by the Free Software Foundation.
|
||||
A copy of the license is included in the JUCE distribution, or can be found
|
||||
online at www.gnu.org/licenses.
|
||||
|
||||
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
To release a closed-source product which uses JUCE, commercial licenses are
|
||||
available: visit www.rawmaterialsoftware.com/juce for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
#define __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
|
||||
#include "juce_ChangeListener.h"
|
||||
#include "juce_MessageListener.h"
|
||||
#include "../containers/juce_SortedSet.h"
|
||||
#include "../threads/juce_ScopedLock.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A set of ChangeListeners.
|
||||
|
||||
Listeners can be added and removed from the list, and change messages can be
|
||||
broadcast to all the listeners.
|
||||
|
||||
@see ChangeListener, ChangeBroadcaster
|
||||
*/
|
||||
class JUCE_API ChangeListenerList : public MessageListener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates an empty list. */
|
||||
ChangeListenerList();
|
||||
|
||||
/** Destructor. */
|
||||
~ChangeListenerList();
|
||||
|
||||
//==============================================================================
|
||||
/** Adds a listener to the list.
|
||||
|
||||
(Trying to add a listener that's already on the list will have no effect).
|
||||
*/
|
||||
void addChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes a listener from the list.
|
||||
|
||||
If the listener isn't on the list, this won't have any effect.
|
||||
*/
|
||||
void removeChangeListener (ChangeListener* listener);
|
||||
|
||||
/** Removes all listeners from the list. */
|
||||
void removeAllChangeListeners();
|
||||
|
||||
//==============================================================================
|
||||
/** Posts an asynchronous change message to all the listeners.
|
||||
|
||||
If a message has already been sent and hasn't yet been delivered, this
|
||||
method won't send another - in this way it coalesces multiple frequent
|
||||
changes into fewer actual callbacks to the ChangeListeners. Contrast this
|
||||
with the ActionListener, which posts a new event for every call to its
|
||||
sendActionMessage() method.
|
||||
|
||||
Only listeners which are on the list when the change event is delivered
|
||||
will receive the event - and this may include listeners that weren't on
|
||||
the list when the change message was sent.
|
||||
|
||||
@param objectThatHasChanged this pointer is passed to the
|
||||
ChangeListener::changeListenerCallback() method,
|
||||
and can be any value the application needs
|
||||
@see sendSynchronousChangeMessage
|
||||
*/
|
||||
void sendChangeMessage (void* objectThatHasChanged);
|
||||
|
||||
/** This will synchronously callback all the ChangeListeners.
|
||||
|
||||
Use this if you need to synchronously force a call to all the
|
||||
listeners' ChangeListener::changeListenerCallback() methods.
|
||||
*/
|
||||
void sendSynchronousChangeMessage (void* objectThatHasChanged);
|
||||
|
||||
/** If a change message has been sent but not yet dispatched, this will
|
||||
use sendSynchronousChangeMessage() to make the callback immediately.
|
||||
*/
|
||||
void dispatchPendingMessages();
|
||||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void handleMessage (const Message&);
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
|
||||
private:
|
||||
SortedSet <void*> listeners;
|
||||
CriticalSection lock;
|
||||
void* lastChangedObject;
|
||||
bool messagePending;
|
||||
|
||||
ChangeListenerList (const ChangeListenerList&);
|
||||
ChangeListenerList& operator= (const ChangeListenerList&);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCE_CHANGELISTENERLIST_JUCEHEADER__
|
||||
|
|
@ -130,6 +130,12 @@ public:
|
|||
return listeners.size() == 0;
|
||||
}
|
||||
|
||||
/** Clears the list. */
|
||||
void clear()
|
||||
{
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
/** Returns true if the specified listener has been added to the list. */
|
||||
bool contains (ListenerClass* const listener) const throw()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -381,6 +381,7 @@ void ListBox::setModel (ListBoxModel* const newModel)
|
|||
if (model != newModel)
|
||||
{
|
||||
model = newModel;
|
||||
repaint();
|
||||
updateContent();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ BEGIN_JUCE_NAMESPACE
|
|||
|
||||
#include "juce_DirectoryContentsList.h"
|
||||
#include "../../graphics/imaging/juce_ImageCache.h"
|
||||
#include "../../../threads/juce_ScopedLock.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -160,7 +161,7 @@ bool DirectoryContentsList::isStillLoading() const
|
|||
|
||||
void DirectoryContentsList::changed()
|
||||
{
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ void FileListComponent::scrollToTop()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void FileListComponent::changeListenerCallback (void*)
|
||||
void FileListComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updateContent();
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
int getNumRows();
|
||||
/** @internal */
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
newList->addChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
clearSubItems();
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,181 @@ namespace
|
|||
}
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
class Component::ComponentHelpers
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
static void* runModalLoopCallback (void* userData)
|
||||
{
|
||||
return (void*) (pointer_sized_int) static_cast <Component*> (userData)->runModalLoop();
|
||||
}
|
||||
|
||||
static const Identifier getColourPropertyId (const int colourId)
|
||||
{
|
||||
String s;
|
||||
s.preallocateStorage (18);
|
||||
s << "jcclr_" << String::toHexString (colourId);
|
||||
return s;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static inline bool hitTest (Component& comp, const Point<int>& localPoint)
|
||||
{
|
||||
return ((unsigned int) localPoint.getX()) < (unsigned int) comp.getWidth()
|
||||
&& ((unsigned int) localPoint.getY()) < (unsigned int) comp.getHeight()
|
||||
&& comp.hitTest (localPoint.getX(), localPoint.getY());
|
||||
}
|
||||
|
||||
static const Point<int> convertFromParentSpace (const Component& comp, const Point<int>& pointInParentSpace)
|
||||
{
|
||||
return pointInParentSpace - comp.getPosition();
|
||||
}
|
||||
|
||||
static const Rectangle<int> convertFromParentSpace (const Component& comp, const Rectangle<int>& areaInParentSpace)
|
||||
{
|
||||
return areaInParentSpace - comp.getPosition();
|
||||
}
|
||||
|
||||
static const Point<int> convertToParentSpace (const Component& comp, const Point<int>& pointInLocalSpace)
|
||||
{
|
||||
return pointInLocalSpace + comp.getPosition();
|
||||
}
|
||||
|
||||
static const Rectangle<int> convertToParentSpace (const Component& comp, const Rectangle<int>& areaInLocalSpace)
|
||||
{
|
||||
return areaInLocalSpace + comp.getPosition();
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
static const Type convertFromDistantParentSpace (const Component* parent, const Component& target, Type coordInParent)
|
||||
{
|
||||
const Component* const directParent = target.getParentComponent();
|
||||
jassert (directParent != 0);
|
||||
|
||||
if (directParent == parent)
|
||||
return convertFromParentSpace (target, coordInParent);
|
||||
|
||||
return convertFromParentSpace (target, convertFromDistantParentSpace (parent, *directParent, coordInParent));
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
static const Type convertCoordinate (const Component* target, const Component* source, Type p)
|
||||
{
|
||||
while (source != 0)
|
||||
{
|
||||
if (source == target)
|
||||
return p;
|
||||
|
||||
if (source->isParentOf (target))
|
||||
return convertFromDistantParentSpace (source, *target, p);
|
||||
|
||||
if (source->isOnDesktop())
|
||||
{
|
||||
p = source->getPeer()->localToGlobal (p);
|
||||
source = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = convertToParentSpace (*source, p);
|
||||
source = source->getParentComponent();
|
||||
}
|
||||
}
|
||||
|
||||
jassert (source == 0);
|
||||
if (target == 0)
|
||||
return p;
|
||||
|
||||
const Component* const topLevelComp = target->getTopLevelComponent();
|
||||
|
||||
if (topLevelComp->isOnDesktop())
|
||||
p = topLevelComp->getPeer()->globalToLocal (p);
|
||||
else
|
||||
p = convertFromParentSpace (*topLevelComp, p);
|
||||
|
||||
if (topLevelComp == target)
|
||||
return p;
|
||||
|
||||
return convertFromDistantParentSpace (topLevelComp, *target, p);
|
||||
}
|
||||
|
||||
static const Rectangle<int> getUnclippedArea (const Component& comp)
|
||||
{
|
||||
Rectangle<int> r (comp.getLocalBounds());
|
||||
|
||||
Component* const p = comp.getParentComponent();
|
||||
|
||||
if (p != 0)
|
||||
r = r.getIntersection (convertFromParentSpace (comp, getUnclippedArea (*p)));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static void clipObscuredRegions (const Component& comp, Graphics& g, const Rectangle<int>& clipRect, const Point<int>& delta)
|
||||
{
|
||||
for (int i = comp.childComponentList_.size(); --i >= 0;)
|
||||
{
|
||||
const Component& child = *comp.childComponentList_.getUnchecked(i);
|
||||
|
||||
//xxx if (child.isVisible() && ! child.isTransformed())
|
||||
if (child.isVisible())
|
||||
{
|
||||
const Rectangle<int> newClip (clipRect.getIntersection (child.bounds_));
|
||||
|
||||
if (! newClip.isEmpty())
|
||||
{
|
||||
if (child.isOpaque())
|
||||
{
|
||||
g.excludeClipRegion (newClip + delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Point<int> childPos (child.getPosition());
|
||||
clipObscuredRegions (child, g, newClip - childPos, childPos + delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void subtractObscuredRegions (const Component& comp, RectangleList& result,
|
||||
const Point<int>& delta,
|
||||
const Rectangle<int>& clipRect,
|
||||
const Component* const compToAvoid)
|
||||
{
|
||||
for (int i = comp.childComponentList_.size(); --i >= 0;)
|
||||
{
|
||||
const Component* const c = comp.childComponentList_.getUnchecked(i);
|
||||
|
||||
if (c != compToAvoid && c->isVisible())
|
||||
{
|
||||
if (c->isOpaque())
|
||||
{
|
||||
Rectangle<int> childBounds (c->bounds_.getIntersection (clipRect));
|
||||
childBounds.translate (delta.getX(), delta.getY());
|
||||
|
||||
result.subtract (childBounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
Rectangle<int> newClip (clipRect.getIntersection (c->bounds_));
|
||||
newClip.translate (-c->getX(), -c->getY());
|
||||
|
||||
subtractObscuredRegions (*c, result, c->getPosition() + delta,
|
||||
newClip, compToAvoid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const Rectangle<int> getParentOrMainMonitorBounds (const Component& comp)
|
||||
{
|
||||
return comp.getParentComponent() != 0 ? comp.getParentComponent()->getLocalBounds()
|
||||
: Desktop::getInstance().getMainMonitorArea();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
Component::Component()
|
||||
: parentComponent_ (0),
|
||||
|
|
@ -766,138 +941,30 @@ int Component::getParentHeight() const throw()
|
|||
: getParentMonitorArea().getHeight();
|
||||
}
|
||||
|
||||
int Component::getScreenX() const
|
||||
{
|
||||
return getScreenPosition().getX();
|
||||
}
|
||||
int Component::getScreenX() const { return getScreenPosition().getX(); }
|
||||
int Component::getScreenY() const { return getScreenPosition().getY(); }
|
||||
|
||||
int Component::getScreenY() const
|
||||
{
|
||||
return getScreenPosition().getY();
|
||||
}
|
||||
|
||||
const Point<int> Component::getScreenPosition() const
|
||||
{
|
||||
return localPointToGlobal (Point<int>());
|
||||
}
|
||||
|
||||
const Rectangle<int> Component::getScreenBounds() const
|
||||
{
|
||||
return bounds_.withPosition (getScreenPosition());
|
||||
}
|
||||
|
||||
namespace CoordinateHelpers
|
||||
{
|
||||
inline bool hitTest (Component& comp, const Point<int>& localPoint)
|
||||
{
|
||||
return ((unsigned int) localPoint.getX()) < (unsigned int) comp.getWidth()
|
||||
&& ((unsigned int) localPoint.getY()) < (unsigned int) comp.getHeight()
|
||||
&& comp.hitTest (localPoint.getX(), localPoint.getY());
|
||||
}
|
||||
|
||||
const Point<int> convertFromParentSpace (const Component& comp, const Point<int>& pointInParentSpace)
|
||||
{
|
||||
return pointInParentSpace - comp.getPosition();
|
||||
}
|
||||
|
||||
const Rectangle<int> convertFromParentSpace (const Component& comp, const Rectangle<int>& areaInParentSpace)
|
||||
{
|
||||
return areaInParentSpace - comp.getPosition();
|
||||
}
|
||||
|
||||
const Point<int> convertToParentSpace (const Component& comp, const Point<int>& pointInLocalSpace)
|
||||
{
|
||||
return pointInLocalSpace + comp.getPosition();
|
||||
}
|
||||
|
||||
const Rectangle<int> convertToParentSpace (const Component& comp, const Rectangle<int>& areaInLocalSpace)
|
||||
{
|
||||
return areaInLocalSpace + comp.getPosition();
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
const Type convertFromDistantParentSpace (const Component* parent, const Component& target, Type coordInParent)
|
||||
{
|
||||
const Component* const directParent = target.getParentComponent();
|
||||
jassert (directParent != 0);
|
||||
|
||||
if (directParent == parent)
|
||||
return convertFromParentSpace (target, coordInParent);
|
||||
|
||||
return convertFromParentSpace (target, convertFromDistantParentSpace (parent, *directParent, coordInParent));
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
const Type convertCoordinate (const Component* target, const Component* source, Type p)
|
||||
{
|
||||
while (source != 0)
|
||||
{
|
||||
if (source == target)
|
||||
return p;
|
||||
|
||||
if (source->isParentOf (target))
|
||||
return convertFromDistantParentSpace (source, *target, p);
|
||||
|
||||
if (source->isOnDesktop())
|
||||
{
|
||||
p = source->getPeer()->localToGlobal (p);
|
||||
source = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = convertToParentSpace (*source, p);
|
||||
source = source->getParentComponent();
|
||||
}
|
||||
}
|
||||
|
||||
jassert (source == 0);
|
||||
if (target == 0)
|
||||
return p;
|
||||
|
||||
const Component* const topLevelComp = target->getTopLevelComponent();
|
||||
|
||||
if (topLevelComp->isOnDesktop())
|
||||
p = topLevelComp->getPeer()->globalToLocal (p);
|
||||
else
|
||||
p = convertFromParentSpace (*topLevelComp, p);
|
||||
|
||||
if (topLevelComp == target)
|
||||
return p;
|
||||
|
||||
return convertFromDistantParentSpace (topLevelComp, *target, p);
|
||||
}
|
||||
|
||||
const Rectangle<int> getUnclippedArea (const Component& comp)
|
||||
{
|
||||
Rectangle<int> r (comp.getLocalBounds());
|
||||
|
||||
Component* const p = comp.getParentComponent();
|
||||
|
||||
if (p != 0)
|
||||
r = r.getIntersection (convertFromParentSpace (comp, getUnclippedArea (*p)));
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
const Point<int> Component::getScreenPosition() const { return localPointToGlobal (Point<int>()); }
|
||||
const Rectangle<int> Component::getScreenBounds() const { return localAreaToGlobal (getLocalBounds()); }
|
||||
|
||||
const Point<int> Component::getLocalPoint (const Component* source, const Point<int>& point) const
|
||||
{
|
||||
return CoordinateHelpers::convertCoordinate (this, source, point);
|
||||
return ComponentHelpers::convertCoordinate (this, source, point);
|
||||
}
|
||||
|
||||
const Rectangle<int> Component::getLocalArea (const Component* source, const Rectangle<int>& area) const
|
||||
{
|
||||
return CoordinateHelpers::convertCoordinate (this, source, area);
|
||||
return ComponentHelpers::convertCoordinate (this, source, area);
|
||||
}
|
||||
|
||||
const Point<int> Component::localPointToGlobal (const Point<int>& point) const
|
||||
{
|
||||
return CoordinateHelpers::convertCoordinate (0, this, point);
|
||||
return ComponentHelpers::convertCoordinate (0, this, point);
|
||||
}
|
||||
|
||||
const Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const
|
||||
{
|
||||
return CoordinateHelpers::convertCoordinate (0, this, area);
|
||||
return ComponentHelpers::convertCoordinate (0, this, area);
|
||||
}
|
||||
|
||||
/* Deprecated methods... */
|
||||
|
|
@ -1053,7 +1120,7 @@ void Component::setCentreRelative (const float x, const float y)
|
|||
|
||||
void Component::centreWithSize (const int width, const int height)
|
||||
{
|
||||
const Rectangle<int> parentArea (getParentOrMainMonitorBounds());
|
||||
const Rectangle<int> parentArea (ComponentHelpers::getParentOrMainMonitorBounds (*this));
|
||||
|
||||
setBounds (parentArea.getCentreX() - width / 2,
|
||||
parentArea.getCentreY() - height / 2,
|
||||
|
|
@ -1062,7 +1129,7 @@ void Component::centreWithSize (const int width, const int height)
|
|||
|
||||
void Component::setBoundsInset (const BorderSize& borders)
|
||||
{
|
||||
setBounds (borders.subtractedFrom (getParentOrMainMonitorBounds()));
|
||||
setBounds (borders.subtractedFrom (ComponentHelpers::getParentOrMainMonitorBounds (*this)));
|
||||
}
|
||||
|
||||
void Component::setBoundsToFit (int x, int y, int width, int height,
|
||||
|
|
@ -1124,7 +1191,7 @@ bool Component::hitTest (int x, int y)
|
|||
Component& child = *getChildComponent (i);
|
||||
|
||||
if (child.isVisible()
|
||||
&& CoordinateHelpers::hitTest (child, CoordinateHelpers::convertFromParentSpace (child, Point<int> (x, y))))
|
||||
&& ComponentHelpers::hitTest (child, ComponentHelpers::convertFromParentSpace (child, Point<int> (x, y))))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1148,11 +1215,11 @@ void Component::getInterceptsMouseClicks (bool& allowsClicksOnThisComponent,
|
|||
|
||||
bool Component::contains (const Point<int>& point)
|
||||
{
|
||||
if (CoordinateHelpers::hitTest (*this, point))
|
||||
if (ComponentHelpers::hitTest (*this, point))
|
||||
{
|
||||
if (parentComponent_ != 0)
|
||||
{
|
||||
return parentComponent_->contains (CoordinateHelpers::convertToParentSpace (*this, point));
|
||||
return parentComponent_->contains (ComponentHelpers::convertToParentSpace (*this, point));
|
||||
}
|
||||
else if (flags.hasHeavyweightPeerFlag)
|
||||
{
|
||||
|
|
@ -1181,12 +1248,12 @@ bool Component::reallyContains (const int x, const int y, const bool returnTrueI
|
|||
|
||||
Component* Component::getComponentAt (const Point<int>& position)
|
||||
{
|
||||
if (flags.visibleFlag && CoordinateHelpers::hitTest (*this, position))
|
||||
if (flags.visibleFlag && ComponentHelpers::hitTest (*this, position))
|
||||
{
|
||||
for (int i = childComponentList_.size(); --i >= 0;)
|
||||
{
|
||||
Component* child = childComponentList_.getUnchecked(i);
|
||||
child = child->getComponentAt (CoordinateHelpers::convertFromParentSpace (*child, position));
|
||||
child = child->getComponentAt (ComponentHelpers::convertFromParentSpace (*child, position));
|
||||
|
||||
if (child != 0)
|
||||
return child;
|
||||
|
|
@ -1414,14 +1481,6 @@ void Component::internalHierarchyChanged()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
namespace ComponentHelpers
|
||||
{
|
||||
void* runModalLoopCallback (void* userData)
|
||||
{
|
||||
return (void*) (pointer_sized_int) static_cast <Component*> (userData)->runModalLoop();
|
||||
}
|
||||
}
|
||||
|
||||
int Component::runModalLoop()
|
||||
{
|
||||
if (! MessageManager::getInstance()->isThisTheMessageThread())
|
||||
|
|
@ -1689,7 +1748,7 @@ void Component::paintComponentAndChildren (Graphics& g)
|
|||
else
|
||||
{
|
||||
g.saveState();
|
||||
clipObscuredRegions (g, clipBounds, 0, 0);
|
||||
ComponentHelpers::clipObscuredRegions (*this, g, clipBounds, Point<int>());
|
||||
|
||||
if (! g.isClipEmpty())
|
||||
paintComponent (g);
|
||||
|
|
@ -1878,17 +1937,6 @@ void Component::sendLookAndFeelChange()
|
|||
}
|
||||
}
|
||||
|
||||
namespace ComponentHelpers
|
||||
{
|
||||
const Identifier getColourPropertyId (const int colourId)
|
||||
{
|
||||
String s;
|
||||
s.preallocateStorage (18);
|
||||
s << "jcclr_" << String::toHexString (colourId);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
const Colour Component::findColour (const int colourId, const bool inheritFromParent) const
|
||||
{
|
||||
var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId));
|
||||
|
|
@ -1946,44 +1994,10 @@ const Rectangle<int> Component::getLocalBounds() const throw()
|
|||
return Rectangle<int> (getWidth(), getHeight());
|
||||
}
|
||||
|
||||
const Rectangle<int> Component::getParentOrMainMonitorBounds() const
|
||||
{
|
||||
return parentComponent_ != 0 ? parentComponent_->getLocalBounds()
|
||||
: Desktop::getInstance().getMainMonitorArea();
|
||||
}
|
||||
|
||||
void Component::clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect,
|
||||
const int deltaX, const int deltaY) const
|
||||
{
|
||||
for (int i = childComponentList_.size(); --i >= 0;)
|
||||
{
|
||||
const Component* const c = childComponentList_.getUnchecked(i);
|
||||
|
||||
if (c->isVisible())
|
||||
{
|
||||
const Rectangle<int> newClip (clipRect.getIntersection (c->bounds_));
|
||||
|
||||
if (! newClip.isEmpty())
|
||||
{
|
||||
if (c->isOpaque())
|
||||
{
|
||||
g.excludeClipRegion (newClip.translated (deltaX, deltaY));
|
||||
}
|
||||
else
|
||||
{
|
||||
c->clipObscuredRegions (g, newClip.translated (-c->getX(), -c->getY()),
|
||||
c->getX() + deltaX,
|
||||
c->getY() + deltaY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Component::getVisibleArea (RectangleList& result, const bool includeSiblings) const
|
||||
{
|
||||
result.clear();
|
||||
const Rectangle<int> unclipped (CoordinateHelpers::getUnclippedArea (*this));
|
||||
const Rectangle<int> unclipped (ComponentHelpers::getUnclippedArea (*this));
|
||||
|
||||
if (! unclipped.isEmpty())
|
||||
{
|
||||
|
|
@ -1993,45 +2007,15 @@ void Component::getVisibleArea (RectangleList& result, const bool includeSibling
|
|||
{
|
||||
const Component* const c = getTopLevelComponent();
|
||||
|
||||
c->subtractObscuredRegions (result, getLocalPoint (c, Point<int>()),
|
||||
c->getLocalBounds(), this);
|
||||
ComponentHelpers::subtractObscuredRegions (*c, result, getLocalPoint (c, Point<int>()),
|
||||
c->getLocalBounds(), this);
|
||||
}
|
||||
|
||||
subtractObscuredRegions (result, Point<int>(), unclipped, 0);
|
||||
ComponentHelpers::subtractObscuredRegions (*this, result, Point<int>(), unclipped, 0);
|
||||
result.consolidate();
|
||||
}
|
||||
}
|
||||
|
||||
void Component::subtractObscuredRegions (RectangleList& result,
|
||||
const Point<int>& delta,
|
||||
const Rectangle<int>& clipRect,
|
||||
const Component* const compToAvoid) const
|
||||
{
|
||||
for (int i = childComponentList_.size(); --i >= 0;)
|
||||
{
|
||||
const Component* const c = childComponentList_.getUnchecked(i);
|
||||
|
||||
if (c != compToAvoid && c->isVisible())
|
||||
{
|
||||
if (c->isOpaque())
|
||||
{
|
||||
Rectangle<int> childBounds (c->bounds_.getIntersection (clipRect));
|
||||
childBounds.translate (delta.getX(), delta.getY());
|
||||
|
||||
result.subtract (childBounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
Rectangle<int> newClip (clipRect.getIntersection (c->bounds_));
|
||||
newClip.translate (-c->getX(), -c->getY());
|
||||
|
||||
c->subtractObscuredRegions (result, c->getPosition() + delta,
|
||||
newClip, compToAvoid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void Component::mouseEnter (const MouseEvent&)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2006,16 +2006,13 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
#ifndef DOXYGEN
|
||||
/** @internal
|
||||
This method is deprecated - use localPointToGlobal instead. */
|
||||
/** This method is deprecated - use localPointToGlobal instead. */
|
||||
const Point<int> relativePositionToGlobal (const Point<int>& relativePosition) const;
|
||||
|
||||
/** @internal
|
||||
This method is deprecated - use getLocalPoint instead. */
|
||||
/** This method is deprecated - use getLocalPoint instead. */
|
||||
const Point<int> globalPositionToRelative (const Point<int>& screenPosition) const;
|
||||
|
||||
/** @internal
|
||||
This method is deprecated - use getLocalPoint instead. */
|
||||
/** This method is deprecated - use getLocalPoint instead. */
|
||||
const Point<int> relativePositionToOtherComponent (const Component* targetComponent,
|
||||
const Point<int>& positionRelativeToThis) const;
|
||||
#endif
|
||||
|
|
@ -2109,14 +2106,20 @@ private:
|
|||
void grabFocusInternal (const FocusChangeType cause, bool canTryParent = true);
|
||||
static void giveAwayFocus();
|
||||
void sendEnablementChangeMessage();
|
||||
void subtractObscuredRegions (RectangleList& result, const Point<int>& delta,
|
||||
const Rectangle<int>& clipRect, const Component* const compToAvoid) const;
|
||||
void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, int deltaX, int deltaY) const;
|
||||
|
||||
void sendVisibilityChangeMessage();
|
||||
const Rectangle<int> getParentOrMainMonitorBounds() const;
|
||||
|
||||
class ComponentHelpers;
|
||||
friend class ComponentHelpers;
|
||||
|
||||
/* Components aren't allowed to have copy constructors, as this would mess up parent hierarchies.
|
||||
You might need to give your subclasses a private dummy constructor like this one to avoid
|
||||
compiler warnings.
|
||||
*/
|
||||
Component (const Component&);
|
||||
Component& operator= (const Component&);
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This is included here just to cause a compile error if your code is still handling
|
||||
// drag-and-drop with this method. If so, just update it to use the new FileDragAndDropTarget
|
||||
// class, which is easy (just make your class inherit from FileDragAndDropTarget, and
|
||||
|
|
@ -2126,15 +2129,10 @@ private:
|
|||
// This is included here to cause an error if you use or overload it - it has been deprecated in
|
||||
// favour of contains (const Point<int>&)
|
||||
void contains (int, int);
|
||||
|
||||
/* Components aren't allowed to have copy constructors, as this would mess up parent hierarchies.
|
||||
You might need to give your subclasses a private dummy constructor like this one to avoid
|
||||
compiler warnings.
|
||||
*/
|
||||
Component (const Component&);
|
||||
Component& operator= (const Component&);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
virtual void internalRepaint (int x, int y, int w, int h);
|
||||
/** @internal */
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ public:
|
|||
bool mightContainSubItems() { return true; }
|
||||
const String getUniqueName() const { return "keys"; }
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
const ScopedPointer <XmlElement> oldOpenness (owner.tree.getOpennessState (true));
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID,
|
|||
{
|
||||
mappings.getUnchecked(i)->keypresses.insert (insertIndex, newKeyPress);
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID,
|
|||
cm->wantsKeyUpDownCallbacks = (ci->flags & ApplicationCommandInfo::wantsKeyUpDownCallbacks) != 0;
|
||||
|
||||
mappings.add (cm);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ void KeyPressMappingSet::resetToDefaultMappings()
|
|||
}
|
||||
}
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID)
|
||||
|
|
@ -142,7 +142,7 @@ void KeyPressMappingSet::clearAllKeyPresses()
|
|||
{
|
||||
if (mappings.size() > 0)
|
||||
{
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
mappings.clear();
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID)
|
|||
if (mappings.getUnchecked(i)->commandID == commandID)
|
||||
{
|
||||
mappings.remove (i);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress)
|
|||
if (keypress == cm->keypresses [j])
|
||||
{
|
||||
cm->keypresses.remove (j);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ void KeyPressMappingSet::removeKeyPress (const CommandID commandID, const int ke
|
|||
if (mappings.getUnchecked(i)->commandID == commandID)
|
||||
{
|
||||
mappings.getUnchecked(i)->keypresses.remove (keyPressIndex);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ void ComponentAnimator::animateComponent (Component* const component,
|
|||
{
|
||||
at = new AnimationTask (component);
|
||||
tasks.add (at);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
at->reset (finalBounds, finalAlpha, millisecondsToSpendMoving,
|
||||
|
|
@ -284,7 +284,7 @@ void ComponentAnimator::cancelAllAnimations (const bool moveComponentsToTheirFin
|
|||
tasks.getUnchecked(i)->moveToFinalDestination();
|
||||
|
||||
tasks.clear();
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ void ComponentAnimator::cancelAnimation (Component* const component,
|
|||
at->moveToFinalDestination();
|
||||
|
||||
tasks.removeObject (at);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ void ComponentAnimator::timerCallback()
|
|||
if (! tasks.getUnchecked(i)->useTimeslice (elapsed))
|
||||
{
|
||||
tasks.remove (i);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ void TabbedButtonBar::setCurrentTabIndex (int newIndex, const bool sendChangeMes
|
|||
resized();
|
||||
|
||||
if (sendChangeMessage_)
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
|
||||
currentTabChanged (newIndex, getCurrentTabName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3097,8 +3097,8 @@ void LookAndFeel::drawGlassLozenge (Graphics& g,
|
|||
}
|
||||
|
||||
{
|
||||
const float leftIndent = flatOnLeft ? 0.0f : cs * 0.4f;
|
||||
const float rightIndent = flatOnRight ? 0.0f : cs * 0.4f;
|
||||
const float leftIndent = flatOnTop || flatOnLeft ? 0.0f : cs * 0.4f;
|
||||
const float rightIndent = flatOnTop || flatOnRight ? 0.0f : cs * 0.4f;
|
||||
|
||||
Path highlight;
|
||||
LookAndFeelHelpers::createRoundedPath (highlight,
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ public:
|
|||
/** @internal */
|
||||
void refresh();
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
/** @internal */
|
||||
void sliderValueChanged (Slider*);
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ public:
|
|||
resized();
|
||||
}
|
||||
|
||||
void changeListenerCallback (void*)
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
AudioIODevice* const currentDevice = setup.manager->getCurrentAudioDevice();
|
||||
|
||||
|
|
@ -1059,7 +1059,7 @@ void AudioDeviceSelectorComponent::comboBoxChanged (ComboBox* comboBoxThatHasCha
|
|||
}
|
||||
}
|
||||
|
||||
void AudioDeviceSelectorComponent::changeListenerCallback (void*)
|
||||
void AudioDeviceSelectorComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
if (deviceTypeDropDown != 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
/** @internal */
|
||||
void buttonClicked (Button*);
|
||||
/** @internal */
|
||||
void changeListenerCallback (void*);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
/** @internal */
|
||||
void childBoundsChanged (Component*);
|
||||
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ void ColourSelector::update()
|
|||
if ((flags & showColourAtTop) != 0)
|
||||
repaint (previewArea);
|
||||
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -165,10 +165,11 @@ private:
|
|||
ColourSelector (const ColourSelector&);
|
||||
ColourSelector& operator= (const ColourSelector&);
|
||||
|
||||
// this constructor is here temporarily to prevent old code compiling, because the parameters
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
// This constructor is here temporarily to prevent old code compiling, because the parameters
|
||||
// have changed - if you get an error here, update your code to use the new constructor instead..
|
||||
// (xxx - note to self: remember to remove this at some point in the future)
|
||||
ColourSelector (bool);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ void MidiKeyboardComponent::setLowestVisibleKey (int noteNumber)
|
|||
if (noteNumber != firstKey)
|
||||
{
|
||||
firstKey = noteNumber;
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
resized();
|
||||
}
|
||||
}
|
||||
|
|
@ -598,7 +598,7 @@ void MidiKeyboardComponent::resized()
|
|||
if (kx2 - kx1 <= w)
|
||||
{
|
||||
firstKey = rangeStart;
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ void MidiKeyboardComponent::resized()
|
|||
if (lastStartKey >= 0 && firstKey > lastStartKey)
|
||||
{
|
||||
firstKey = jlimit (rangeStart, rangeEnd, lastStartKey);
|
||||
sendChangeMessage (this);
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
int newOffset = 0;
|
||||
|
|
|
|||
|
|
@ -165,6 +165,11 @@ void Graphics::setOrigin (const int newOriginX, const int newOriginY)
|
|||
context->setOrigin (newOriginX, newOriginY);
|
||||
}
|
||||
|
||||
void Graphics::addTransform (const AffineTransform& transform)
|
||||
{
|
||||
context->addTransform (transform);
|
||||
}
|
||||
|
||||
bool Graphics::clipRegionIntersects (const Rectangle<int>& area) const
|
||||
{
|
||||
return context->clipRegionIntersects (area);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue