diff --git a/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp b/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
index d7b53044bb..4a05407d9a 100644
--- a/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
+++ b/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
@@ -1796,10 +1796,6 @@
-
-
-
-
diff --git a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
index 66df3d76ef..fe5039efc3 100644
--- a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
+++ b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
@@ -659,7 +659,6 @@
B8B309972EBB7F07305ACCCA = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_SliderPropertyComponent.h"; path = "../../../../modules/juce_gui_basics/properties/juce_SliderPropertyComponent.h"; sourceTree = "SOURCE_ROOT"; };
B8BEDDA33D5B1613213434F4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MouseCursor.cpp"; path = "../../../../modules/juce_gui_basics/mouse/juce_MouseCursor.cpp"; sourceTree = "SOURCE_ROOT"; };
B92070A7D5952D560DAD32C4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_GZIPCompressorOutputStream.cpp"; path = "../../../../modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp"; sourceTree = "SOURCE_ROOT"; };
- B945EB1DEE6D684E980B7428 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
B9F806910507E82E7BFB15E0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MemoryOutputStream.h"; path = "../../../../modules/juce_core/streams/juce_MemoryOutputStream.h"; sourceTree = "SOURCE_ROOT"; };
BA1E340A922D0D7E543563CF = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_AttributedString.cpp"; path = "../../../../modules/juce_graphics/fonts/juce_AttributedString.cpp"; sourceTree = "SOURCE_ROOT"; };
BA5C7DE347A73A87F687703C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationCommandTarget.h"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1433,7 +1432,6 @@
82395D0DB15E012EDA1AC1FE,
B79595279502C1A11A4E8C36,
E27F0860F27023BAA9798B46,
- B945EB1DEE6D684E980B7428,
F08EB921DB62255A4B6DE85A ); name = geometry; sourceTree = ""; };
14995D34FE0826A52FA5262D = { isa = PBXGroup; children = (
43B98AB307841FAAB076B882,
diff --git a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
index fb4a74457a..01a9296d5d 100644
--- a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
@@ -1946,16 +1946,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
index 17cb6d65b0..7af1eb0260 100644
--- a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
@@ -1946,16 +1946,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
index fede3df737..b170c899c5 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
@@ -541,9 +541,6 @@
true
-
- true
-
true
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
index 8151563b49..9d133f2fd3 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
@@ -772,9 +772,6 @@
Juce Modules\juce_graphics\geometry
-
- Juce Modules\juce_graphics\geometry
-
Juce Modules\juce_graphics\placement
diff --git a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
index c12446a7f3..d49652f12f 100644
--- a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
@@ -547,9 +547,6 @@
true
-
- true
-
true
diff --git a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
index 8151563b49..9d133f2fd3 100644
--- a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
@@ -772,9 +772,6 @@
Juce Modules\juce_graphics\geometry
-
- Juce Modules\juce_graphics\geometry
-
Juce Modules\juce_graphics\placement
diff --git a/extras/Introjucer/JuceLibraryCode/AppConfig.h b/extras/Introjucer/JuceLibraryCode/AppConfig.h
index daf33c2af6..b721cdab16 100644
--- a/extras/Introjucer/JuceLibraryCode/AppConfig.h
+++ b/extras/Introjucer/JuceLibraryCode/AppConfig.h
@@ -49,6 +49,10 @@
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
+#ifndef JUCE_INCLUDE_ZLIB_CODE
+ //#define JUCE_INCLUDE_ZLIB_CODE
+#endif
+
//==============================================================================
// juce_graphics flags:
diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_UtilityFunctions.h b/extras/Introjucer/Source/ComponentEditor/jucer_UtilityFunctions.h
index 1ea46a84a2..6a7c1275a0 100644
--- a/extras/Introjucer/Source/ComponentEditor/jucer_UtilityFunctions.h
+++ b/extras/Introjucer/Source/ComponentEditor/jucer_UtilityFunctions.h
@@ -95,7 +95,7 @@ inline void drawResizableBorder (Graphics& g, int w, int h,
inline void drawMouseOverCorners (Graphics& g, int w, int h)
{
- RectangleList r (Rectangle (0, 0, w, h));
+ RectangleList r (Rectangle (0, 0, w, h));
r.subtract (Rectangle (1, 1, w - 2, h - 2));
const int size = jmin (w / 3, h / 3, 12);
diff --git a/extras/JuceDemo/Builds/Android/jni/Android.mk b/extras/JuceDemo/Builds/Android/jni/Android.mk
index ea6ef151a1..36af02b515 100644
--- a/extras/JuceDemo/Builds/Android/jni/Android.mk
+++ b/extras/JuceDemo/Builds/Android/jni/Android.mk
@@ -5,6 +5,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ARM_MODE := arm
LOCAL_MODULE := juce_jni
LOCAL_SRC_FILES := \
../../../Source/ApplicationStartup.cpp\
diff --git a/extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp b/extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp
index 1362162933..89374069e5 100644
--- a/extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp
+++ b/extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp
@@ -1973,10 +1973,6 @@
-
-
-
-
diff --git a/extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj b/extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
index 6804124021..3a9ebd11bf 100644
--- a/extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
+++ b/extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
@@ -748,7 +748,6 @@
BF2093D486040BEC64210EBB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ColourSelector.h"; path = "../../../../modules/juce_gui_extra/misc/juce_ColourSelector.h"; sourceTree = "SOURCE_ROOT"; };
BF59C96BC3BCB29CCB421861 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_graphics.h"; path = "../../../../modules/juce_graphics/juce_graphics.h"; sourceTree = "SOURCE_ROOT"; };
BF6F272194D16055D6A90D94 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ComponentListener.cpp"; path = "../../../../modules/juce_gui_basics/components/juce_ComponentListener.cpp"; sourceTree = "SOURCE_ROOT"; };
- BF76B8C5007732311AF50543 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
C03AF9257B94504D7270416A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ImagePreviewComponent.h"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h"; sourceTree = "SOURCE_ROOT"; };
C0608375ACE89B422431E9A9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationCommandManager.h"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h"; sourceTree = "SOURCE_ROOT"; };
C069C5FCE1539E9F85C7F29E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FilenameComponent.h"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1556,7 +1555,6 @@
D4DC657E222FE2BDE92EC58E,
33A84E7FDD64568649CC89BF,
1089C7A1FF43033FDA63F711,
- BF76B8C5007732311AF50543,
38E0255E6BB9600DEECD39F8 ); name = geometry; sourceTree = ""; };
BB4F117CD3A2EA9CE8390AD0 = { isa = PBXGroup; children = (
DF47E8197FF5A9309C062C61,
diff --git a/extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj b/extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
index e472ac2732..928df05ac1 100644
--- a/extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
+++ b/extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
@@ -2576,16 +2576,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj b/extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
index cb5d36c310..b4bab6709d 100644
--- a/extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
+++ b/extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
@@ -2576,16 +2576,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj b/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
index f30e5f379b..18242c2fb9 100644
--- a/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
+++ b/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
@@ -719,9 +719,6 @@
true
-
- true
-
true
diff --git a/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters b/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
index f28fafcefb..b0780817b9 100644
--- a/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
+++ b/extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
@@ -976,9 +976,6 @@
Juce Modules\juce_graphics\geometry
-
- Juce Modules\juce_graphics\geometry
-
Juce Modules\juce_graphics\placement
diff --git a/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj b/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj
index 028d0fb671..d0641fc6c0 100644
--- a/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj
+++ b/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj
@@ -725,9 +725,6 @@
true
-
- true
-
true
diff --git a/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters b/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters
index f28fafcefb..b0780817b9 100644
--- a/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters
+++ b/extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters
@@ -976,9 +976,6 @@
Juce Modules\juce_graphics\geometry
-
- Juce Modules\juce_graphics\geometry
-
Juce Modules\juce_graphics\placement
diff --git a/extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj b/extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
index 581b83f936..0572545646 100644
--- a/extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
+++ b/extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
@@ -740,7 +740,6 @@
BF2093D486040BEC64210EBB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ColourSelector.h"; path = "../../../../modules/juce_gui_extra/misc/juce_ColourSelector.h"; sourceTree = "SOURCE_ROOT"; };
BF59C96BC3BCB29CCB421861 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_graphics.h"; path = "../../../../modules/juce_graphics/juce_graphics.h"; sourceTree = "SOURCE_ROOT"; };
BF6F272194D16055D6A90D94 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ComponentListener.cpp"; path = "../../../../modules/juce_gui_basics/components/juce_ComponentListener.cpp"; sourceTree = "SOURCE_ROOT"; };
- BF76B8C5007732311AF50543 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
C03AF9257B94504D7270416A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ImagePreviewComponent.h"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h"; sourceTree = "SOURCE_ROOT"; };
C0608375ACE89B422431E9A9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationCommandManager.h"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h"; sourceTree = "SOURCE_ROOT"; };
C069C5FCE1539E9F85C7F29E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FilenameComponent.h"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1546,7 +1545,6 @@
D4DC657E222FE2BDE92EC58E,
33A84E7FDD64568649CC89BF,
1089C7A1FF43033FDA63F711,
- BF76B8C5007732311AF50543,
38E0255E6BB9600DEECD39F8 ); name = geometry; sourceTree = ""; };
BB4F117CD3A2EA9CE8390AD0 = { isa = PBXGroup; children = (
DF47E8197FF5A9309C062C61,
diff --git a/extras/audio plugin demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj b/extras/audio plugin demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj
index 7f3e5c225b..c4c609062a 100644
--- a/extras/audio plugin demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj
+++ b/extras/audio plugin demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj
@@ -432,7 +432,6 @@
6A3C840E1B6CD34CA8C8DB4B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_GroupComponent.h"; path = "../../../../modules/juce_gui_basics/layout/juce_GroupComponent.h"; sourceTree = "SOURCE_ROOT"; };
6A593B7ADFAC09D547EA809D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = AUCarbonViewBase.cpp; path = Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp; sourceTree = "DEVELOPER_DIR"; };
6AAAA6BD093B9CCD11BC26EC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ListenerList.h"; path = "../../../../modules/juce_events/broadcasters/juce_ListenerList.h"; sourceTree = "SOURCE_ROOT"; };
- 6AB37A1375F5973557FB034E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
6B5564F5E6A5B70B890C146D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_WindowsMediaAudioFormat.h"; path = "../../../../modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h"; sourceTree = "SOURCE_ROOT"; };
6C4AD1B0CA254C16E38609DD = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TextEditorKeyMapper.h"; path = "../../../../modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h"; sourceTree = "SOURCE_ROOT"; };
6C5452492262FE01944BE60C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TableHeaderComponent.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1519,7 +1518,6 @@
42458330B018CCF81D0931CA,
4514B5F7DBC9B5A3E014C4CA,
5EE4BB25075E3ACDCFCE14D2,
- 6AB37A1375F5973557FB034E,
A1A74C33F871DF7D5E3C4B65 ); name = geometry; sourceTree = ""; };
81AE068FB11A7B2265764318 = { isa = PBXGroup; children = (
53ADE0EF49550FB565B3A0A5,
diff --git a/extras/audio plugin demo/Builds/VisualStudio2005/JuceDemoPlugin.vcproj b/extras/audio plugin demo/Builds/VisualStudio2005/JuceDemoPlugin.vcproj
index 651754afd5..813655fd13 100644
--- a/extras/audio plugin demo/Builds/VisualStudio2005/JuceDemoPlugin.vcproj
+++ b/extras/audio plugin demo/Builds/VisualStudio2005/JuceDemoPlugin.vcproj
@@ -2456,16 +2456,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/audio plugin demo/Builds/VisualStudio2008/JuceDemoPlugin.vcproj b/extras/audio plugin demo/Builds/VisualStudio2008/JuceDemoPlugin.vcproj
index 40c9d4e2de..4e90fdcb54 100644
--- a/extras/audio plugin demo/Builds/VisualStudio2008/JuceDemoPlugin.vcproj
+++ b/extras/audio plugin demo/Builds/VisualStudio2008/JuceDemoPlugin.vcproj
@@ -2456,16 +2456,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/audio plugin demo/JuceLibraryCode/AppConfig.h b/extras/audio plugin demo/JuceLibraryCode/AppConfig.h
index a730927ea9..a2fc3d9dcb 100644
--- a/extras/audio plugin demo/JuceLibraryCode/AppConfig.h
+++ b/extras/audio plugin demo/JuceLibraryCode/AppConfig.h
@@ -123,6 +123,10 @@
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
+#ifndef JUCE_INCLUDE_ZLIB_CODE
+ //#define JUCE_INCLUDE_ZLIB_CODE
+#endif
+
//==============================================================================
// juce_graphics flags:
diff --git a/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj b/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj
index 35af73faa6..b9e62f790c 100644
--- a/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj
+++ b/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj
@@ -777,7 +777,6 @@
DD53156BA824889FD7DF52D2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ThreadPool.cpp"; path = "../../../../modules/juce_core/threads/juce_ThreadPool.cpp"; sourceTree = "SOURCE_ROOT"; };
DD8E5D0C88FA2C287F824357 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GraphEditorPanel.h; path = ../../Source/GraphEditorPanel.h; sourceTree = "SOURCE_ROOT"; };
DE0C4CC1CE545BAD009786E4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_AudioFormatWriter.cpp"; path = "../../../../modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp"; sourceTree = "SOURCE_ROOT"; };
- DE8035865F6033F8BBF41740 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_HyperlinkButton.cpp"; path = "../../../../modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp"; sourceTree = "SOURCE_ROOT"; };
E146C1CCDC8EA0498CD33E5D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_AudioIODevice.cpp"; path = "../../../../modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp"; sourceTree = "SOURCE_ROOT"; };
E179C9C99270068D4ED16872 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ReverbAudioSource.h"; path = "../../../../modules/juce_audio_basics/sources/juce_ReverbAudioSource.h"; sourceTree = "SOURCE_ROOT"; };
E68018DE199135B7F738FB17 = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioKit.framework; path = System/Library/Frameworks/CoreAudioKit.framework; sourceTree = SDKROOT; };
@@ -800,6 +799,7 @@
DE0712F13AD6AB6180E2E680 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_FileSearchPathListComponent.cpp"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
DE1FE14BE1B14A214C2D8B66 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_WildcardFileFilter.cpp"; path = "../../../../modules/juce_gui_basics/filebrowser/juce_WildcardFileFilter.cpp"; sourceTree = "SOURCE_ROOT"; };
DE435BB18276B8626AF37D05 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ScopedValueSetter.h"; path = "../../../../modules/juce_core/containers/juce_ScopedValueSetter.h"; sourceTree = "SOURCE_ROOT"; };
+ DE8035865F6033F8BBF41740 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_HyperlinkButton.cpp"; path = "../../../../modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp"; sourceTree = "SOURCE_ROOT"; };
DEEFCE87BE3B9D7AFC7ADC16 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ApplicationCommandInfo.cpp"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp"; sourceTree = "SOURCE_ROOT"; };
DF309886A3D26FC34280B329 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_CameraDevice.mm"; path = "../../../../modules/juce_video/native/juce_mac_CameraDevice.mm"; sourceTree = "SOURCE_ROOT"; };
DF614EDBEA2D76889E002465 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_SystemTrayIcon.cpp"; path = "../../../../modules/juce_gui_extra/native/juce_linux_SystemTrayIcon.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -831,7 +831,6 @@
E5FEEAA0CF737C7F947FD9DD = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Desktop.h"; path = "../../../../modules/juce_gui_basics/components/juce_Desktop.h"; sourceTree = "SOURCE_ROOT"; };
E64782A3957A60231A396D3D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_Windowing.mm"; path = "../../../../modules/juce_gui_basics/native/juce_ios_Windowing.mm"; sourceTree = "SOURCE_ROOT"; };
E66AB26776DD0039834DBC76 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_CustomTypeface.h"; path = "../../../../modules/juce_graphics/fonts/juce_CustomTypeface.h"; sourceTree = "SOURCE_ROOT"; };
- E682272A2E1A3947D3A9E452 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
E6E9A8E11791B4B4D6B3E6D4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_UndoManager.cpp"; path = "../../../../modules/juce_data_structures/undomanager/juce_UndoManager.cpp"; sourceTree = "SOURCE_ROOT"; };
E6EDE8F1BBF28362AC9E1F28 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ScopedPointer.h"; path = "../../../../modules/juce_core/memory/juce_ScopedPointer.h"; sourceTree = "SOURCE_ROOT"; };
E7734E1F585ACB33420E44B4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_DirectSound.cpp"; path = "../../../../modules/juce_audio_devices/native/juce_win32_DirectSound.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -1477,7 +1476,6 @@
3287ECA0DE90C0BCF3CAE6C2,
15FBAE360A9B69D6DB38FF22,
E7F0E3EF611F21E0B80C7216,
- E682272A2E1A3947D3A9E452,
BC12698889AAD84B83FA7A21 ); name = geometry; sourceTree = ""; };
9F3AAF568F1D887C6A73CC41 = { isa = PBXGroup; children = (
FBD139239758935DC4B678F1,
diff --git a/extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj b/extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj
index cb7d1f7134..eade3b4e20 100644
--- a/extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj
+++ b/extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj
@@ -2499,16 +2499,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj b/extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj
index 245e1a455b..37c70301d4 100644
--- a/extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj
+++ b/extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj
@@ -2499,16 +2499,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/audio plugin host/JuceLibraryCode/AppConfig.h b/extras/audio plugin host/JuceLibraryCode/AppConfig.h
index 3b4e7b4f20..73ca353d87 100644
--- a/extras/audio plugin host/JuceLibraryCode/AppConfig.h
+++ b/extras/audio plugin host/JuceLibraryCode/AppConfig.h
@@ -125,6 +125,10 @@
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
+#ifndef JUCE_INCLUDE_ZLIB_CODE
+ //#define JUCE_INCLUDE_ZLIB_CODE
+#endif
+
//==============================================================================
// juce_graphics flags:
diff --git a/extras/binarybuilder/JuceLibraryCode/AppConfig.h b/extras/binarybuilder/JuceLibraryCode/AppConfig.h
index 468554b3be..b7a86d2636 100644
--- a/extras/binarybuilder/JuceLibraryCode/AppConfig.h
+++ b/extras/binarybuilder/JuceLibraryCode/AppConfig.h
@@ -43,5 +43,9 @@
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
+#ifndef JUCE_INCLUDE_ZLIB_CODE
+ //#define JUCE_INCLUDE_ZLIB_CODE
+#endif
+
#endif // __JUCE_APPCONFIG_3T6YQETY1__
diff --git a/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj b/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj
index 6e54ef7796..8d576e63f8 100644
--- a/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj
+++ b/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj
@@ -211,7 +211,6 @@
4A20547D0C763ABB1DE5A9C4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Slider.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_Slider.h"; sourceTree = "SOURCE_ROOT"; };
4A5ED88CC2ED6ADD8A5B102A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Result.h"; path = "../../../../modules/juce_core/misc/juce_Result.h"; sourceTree = "SOURCE_ROOT"; };
4A8C64BB96FB93919DDF2166 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../../../modules/juce_events/native/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; };
- 4BCEEF3FC9849208FF6B1BD7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
4C34CB4DC542D86A193C055A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_RenderingHelpers.h"; path = "../../../../modules/juce_graphics/native/juce_RenderingHelpers.h"; sourceTree = "SOURCE_ROOT"; };
4CC331BEE18B3EC4BADF38CE = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Colours.h"; path = "../../../../modules/juce_graphics/colour/juce_Colours.h"; sourceTree = "SOURCE_ROOT"; };
4D44E9AD19469774ED8245B2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_CodeEditorComponent.cpp"; path = "../../../../modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -987,7 +986,6 @@
6889EF825EA839830C733D07,
3B51C055A70A99CDCEDFA399,
189CC2967B6148BE990281E8,
- 4BCEEF3FC9849208FF6B1BD7,
9EF2F14290768DC26DBA6149 ); name = geometry; sourceTree = ""; };
C8E76BBA092B9546D62BFFE4 = { isa = PBXGroup; children = (
79E7E37683CACE292A596CEA,
diff --git a/extras/example projects/Builds/VisualStudio2005/HelloWorld.vcproj b/extras/example projects/Builds/VisualStudio2005/HelloWorld.vcproj
index f05d6f2a33..02a3090036 100644
--- a/extras/example projects/Builds/VisualStudio2005/HelloWorld.vcproj
+++ b/extras/example projects/Builds/VisualStudio2005/HelloWorld.vcproj
@@ -1482,16 +1482,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/example projects/Builds/VisualStudio2008/HelloWorld.vcproj b/extras/example projects/Builds/VisualStudio2008/HelloWorld.vcproj
index 7af9221a07..df27f33c65 100644
--- a/extras/example projects/Builds/VisualStudio2008/HelloWorld.vcproj
+++ b/extras/example projects/Builds/VisualStudio2008/HelloWorld.vcproj
@@ -1482,16 +1482,6 @@
-
-
-
-
-
-
-
-
diff --git a/extras/example projects/Builds/iOS/HelloWorld.xcodeproj/project.pbxproj b/extras/example projects/Builds/iOS/HelloWorld.xcodeproj/project.pbxproj
index da7d19de15..942c7aeb42 100644
--- a/extras/example projects/Builds/iOS/HelloWorld.xcodeproj/project.pbxproj
+++ b/extras/example projects/Builds/iOS/HelloWorld.xcodeproj/project.pbxproj
@@ -209,7 +209,6 @@
4A20547D0C763ABB1DE5A9C4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Slider.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_Slider.h"; sourceTree = "SOURCE_ROOT"; };
4A5ED88CC2ED6ADD8A5B102A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Result.h"; path = "../../../../modules/juce_core/misc/juce_Result.h"; sourceTree = "SOURCE_ROOT"; };
4A8C64BB96FB93919DDF2166 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../../../modules/juce_events/native/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; };
- 4BCEEF3FC9849208FF6B1BD7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectangleList.cpp"; path = "../../../../modules/juce_graphics/geometry/juce_RectangleList.cpp"; sourceTree = "SOURCE_ROOT"; };
4C34CB4DC542D86A193C055A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_RenderingHelpers.h"; path = "../../../../modules/juce_graphics/native/juce_RenderingHelpers.h"; sourceTree = "SOURCE_ROOT"; };
4CC331BEE18B3EC4BADF38CE = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Colours.h"; path = "../../../../modules/juce_graphics/colour/juce_Colours.h"; sourceTree = "SOURCE_ROOT"; };
4D44E9AD19469774ED8245B2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_CodeEditorComponent.cpp"; path = "../../../../modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -985,7 +984,6 @@
6889EF825EA839830C733D07,
3B51C055A70A99CDCEDFA399,
189CC2967B6148BE990281E8,
- 4BCEEF3FC9849208FF6B1BD7,
9EF2F14290768DC26DBA6149 ); name = geometry; sourceTree = ""; };
C8E76BBA092B9546D62BFFE4 = { isa = PBXGroup; children = (
79E7E37683CACE292A596CEA,
diff --git a/extras/example projects/JuceLibraryCode/AppConfig.h b/extras/example projects/JuceLibraryCode/AppConfig.h
index 6c9f205a49..a9bf7747ec 100644
--- a/extras/example projects/JuceLibraryCode/AppConfig.h
+++ b/extras/example projects/JuceLibraryCode/AppConfig.h
@@ -48,6 +48,10 @@
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
+#ifndef JUCE_INCLUDE_ZLIB_CODE
+ //#define JUCE_INCLUDE_ZLIB_CODE
+#endif
+
//==============================================================================
// juce_graphics flags:
diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
index 18ae842d22..387c130bf7 100644
--- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
+++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
@@ -932,7 +932,7 @@ public:
r.size.width = component.getWidth();
r.size.height = component.getHeight();
[[view superview] setFrame: r];
- [view setFrame: NSMakeRect (0, 0, component.getWidth(), component.getHeight())];
+ [view setFrame: makeNSRect (component.getLocalBounds())];
[view setNeedsDisplay: YES];
}
@@ -961,7 +961,7 @@ public:
static NSView* createViewFor (AudioProcessor* filter, JuceAU* au, AudioProcessorEditor* const editor)
{
EditorCompHolder* editorCompHolder = new EditorCompHolder (editor);
- NSRect r = NSMakeRect (0, 0, editorCompHolder->getWidth(), editorCompHolder->getHeight());
+ NSRect r = makeNSRect (editorCompHolder->getLocalBounds());
static JuceUIViewClass cls;
NSView* view = [[cls.createInstance() initWithFrame: r] autorelease];
@@ -999,7 +999,7 @@ public:
r.size.width = editor->getWidth();
r.size.height = editor->getHeight();
[[view superview] setFrame: r];
- [view setFrame: NSMakeRect (0, 0, editor->getWidth(), editor->getHeight())];
+ [view setFrame: makeNSRect (editor->getLocalBounds())];
[view setNeedsDisplay: YES];
}
}
diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h
index aa0a2be087..0083114217 100644
--- a/modules/juce_core/native/juce_osx_ObjCHelpers.h
+++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h
@@ -55,6 +55,15 @@ namespace
{
return [NSString string];
}
+
+ template
+ static NSRect makeNSRect (const RectangleType& r) noexcept
+ {
+ return NSMakeRect (static_cast (r.getX()),
+ static_cast (r.getY()),
+ static_cast (r.getWidth()),
+ static_cast (r.getHeight()));
+ }
}
//==============================================================================
diff --git a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp
index 625958cca1..9c3d248bcd 100644
--- a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp
+++ b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp
@@ -85,7 +85,7 @@ bool Graphics::reduceClipRegion (const int x, const int y, const int w, const in
return reduceClipRegion (Rectangle (x, y, w, h));
}
-bool Graphics::reduceClipRegion (const RectangleList& clipRegion)
+bool Graphics::reduceClipRegion (const RectangleList& clipRegion)
{
saveStateIfPending();
return context.clipToRectangleList (clipRegion);
diff --git a/modules/juce_graphics/contexts/juce_GraphicsContext.h b/modules/juce_graphics/contexts/juce_GraphicsContext.h
index 77fb9e6d9f..54e0c5e8e9 100644
--- a/modules/juce_graphics/contexts/juce_GraphicsContext.h
+++ b/modules/juce_graphics/contexts/juce_GraphicsContext.h
@@ -26,7 +26,7 @@
#define JUCE_GRAPHICSCONTEXT_H_INCLUDED
#include "../fonts/juce_Font.h"
-#include "../geometry/juce_Rectangle.h"
+#include "../geometry/juce_RectangleList.h"
#include "../geometry/juce_PathStrokeType.h"
#include "../geometry/juce_Line.h"
#include "../colour/juce_Colours.h"
@@ -35,7 +35,6 @@
class LowLevelGraphicsContext;
class Image;
class FillType;
-class RectangleList;
//==============================================================================
@@ -597,7 +596,7 @@ public:
@returns true if the resulting clipping region is non-zero in size
@see setOrigin, clipRegionIntersects
*/
- bool reduceClipRegion (const RectangleList& clipRegion);
+ bool reduceClipRegion (const RectangleList& clipRegion);
/** Intersects the current clipping region with a path.
diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h
index 0a5dfd3d54..c82c19731f 100644
--- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h
+++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h
@@ -71,7 +71,7 @@ public:
virtual float getTargetDeviceScaleFactor() { return 1.0f; }
virtual bool clipToRectangle (const Rectangle&) = 0;
- virtual bool clipToRectangleList (const RectangleList&) = 0;
+ virtual bool clipToRectangleList (const RectangleList&) = 0;
virtual void excludeClipRectangle (const Rectangle&) = 0;
virtual void clipToPath (const Path&, const AffineTransform&) = 0;
virtual void clipToImageAlpha (const Image&, const AffineTransform&) = 0;
diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp
index faac3f7fb1..fb0be4ff47 100644
--- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp
+++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp
@@ -117,7 +117,7 @@ bool LowLevelGraphicsPostScriptRenderer::clipToRectangle (const Rectangle&
return stateStack.getLast()->clip.clipTo (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset));
}
-bool LowLevelGraphicsPostScriptRenderer::clipToRectangleList (const RectangleList& clipRegion)
+bool LowLevelGraphicsPostScriptRenderer::clipToRectangleList (const RectangleList& clipRegion)
{
needToClip = true;
return stateStack.getLast()->clip.clipTo (clipRegion);
@@ -470,7 +470,7 @@ void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, co
writeTransform (transform.translated ((float) stateStack.getLast()->xOffset, (float) stateStack.getLast()->yOffset)
.scaled (1.0f, -1.0f));
- RectangleList imageClip;
+ RectangleList imageClip;
sourceImage.createSolidAreaMask (imageClip, 0.5f);
out << "newpath ";
diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h
index e09e84d6b3..d46760a3ef 100644
--- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h
+++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h
@@ -52,7 +52,7 @@ public:
float getScaleFactor() override;
bool clipToRectangle (const Rectangle&) override;
- bool clipToRectangleList (const RectangleList&) override;
+ bool clipToRectangleList (const RectangleList&) override;
void excludeClipRectangle (const Rectangle&) override;
void clipToPath (const Path&, const AffineTransform&) override;
void clipToImageAlpha (const Image&, const AffineTransform&) override;
@@ -100,7 +100,7 @@ protected:
SavedState();
~SavedState();
- RectangleList clip;
+ RectangleList clip;
int xOffset, yOffset;
FillType fillType;
Font font;
diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp
index 09d6d81a01..213f7def49 100644
--- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp
+++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp
@@ -28,7 +28,7 @@ LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image&
}
LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image& image, Point origin,
- const RectangleList& initialClip)
+ const RectangleList& initialClip)
: savedState (new RenderingHelpers::SoftwareRendererSavedState (image, initialClip, origin.x, origin.y))
{
}
@@ -45,9 +45,9 @@ float LowLevelGraphicsSoftwareRenderer::getScaleFactor()
Rectangle LowLevelGraphicsSoftwareRenderer::getClipBounds() const { return savedState->getClipBounds(); }
bool LowLevelGraphicsSoftwareRenderer::isClipEmpty() const { return savedState->clip == nullptr; }
-bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) { return savedState->clipToRectangle (r); }
-bool LowLevelGraphicsSoftwareRenderer::clipToRectangleList (const RectangleList& r) { return savedState->clipToRectangleList (r); }
-void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) { savedState->excludeClipRectangle (r); }
+bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) { return savedState->clipToRectangle (r); }
+bool LowLevelGraphicsSoftwareRenderer::clipToRectangleList (const RectangleList& r) { return savedState->clipToRectangleList (r); }
+void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) { savedState->excludeClipRectangle (r); }
void LowLevelGraphicsSoftwareRenderer::clipToPath (const Path& path, const AffineTransform& transform)
{
diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h
index 5378e57277..c6424b6c49 100644
--- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h
+++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h
@@ -42,7 +42,7 @@ public:
//==============================================================================
LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOnto);
LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOnto, Point origin,
- const RectangleList& initialClip);
+ const RectangleList& initialClip);
~LowLevelGraphicsSoftwareRenderer();
bool isVectorDevice() const override;
@@ -50,7 +50,7 @@ public:
void addTransform (const AffineTransform&) override;
float getScaleFactor() override;
bool clipToRectangle (const Rectangle&) override;
- bool clipToRectangleList (const RectangleList&) override;
+ bool clipToRectangleList (const RectangleList&) override;
void excludeClipRectangle (const Rectangle&) override;
void clipToPath (const Path&, const AffineTransform&) override;
void clipToImageAlpha (const Image&, const AffineTransform&) override;
diff --git a/modules/juce_graphics/geometry/juce_EdgeTable.cpp b/modules/juce_graphics/geometry/juce_EdgeTable.cpp
index 0f697c9a9c..5ed84796ff 100644
--- a/modules/juce_graphics/geometry/juce_EdgeTable.cpp
+++ b/modules/juce_graphics/geometry/juce_EdgeTable.cpp
@@ -124,7 +124,7 @@ EdgeTable::EdgeTable (const Rectangle& rectangleToAdd)
}
}
-EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd)
+EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd)
: bounds (rectanglesToAdd.getBounds()),
maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine),
lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1),
diff --git a/modules/juce_graphics/geometry/juce_EdgeTable.h b/modules/juce_graphics/geometry/juce_EdgeTable.h
index bcf6af5e7d..0b479b64b8 100644
--- a/modules/juce_graphics/geometry/juce_EdgeTable.h
+++ b/modules/juce_graphics/geometry/juce_EdgeTable.h
@@ -59,7 +59,7 @@ public:
explicit EdgeTable (const Rectangle& rectangleToAdd);
/** Creates an edge table containing a rectangle list. */
- explicit EdgeTable (const RectangleList& rectanglesToAdd);
+ explicit EdgeTable (const RectangleList& rectanglesToAdd);
/** Creates an edge table containing a rectangle. */
explicit EdgeTable (const Rectangle& rectangleToAdd);
diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h
index 2ebaf4979b..c9bda49a69 100644
--- a/modules/juce_graphics/geometry/juce_Rectangle.h
+++ b/modules/juce_graphics/geometry/juce_Rectangle.h
@@ -26,7 +26,6 @@
#define JUCE_RECTANGLE_H_INCLUDED
#include "juce_Point.h"
-class RectangleList;
//==============================================================================
@@ -809,15 +808,15 @@ public:
JUCE_DEPRECATED_WITH_BODY (Rectangle transformed (const AffineTransform& t) const noexcept, { return transformedBy (t); })
private:
- friend class RectangleList;
+ template friend class Rectangle;
+ template friend class RectangleList;
+
Point pos;
ValueType w, h;
static int parseIntAfterSpace (const String& s) noexcept
{ return s.getCharPointer().findEndOfWhitespace().getIntValue32(); }
- template friend class Rectangle;
-
void copyWithRounding (Rectangle& result) const noexcept { result = getSmallestIntegerContainer(); }
void copyWithRounding (Rectangle& result) const noexcept { result = toFloat(); }
void copyWithRounding (Rectangle& result) const noexcept { result = toDouble(); }
diff --git a/modules/juce_graphics/geometry/juce_RectangleList.cpp b/modules/juce_graphics/geometry/juce_RectangleList.cpp
deleted file mode 100644
index f9b99b60ed..0000000000
--- a/modules/juce_graphics/geometry/juce_RectangleList.cpp
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- ==============================================================================
-
- This file is part of the JUCE library.
- Copyright (c) 2013 - Raw Material Software Ltd.
-
- Permission is granted to use this software under the terms of either:
- a) the GPL v2 (or any later version)
- b) the Affero GPL v3
-
- Details of these licenses can be found 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.juce.com for more information.
-
- ==============================================================================
-*/
-
-RectangleList::RectangleList() noexcept
-{
-}
-
-RectangleList::RectangleList (const Rectangle& rect)
-{
- addWithoutMerging (rect);
-}
-
-RectangleList::RectangleList (const RectangleList& other)
- : rects (other.rects)
-{
-}
-
-RectangleList& RectangleList::operator= (const RectangleList& other)
-{
- rects = other.rects;
- return *this;
-}
-
-#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
-RectangleList::RectangleList (RectangleList&& other) noexcept
- : rects (static_cast >&&> (other.rects))
-{
-}
-
-RectangleList& RectangleList::operator= (RectangleList&& other) noexcept
-{
- rects = static_cast >&&> (other.rects);
- return *this;
-}
-#endif
-
-RectangleList::~RectangleList()
-{
-}
-
-//==============================================================================
-void RectangleList::clear()
-{
- rects.clearQuick();
-}
-
-Rectangle RectangleList::getRectangle (const int index) const noexcept
-{
- if (isPositiveAndBelow (index, rects.size()))
- return rects.getReference (index);
-
- return Rectangle();
-}
-
-bool RectangleList::isEmpty() const noexcept
-{
- return rects.size() == 0;
-}
-
-//==============================================================================
-RectangleList::Iterator::Iterator (const RectangleList& list) noexcept
- : current (nullptr),
- owner (list),
- index (list.rects.size())
-{
-}
-
-RectangleList::Iterator::~Iterator()
-{
-}
-
-bool RectangleList::Iterator::next() noexcept
-{
- if (--index >= 0)
- {
- current = &(owner.rects.getReference (index));
- return true;
- }
-
- return false;
-}
-
-
-//==============================================================================
-void RectangleList::add (const Rectangle& rect)
-{
- if (! rect.isEmpty())
- {
- if (rects.size() == 0)
- {
- rects.add (rect);
- }
- else
- {
- bool anyOverlaps = false;
-
- for (int j = rects.size(); --j >= 0;)
- {
- Rectangle& ourRect = rects.getReference (j);
-
- if (rect.intersects (ourRect))
- {
- if (rect.contains (ourRect))
- rects.remove (j);
- else if (! ourRect.reduceIfPartlyContainedIn (rect))
- anyOverlaps = true;
- }
- }
-
- if (anyOverlaps && rects.size() > 0)
- {
- RectangleList r (rect);
-
- for (int i = rects.size(); --i >= 0;)
- {
- const Rectangle& ourRect = rects.getReference (i);
-
- if (rect.intersects (ourRect))
- {
- r.subtract (ourRect);
-
- if (r.rects.size() == 0)
- return;
- }
- }
-
- rects.addArray (r.rects);
- }
- else
- {
- rects.add (rect);
- }
- }
- }
-}
-
-void RectangleList::addWithoutMerging (const Rectangle& rect)
-{
- if (! rect.isEmpty())
- rects.add (rect);
-}
-
-void RectangleList::add (const int x, const int y, const int w, const int h)
-{
- add (Rectangle (x, y, w, h));
-}
-
-void RectangleList::add (const RectangleList& other)
-{
- for (const Rectangle* r = other.begin(), * const e = other.end(); r != e; ++r)
- add (*r);
-}
-
-void RectangleList::subtract (const Rectangle& rect)
-{
- const int originalNumRects = rects.size();
-
- if (originalNumRects > 0)
- {
- const int x1 = rect.pos.x;
- const int y1 = rect.pos.y;
- const int x2 = x1 + rect.w;
- const int y2 = y1 + rect.h;
-
- for (int i = getNumRectangles(); --i >= 0;)
- {
- Rectangle& r = rects.getReference (i);
-
- const int rx1 = r.pos.x;
- const int ry1 = r.pos.y;
- const int rx2 = rx1 + r.w;
- const int ry2 = ry1 + r.h;
-
- if (! (x2 <= rx1 || x1 >= rx2 || y2 <= ry1 || y1 >= ry2))
- {
- if (x1 > rx1 && x1 < rx2)
- {
- if (y1 <= ry1 && y2 >= ry2 && x2 >= rx2)
- {
- r.w = x1 - rx1;
- }
- else
- {
- r.pos.x = x1;
- r.w = rx2 - x1;
-
- rects.insert (++i, Rectangle (rx1, ry1, x1 - rx1, ry2 - ry1));
- ++i;
- }
- }
- else if (x2 > rx1 && x2 < rx2)
- {
- r.pos.x = x2;
- r.w = rx2 - x2;
-
- if (y1 > ry1 || y2 < ry2 || x1 > rx1)
- {
- rects.insert (++i, Rectangle (rx1, ry1, x2 - rx1, ry2 - ry1));
- ++i;
- }
- }
- else if (y1 > ry1 && y1 < ry2)
- {
- if (x1 <= rx1 && x2 >= rx2 && y2 >= ry2)
- {
- r.h = y1 - ry1;
- }
- else
- {
- r.pos.y = y1;
- r.h = ry2 - y1;
-
- rects.insert (++i, Rectangle (rx1, ry1, rx2 - rx1, y1 - ry1));
- ++i;
- }
- }
- else if (y2 > ry1 && y2 < ry2)
- {
- r.pos.y = y2;
- r.h = ry2 - y2;
-
- if (x1 > rx1 || x2 < rx2 || y1 > ry1)
- {
- rects.insert (++i, Rectangle (rx1, ry1, rx2 - rx1, y2 - ry1));
- ++i;
- }
- }
- else
- {
- rects.remove (i);
- }
- }
- }
- }
-}
-
-bool RectangleList::subtract (const RectangleList& otherList)
-{
- for (int i = otherList.rects.size(); --i >= 0 && rects.size() > 0;)
- subtract (otherList.rects.getReference (i));
-
- return rects.size() > 0;
-}
-
-bool RectangleList::clipTo (const Rectangle& rect)
-{
- bool notEmpty = false;
-
- if (rect.isEmpty())
- {
- clear();
- }
- else
- {
- for (int i = rects.size(); --i >= 0;)
- {
- Rectangle& r = rects.getReference (i);
-
- if (! rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
- rects.remove (i);
- else
- notEmpty = true;
- }
- }
-
- return notEmpty;
-}
-
-bool RectangleList::clipTo (const RectangleList& other)
-{
- if (rects.size() == 0)
- return false;
-
- RectangleList result;
-
- for (int j = 0; j < rects.size(); ++j)
- {
- const Rectangle& rect = rects.getReference (j);
-
- for (int i = other.rects.size(); --i >= 0;)
- {
- Rectangle r (other.rects.getReference (i));
-
- if (rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
- result.rects.add (r);
- }
- }
-
- swapWith (result);
-
- return ! isEmpty();
-}
-
-bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const
-{
- destRegion.clear();
-
- if (! rect.isEmpty())
- {
- for (int i = rects.size(); --i >= 0;)
- {
- Rectangle r (rects.getReference (i));
-
- if (rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
- destRegion.rects.add (r);
- }
- }
-
- return destRegion.rects.size() > 0;
-}
-
-void RectangleList::swapWith (RectangleList& otherList) noexcept
-{
- rects.swapWith (otherList.rects);
-}
-
-
-//==============================================================================
-void RectangleList::consolidate()
-{
- for (int i = 0; i < getNumRectangles() - 1; ++i)
- {
- Rectangle& r = rects.getReference (i);
- const int rx1 = r.pos.x;
- const int ry1 = r.pos.y;
- const int rx2 = rx1 + r.w;
- const int ry2 = ry1 + r.h;
-
- for (int j = rects.size(); --j > i;)
- {
- Rectangle& r2 = rects.getReference (j);
- const int jrx1 = r2.pos.x;
- const int jry1 = r2.pos.y;
- const int jrx2 = jrx1 + r2.w;
- const int jry2 = jry1 + r2.h;
-
- // if the vertical edges of any blocks are touching and their horizontals don't
- // line up, split them horizontally..
- if (jrx1 == rx2 || jrx2 == rx1)
- {
- if (jry1 > ry1 && jry1 < ry2)
- {
- r.h = jry1 - ry1;
- rects.add (Rectangle (rx1, jry1, rx2 - rx1, ry2 - jry1));
- i = -1;
- break;
- }
-
- if (jry2 > ry1 && jry2 < ry2)
- {
- r.h = jry2 - ry1;
- rects.add (Rectangle (rx1, jry2, rx2 - rx1, ry2 - jry2));
- i = -1;
- break;
- }
- else if (ry1 > jry1 && ry1 < jry2)
- {
- r2.h = ry1 - jry1;
- rects.add (Rectangle (jrx1, ry1, jrx2 - jrx1, jry2 - ry1));
- i = -1;
- break;
- }
- else if (ry2 > jry1 && ry2 < jry2)
- {
- r2.h = ry2 - jry1;
- rects.add (Rectangle (jrx1, ry2, jrx2 - jrx1, jry2 - ry2));
- i = -1;
- break;
- }
- }
- }
- }
-
- for (int i = 0; i < rects.size() - 1; ++i)
- {
- Rectangle& r = rects.getReference (i);
-
- for (int j = rects.size(); --j > i;)
- {
- if (r.enlargeIfAdjacent (rects.getReference (j)))
- {
- rects.remove (j);
- i = -1;
- break;
- }
- }
- }
-}
-
-//==============================================================================
-bool RectangleList::containsPoint (const int x, const int y) const noexcept
-{
- for (const Rectangle* r = rects.begin(), * const e = rects.end(); r != e; ++r)
- if (r->contains (x, y))
- return true;
-
- return false;
-}
-
-bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const
-{
- if (rects.size() > 1)
- {
- RectangleList r (rectangleToCheck);
-
- for (int i = rects.size(); --i >= 0;)
- {
- r.subtract (rects.getReference (i));
-
- if (r.rects.size() == 0)
- return true;
- }
- }
- else if (rects.size() > 0)
- {
- return rects.getReference (0).contains (rectangleToCheck);
- }
-
- return false;
-}
-
-bool RectangleList::intersectsRectangle (const Rectangle& rectangleToCheck) const noexcept
-{
- for (const Rectangle* r = rects.begin(), * const e = rects.end(); r != e; ++r)
- if (r->intersects (rectangleToCheck))
- return true;
-
- return false;
-}
-
-bool RectangleList::intersects (const RectangleList& other) const noexcept
-{
- for (const Rectangle* r = rects.begin(), * const e = rects.end(); r != e; ++r)
- if (other.intersectsRectangle (*r))
- return true;
-
- return false;
-}
-
-Rectangle RectangleList::getBounds() const noexcept
-{
- if (rects.size() <= 1)
- {
- if (rects.size() == 0)
- return Rectangle();
-
- return rects.getReference (0);
- }
- else
- {
- const Rectangle& r = rects.getReference (0);
-
- int minX = r.pos.x;
- int minY = r.pos.y;
- int maxX = minX + r.w;
- int maxY = minY + r.h;
-
- for (int i = rects.size(); --i > 0;)
- {
- const Rectangle& r2 = rects.getReference (i);
-
- minX = jmin (minX, r2.pos.x);
- minY = jmin (minY, r2.pos.y);
- maxX = jmax (maxX, r2.getRight());
- maxY = jmax (maxY, r2.getBottom());
- }
-
- return Rectangle (minX, minY, maxX - minX, maxY - minY);
- }
-}
-
-void RectangleList::offsetAll (const int dx, const int dy) noexcept
-{
- for (Rectangle* r = rects.begin(), * const e = rects.end(); r != e; ++r)
- {
- r->pos.x += dx;
- r->pos.y += dy;
- }
-}
-
-//==============================================================================
-Path RectangleList::toPath() const
-{
- Path p;
-
- for (int i = 0; i < rects.size(); ++i)
- p.addRectangle (rects.getReference (i));
-
- return p;
-}
diff --git a/modules/juce_graphics/geometry/juce_RectangleList.h b/modules/juce_graphics/geometry/juce_RectangleList.h
index 5aa726e5dd..565d3d365a 100644
--- a/modules/juce_graphics/geometry/juce_RectangleList.h
+++ b/modules/juce_graphics/geometry/juce_RectangleList.h
@@ -39,33 +39,50 @@
@see Rectangle
*/
-class JUCE_API RectangleList
+template
+class RectangleList
{
public:
+ typedef Rectangle RectangleType;
+
//==============================================================================
/** Creates an empty RectangleList */
- RectangleList() noexcept;
+ RectangleList() noexcept {}
/** Creates a copy of another list */
- RectangleList (const RectangleList& other);
+ RectangleList (const RectangleList& other) : rects (other.rects)
+ {
+ }
/** Creates a list containing just one rectangle. */
- RectangleList (const Rectangle& rect);
+ RectangleList (const RectangleType& rect)
+ {
+ addWithoutMerging (rect);
+ }
/** Copies this list from another one. */
- RectangleList& operator= (const RectangleList& other);
+ RectangleList& operator= (const RectangleList& other)
+ {
+ rects = other.rects;
+ return *this;
+ }
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
- RectangleList (RectangleList&& other) noexcept;
- RectangleList& operator= (RectangleList&& other) noexcept;
- #endif
+ RectangleList (RectangleList&& other) noexcept
+ : rects (static_cast &&> (other.rects))
+ {
+ }
- /** Destructor. */
- ~RectangleList();
+ RectangleList& operator= (RectangleList&& other) noexcept
+ {
+ rects = static_cast &&> (other.rects);
+ return *this;
+ }
+ #endif
//==============================================================================
/** Returns true if the region is empty. */
- bool isEmpty() const noexcept;
+ bool isEmpty() const noexcept { return rects.size() == 0; }
/** Returns the number of rectangles in the list. */
int getNumRectangles() const noexcept { return rects.size(); }
@@ -75,48 +92,198 @@ public:
@returns the rectangle at the index, or an empty rectangle if the
index is out-of-range.
*/
- Rectangle getRectangle (int index) const noexcept;
+ RectangleType getRectangle (int index) const noexcept
+ {
+ if (isPositiveAndBelow (index, rects.size()))
+ return rects.getReference (index);
+ return RectangleType();
+ }
//==============================================================================
/** Removes all rectangles to leave an empty region. */
- void clear();
+ void clear()
+ {
+ rects.clearQuick();
+ }
/** Merges a new rectangle into the list.
The rectangle being added will first be clipped to remove any parts of it
- that overlap existing rectangles in the list.
+ that overlap existing rectangles in the list, and adjacent rectangles will be
+ merged into it.
*/
- void add (int x, int y, int width, int height);
+ void add (const RectangleType& rect)
+ {
+ if (! rect.isEmpty())
+ {
+ if (rects.size() == 0)
+ {
+ rects.add (rect);
+ }
+ else
+ {
+ bool anyOverlaps = false;
+
+ for (int j = rects.size(); --j >= 0;)
+ {
+ RectangleType& ourRect = rects.getReference (j);
+
+ if (rect.intersects (ourRect))
+ {
+ if (rect.contains (ourRect))
+ rects.remove (j);
+ else if (! ourRect.reduceIfPartlyContainedIn (rect))
+ anyOverlaps = true;
+ }
+ }
+
+ if (anyOverlaps && rects.size() > 0)
+ {
+ RectangleList r (rect);
+
+ for (int i = rects.size(); --i >= 0;)
+ {
+ const RectangleType& ourRect = rects.getReference (i);
+
+ if (rect.intersects (ourRect))
+ {
+ r.subtract (ourRect);
+
+ if (r.rects.size() == 0)
+ return;
+ }
+ }
+
+ rects.addArray (r.rects);
+ }
+ else
+ {
+ rects.add (rect);
+ }
+ }
+ }
+ }
/** Merges a new rectangle into the list.
The rectangle being added will first be clipped to remove any parts of it
- that overlap existing rectangles in the list, and adjacent rectangles will be
- merged into it.
+ that overlap existing rectangles in the list.
*/
- void add (const Rectangle& rect);
+ void add (ValueType x, ValueType y, ValueType width, ValueType height)
+ {
+ add (RectangleType (x, y, width, height));
+ }
/** Dumbly adds a rectangle to the list without checking for overlaps.
This simply adds the rectangle to the end, it doesn't merge it or remove
any overlapping bits.
*/
- void addWithoutMerging (const Rectangle& rect);
+ void addWithoutMerging (const RectangleType& rect)
+ {
+ if (! rect.isEmpty())
+ rects.add (rect);
+ }
/** Merges another rectangle list into this one.
Any overlaps between the two lists will be clipped, so that the result is
the union of both lists.
*/
- void add (const RectangleList& other);
+ void add (const RectangleList& other)
+ {
+ for (const RectangleType* r = other.begin(), * const e = other.end(); r != e; ++r)
+ add (*r);
+ }
/** Removes a rectangular region from the list.
Any rectangles in the list which overlap this will be clipped and subdivided
if necessary.
*/
- void subtract (const Rectangle& rect);
+ void subtract (const RectangleType& rect)
+ {
+ const int originalNumRects = rects.size();
+
+ if (originalNumRects > 0)
+ {
+ const ValueType x1 = rect.pos.x;
+ const ValueType y1 = rect.pos.y;
+ const ValueType x2 = x1 + rect.w;
+ const ValueType y2 = y1 + rect.h;
+
+ for (int i = getNumRectangles(); --i >= 0;)
+ {
+ RectangleType& r = rects.getReference (i);
+
+ const ValueType rx1 = r.pos.x;
+ const ValueType ry1 = r.pos.y;
+ const ValueType rx2 = rx1 + r.w;
+ const ValueType ry2 = ry1 + r.h;
+
+ if (! (x2 <= rx1 || x1 >= rx2 || y2 <= ry1 || y1 >= ry2))
+ {
+ if (x1 > rx1 && x1 < rx2)
+ {
+ if (y1 <= ry1 && y2 >= ry2 && x2 >= rx2)
+ {
+ r.w = x1 - rx1;
+ }
+ else
+ {
+ r.pos.x = x1;
+ r.w = rx2 - x1;
+
+ rects.insert (++i, RectangleType (rx1, ry1, x1 - rx1, ry2 - ry1));
+ ++i;
+ }
+ }
+ else if (x2 > rx1 && x2 < rx2)
+ {
+ r.pos.x = x2;
+ r.w = rx2 - x2;
+
+ if (y1 > ry1 || y2 < ry2 || x1 > rx1)
+ {
+ rects.insert (++i, RectangleType (rx1, ry1, x2 - rx1, ry2 - ry1));
+ ++i;
+ }
+ }
+ else if (y1 > ry1 && y1 < ry2)
+ {
+ if (x1 <= rx1 && x2 >= rx2 && y2 >= ry2)
+ {
+ r.h = y1 - ry1;
+ }
+ else
+ {
+ r.pos.y = y1;
+ r.h = ry2 - y1;
+
+ rects.insert (++i, RectangleType (rx1, ry1, rx2 - rx1, y1 - ry1));
+ ++i;
+ }
+ }
+ else if (y2 > ry1 && y2 < ry2)
+ {
+ r.pos.y = y2;
+ r.h = ry2 - y2;
+
+ if (x1 > rx1 || x2 < rx2 || y1 > ry1)
+ {
+ rects.insert (++i, RectangleType (rx1, ry1, rx2 - rx1, y2 - ry1));
+ ++i;
+ }
+ }
+ else
+ {
+ rects.remove (i);
+ }
+ }
+ }
+ }
+ }
/** Removes all areas in another RectangleList from this one.
@@ -125,7 +292,14 @@ public:
@returns true if the resulting list is non-empty.
*/
- bool subtract (const RectangleList& otherList);
+ bool subtract (const RectangleList& otherList)
+ {
+ for (int i = otherList.rects.size(); --i >= 0 && rects.size() > 0;)
+ subtract (otherList.rects.getReference (i));
+
+ return rects.size() > 0;
+ }
+
/** Removes any areas of the region that lie outside a given rectangle.
@@ -136,7 +310,29 @@ public:
@see getIntersectionWith
*/
- bool clipTo (const Rectangle& rect);
+ bool clipTo (const RectangleType& rect)
+ {
+ bool notEmpty = false;
+
+ if (rect.isEmpty())
+ {
+ clear();
+ }
+ else
+ {
+ for (int i = rects.size(); --i >= 0;)
+ {
+ RectangleType& r = rects.getReference (i);
+
+ if (! rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
+ rects.remove (i);
+ else
+ notEmpty = true;
+ }
+ }
+
+ return notEmpty;
+ }
/** Removes any areas of the region that lie outside a given rectangle list.
@@ -147,7 +343,30 @@ public:
@see getIntersectionWith
*/
- bool clipTo (const RectangleList& other);
+ bool clipTo (const RectangleList& other)
+ {
+ if (rects.size() == 0)
+ return false;
+
+ RectangleList result;
+
+ for (int j = 0; j < rects.size(); ++j)
+ {
+ const RectangleType& rect = rects.getReference (j);
+
+ for (int i = other.rects.size(); --i >= 0;)
+ {
+ RectangleType r (other.rects.getReference (i));
+
+ if (rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
+ result.rects.add (r);
+ }
+ }
+
+ swapWith (result);
+
+ return ! isEmpty();
+ }
/** Creates a region which is the result of clipping this one to a given rectangle.
@@ -158,21 +377,54 @@ public:
@see clipTo
*/
- bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const;
+ bool getIntersectionWith (const RectangleType& rect, RectangleList& destRegion) const
+ {
+ destRegion.clear();
+
+ if (! rect.isEmpty())
+ {
+ for (int i = rects.size(); --i >= 0;)
+ {
+ RectangleType r (rects.getReference (i));
+
+ if (rect.intersectRectangle (r.pos.x, r.pos.y, r.w, r.h))
+ destRegion.rects.add (r);
+ }
+ }
+
+ return destRegion.rects.size() > 0;
+ }
/** Swaps the contents of this and another list.
This swaps their internal pointers, so is hugely faster than using copy-by-value
to swap them.
*/
- void swapWith (RectangleList& otherList) noexcept;
+ void swapWith (RectangleList& otherList) noexcept
+ {
+ rects.swapWith (otherList.rects);
+ }
//==============================================================================
/** Checks whether the region contains a given point.
+ @returns true if the point lies within one of the rectangles in the list
+ */
+ bool containsPoint (Point point) const noexcept
+ {
+ for (const RectangleType* r = rects.begin(), * const e = rects.end(); r != e; ++r)
+ if (r->contains (point))
+ return true;
+ return false;
+ }
+
+ /** Checks whether the region contains a given point.
@returns true if the point lies within one of the rectangles in the list
*/
- bool containsPoint (int x, int y) const noexcept;
+ bool containsPoint (ValueType x, ValueType y) const noexcept
+ {
+ return contains (Point (x, y));
+ }
/** Checks whether the region contains the whole of a given rectangle.
@@ -180,7 +432,27 @@ public:
defined by this object
@see intersectsRectangle, containsPoint
*/
- bool containsRectangle (const Rectangle& rectangleToCheck) const;
+ bool containsRectangle (const RectangleType& rectangleToCheck) const
+ {
+ if (rects.size() > 1)
+ {
+ RectangleList r (rectangleToCheck);
+
+ for (int i = rects.size(); --i >= 0;)
+ {
+ r.subtract (rects.getReference (i));
+
+ if (r.rects.size() == 0)
+ return true;
+ }
+ }
+ else if (rects.size() > 0)
+ {
+ return rects.getReference (0).contains (rectangleToCheck);
+ }
+
+ return false;
+ }
/** Checks whether the region contains any part of a given rectangle.
@@ -188,17 +460,59 @@ public:
defined by this object
@see containsRectangle
*/
- bool intersectsRectangle (const Rectangle& rectangleToCheck) const noexcept;
+ bool intersectsRectangle (const RectangleType& rectangleToCheck) const noexcept
+ {
+ for (const RectangleType* r = rects.begin(), * const e = rects.end(); r != e; ++r)
+ if (r->intersects (rectangleToCheck))
+ return true;
+
+ return false;
+ }
/** Checks whether this region intersects any part of another one.
@see intersectsRectangle
*/
- bool intersects (const RectangleList& other) const noexcept;
+ bool intersects (const RectangleList& other) const noexcept
+ {
+ for (const RectangleType* r = rects.begin(), * const e = rects.end(); r != e; ++r)
+ if (other.intersectsRectangle (*r))
+ return true;
+
+ return false;
+ }
//==============================================================================
/** Returns the smallest rectangle that can enclose the whole of this region. */
- Rectangle getBounds() const noexcept;
+ RectangleType getBounds() const noexcept
+ {
+ if (rects.size() <= 1)
+ {
+ if (rects.size() == 0)
+ return RectangleType();
+
+ return rects.getReference (0);
+ }
+
+ const RectangleType& r = rects.getReference (0);
+
+ ValueType minX = r.pos.x;
+ ValueType minY = r.pos.y;
+ ValueType maxX = minX + r.w;
+ ValueType maxY = minY + r.h;
+
+ for (int i = rects.size(); --i > 0;)
+ {
+ const RectangleType& r2 = rects.getReference (i);
+
+ minX = jmin (minX, r2.pos.x);
+ minY = jmin (minY, r2.pos.y);
+ maxX = jmax (maxX, r2.getRight());
+ maxY = jmax (maxY, r2.getBottom());
+ }
+
+ return RectangleType (minX, minY, maxX - minX, maxY - minY);
+ }
/** Optimises the list into a minimum number of constituent rectangles.
@@ -206,63 +520,116 @@ public:
possible, to simplify lists that might have been fragmented by repeated
add/subtract calls.
*/
- void consolidate();
+ void consolidate()
+ {
+ for (int i = 0; i < getNumRectangles() - 1; ++i)
+ {
+ RectangleType& r = rects.getReference (i);
+ const ValueType rx1 = r.pos.x;
+ const ValueType ry1 = r.pos.y;
+ const ValueType rx2 = rx1 + r.w;
+ const ValueType ry2 = ry1 + r.h;
+
+ for (int j = rects.size(); --j > i;)
+ {
+ RectangleType& r2 = rects.getReference (j);
+ const ValueType jrx1 = r2.pos.x;
+ const ValueType jry1 = r2.pos.y;
+ const ValueType jrx2 = jrx1 + r2.w;
+ const ValueType jry2 = jry1 + r2.h;
+
+ // if the vertical edges of any blocks are touching and their horizontals don't
+ // line up, split them horizontally..
+ if (jrx1 == rx2 || jrx2 == rx1)
+ {
+ if (jry1 > ry1 && jry1 < ry2)
+ {
+ r.h = jry1 - ry1;
+ rects.add (RectangleType (rx1, jry1, rx2 - rx1, ry2 - jry1));
+ i = -1;
+ break;
+ }
+
+ if (jry2 > ry1 && jry2 < ry2)
+ {
+ r.h = jry2 - ry1;
+ rects.add (RectangleType (rx1, jry2, rx2 - rx1, ry2 - jry2));
+ i = -1;
+ break;
+ }
+ else if (ry1 > jry1 && ry1 < jry2)
+ {
+ r2.h = ry1 - jry1;
+ rects.add (RectangleType (jrx1, ry1, jrx2 - jrx1, jry2 - ry1));
+ i = -1;
+ break;
+ }
+ else if (ry2 > jry1 && ry2 < jry2)
+ {
+ r2.h = ry2 - jry1;
+ rects.add (RectangleType (jrx1, ry2, jrx2 - jrx1, jry2 - ry2));
+ i = -1;
+ break;
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < rects.size() - 1; ++i)
+ {
+ RectangleType& r = rects.getReference (i);
+
+ for (int j = rects.size(); --j > i;)
+ {
+ if (r.enlargeIfAdjacent (rects.getReference (j)))
+ {
+ rects.remove (j);
+ i = -1;
+ break;
+ }
+ }
+ }
+ }
/** Adds an x and y value to all the coordinates. */
- void offsetAll (int dx, int dy) noexcept;
+ void offsetAll (ValueType dx, ValueType dy) noexcept
+ {
+ for (RectangleType* r = rects.begin(), * const e = rects.end(); r != e; ++r)
+ {
+ r->pos.x += dx;
+ r->pos.y += dy;
+ }
+ }
/** Scales all the coordinates. */
template
void scaleAll (ScaleType scaleFactor) noexcept
{
- for (Rectangle* r = rects.begin(), * const e = rects.end(); r != e; ++r)
+ for (RectangleType* r = rects.begin(), * const e = rects.end(); r != e; ++r)
*r *= scaleFactor;
}
//==============================================================================
/** Creates a Path object to represent this region. */
- Path toPath() const;
-
- //==============================================================================
- /** Standard method for iterating the rectangles in the list. */
- const Rectangle* begin() const noexcept { return rects.begin(); }
- /** Standard method for iterating the rectangles in the list. */
- const Rectangle* end() const noexcept { return rects.end(); }
-
- //==============================================================================
- /** An iterator for accessing all the rectangles in a RectangleList.
- Note that this class is deprectated in favour of just using the standard
- RectangleList::begin() and RectangleList::end() methods, which are more efficient.
- */
- class JUCE_API Iterator
+ Path toPath() const
{
- public:
- //==============================================================================
- Iterator (const RectangleList& list) noexcept;
- ~Iterator();
-
- //==============================================================================
- /** Advances to the next rectangle, and returns true if it's not finished.
+ Path p;
- Call this before using getRectangle() to find the rectangle that was returned.
- */
- bool next() noexcept;
+ for (int i = 0; i < rects.size(); ++i)
+ p.addRectangle (rects.getReference (i));
- /** Returns the current rectangle. */
- const Rectangle* getRectangle() const noexcept { return current; }
-
- private:
- const Rectangle* current;
- const RectangleList& owner;
- int index;
+ return p;
+ }
- JUCE_DECLARE_NON_COPYABLE (Iterator)
- };
+ //==============================================================================
+ /** Standard method for iterating the rectangles in the list. */
+ const RectangleType* begin() const noexcept { return rects.begin(); }
+ /** Standard method for iterating the rectangles in the list. */
+ const RectangleType* end() const noexcept { return rects.end(); }
private:
//==============================================================================
- friend class Iterator;
- Array > rects;
+ Array rects;
JUCE_LEAK_DETECTOR (RectangleList)
};
diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp
index 63fe50e023..e007adbd99 100644
--- a/modules/juce_graphics/images/juce_Image.cpp
+++ b/modules/juce_graphics/images/juce_Image.cpp
@@ -522,7 +522,7 @@ void Image::desaturate()
}
}
-void Image::createSolidAreaMask (RectangleList& result, const float alphaThreshold) const
+void Image::createSolidAreaMask (RectangleList& result, const float alphaThreshold) const
{
if (hasAlphaChannel())
{
diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h
index b0ebb6aeec..5ce0bab37f 100644
--- a/modules/juce_graphics/images/juce_Image.h
+++ b/modules/juce_graphics/images/juce_Image.h
@@ -383,7 +383,7 @@ public:
@param alphaThreshold for a semi-transparent image, any pixels whose alpha is
above this level will be considered opaque
*/
- void createSolidAreaMask (RectangleList& result, float alphaThreshold) const;
+ void createSolidAreaMask (RectangleList& result, float alphaThreshold) const;
//==============================================================================
/** Returns a NamedValueSet that is attached to the image and which can be used for
diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp
index 3547b00d41..1769ee20b9 100644
--- a/modules/juce_graphics/juce_graphics.cpp
+++ b/modules/juce_graphics/juce_graphics.cpp
@@ -105,7 +105,6 @@ namespace juce
#include "geometry/juce_Path.cpp"
#include "geometry/juce_PathIterator.cpp"
#include "geometry/juce_PathStrokeType.cpp"
-#include "geometry/juce_RectangleList.cpp"
#include "placement/juce_Justification.cpp"
#include "placement/juce_RectanglePlacement.cpp"
#include "contexts/juce_GraphicsContext.cpp"
diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h
index 7aae899895..9f2af01f5e 100644
--- a/modules/juce_graphics/native/juce_RenderingHelpers.h
+++ b/modules/juce_graphics/native/juce_RenderingHelpers.h
@@ -1550,7 +1550,7 @@ namespace ClipRegions
virtual Ptr applyClipTo (const Ptr& target) const = 0;
virtual Ptr clipToRectangle (const Rectangle&) = 0;
- virtual Ptr clipToRectangleList (const RectangleList&) = 0;
+ virtual Ptr clipToRectangleList (const RectangleList&) = 0;
virtual Ptr excludeClipRectangle (const Rectangle&) = 0;
virtual Ptr clipToPath (const Path&, const AffineTransform&) = 0;
virtual Ptr clipToEdgeTable (const EdgeTable& et) = 0;
@@ -1572,12 +1572,12 @@ namespace ClipRegions
class EdgeTableRegion : public Base
{
public:
- EdgeTableRegion (const EdgeTable& e) : edgeTable (e) {}
- EdgeTableRegion (const Rectangle& r) : edgeTable (r) {}
- EdgeTableRegion (const Rectangle& r) : edgeTable (r) {}
- EdgeTableRegion (const RectangleList& r) : edgeTable (r) {}
+ EdgeTableRegion (const EdgeTable& e) : edgeTable (e) {}
+ EdgeTableRegion (const Rectangle& r) : edgeTable (r) {}
+ EdgeTableRegion (const Rectangle& r) : edgeTable (r) {}
+ EdgeTableRegion (const RectangleList& r) : edgeTable (r) {}
EdgeTableRegion (const Rectangle& bounds, const Path& p, const AffineTransform& t) : edgeTable (bounds, p, t) {}
- EdgeTableRegion (const EdgeTableRegion& other) : Base(), edgeTable (other.edgeTable) {}
+ EdgeTableRegion (const EdgeTableRegion& other) : Base(), edgeTable (other.edgeTable) {}
Ptr clone() const { return new EdgeTableRegion (*this); }
Ptr applyClipTo (const Ptr& target) const { return target->clipToEdgeTable (edgeTable); }
@@ -1588,9 +1588,9 @@ namespace ClipRegions
return edgeTable.isEmpty() ? nullptr : this;
}
- Ptr clipToRectangleList (const RectangleList& r)
+ Ptr clipToRectangleList (const RectangleList& r)
{
- RectangleList inverse (edgeTable.getMaximumBounds());
+ RectangleList inverse (edgeTable.getMaximumBounds());
if (inverse.subtract (r))
for (const Rectangle* i = inverse.begin(), * const e = inverse.end(); i != e; ++i)
@@ -1772,7 +1772,7 @@ namespace ClipRegions
{
public:
RectangleListRegion (const Rectangle& r) : clip (r) {}
- RectangleListRegion (const RectangleList& r) : clip (r) {}
+ RectangleListRegion (const RectangleList& r) : clip (r) {}
RectangleListRegion (const RectangleListRegion& other) : Base(), clip (other.clip) {}
Ptr clone() const { return new RectangleListRegion (*this); }
@@ -1784,7 +1784,7 @@ namespace ClipRegions
return clip.isEmpty() ? nullptr : this;
}
- Ptr clipToRectangleList (const RectangleList& r)
+ Ptr clipToRectangleList (const RectangleList& r)
{
clip.clipTo (r);
return clip.isEmpty() ? nullptr : this;
@@ -1870,7 +1870,7 @@ namespace ClipRegions
EdgeTableFillers::renderImageUntransformed (*this, destData, srcData, alpha, x, y, tiledFill);
}
- RectangleList clip;
+ RectangleList clip;
//==============================================================================
template
@@ -1896,7 +1896,7 @@ namespace ClipRegions
class SubRectangleIterator
{
public:
- SubRectangleIterator (const RectangleList& clipList, const Rectangle& clipBounds)
+ SubRectangleIterator (const RectangleList& clipList, const Rectangle& clipBounds)
: clip (clipList), area (clipBounds)
{}
@@ -1923,7 +1923,7 @@ namespace ClipRegions
}
private:
- const RectangleList& clip;
+ const RectangleList& clip;
const Rectangle area;
JUCE_DECLARE_NON_COPYABLE (SubRectangleIterator)
@@ -1933,7 +1933,7 @@ namespace ClipRegions
class SubRectangleIteratorFloat
{
public:
- SubRectangleIteratorFloat (const RectangleList& clipList, const Rectangle& clipBounds) noexcept
+ SubRectangleIteratorFloat (const RectangleList& clipList, const Rectangle& clipBounds) noexcept
: clip (clipList), area (clipBounds)
{
}
@@ -2013,7 +2013,7 @@ namespace ClipRegions
}
private:
- const RectangleList& clip;
+ const RectangleList& clip;
const Rectangle& area;
JUCE_DECLARE_NON_COPYABLE (SubRectangleIteratorFloat)
@@ -2037,7 +2037,7 @@ public:
{
}
- SoftwareRendererSavedState (const Image& im, const RectangleList& clipList, const int x, const int y)
+ SoftwareRendererSavedState (const Image& im, const RectangleList& clipList, const int x, const int y)
: image (im), clip (new ClipRegions::RectangleListRegion (clipList)),
transform (x, y),
interpolationQuality (Graphics::mediumResamplingQuality),
@@ -2078,21 +2078,21 @@ public:
return clip != nullptr;
}
- bool clipToRectangleList (const RectangleList& r)
+ bool clipToRectangleList (const RectangleList& r)
{
if (clip != nullptr)
{
if (transform.isOnlyTranslated)
{
cloneClipIfMultiplyReferenced();
- RectangleList offsetList (r);
+ RectangleList offsetList (r);
offsetList.offsetAll (transform.xOffset, transform.yOffset);
clip = clip->clipToRectangleList (offsetList);
}
else if (transform.isIntegerScaling)
{
cloneClipIfMultiplyReferenced();
- RectangleList scaledList;
+ RectangleList scaledList;
for (const Rectangle* i = r.begin(), * const e = r.end(); i != e; ++i)
scaledList.add (transform.transformed (*i));
diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h
index 82ccb19a79..e6e5725848 100644
--- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h
+++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h
@@ -40,7 +40,7 @@ public:
float getScaleFactor() override;
float getTargetDeviceScaleFactor() override { return targetScale; }
bool clipToRectangle (const Rectangle&) override;
- bool clipToRectangleList (const RectangleList&) override;
+ bool clipToRectangleList (const RectangleList&) override;
void excludeClipRectangle (const Rectangle&) override;
void clipToPath (const Path&, const AffineTransform&) override;
void clipToImageAlpha (const Image&, const AffineTransform&) override;
@@ -113,7 +113,7 @@ private:
void flip() const;
void applyTransform (const AffineTransform&) const;
void drawImage (const Image&, const AffineTransform&, bool fillEntireClipAsTiles);
- bool clipToRectangleListWithoutTest (const RectangleList&);
+ bool clipToRectangleListWithoutTest (const RectangleList&);
void fillCGRect (const CGRect&, bool replaceExistingContents);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CoreGraphicsContext)
diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
index efe3ac6948..6d06842113 100644
--- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
+++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
@@ -192,7 +192,7 @@ bool CoreGraphicsContext::clipToRectangle (const Rectangle& r)
return ! isClipEmpty();
}
-bool CoreGraphicsContext::clipToRectangleListWithoutTest (const RectangleList& clipRegion)
+bool CoreGraphicsContext::clipToRectangleListWithoutTest (const RectangleList& clipRegion)
{
if (clipRegion.isEmpty())
{
@@ -216,14 +216,14 @@ bool CoreGraphicsContext::clipToRectangleListWithoutTest (const RectangleList& c
}
}
-bool CoreGraphicsContext::clipToRectangleList (const RectangleList& clipRegion)
+bool CoreGraphicsContext::clipToRectangleList (const RectangleList& clipRegion)
{
return clipToRectangleListWithoutTest (clipRegion) && ! isClipEmpty();
}
void CoreGraphicsContext::excludeClipRectangle (const Rectangle& r)
{
- RectangleList remaining (getClipBounds());
+ RectangleList remaining (getClipBounds());
remaining.subtract (r);
clipToRectangleListWithoutTest (remaining);
}
diff --git a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp
index 519557e7e8..9900825b02 100644
--- a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp
+++ b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp
@@ -103,7 +103,7 @@ public:
return ! isClipEmpty();
}
- bool clipToRectangleList (const RectangleList& clipRegion)
+ bool clipToRectangleList (const RectangleList& clipRegion)
{
currentState->clipToRectList (rectListToPathGeometry (clipRegion));
return ! isClipEmpty();
@@ -742,7 +742,7 @@ private:
sink->EndFigure (D2D1_FIGURE_END_CLOSED);
}
- static ID2D1PathGeometry* rectListToPathGeometry (const RectangleList& clipRegion)
+ static ID2D1PathGeometry* rectListToPathGeometry (const RectangleList& clipRegion)
{
ID2D1PathGeometry* p = nullptr;
Direct2DFactories::getInstance().d2dFactory->CreatePathGeometry (&p);
diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp
index 1fc7fcb086..398e60354f 100644
--- a/modules/juce_gui_basics/components/juce_Component.cpp
+++ b/modules/juce_gui_basics/components/juce_Component.cpp
@@ -335,7 +335,7 @@ struct Component::ComponentHelpers
return nothingChanged;
}
- static void subtractObscuredRegions (const Component& comp, RectangleList& result,
+ static void subtractObscuredRegions (const Component& comp, RectangleList& result,
Point delta, const Rectangle& clipRect,
const Component* const compToAvoid)
{
@@ -743,7 +743,7 @@ public:
private:
Image image;
- RectangleList validArea;
+ RectangleList validArea;
Component& owner;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StandardCachedComponentImage)
@@ -2114,7 +2114,7 @@ Rectangle Component::getBoundsInParent() const noexcept
: bounds.transformedBy (*affineTransform);
}
-void Component::getVisibleArea (RectangleList& result, const bool includeSiblings) const
+void Component::getVisibleArea (RectangleList& result, const bool includeSiblings) const
{
result.clear();
const Rectangle unclipped (ComponentHelpers::getUnclippedArea (*this));
diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h
index ab4937b46e..1962ffc0b3 100644
--- a/modules/juce_gui_basics/components/juce_Component.h
+++ b/modules/juce_gui_basics/components/juce_Component.h
@@ -330,7 +330,7 @@ public:
If includeSiblings is true, it will also take into account any siblings
that may be overlapping the component.
*/
- void getVisibleArea (RectangleList& result, bool includeSiblings) const;
+ void getVisibleArea (RectangleList& result, bool includeSiblings) const;
//==============================================================================
/** Returns this component's x coordinate relative the the screen's top-left origin.
diff --git a/modules/juce_gui_basics/components/juce_Desktop.cpp b/modules/juce_gui_basics/components/juce_Desktop.cpp
index d9160cbac9..5d476b6348 100644
--- a/modules/juce_gui_basics/components/juce_Desktop.cpp
+++ b/modules/juce_gui_basics/components/juce_Desktop.cpp
@@ -378,9 +378,9 @@ const Desktop::Displays::Display& Desktop::Displays::getDisplayContaining (Point
return *best;
}
-RectangleList Desktop::Displays::getRectangleList (bool userAreasOnly) const
+RectangleList Desktop::Displays::getRectangleList (bool userAreasOnly) const
{
- RectangleList rl;
+ RectangleList rl;
for (int i = 0; i < displays.size(); ++i)
{
diff --git a/modules/juce_gui_basics/components/juce_Desktop.h b/modules/juce_gui_basics/components/juce_Desktop.h
index 1870cbc76e..2038cbd2b9 100644
--- a/modules/juce_gui_basics/components/juce_Desktop.h
+++ b/modules/juce_gui_basics/components/juce_Desktop.h
@@ -352,7 +352,7 @@ public:
const Display& getDisplayContaining (Point position) const noexcept;
/** Returns a RectangleList made up of all the displays. */
- RectangleList getRectangleList (bool userAreasOnly) const;
+ RectangleList getRectangleList (bool userAreasOnly) const;
/** Returns the smallest bounding box which contains all the displays. */
Rectangle getTotalBounds (bool userAreasOnly) const;
diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp
index d8570afc7b..a2f46808ce 100644
--- a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp
+++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp
@@ -244,7 +244,7 @@ void TabbedComponent::paint (Graphics& g)
if (outlineThickness > 0)
{
- RectangleList rl (content);
+ RectangleList rl (content);
rl.subtract (outline.subtractedFrom (content));
g.reduceClipRegion (rl);
diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
index e9682db0fd..194601c80c 100644
--- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
+++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
@@ -300,7 +300,8 @@ MouseCursor LookAndFeel::getMouseCursorFor (Component& component)
return m;
}
-LowLevelGraphicsContext* LookAndFeel::createGraphicsContext (const Image& imageToRenderOn, const Point& origin, const RectangleList& initialClip)
+LowLevelGraphicsContext* LookAndFeel::createGraphicsContext (const Image& imageToRenderOn, const Point& origin,
+ const RectangleList& initialClip)
{
return new LowLevelGraphicsSoftwareRenderer (imageToRenderOn, origin, initialClip);
}
diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h
index 0bee9a92e9..c43a1d015d 100644
--- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h
+++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h
@@ -148,7 +148,7 @@ public:
// Creates a new graphics context object.
virtual LowLevelGraphicsContext* createGraphicsContext (const Image& imageToRenderOn,
const Point& origin,
- const RectangleList& initialClip);
+ const RectangleList& initialClip);
//==============================================================================
/** Draws the lozenge-shaped background for a standard button. */
diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
index 1571df1787..b11f7c56f2 100644
--- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
+++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
@@ -1842,7 +1842,7 @@ private:
peer.clearMaskedRegion();
- RectangleList originalRepaintRegion (regionsNeedingRepaint);
+ RectangleList originalRepaintRegion (regionsNeedingRepaint);
regionsNeedingRepaint.clear();
const Rectangle totalArea (originalRepaintRegion.getBounds());
@@ -1864,7 +1864,7 @@ private:
startTimer (repaintTimerPeriod);
- RectangleList adjustedList (originalRepaintRegion);
+ RectangleList adjustedList (originalRepaintRegion);
adjustedList.offsetAll (-totalArea.getX(), -totalArea.getY());
if (peer.depth == 32)
@@ -1907,7 +1907,7 @@ private:
LinuxComponentPeer& peer;
Image image;
uint32 lastTimeImageUsed;
- RectangleList regionsNeedingRepaint;
+ RectangleList regionsNeedingRepaint;
#if JUCE_USE_XSHM
bool useARGBImagesForRendering;
diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
index a3f8397936..db6a72227a 100644
--- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
+++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
@@ -64,7 +64,7 @@ public:
appFocusChangeCallback = appFocusChanged;
isEventBlockedByModalComps = checkEventBlockedByModalComps;
- NSRect r = NSMakeRect (0, 0, (CGFloat) component.getWidth(), (CGFloat) component.getHeight());
+ NSRect r = makeNSRect (component.getLocalBounds());
view = [createViewInstance() initWithFrame: r];
setOwner (view, this);
@@ -225,8 +225,7 @@ public:
{
fullScreen = isNowFullScreen;
- NSRect r = NSMakeRect ((CGFloat) newBounds.getX(), (CGFloat) newBounds.getY(),
- (CGFloat) jmax (0, newBounds.getWidth()), (CGFloat) jmax (0, newBounds.getHeight()));
+ NSRect r = makeNSRect (newBounds);
if (isSharedWindow)
{
@@ -770,7 +769,7 @@ public:
const int clipW = (int) (r.size.width + 0.5f);
const int clipH = (int) (r.size.height + 0.5f);
- RectangleList clip;
+ RectangleList clip;
getClipRects (clip, offset, clipW, clipH);
if (! clip.isEmpty())
@@ -1192,7 +1191,7 @@ private:
object_setInstanceVariable (viewOrWindow, "owner", newOwner);
}
- void getClipRects (RectangleList& clip, const Point offset, const int clipW, const int clipH)
+ void getClipRects (RectangleList& clip, const Point offset, const int clipW, const int clipH)
{
const NSRect* rects = nullptr;
NSInteger numRects = 0;
diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
index 024adb3bbc..fc4457f803 100644
--- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
+++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
@@ -333,7 +333,7 @@ public:
void blitToWindow (HWND hwnd, HDC dc, const bool transparent,
const int x, const int y,
- const RectangleList& maskedRegion,
+ const RectangleList& maskedRegion,
const uint8 updateLayeredWindowAlpha) noexcept
{
SetMapMode (dc, MM_TEXT);
@@ -1487,7 +1487,7 @@ private:
Image& offscreenImage = offscreenImageGenerator.getImage (transparent, w, h);
- RectangleList contextClip;
+ RectangleList contextClip;
const Rectangle clipBounds (w, h);
bool needToPaintAll = true;
diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp
index 5eb3db8a36..5b97735be0 100644
--- a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp
+++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp
@@ -399,6 +399,14 @@ Rectangle ComponentPeer::globalToLocal (const Rectangle& screenPositio
return screenPosition.withPosition (globalToLocal (screenPosition.getPosition()));
}
+Rectangle ComponentPeer::getAreaCoveredBy (Component& subComponent) const
+{
+ jassert (component.isParentOf (&subComponent)); // this can only be used for child components.
+
+ return Component::ComponentHelpers::scaledScreenPosToUnscaled
+ (component.getLocalArea (&subComponent, subComponent.getLocalBounds()));
+}
+
//==============================================================================
namespace DragHelpers
{
diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
index cc0ae4732f..6375b8db51 100644
--- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h
+++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
@@ -165,6 +165,11 @@ public:
/** Converts a screen area to a position relative to the top-left of this component. */
virtual Rectangle globalToLocal (const Rectangle& screenPosition);
+ /** Returns the area in peer coordinates that is covered by the given sub-comp (which
+ may be at any depth)
+ */
+ Rectangle getAreaCoveredBy (Component& subComponent) const;
+
/** Minimises the window. */
virtual void setMinimised (bool shouldBeMinimised) = 0;
@@ -364,7 +369,7 @@ protected:
//==============================================================================
Component& component;
const int styleFlags;
- RectangleList maskedRegion;
+ RectangleList maskedRegion;
Rectangle lastNonFullscreenBounds;
ComponentBoundsConstrainer* constrainer;
diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp
index f3ad59680c..6156b09037 100644
--- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp
+++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp
@@ -532,7 +532,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
{
Desktop& desktop = Desktop::getInstance();
- RectangleList allMonitors (desktop.getDisplays().getRectangleList (true));
+ RectangleList allMonitors (desktop.getDisplays().getRectangleList (true));
allMonitors.clipTo (newPos);
const Rectangle onScreenArea (allMonitors.getBounds());
diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm
index a9e627e670..ff769d08cf 100644
--- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm
+++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm
@@ -58,13 +58,9 @@ public:
void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) override
{
- Component* const topComp = owner.getTopLevelComponent();
-
- if (topComp->getPeer() != nullptr)
+ if (ComponentPeer* const peer = owner.getTopLevelComponent()->getPeer())
{
- const Rectangle area (topComp->getLocalArea (&owner, owner.getLocalBounds()));
-
- NSRect r = NSMakeRect ((float) area.getX(), (float) area.getY(), (float) area.getWidth(), (float) area.getHeight());
+ NSRect r = makeNSRect (peer->getAreaCoveredBy (owner));
r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height);
[view setFrame: r];
}
diff --git a/modules/juce_opengl/native/juce_OpenGL_win32.h b/modules/juce_opengl/native/juce_OpenGL_win32.h
index 3338b9e758..fa6f05f724 100644
--- a/modules/juce_opengl/native/juce_OpenGL_win32.h
+++ b/modules/juce_opengl/native/juce_OpenGL_win32.h
@@ -142,7 +142,10 @@ private:
{
Component* topComp = component.getTopLevelComponent();
nativeWindow = createNonRepaintingEmbeddedWindowsPeer (&dummyComponent, topComp->getWindowHandle());
- updateWindowPosition (topComp->getLocalArea (&component, component.getLocalBounds()));
+
+ if (ComponentPeer* peer = topComp->getPeer())
+ updateWindowPosition (peer->getAreaCoveredBy (component));
+
nativeWindow->setVisible (true);
dc = GetDC ((HWND) nativeWindow->getNativeHandle());
}
diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp
index 8bd131685c..f63e649644 100644
--- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp
+++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp
@@ -119,7 +119,7 @@ public:
return true;
}
- void clearRegionInFrameBuffer (const RectangleList& list, const float scaleFactor)
+ void clearRegionInFrameBuffer (const RectangleList& list, const float scaleFactor)
{
glClearColor (0, 0, 0, 0);
glEnable (GL_SCISSOR_TEST);
@@ -211,7 +211,7 @@ public:
if (! ensureFrameBufferSize())
return;
- RectangleList invalid (viewportArea);
+ RectangleList invalid (viewportArea);
invalid.subtract (validArea);
validArea = viewportArea;
@@ -361,7 +361,7 @@ public:
Component& component;
OpenGLFrameBuffer cachedImageFrameBuffer;
- RectangleList validArea;
+ RectangleList validArea;
Rectangle viewportArea;
double scale;
@@ -429,8 +429,8 @@ public:
if (CachedImage* const c = CachedImage::get (comp))
c->handleResize();
- context.nativeContext->updateWindowPosition (comp.getTopLevelComponent()
- ->getLocalArea (&comp, comp.getLocalBounds()));
+ if (ComponentPeer* peer = comp.getTopLevelComponent()->getPeer())
+ context.nativeContext->updateWindowPosition (peer->getAreaCoveredBy (comp));
}
}
diff --git a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
index eb641389a2..76b418a438 100644
--- a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
+++ b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
@@ -978,13 +978,13 @@ struct StateHelpers
RenderingHelpers::FloatRectangleRasterisingInfo (r).iterate (frr);
}
- void add (const RectangleList& list, const PixelARGB colour) noexcept
+ void add (const RectangleList& list, const PixelARGB colour) noexcept
{
for (const Rectangle* i = list.begin(), * const e = list.end(); i != e; ++i)
add (*i, colour);
}
- void add (const RectangleList& list, const Rectangle& clip, const PixelARGB colour) noexcept
+ void add (const RectangleList& list, const Rectangle& clip, const PixelARGB colour) noexcept
{
for (const Rectangle* i = list.begin(), * const e = list.end(); i != e; ++i)
{
@@ -1318,7 +1318,7 @@ public:
virtual Ptr clone() const = 0;
virtual Ptr clipToRectangle (const Rectangle&) = 0;
- virtual Ptr clipToRectangleList (const RectangleList&) = 0;
+ virtual Ptr clipToRectangleList (const RectangleList&) = 0;
virtual Ptr excludeClipRectangle (const Rectangle&) = 0;
virtual Ptr clipToPath (const Path& p, const AffineTransform&) = 0;
virtual Ptr clipToImageAlpha (const OpenGLTextureFromImage&, const AffineTransform&) = 0;
@@ -1369,7 +1369,7 @@ public:
state.shaderQuadQueue.flush();
}
- ClipRegion_Mask (GLState& state_, const RectangleList& r)
+ ClipRegion_Mask (GLState& state_, const RectangleList& r)
: ClipRegionBase (state_),
clip (r.getBounds()),
maskArea (clip)
@@ -1397,13 +1397,13 @@ public:
return clip.isEmpty() ? nullptr : this;
}
- Ptr clipToRectangleList (const RectangleList& r)
+ Ptr clipToRectangleList (const RectangleList& r)
{
clip = clip.getIntersection (r.getBounds());
if (clip.isEmpty())
return Ptr();
- RectangleList excluded (clip);
+ RectangleList excluded (clip);
if (excluded.subtract (r))
{
@@ -1640,7 +1640,7 @@ public:
: ClipRegionBase (state_), clip (r)
{}
- ClipRegion_RectangleList (GLState& state_, const RectangleList& r) noexcept
+ ClipRegion_RectangleList (GLState& state_, const RectangleList& r) noexcept
: ClipRegionBase (state_), clip (r)
{}
@@ -1704,13 +1704,13 @@ public:
}
}
- Rectangle getClipBounds() const { return clip.getBounds(); }
- Ptr clipToRectangle (const Rectangle& r) { return clip.clipTo (r) ? this : nullptr; }
- Ptr clipToRectangleList (const RectangleList& r) { return clip.clipTo (r) ? this : nullptr; }
- Ptr excludeClipRectangle (const Rectangle& r) { clip.subtract (r); return clip.isEmpty() ? nullptr : this; }
+ Rectangle getClipBounds() const { return clip.getBounds(); }
+ Ptr clipToRectangle (const Rectangle& r) { return clip.clipTo (r) ? this : nullptr; }
+ Ptr clipToRectangleList (const RectangleList& r) { return clip.clipTo (r) ? this : nullptr; }
+ Ptr excludeClipRectangle (const Rectangle& r) { clip.subtract (r); return clip.isEmpty() ? nullptr : this; }
private:
- RectangleList clip;
+ RectangleList clip;
Ptr toMask() const { return new ClipRegion_Mask (state, clip); }
@@ -1796,21 +1796,21 @@ public:
return clip != nullptr;
}
- bool clipToRectangleList (const RectangleList& r)
+ bool clipToRectangleList (const RectangleList& r)
{
if (clip != nullptr)
{
if (transform.isOnlyTranslated)
{
cloneClipIfMultiplyReferenced();
- RectangleList offsetList (r);
+ RectangleList offsetList (r);
offsetList.offsetAll (transform.xOffset, transform.yOffset);
clip = clip->clipToRectangleList (offsetList);
}
else if (transform.isIntegerScaling)
{
cloneClipIfMultiplyReferenced();
- RectangleList scaledList;
+ RectangleList scaledList;
for (const Rectangle* i = r.begin(), * const e = r.end(); i != e; ++i)
scaledList.add (transform.transformed (*i).getSmallestIntegerContainer());
@@ -2124,7 +2124,7 @@ public:
bool isClipEmpty() const { return stack->clip == nullptr; }
bool clipRegionIntersects (const Rectangle& r) { return stack->clipRegionIntersects (r); }
bool clipToRectangle (const Rectangle& r) { return stack->clipToRectangle (r); }
- bool clipToRectangleList (const RectangleList& r) { return stack->clipToRectangleList (r); }
+ bool clipToRectangleList (const RectangleList& r) { return stack->clipToRectangleList (r); }
void excludeClipRectangle (const Rectangle& r) { stack->excludeClipRectangle (r); }
void clipToPath (const Path& path, const AffineTransform& t) { stack->clipToPath (path, t); }
void clipToImageAlpha (const Image& im, const AffineTransform& t) { stack->clipToImageAlpha (im, t); }