diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index 298a7f0ee0..f55ee1b46b 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -281,8 +281,8 @@ C9FB7884928BF0D6140AF881 = { isa = PBXBuildFile; fileRef = 9DC2C10B16A645EEB82220D8; }; 5C9628DB3E0C0BA8809AE45D = { isa = PBXBuildFile; fileRef = EE5F18DF1DED7617C4A41FF3; }; 724DA2BCA5ABC5772604C3B4 = { isa = PBXBuildFile; fileRef = B2BCE9DDC8F0F54CA3D913E7; }; - 140FD4605CC549620CC7F44D = { isa = PBXBuildFile; fileRef = 562A8671221397C9CAD1BB2A; }; 035B1F7B1505ABF24455690E = { isa = PBXBuildFile; fileRef = 5249EFBE3B22E6FC1A7B6D42; }; + 3C71EA297D7418FEBB52F9DD = { isa = PBXBuildFile; fileRef = A257B76FCE9D594EAD41414C; }; 7A86E411B55E15DA7AF1FE67 = { isa = PBXBuildFile; fileRef = 8280AA34B23B4D366711A9E7; }; BD86381924AE45021246ABA3 = { isa = PBXBuildFile; fileRef = C9561A66310DAD5EEB4A9462; }; 306AB64E97A05B800349E7E2 = { isa = PBXBuildFile; fileRef = B62991F8AEE7327BA8A5070F; }; @@ -296,7 +296,6 @@ D04EEEC7EAE7C806E95ED41C = { isa = PBXBuildFile; fileRef = 7DB37383434F45D8A7B674C3; }; 7EA440527972D6B7322EC307 = { isa = PBXBuildFile; fileRef = CB16B2438EDCC10C499645E6; }; CB9FE1DA1AFE5FBA9FF06061 = { isa = PBXBuildFile; fileRef = BEB35C6173793C1CB7AB6311; }; - DEDFFA49B5CBF862CD6EDFD4 = { isa = PBXBuildFile; fileRef = 1B00957D2190CF28CF03E304; }; 26454A5DB5BAFD7901F17DA7 = { isa = PBXBuildFile; fileRef = BA58B49B820A47F6F55CDACB; }; F41B46F970BA78762DCE67D1 = { isa = PBXBuildFile; fileRef = 930E58E13FC92BF70AC20EEF; }; B7A8CF6F889840BED05C8C27 = { isa = PBXBuildFile; fileRef = 9113CDD122D2790E147A8CF5; }; @@ -308,6 +307,7 @@ 5E330E219B2D2944BCE95174 = { isa = PBXBuildFile; fileRef = FE6E3F911679B0D7547577A3; }; 275FBC09BE58E708A73B88C1 = { isa = PBXBuildFile; fileRef = 8BCE60CBC91DBAAB089958A1; }; 6DA99BA218FB45568258841C = { isa = PBXBuildFile; fileRef = 3F11593DC3A168A52FCC2DD9; }; + 32F1C95EDEE7722797B8CEE8 = { isa = PBXBuildFile; fileRef = FC2C82760E717788B5A6E691; }; 029A0E8B44DC17211722677D = { isa = PBXBuildFile; fileRef = 42059626955C547DA6AD3196; }; 4B4E17467BC41E2166549998 = { isa = PBXBuildFile; fileRef = 8F383A785B4876198C5B0194; }; 9686F29C29D1C26E353DE68A = { isa = PBXBuildFile; fileRef = F3B50EE3939E9F16D13C3C7C; }; @@ -982,8 +982,8 @@ 9DC2C10B16A645EEB82220D8 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Windowing.cpp"; path = "../../src/native/linux/juce_linux_Windowing.cpp"; sourceTree = "SOURCE_ROOT"; }; EE5F18DF1DED7617C4A41FF3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ios_Audio.cpp"; path = "../../src/native/mac/juce_ios_Audio.cpp"; sourceTree = "SOURCE_ROOT"; }; B2BCE9DDC8F0F54CA3D913E7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../src/native/mac/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; }; - 562A8671221397C9CAD1BB2A = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MiscUtilities.mm"; path = "../../src/native/mac/juce_ios_MiscUtilities.mm"; sourceTree = "SOURCE_ROOT"; }; 5249EFBE3B22E6FC1A7B6D42 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_UIViewComponentPeer.mm"; path = "../../src/native/mac/juce_ios_UIViewComponentPeer.mm"; sourceTree = "SOURCE_ROOT"; }; + A257B76FCE9D594EAD41414C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_Windowing.mm"; path = "../../src/native/mac/juce_ios_Windowing.mm"; sourceTree = "SOURCE_ROOT"; }; 8280AA34B23B4D366711A9E7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AppleRemote.mm"; path = "../../src/native/mac/juce_mac_AppleRemote.mm"; sourceTree = "SOURCE_ROOT"; }; C9561A66310DAD5EEB4A9462 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AudioCDBurner.mm"; path = "../../src/native/mac/juce_mac_AudioCDBurner.mm"; sourceTree = "SOURCE_ROOT"; }; B62991F8AEE7327BA8A5070F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AudioCDReader.mm"; path = "../../src/native/mac/juce_mac_AudioCDReader.mm"; sourceTree = "SOURCE_ROOT"; }; @@ -998,7 +998,6 @@ 7DB37383434F45D8A7B674C3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Fonts.mm"; path = "../../src/native/mac/juce_mac_Fonts.mm"; sourceTree = "SOURCE_ROOT"; }; CB16B2438EDCC10C499645E6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MainMenu.mm"; path = "../../src/native/mac/juce_mac_MainMenu.mm"; sourceTree = "SOURCE_ROOT"; }; BEB35C6173793C1CB7AB6311 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MessageManager.mm"; path = "../../src/native/mac/juce_mac_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; }; - 1B00957D2190CF28CF03E304 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MiscUtilities.mm"; path = "../../src/native/mac/juce_mac_MiscUtilities.mm"; sourceTree = "SOURCE_ROOT"; }; BA58B49B820A47F6F55CDACB = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MouseCursor.mm"; path = "../../src/native/mac/juce_mac_MouseCursor.mm"; sourceTree = "SOURCE_ROOT"; }; 930E58E13FC92BF70AC20EEF = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_NativeCode.mm"; path = "../../src/native/mac/juce_mac_NativeCode.mm"; sourceTree = "SOURCE_ROOT"; }; 2F1812B26076D9CC1495D452 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_mac_NativeIncludes.h"; path = "../../src/native/mac/juce_mac_NativeIncludes.h"; sourceTree = "SOURCE_ROOT"; }; @@ -1012,6 +1011,7 @@ FE6E3F911679B0D7547577A3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_SystemStats.mm"; path = "../../src/native/mac/juce_mac_SystemStats.mm"; sourceTree = "SOURCE_ROOT"; }; 8BCE60CBC91DBAAB089958A1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Threads.mm"; path = "../../src/native/mac/juce_mac_Threads.mm"; sourceTree = "SOURCE_ROOT"; }; 3F11593DC3A168A52FCC2DD9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_WebBrowserComponent.mm"; path = "../../src/native/mac/juce_mac_WebBrowserComponent.mm"; sourceTree = "SOURCE_ROOT"; }; + FC2C82760E717788B5A6E691 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Windowing.mm"; path = "../../src/native/mac/juce_mac_Windowing.mm"; sourceTree = "SOURCE_ROOT"; }; AB0F3F5A622CBB251F64945A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_osx_MessageQueue.h"; path = "../../src/native/mac/juce_osx_MessageQueue.h"; sourceTree = "SOURCE_ROOT"; }; AD495FA1991295C722B46843 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_osx_ObjCHelpers.h"; path = "../../src/native/mac/juce_osx_ObjCHelpers.h"; sourceTree = "SOURCE_ROOT"; }; 42059626955C547DA6AD3196 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_ActiveXComponent.cpp"; path = "../../src/native/windows/juce_win32_ActiveXComponent.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -1824,8 +1824,8 @@ 13513EE40AD6BAB30E26C88B = { isa = PBXGroup; children = ( EE5F18DF1DED7617C4A41FF3, B2BCE9DDC8F0F54CA3D913E7, - 562A8671221397C9CAD1BB2A, 5249EFBE3B22E6FC1A7B6D42, + A257B76FCE9D594EAD41414C, 8280AA34B23B4D366711A9E7, C9561A66310DAD5EEB4A9462, B62991F8AEE7327BA8A5070F, @@ -1840,7 +1840,6 @@ 7DB37383434F45D8A7B674C3, CB16B2438EDCC10C499645E6, BEB35C6173793C1CB7AB6311, - 1B00957D2190CF28CF03E304, BA58B49B820A47F6F55CDACB, 930E58E13FC92BF70AC20EEF, 2F1812B26076D9CC1495D452, @@ -1854,6 +1853,7 @@ FE6E3F911679B0D7547577A3, 8BCE60CBC91DBAAB089958A1, 3F11593DC3A168A52FCC2DD9, + FC2C82760E717788B5A6E691, AB0F3F5A622CBB251F64945A, AD495FA1991295C722B46843 ); name = mac; sourceTree = ""; }; 64DE2D4534D79E74C40A0DEE = { isa = PBXGroup; children = ( @@ -2344,8 +2344,8 @@ C9FB7884928BF0D6140AF881, 5C9628DB3E0C0BA8809AE45D, 724DA2BCA5ABC5772604C3B4, - 140FD4605CC549620CC7F44D, 035B1F7B1505ABF24455690E, + 3C71EA297D7418FEBB52F9DD, 7A86E411B55E15DA7AF1FE67, BD86381924AE45021246ABA3, 306AB64E97A05B800349E7E2, @@ -2359,7 +2359,6 @@ D04EEEC7EAE7C806E95ED41C, 7EA440527972D6B7322EC307, CB9FE1DA1AFE5FBA9FF06061, - DEDFFA49B5CBF862CD6EDFD4, 26454A5DB5BAFD7901F17DA7, F41B46F970BA78762DCE67D1, B7A8CF6F889840BED05C8C27, @@ -2371,6 +2370,7 @@ 5E330E219B2D2944BCE95174, 275FBC09BE58E708A73B88C1, 6DA99BA218FB45568258841C, + 32F1C95EDEE7722797B8CEE8, 029A0E8B44DC17211722677D, 4B4E17467BC41E2166549998, 9686F29C29D1C26E353DE68A, diff --git a/Builds/VisualStudio2005/Juce.vcproj b/Builds/VisualStudio2005/Juce.vcproj index fcd41e82c8..d80a877a9f 100644 --- a/Builds/VisualStudio2005/Juce.vcproj +++ b/Builds/VisualStudio2005/Juce.vcproj @@ -883,8 +883,8 @@ - + @@ -899,7 +899,6 @@ - @@ -913,6 +912,7 @@ + diff --git a/Builds/VisualStudio2008/Juce.vcproj b/Builds/VisualStudio2008/Juce.vcproj index 7ab0421ba0..62c41280ba 100644 --- a/Builds/VisualStudio2008/Juce.vcproj +++ b/Builds/VisualStudio2008/Juce.vcproj @@ -883,8 +883,8 @@ - + @@ -899,7 +899,6 @@ - @@ -913,6 +912,7 @@ + diff --git a/Builds/VisualStudio2008_DLL/Juce.vcproj b/Builds/VisualStudio2008_DLL/Juce.vcproj index f3347f92a7..2beb19c93e 100644 --- a/Builds/VisualStudio2008_DLL/Juce.vcproj +++ b/Builds/VisualStudio2008_DLL/Juce.vcproj @@ -885,8 +885,8 @@ - + @@ -901,7 +901,6 @@ - @@ -915,6 +914,7 @@ + diff --git a/Builds/VisualStudio2010/Juce.vcxproj.filters b/Builds/VisualStudio2010/Juce.vcxproj.filters index 5e4de1d9f6..33b7b7adb5 100644 --- a/Builds/VisualStudio2010/Juce.vcxproj.filters +++ b/Builds/VisualStudio2010/Juce.vcxproj.filters @@ -1042,10 +1042,10 @@ Juce\Source\native\mac - + Juce\Source\native\mac - + Juce\Source\native\mac @@ -1087,9 +1087,6 @@ Juce\Source\native\mac - - Juce\Source\native\mac - Juce\Source\native\mac @@ -1123,6 +1120,9 @@ Juce\Source\native\mac + + Juce\Source\native\mac + Juce\Source\native\windows diff --git a/Builds/iOS/Juce.xcodeproj/project.pbxproj b/Builds/iOS/Juce.xcodeproj/project.pbxproj index 363f5f6d0e..195bb2d6f7 100644 --- a/Builds/iOS/Juce.xcodeproj/project.pbxproj +++ b/Builds/iOS/Juce.xcodeproj/project.pbxproj @@ -281,8 +281,8 @@ C9FB7884928BF0D6140AF881 = { isa = PBXBuildFile; fileRef = 9DC2C10B16A645EEB82220D8; }; 5C9628DB3E0C0BA8809AE45D = { isa = PBXBuildFile; fileRef = EE5F18DF1DED7617C4A41FF3; }; 724DA2BCA5ABC5772604C3B4 = { isa = PBXBuildFile; fileRef = B2BCE9DDC8F0F54CA3D913E7; }; - 140FD4605CC549620CC7F44D = { isa = PBXBuildFile; fileRef = 562A8671221397C9CAD1BB2A; }; 035B1F7B1505ABF24455690E = { isa = PBXBuildFile; fileRef = 5249EFBE3B22E6FC1A7B6D42; }; + 3C71EA297D7418FEBB52F9DD = { isa = PBXBuildFile; fileRef = A257B76FCE9D594EAD41414C; }; 7A86E411B55E15DA7AF1FE67 = { isa = PBXBuildFile; fileRef = 8280AA34B23B4D366711A9E7; }; BD86381924AE45021246ABA3 = { isa = PBXBuildFile; fileRef = C9561A66310DAD5EEB4A9462; }; 306AB64E97A05B800349E7E2 = { isa = PBXBuildFile; fileRef = B62991F8AEE7327BA8A5070F; }; @@ -296,7 +296,6 @@ D04EEEC7EAE7C806E95ED41C = { isa = PBXBuildFile; fileRef = 7DB37383434F45D8A7B674C3; }; 7EA440527972D6B7322EC307 = { isa = PBXBuildFile; fileRef = CB16B2438EDCC10C499645E6; }; CB9FE1DA1AFE5FBA9FF06061 = { isa = PBXBuildFile; fileRef = BEB35C6173793C1CB7AB6311; }; - DEDFFA49B5CBF862CD6EDFD4 = { isa = PBXBuildFile; fileRef = 1B00957D2190CF28CF03E304; }; 26454A5DB5BAFD7901F17DA7 = { isa = PBXBuildFile; fileRef = BA58B49B820A47F6F55CDACB; }; F41B46F970BA78762DCE67D1 = { isa = PBXBuildFile; fileRef = 930E58E13FC92BF70AC20EEF; }; B7A8CF6F889840BED05C8C27 = { isa = PBXBuildFile; fileRef = 9113CDD122D2790E147A8CF5; }; @@ -308,6 +307,7 @@ 5E330E219B2D2944BCE95174 = { isa = PBXBuildFile; fileRef = FE6E3F911679B0D7547577A3; }; 275FBC09BE58E708A73B88C1 = { isa = PBXBuildFile; fileRef = 8BCE60CBC91DBAAB089958A1; }; 6DA99BA218FB45568258841C = { isa = PBXBuildFile; fileRef = 3F11593DC3A168A52FCC2DD9; }; + 32F1C95EDEE7722797B8CEE8 = { isa = PBXBuildFile; fileRef = FC2C82760E717788B5A6E691; }; 029A0E8B44DC17211722677D = { isa = PBXBuildFile; fileRef = 42059626955C547DA6AD3196; }; 4B4E17467BC41E2166549998 = { isa = PBXBuildFile; fileRef = 8F383A785B4876198C5B0194; }; 9686F29C29D1C26E353DE68A = { isa = PBXBuildFile; fileRef = F3B50EE3939E9F16D13C3C7C; }; @@ -982,8 +982,8 @@ 9DC2C10B16A645EEB82220D8 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Windowing.cpp"; path = "../../src/native/linux/juce_linux_Windowing.cpp"; sourceTree = "SOURCE_ROOT"; }; EE5F18DF1DED7617C4A41FF3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ios_Audio.cpp"; path = "../../src/native/mac/juce_ios_Audio.cpp"; sourceTree = "SOURCE_ROOT"; }; B2BCE9DDC8F0F54CA3D913E7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../src/native/mac/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; }; - 562A8671221397C9CAD1BB2A = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MiscUtilities.mm"; path = "../../src/native/mac/juce_ios_MiscUtilities.mm"; sourceTree = "SOURCE_ROOT"; }; 5249EFBE3B22E6FC1A7B6D42 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_UIViewComponentPeer.mm"; path = "../../src/native/mac/juce_ios_UIViewComponentPeer.mm"; sourceTree = "SOURCE_ROOT"; }; + A257B76FCE9D594EAD41414C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_Windowing.mm"; path = "../../src/native/mac/juce_ios_Windowing.mm"; sourceTree = "SOURCE_ROOT"; }; 8280AA34B23B4D366711A9E7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AppleRemote.mm"; path = "../../src/native/mac/juce_mac_AppleRemote.mm"; sourceTree = "SOURCE_ROOT"; }; C9561A66310DAD5EEB4A9462 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AudioCDBurner.mm"; path = "../../src/native/mac/juce_mac_AudioCDBurner.mm"; sourceTree = "SOURCE_ROOT"; }; B62991F8AEE7327BA8A5070F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AudioCDReader.mm"; path = "../../src/native/mac/juce_mac_AudioCDReader.mm"; sourceTree = "SOURCE_ROOT"; }; @@ -998,7 +998,6 @@ 7DB37383434F45D8A7B674C3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Fonts.mm"; path = "../../src/native/mac/juce_mac_Fonts.mm"; sourceTree = "SOURCE_ROOT"; }; CB16B2438EDCC10C499645E6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MainMenu.mm"; path = "../../src/native/mac/juce_mac_MainMenu.mm"; sourceTree = "SOURCE_ROOT"; }; BEB35C6173793C1CB7AB6311 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MessageManager.mm"; path = "../../src/native/mac/juce_mac_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; }; - 1B00957D2190CF28CF03E304 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MiscUtilities.mm"; path = "../../src/native/mac/juce_mac_MiscUtilities.mm"; sourceTree = "SOURCE_ROOT"; }; BA58B49B820A47F6F55CDACB = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_MouseCursor.mm"; path = "../../src/native/mac/juce_mac_MouseCursor.mm"; sourceTree = "SOURCE_ROOT"; }; 930E58E13FC92BF70AC20EEF = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_NativeCode.mm"; path = "../../src/native/mac/juce_mac_NativeCode.mm"; sourceTree = "SOURCE_ROOT"; }; 2F1812B26076D9CC1495D452 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_mac_NativeIncludes.h"; path = "../../src/native/mac/juce_mac_NativeIncludes.h"; sourceTree = "SOURCE_ROOT"; }; @@ -1012,6 +1011,7 @@ FE6E3F911679B0D7547577A3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_SystemStats.mm"; path = "../../src/native/mac/juce_mac_SystemStats.mm"; sourceTree = "SOURCE_ROOT"; }; 8BCE60CBC91DBAAB089958A1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Threads.mm"; path = "../../src/native/mac/juce_mac_Threads.mm"; sourceTree = "SOURCE_ROOT"; }; 3F11593DC3A168A52FCC2DD9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_WebBrowserComponent.mm"; path = "../../src/native/mac/juce_mac_WebBrowserComponent.mm"; sourceTree = "SOURCE_ROOT"; }; + FC2C82760E717788B5A6E691 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_Windowing.mm"; path = "../../src/native/mac/juce_mac_Windowing.mm"; sourceTree = "SOURCE_ROOT"; }; AB0F3F5A622CBB251F64945A = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_osx_MessageQueue.h"; path = "../../src/native/mac/juce_osx_MessageQueue.h"; sourceTree = "SOURCE_ROOT"; }; AD495FA1991295C722B46843 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_osx_ObjCHelpers.h"; path = "../../src/native/mac/juce_osx_ObjCHelpers.h"; sourceTree = "SOURCE_ROOT"; }; 42059626955C547DA6AD3196 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_ActiveXComponent.cpp"; path = "../../src/native/windows/juce_win32_ActiveXComponent.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -1824,8 +1824,8 @@ 13513EE40AD6BAB30E26C88B = { isa = PBXGroup; children = ( EE5F18DF1DED7617C4A41FF3, B2BCE9DDC8F0F54CA3D913E7, - 562A8671221397C9CAD1BB2A, 5249EFBE3B22E6FC1A7B6D42, + A257B76FCE9D594EAD41414C, 8280AA34B23B4D366711A9E7, C9561A66310DAD5EEB4A9462, B62991F8AEE7327BA8A5070F, @@ -1840,7 +1840,6 @@ 7DB37383434F45D8A7B674C3, CB16B2438EDCC10C499645E6, BEB35C6173793C1CB7AB6311, - 1B00957D2190CF28CF03E304, BA58B49B820A47F6F55CDACB, 930E58E13FC92BF70AC20EEF, 2F1812B26076D9CC1495D452, @@ -1854,6 +1853,7 @@ FE6E3F911679B0D7547577A3, 8BCE60CBC91DBAAB089958A1, 3F11593DC3A168A52FCC2DD9, + FC2C82760E717788B5A6E691, AB0F3F5A622CBB251F64945A, AD495FA1991295C722B46843 ); name = mac; sourceTree = ""; }; 64DE2D4534D79E74C40A0DEE = { isa = PBXGroup; children = ( @@ -2348,8 +2348,8 @@ C9FB7884928BF0D6140AF881, 5C9628DB3E0C0BA8809AE45D, 724DA2BCA5ABC5772604C3B4, - 140FD4605CC549620CC7F44D, 035B1F7B1505ABF24455690E, + 3C71EA297D7418FEBB52F9DD, 7A86E411B55E15DA7AF1FE67, BD86381924AE45021246ABA3, 306AB64E97A05B800349E7E2, @@ -2363,7 +2363,6 @@ D04EEEC7EAE7C806E95ED41C, 7EA440527972D6B7322EC307, CB9FE1DA1AFE5FBA9FF06061, - DEDFFA49B5CBF862CD6EDFD4, 26454A5DB5BAFD7901F17DA7, F41B46F970BA78762DCE67D1, B7A8CF6F889840BED05C8C27, @@ -2375,6 +2374,7 @@ 5E330E219B2D2944BCE95174, 275FBC09BE58E708A73B88C1, 6DA99BA218FB45568258841C, + 32F1C95EDEE7722797B8CEE8, 029A0E8B44DC17211722677D, 4B4E17467BC41E2166549998, 9686F29C29D1C26E353DE68A, diff --git a/Juce.jucer b/Juce.jucer index f876827119..6520e2f1c3 100644 --- a/Juce.jucer +++ b/Juce.jucer @@ -1346,10 +1346,10 @@ file="src/native/mac/juce_ios_Audio.cpp"/> - + - + getApplicationName()); + + if (currentProject != nullptr) + name = currentProject->getDocumentTitle() + " - " + name; + if (documentName.isNotEmpty()) name = documentName + " - " + name; diff --git a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp index ffc4af1791..80d124e35c 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp @@ -308,7 +308,9 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) if (project != nullptr) { ScopedPointer exporter (ProjectExporter::createPlatformDefaultExporter (*project)); - exporter->launchProject(); + + if (exporter != nullptr) + exporter->launchProject(); } break; @@ -316,7 +318,9 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) if (project != nullptr && project->save (true, true) == FileBasedDocument::savedOk) { ScopedPointer exporter (ProjectExporter::createPlatformDefaultExporter (*project)); - exporter->launchProject(); + + if (exporter != nullptr) + exporter->launchProject(); } break; diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h index a7d17f6429..115457a5a3 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_Android.h @@ -65,13 +65,13 @@ public: } //============================================================================== - bool isDefaultFormatForCurrentOS() + int getLaunchPreferenceOrderForCurrentOS() { - #if JUCE_ANDROID - return true; - #else - return false; - #endif + #if JUCE_ANDROID + return 1; + #else + return 0; + #endif } bool isPossibleForCurrentProject() { return project.isGUIApplication(); } diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h index a6687ec584..8bf076a257 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_MSVC.h @@ -431,13 +431,13 @@ public: void launchProject() { getSLNFile().startAsProcess(); } - bool isDefaultFormatForCurrentOS() + int getLaunchPreferenceOrderForCurrentOS() { - #if JUCE_WINDOWS - return true; - #else - return false; - #endif + #if JUCE_WINDOWS + return 4; + #else + return 0; + #endif } static MSVCProjectExporterVC2008* createForSettings (Project& project, const ValueTree& settings) @@ -785,7 +785,14 @@ public: static const char* getName() { return "Visual Studio 2005"; } static const char* getValueTreeTypeName() { return "VS2005"; } - bool isDefaultFormatForCurrentOS() { return false; } + int getLaunchPreferenceOrderForCurrentOS() + { + #if JUCE_WINDOWS + return 2; + #else + return 0; + #endif + } static MSVCProjectExporterVC2005* createForSettings (Project& project, const ValueTree& settings) { @@ -817,7 +824,15 @@ public: static const char* getName() { return "Visual C++ 6.0"; } static const char* getValueTreeTypeName() { return "MSVC6"; } - bool isDefaultFormatForCurrentOS() { return false; } + int getLaunchPreferenceOrderForCurrentOS() + { + #if JUCE_WINDOWS + return 1; + #else + return 0; + #endif + } + void launchProject() { getDSWFile().startAsProcess(); } static MSVCProjectExporterVC6* createForSettings (Project& project, const ValueTree& settings) @@ -1078,7 +1093,15 @@ public: static const char* getName() { return "Visual Studio 2010"; } static const char* getValueTreeTypeName() { return "VS2010"; } - bool isDefaultFormatForCurrentOS() { return false; } + int getLaunchPreferenceOrderForCurrentOS() + { + #if JUCE_WINDOWS + return 3; + #else + return 0; + #endif + } + void launchProject() { getSLNFile().startAsProcess(); } static MSVCProjectExporterVC2010* createForSettings (Project& project, const ValueTree& settings) @@ -1235,63 +1258,77 @@ protected: XmlElement* group = projectXml.createNewChildElement ("ItemDefinitionGroup"); setConditionAttribute (*group, config); - XmlElement* midl = group->createNewChildElement ("Midl"); - midl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (isDebug ? "_DEBUG;%(PreprocessorDefinitions)" - : "NDEBUG;%(PreprocessorDefinitions)"); - midl->createNewChildElement ("MkTypLibCompatible")->addTextElement ("true"); - midl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); - midl->createNewChildElement ("TargetEnvironment")->addTextElement ("Win32"); - //midl->createNewChildElement ("TypeLibraryName")->addTextElement (""); - midl->createNewChildElement ("HeaderFileName"); - - XmlElement* cl = group->createNewChildElement ("ClCompile"); - cl->createNewChildElement ("Optimization")->addTextElement (isDebug ? "Disabled" : "MaxSpeed"); - - if (isDebug) - cl->createNewChildElement ("DebugInformationFormat")->addTextElement ("EditAndContinue"); - - StringArray includePaths (getHeaderSearchPaths (config)); - includePaths.add ("%(AdditionalIncludeDirectories)"); - cl->createNewChildElement ("AdditionalIncludeDirectories")->addTextElement (includePaths.joinIntoString (";")); - cl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (getPreprocessorDefs (config, ";") + ";%(PreprocessorDefinitions)"); - cl->createNewChildElement ("RuntimeLibrary")->addTextElement (isRTAS() ? (isDebug ? "MultiThreadedDLLDebug" : "MultiThreadedDLL") - : (isDebug ? "MultiThreadedDebug" : "MultiThreaded")); - cl->createNewChildElement ("RuntimeTypeInfo")->addTextElement ("true"); - cl->createNewChildElement ("PrecompiledHeader"); - cl->createNewChildElement ("AssemblerListingLocation")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); - cl->createNewChildElement ("ObjectFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); - cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); - cl->createNewChildElement ("WarningLevel")->addTextElement ("Level4"); - cl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); - - XmlElement* res = group->createNewChildElement ("ResourceCompile"); - res->createNewChildElement ("PreprocessorDefinitions")->addTextElement (isDebug ? "_DEBUG;%(PreprocessorDefinitions)" - : "NDEBUG;%(PreprocessorDefinitions)"); - - XmlElement* link = group->createNewChildElement ("Link"); - link->createNewChildElement ("OutputFile")->addTextElement (FileHelpers::windowsStylePath (binariesPath + "/" + outputFileName)); - link->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); - link->createNewChildElement ("IgnoreSpecificDefaultLibraries")->addTextElement (isDebug ? "libcmt.lib; msvcrt.lib;;%(IgnoreSpecificDefaultLibraries)" - : "%(IgnoreSpecificDefaultLibraries)"); - link->createNewChildElement ("GenerateDebugInformation")->addTextElement (isDebug ? "true" : "false"); - link->createNewChildElement ("ProgramDatabaseFile")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".pdb")); - link->createNewChildElement ("SubSystem")->addTextElement (project.isCommandLineApp() ? "Console" : "Windows"); - link->createNewChildElement ("TargetMachine")->addTextElement ("MachineX86"); - - if (! isDebug) { - link->createNewChildElement ("OptimizeReferences")->addTextElement ("true"); - link->createNewChildElement ("EnableCOMDATFolding")->addTextElement ("true"); + XmlElement* midl = group->createNewChildElement ("Midl"); + midl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (isDebug ? "_DEBUG;%(PreprocessorDefinitions)" + : "NDEBUG;%(PreprocessorDefinitions)"); + midl->createNewChildElement ("MkTypLibCompatible")->addTextElement ("true"); + midl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); + midl->createNewChildElement ("TargetEnvironment")->addTextElement ("Win32"); + //midl->createNewChildElement ("TypeLibraryName")->addTextElement (""); + midl->createNewChildElement ("HeaderFileName"); } - String extraLinkerOptions (getExtraLinkerFlags().toString()); - if (extraLinkerOptions.isNotEmpty()) - link->createNewChildElement ("AdditionalOptions")->addTextElement (replacePreprocessorTokens (config, extraLinkerOptions).trim() - + " %(AdditionalOptions)"); + { + XmlElement* cl = group->createNewChildElement ("ClCompile"); + cl->createNewChildElement ("Optimization")->addTextElement (isDebug ? "Disabled" : "MaxSpeed"); - XmlElement* bsc = group->createNewChildElement ("Bscmake"); - bsc->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); - bsc->createNewChildElement ("OutputFile")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".bsc")); + if (isDebug) + cl->createNewChildElement ("DebugInformationFormat")->addTextElement ("EditAndContinue"); + + StringArray includePaths (getHeaderSearchPaths (config)); + includePaths.add ("%(AdditionalIncludeDirectories)"); + cl->createNewChildElement ("AdditionalIncludeDirectories")->addTextElement (includePaths.joinIntoString (";")); + cl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (getPreprocessorDefs (config, ";") + ";%(PreprocessorDefinitions)"); + cl->createNewChildElement ("RuntimeLibrary")->addTextElement (isRTAS() ? (isDebug ? "MultiThreadedDLLDebug" : "MultiThreadedDLL") + : (isDebug ? "MultiThreadedDebug" : "MultiThreaded")); + cl->createNewChildElement ("RuntimeTypeInfo")->addTextElement ("true"); + cl->createNewChildElement ("PrecompiledHeader"); + cl->createNewChildElement ("AssemblerListingLocation")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); + cl->createNewChildElement ("ObjectFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); + cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/")); + cl->createNewChildElement ("WarningLevel")->addTextElement ("Level4"); + cl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); + + const String extraFlags (replacePreprocessorTokens (config, getExtraCompilerFlags().toString()).trim()); + if (extraFlags.isNotEmpty()) + cl->createNewChildElement ("AdditionalOptions")->addTextElement (extraFlags + " %(AdditionalOptions)"); + } + + { + XmlElement* res = group->createNewChildElement ("ResourceCompile"); + res->createNewChildElement ("PreprocessorDefinitions")->addTextElement (isDebug ? "_DEBUG;%(PreprocessorDefinitions)" + : "NDEBUG;%(PreprocessorDefinitions)"); + } + + { + XmlElement* link = group->createNewChildElement ("Link"); + link->createNewChildElement ("OutputFile")->addTextElement (FileHelpers::windowsStylePath (binariesPath + "/" + outputFileName)); + link->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); + link->createNewChildElement ("IgnoreSpecificDefaultLibraries")->addTextElement (isDebug ? "libcmt.lib; msvcrt.lib;;%(IgnoreSpecificDefaultLibraries)" + : "%(IgnoreSpecificDefaultLibraries)"); + link->createNewChildElement ("GenerateDebugInformation")->addTextElement (isDebug ? "true" : "false"); + link->createNewChildElement ("ProgramDatabaseFile")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".pdb")); + link->createNewChildElement ("SubSystem")->addTextElement (project.isCommandLineApp() ? "Console" : "Windows"); + link->createNewChildElement ("TargetMachine")->addTextElement ("MachineX86"); + + if (! isDebug) + { + link->createNewChildElement ("OptimizeReferences")->addTextElement ("true"); + link->createNewChildElement ("EnableCOMDATFolding")->addTextElement ("true"); + } + + String extraLinkerOptions (getExtraLinkerFlags().toString()); + if (extraLinkerOptions.isNotEmpty()) + link->createNewChildElement ("AdditionalOptions")->addTextElement (replacePreprocessorTokens (config, extraLinkerOptions).trim() + + " %(AdditionalOptions)"); + } + + { + XmlElement* bsc = group->createNewChildElement ("Bscmake"); + bsc->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); + bsc->createNewChildElement ("OutputFile")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".bsc")); + } } { @@ -1332,12 +1369,9 @@ protected: const String getProjectType() const { - if (project.isGUIApplication() || project.isCommandLineApp()) - return "Application"; - else if (project.isAudioPlugin() || project.isBrowserPlugin()) - return "DynamicLibrary"; - else if (project.isLibrary()) - return "StaticLibrary"; + if (project.isGUIApplication() || project.isCommandLineApp()) return "Application"; + else if (project.isAudioPlugin() || project.isBrowserPlugin()) return "DynamicLibrary"; + else if (project.isLibrary()) return "StaticLibrary"; jassertfalse; return String::empty; diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h index 790b43bf09..72431069d2 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_Make.h @@ -60,13 +60,13 @@ public: } //============================================================================== - bool isDefaultFormatForCurrentOS() + int getLaunchPreferenceOrderForCurrentOS() { - #if JUCE_LINUX - return true; - #else - return false; - #endif + #if JUCE_LINUX + return 1; + #else + return 0; + #endif } bool isPossibleForCurrentProject() { return true; } diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h index c2fd313c60..080f1ca8c7 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h @@ -73,13 +73,22 @@ public: //============================================================================== Value getObjCSuffix() { return getSetting ("objCExtraSuffix"); } - bool isDefaultFormatForCurrentOS() + int getLaunchPreferenceOrderForCurrentOS() { - #if JUCE_MAC - return ! iPhone; - #else + #if JUCE_MAC + return iPhone ? 1 : 2; + #else + return 0; + #endif + } + + bool isAvailableOnCurrentOS() + { + #if JUCE_MAC + return true; + #else return false; - #endif + #endif } bool isPossibleForCurrentProject() { return project.isGUIApplication() || ! iPhone; } diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp b/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp index dcb36a2758..28514e22a1 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp @@ -104,15 +104,23 @@ ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueT ProjectExporter* ProjectExporter::createPlatformDefaultExporter (Project& project) { + ScopedPointer best; + int bestPref = 0; + for (int i = 0; i < project.getNumExporters(); ++i) { ScopedPointer exp (project.createExporter (i)); - if (exp->isDefaultFormatForCurrentOS()) - return exp.release(); + const int pref = exp->getLaunchPreferenceOrderForCurrentOS(); + + if (pref > bestPref) + { + bestPref = pref; + best = exp; + } } - return 0; + return best.release(); } const File ProjectExporter::getTargetFolder() const diff --git a/extras/Introjucer/Source/Project/jucer_ProjectExporter.h b/extras/Introjucer/Source/Project/jucer_ProjectExporter.h index 92bfeb1bb8..009401ee04 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectExporter.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectExporter.h @@ -48,7 +48,8 @@ public: static ProjectExporter* createPlatformDefaultExporter (Project& project); //============================================================================= - virtual bool isDefaultFormatForCurrentOS() = 0; + // return 0 if this can't be opened in the current OS, or a higher value, where higher numbers are more preferable. + virtual int getLaunchPreferenceOrderForCurrentOS() = 0; virtual bool isPossibleForCurrentProject() = 0; virtual bool usesMMFiles() const = 0; virtual void createPropertyEditors (Array & props); diff --git a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp index 4662914004..72ee209680 100644 --- a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp +++ b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp @@ -1204,7 +1204,7 @@ public: demoComponent->performDemoMenuItem (result); } - static void alertBoxResultChosen (int result, WidgetsDemo* demoComponent) + static void alertBoxResultChosen (int result, WidgetsDemo*) { AlertWindow::showMessageBoxAsync (AlertWindow::InfoIcon, "Alert Box", diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index e567aa2de0..a98a06bf7e 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -270878,6 +270878,16 @@ namespace } } +ScopedAutoReleasePool::ScopedAutoReleasePool() +{ + pool = [[NSAutoreleasePool alloc] init]; +} + +ScopedAutoReleasePool::~ScopedAutoReleasePool() +{ + [((NSAutoreleasePool*) pool) release]; +} + #endif // __JUCE_OSX_OBJCHELPERS_JUCEHEADER__ /*** End of inlined file: juce_osx_ObjCHelpers.h ***/ @@ -273303,541 +273313,6 @@ void File::addToDock() const /*** End of inlined file: juce_mac_Files.mm ***/ -#if JUCE_IOS - -/*** Start of inlined file: juce_ios_MiscUtilities.mm ***/ -// (This file gets included by juce_mac_NativeCode.mm, rather than being -// compiled on its own). -#if JUCE_INCLUDED_FILE - -END_JUCE_NAMESPACE - -@interface JuceAppStartupDelegate : NSObject -{ -} - -- (void) applicationDidFinishLaunching: (UIApplication*) application; -- (void) applicationWillTerminate: (UIApplication*) application; - -@end - -@implementation JuceAppStartupDelegate - -- (void) applicationDidFinishLaunching: (UIApplication*) application -{ - initialiseJuce_GUI(); - - if (! JUCEApplication::createInstance()->initialiseApp (String::empty)) - exit (0); -} - -- (void) applicationWillTerminate: (UIApplication*) application -{ - JUCEApplication::appWillTerminateByForce(); -} - -@end - -BEGIN_JUCE_NAMESPACE - -int juce_iOSMain (int argc, const char* argv[]) -{ - return UIApplicationMain (argc, const_cast (argv), nil, @"JuceAppStartupDelegate"); -} - -ScopedAutoReleasePool::ScopedAutoReleasePool() -{ - pool = [[NSAutoreleasePool alloc] init]; -} - -ScopedAutoReleasePool::~ScopedAutoReleasePool() -{ - [((NSAutoreleasePool*) pool) release]; -} - -void LookAndFeel::playAlertSound() -{ - //xxx - //AudioServicesPlaySystemSound (); -} - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - -class iOSMessageBox; - -END_JUCE_NAMESPACE - -@interface JuceAlertBoxDelegate : NSObject -{ -@public - iOSMessageBox* owner; -} - -- (void) alertView: (UIAlertView*) alertView clickedButtonAtIndex: (NSInteger) buttonIndex; - -@end - -BEGIN_JUCE_NAMESPACE - -class iOSMessageBox -{ -public: - iOSMessageBox (const String& title, const String& message, - NSString* button1, NSString* button2, NSString* button3, - ModalComponentManager::Callback* callback_, const bool isAsync_) - : result (0), delegate (nil), alert (nil), - callback (callback_), isYesNo (button3 != nil), isAsync (isAsync_) - { - delegate = [[JuceAlertBoxDelegate alloc] init]; - delegate->owner = this; - - alert = [[UIAlertView alloc] initWithTitle: juceStringToNS (title) - message: juceStringToNS (message) - delegate: delegate - cancelButtonTitle: button1 - otherButtonTitles: button2, button3, nil]; - [alert retain]; - [alert show]; - } - - ~iOSMessageBox() - { - [alert release]; - [delegate release]; - } - - int getResult() - { - jassert (callback == nullptr); - JUCE_AUTORELEASEPOOL - - while (! alert.hidden && alert.superview != nil) - [[NSRunLoop mainRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; - - return result; - } - - void buttonClicked (const int buttonIndex) noexcept - { - result = buttonIndex; - - if (callback != nullptr) - callback->modalStateFinished (result); - - if (isAsync) - delete this; - } - -private: - int result; - JuceAlertBoxDelegate* delegate; - UIAlertView* alert; - ModalComponentManager::Callback* callback; - const bool isYesNo, isAsync; - - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (iOSMessageBox); -}; - -END_JUCE_NAMESPACE - -@implementation JuceAlertBoxDelegate - -- (void) alertView: (UIAlertView*) alertView clickedButtonAtIndex: (NSInteger) buttonIndex -{ - owner->buttonClicked (buttonIndex); - alertView.hidden = true; -} - -@end -BEGIN_JUCE_NAMESPACE - -void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent) -{ - JUCE_AUTORELEASEPOOL - iOSMessageBox mb (title, message, @"OK", nil, nil, 0, false); - (void) mb.getResult(); -} - -void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent) -{ - JUCE_AUTORELEASEPOOL - new iOSMessageBox (title, message, @"OK", nil, nil, 0, true); -} - -bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent, - ModalComponentManager::Callback* callback) -{ - ScopedPointer mb (new iOSMessageBox (title, message, @"Cancel", @"OK", nil, callback, callback != nullptr)); - - if (callback == nullptr) - return mb->getResult() == 1; - - mb.release(); - return false; -} - -int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent, - ModalComponentManager::Callback* callback) -{ - ScopedPointer mb (new iOSMessageBox (title, message, @"Cancel", @"Yes", @"No", callback, callback != nullptr)); - - if (callback == nullptr) - return mb->getResult(); - - mb.release(); - return 0; -} - -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) -{ - jassertfalse; // no such thing on the iphone! - return false; -} - -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) -{ - jassertfalse; // no such thing on the iphone! - return false; -} - -void Desktop::setScreenSaverEnabled (const bool isEnabled) -{ - [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; -} - -bool Desktop::isScreenSaverEnabled() -{ - return ! [[UIApplication sharedApplication] isIdleTimerDisabled]; -} - -#endif - -#endif - -/*** End of inlined file: juce_ios_MiscUtilities.mm ***/ - - -#else - -/*** Start of inlined file: juce_mac_MiscUtilities.mm ***/ -// (This file gets included by juce_mac_NativeCode.mm, rather than being -// compiled on its own). -#if JUCE_INCLUDED_FILE - -ScopedAutoReleasePool::ScopedAutoReleasePool() -{ - pool = [[NSAutoreleasePool alloc] init]; -} - -ScopedAutoReleasePool::~ScopedAutoReleasePool() -{ - [((NSAutoreleasePool*) pool) release]; -} - -void LookAndFeel::playAlertSound() -{ - NSBeep(); -} - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - -class OSXMessageBox : public AsyncUpdater -{ -public: - OSXMessageBox (AlertWindow::AlertIconType iconType_, - const String& title_, const String& message_, - NSString* button1_, NSString* button2_, NSString* button3_, - ModalComponentManager::Callback* callback_, - const bool runAsync) - : iconType (iconType_), title (title_), - message (message_), callback (callback_), - button1 ([button1_ retain]), - button2 ([button2_ retain]), - button3 ([button3_ retain]) - { - if (runAsync) - triggerAsyncUpdate(); - } - - ~OSXMessageBox() - { - [button1 release]; - [button2 release]; - [button3 release]; - } - - int getResult() const - { - JUCE_AUTORELEASEPOOL - NSInteger r = getRawResult(); - return r == NSAlertDefaultReturn ? 1 : (r == NSAlertOtherReturn ? 2 : 0); - } - - void handleAsyncUpdate() - { - const int result = getResult(); - - if (callback != nullptr) - callback->modalStateFinished (result); - - delete this; - } - -private: - AlertWindow::AlertIconType iconType; - String title, message; - ModalComponentManager::Callback* callback; - NSString* button1; - NSString* button2; - NSString* button3; - - NSInteger getRawResult() const - { - NSString* messageString = juceStringToNS (message); - NSString* titleString = juceStringToNS (title); - - switch (iconType) - { - case AlertWindow::InfoIcon: return NSRunInformationalAlertPanel (titleString, messageString, button1, button2, button3); - case AlertWindow::WarningIcon: return NSRunCriticalAlertPanel (titleString, messageString, button1, button2, button3); - default: return NSRunAlertPanel (titleString, messageString, button1, button2, button3); - } - } -}; - -void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent) -{ - OSXMessageBox box (iconType, title, message, @"OK", nil, nil, 0, false); - (void) box.getResult(); -} - -void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent) -{ - new OSXMessageBox (iconType, title, message, @"OK", nil, nil, 0, true); -} - -bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent, - ModalComponentManager::Callback* callback) -{ - ScopedPointer mb (new OSXMessageBox (iconType, title, message, - @"OK", @"Cancel", nil, callback, callback != nullptr)); - if (callback == nullptr) - return mb->getResult() == 1; - - mb.release(); - return false; -} - -int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, - const String& title, const String& message, - Component* associatedComponent, - ModalComponentManager::Callback* callback) -{ - ScopedPointer mb (new OSXMessageBox (iconType, title, message, - @"Yes", @"Cancel", @"No", callback, callback != nullptr)); - if (callback == nullptr) - return mb->getResult(); - - mb.release(); - return 0; -} - -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool /*canMoveFiles*/) -{ - if (files.size() == 0) - return false; - - MouseInputSource* draggingSource = Desktop::getInstance().getDraggingMouseSource(0); - - if (draggingSource == nullptr) - { - jassertfalse; // This method must be called in response to a component's mouseDown or mouseDrag event! - return false; - } - - Component* sourceComp = draggingSource->getComponentUnderMouse(); - - if (sourceComp == nullptr) - { - jassertfalse; // This method must be called in response to a component's mouseDown or mouseDrag event! - return false; - } - - JUCE_AUTORELEASEPOOL - - NSView* view = (NSView*) sourceComp->getWindowHandle(); - - if (view == nil) - return false; - - NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; - [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] - owner: nil]; - - NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4]; - for (int i = 0; i < files.size(); ++i) - [filesArray addObject: juceStringToNS (files[i])]; - - [pboard setPropertyList: filesArray - forType: NSFilenamesPboardType]; - - NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow] - fromView: nil]; - dragPosition.x -= 16; - dragPosition.y -= 16; - - [view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])] - at: dragPosition - offset: NSMakeSize (0, 0) - event: [[view window] currentEvent] - pasteboard: pboard - source: view - slideBack: YES]; - - return true; -} - -bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/) -{ - jassertfalse; // not implemented! - return false; -} - -bool Desktop::canUseSemiTransparentWindows() noexcept -{ - return true; -} - -const Point MouseInputSource::getCurrentMousePosition() -{ - JUCE_AUTORELEASEPOOL - const NSPoint p ([NSEvent mouseLocation]); - return Point (roundToInt (p.x), roundToInt ([[[NSScreen screens] objectAtIndex: 0] frame].size.height - p.y)); -} - -void Desktop::setMousePosition (const Point& newPosition) -{ - // this rubbish needs to be done around the warp call, to avoid causing a - // bizarre glitch.. - CGAssociateMouseAndMouseCursorPosition (false); - CGWarpMouseCursorPosition (CGPointMake (newPosition.getX(), newPosition.getY())); - CGAssociateMouseAndMouseCursorPosition (true); -} - -Desktop::DisplayOrientation Desktop::getCurrentOrientation() const -{ - return upright; -} - -#ifndef __POWER__ // Some versions of the SDK omit this function.. - extern "C" { extern OSErr UpdateSystemActivity (UInt8); } -#endif - -class ScreenSaverDefeater : public Timer -{ -public: - ScreenSaverDefeater() - { - startTimer (10000); - timerCallback(); - } - - void timerCallback() - { - if (Process::isForegroundProcess()) - UpdateSystemActivity (1 /*UsrActivity*/); - } -}; - -static ScopedPointer screenSaverDefeater; - -void Desktop::setScreenSaverEnabled (const bool isEnabled) -{ - if (isEnabled) - screenSaverDefeater = nullptr; - else if (screenSaverDefeater == nullptr) - screenSaverDefeater = new ScreenSaverDefeater(); -} - -bool Desktop::isScreenSaverEnabled() -{ - return screenSaverDefeater == nullptr; -} - -class DisplaySettingsChangeCallback : public DeletedAtShutdown -{ -public: - DisplaySettingsChangeCallback() - { - CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, 0); - } - - ~DisplaySettingsChangeCallback() - { - CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, 0); - clearSingletonInstance(); - } - - static void displayReconfigurationCallBack (CGDirectDisplayID, CGDisplayChangeSummaryFlags, void*) - { - Desktop::getInstance().refreshMonitorSizes(); - } - - juce_DeclareSingleton_SingleThreaded_Minimal (DisplaySettingsChangeCallback); - -private: - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DisplaySettingsChangeCallback); -}; - -juce_ImplementSingleton_SingleThreaded (DisplaySettingsChangeCallback); - -void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) -{ - JUCE_AUTORELEASEPOOL - - DisplaySettingsChangeCallback::getInstance(); - - monitorCoords.clear(); - NSArray* screens = [NSScreen screens]; - const CGFloat mainScreenBottom = [[[NSScreen screens] objectAtIndex: 0] frame].size.height; - - for (unsigned int i = 0; i < [screens count]; ++i) - { - NSScreen* s = (NSScreen*) [screens objectAtIndex: i]; - - NSRect r = clipToWorkArea ? [s visibleFrame] - : [s frame]; - - r.origin.y = mainScreenBottom - (r.origin.y + r.size.height); - - monitorCoords.add (convertToRectInt (r)); - } - - jassert (monitorCoords.size() > 0); -} - -#endif -#endif - -/*** End of inlined file: juce_mac_MiscUtilities.mm ***/ - - -#endif - /*** Start of inlined file: juce_mac_Debugging.mm ***/ // (This file gets included by juce_mac_NativeCode.mm, rather than being @@ -276451,61 +275926,6 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) return new UIViewComponentPeer (this, styleFlags, (UIView*) windowToAttachTo); } -Image juce_createIconForFile (const File& file) -{ - return Image::null; -} - -void SystemClipboard::copyTextToClipboard (const String& text) -{ - [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) - forPasteboardType: @"public.text"]; -} - -String SystemClipboard::getTextFromClipboard() -{ - NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; - - return text == nil ? String::empty - : nsStringToJuce (text); -} - -void Desktop::createMouseInputSources() -{ - for (int i = 0; i < 10; ++i) - mouseSources.add (new MouseInputSource (i, false)); -} - -bool Desktop::canUseSemiTransparentWindows() noexcept -{ - return true; -} - -const Point MouseInputSource::getCurrentMousePosition() -{ - return juce_lastMousePos; -} - -void Desktop::setMousePosition (const Point&) -{ -} - -Desktop::DisplayOrientation Desktop::getCurrentOrientation() const -{ - return convertToJuceOrientation ([[UIApplication sharedApplication] statusBarOrientation]); -} - -void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) -{ - JUCE_AUTORELEASEPOOL - monitorCoords.clear(); - - CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] - : [[UIScreen mainScreen] bounds]; - - monitorCoords.add (UIViewComponentPeer::realScreenPosToRotated (convertToRectInt (r))); -} - const int KeyPress::spaceKey = ' '; const int KeyPress::returnKey = 0x0d; const int KeyPress::escapeKey = 0x1b; @@ -276565,11 +275985,272 @@ const int KeyPress::rewindKey = 0x30003; /*** End of inlined file: juce_ios_UIViewComponentPeer.mm ***/ +/*** Start of inlined file: juce_ios_Windowing.mm ***/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +void LookAndFeel::playAlertSound() +{ + //xxx + //AudioServicesPlaySystemSound (); +} + +class iOSMessageBox; + +END_JUCE_NAMESPACE + +@interface JuceAlertBoxDelegate : NSObject +{ +@public + iOSMessageBox* owner; +} + +- (void) alertView: (UIAlertView*) alertView clickedButtonAtIndex: (NSInteger) buttonIndex; + +@end + +BEGIN_JUCE_NAMESPACE + +class iOSMessageBox +{ +public: + iOSMessageBox (const String& title, const String& message, + NSString* button1, NSString* button2, NSString* button3, + ModalComponentManager::Callback* callback_, const bool isAsync_) + : result (0), delegate (nil), alert (nil), + callback (callback_), isYesNo (button3 != nil), isAsync (isAsync_) + { + delegate = [[JuceAlertBoxDelegate alloc] init]; + delegate->owner = this; + + alert = [[UIAlertView alloc] initWithTitle: juceStringToNS (title) + message: juceStringToNS (message) + delegate: delegate + cancelButtonTitle: button1 + otherButtonTitles: button2, button3, nil]; + [alert retain]; + [alert show]; + } + + ~iOSMessageBox() + { + [alert release]; + [delegate release]; + } + + int getResult() + { + jassert (callback == nullptr); + JUCE_AUTORELEASEPOOL + + while (! alert.hidden && alert.superview != nil) + [[NSRunLoop mainRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; + + return result; + } + + void buttonClicked (const int buttonIndex) noexcept + { + result = buttonIndex; + + if (callback != nullptr) + callback->modalStateFinished (result); + + if (isAsync) + delete this; + } + +private: + int result; + JuceAlertBoxDelegate* delegate; + UIAlertView* alert; + ModalComponentManager::Callback* callback; + const bool isYesNo, isAsync; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (iOSMessageBox); +}; + +END_JUCE_NAMESPACE + +@implementation JuceAlertBoxDelegate + +- (void) alertView: (UIAlertView*) alertView clickedButtonAtIndex: (NSInteger) buttonIndex +{ + owner->buttonClicked (buttonIndex); + alertView.hidden = true; +} + +@end +BEGIN_JUCE_NAMESPACE + +void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent) +{ + JUCE_AUTORELEASEPOOL + iOSMessageBox mb (title, message, @"OK", nil, nil, 0, false); + (void) mb.getResult(); +} + +void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent) +{ + JUCE_AUTORELEASEPOOL + new iOSMessageBox (title, message, @"OK", nil, nil, 0, true); +} + +bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent, + ModalComponentManager::Callback* callback) +{ + ScopedPointer mb (new iOSMessageBox (title, message, @"Cancel", @"OK", nil, callback, callback != nullptr)); + + if (callback == nullptr) + return mb->getResult() == 1; + + mb.release(); + return false; +} + +int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent, + ModalComponentManager::Callback* callback) +{ + ScopedPointer mb (new iOSMessageBox (title, message, @"Cancel", @"Yes", @"No", callback, callback != nullptr)); + + if (callback == nullptr) + return mb->getResult(); + + mb.release(); + return 0; +} + +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +{ + jassertfalse; // no such thing on the iphone! + return false; +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +{ + jassertfalse; // no such thing on the iphone! + return false; +} + +void Desktop::setScreenSaverEnabled (const bool isEnabled) +{ + [[UIApplication sharedApplication] setIdleTimerDisabled: ! isEnabled]; +} + +bool Desktop::isScreenSaverEnabled() +{ + return ! [[UIApplication sharedApplication] isIdleTimerDisabled]; +} + +Image juce_createIconForFile (const File& file) +{ + return Image::null; +} + +void SystemClipboard::copyTextToClipboard (const String& text) +{ + [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) + forPasteboardType: @"public.text"]; +} + +String SystemClipboard::getTextFromClipboard() +{ + NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; + + return text == nil ? String::empty + : nsStringToJuce (text); +} + +void Desktop::createMouseInputSources() +{ + for (int i = 0; i < 10; ++i) + mouseSources.add (new MouseInputSource (i, false)); +} + +bool Desktop::canUseSemiTransparentWindows() noexcept +{ + return true; +} + +const Point MouseInputSource::getCurrentMousePosition() +{ + return juce_lastMousePos; +} + +void Desktop::setMousePosition (const Point&) +{ +} + +Desktop::DisplayOrientation Desktop::getCurrentOrientation() const +{ + return convertToJuceOrientation ([[UIApplication sharedApplication] statusBarOrientation]); +} + +void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) +{ + JUCE_AUTORELEASEPOOL + monitorCoords.clear(); + + CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] + : [[UIScreen mainScreen] bounds]; + + monitorCoords.add (UIViewComponentPeer::realScreenPosToRotated (convertToRectInt (r))); +} + +#endif + +/*** End of inlined file: juce_ios_Windowing.mm ***/ + + /*** Start of inlined file: juce_ios_MessageManager.mm ***/ // (This file gets included by juce_mac_NativeCode.mm, rather than being // compiled on its own). #if JUCE_INCLUDED_FILE +END_JUCE_NAMESPACE + +@interface JuceAppStartupDelegate : NSObject +{ +} + +- (void) applicationDidFinishLaunching: (UIApplication*) application; +- (void) applicationWillTerminate: (UIApplication*) application; + +@end + +@implementation JuceAppStartupDelegate + +- (void) applicationDidFinishLaunching: (UIApplication*) application +{ + initialiseJuce_GUI(); + + if (! JUCEApplication::createInstance()->initialiseApp (String::empty)) + exit (0); +} + +- (void) applicationWillTerminate: (UIApplication*) application +{ + JUCEApplication::appWillTerminateByForce(); +} + +@end + +BEGIN_JUCE_NAMESPACE + +int juce_iOSMain (int argc, const char* argv[]) +{ + return UIApplicationMain (argc, const_cast (argv), nil, @"JuceAppStartupDelegate"); +} + struct CallbackMessagePayload { MessageCallbackFunction* function; @@ -282218,44 +281899,6 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) return new NSViewComponentPeer (this, styleFlags, (NSView*) windowToAttachTo); } -Image juce_createIconForFile (const File& file) -{ - JUCE_AUTORELEASEPOOL - - NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; - - CoreGraphicsImage* result = new CoreGraphicsImage (Image::ARGB, (int) [image size].width, (int) [image size].height, true); - - [NSGraphicsContext saveGraphicsState]; - [NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: result->context flipped: false]]; - - [image drawAtPoint: NSMakePoint (0, 0) - fromRect: NSMakeRect (0, 0, [image size].width, [image size].height) - operation: NSCompositeSourceOver fraction: 1.0f]; - - [[NSGraphicsContext currentContext] flushGraphics]; - [NSGraphicsContext restoreGraphicsState]; - - return Image (result); -} - -void SystemClipboard::copyTextToClipboard (const String& text) -{ - [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] - owner: nil]; - - [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) - forType: NSStringPboardType]; -} - -String SystemClipboard::getTextFromClipboard() -{ - NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; - - return text == nil ? String::empty - : nsStringToJuce (text); -} - const int KeyPress::spaceKey = ' '; const int KeyPress::returnKey = 0x0d; const int KeyPress::escapeKey = 0x1b; @@ -282315,6 +281958,342 @@ const int KeyPress::rewindKey = 0x30003; /*** End of inlined file: juce_mac_NSViewComponentPeer.mm ***/ +/*** Start of inlined file: juce_mac_Windowing.mm ***/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +void LookAndFeel::playAlertSound() +{ + NSBeep(); +} + +class OSXMessageBox : public AsyncUpdater +{ +public: + OSXMessageBox (AlertWindow::AlertIconType iconType_, + const String& title_, const String& message_, + NSString* button1_, NSString* button2_, NSString* button3_, + ModalComponentManager::Callback* callback_, + const bool runAsync) + : iconType (iconType_), title (title_), + message (message_), callback (callback_), + button1 ([button1_ retain]), + button2 ([button2_ retain]), + button3 ([button3_ retain]) + { + if (runAsync) + triggerAsyncUpdate(); + } + + ~OSXMessageBox() + { + [button1 release]; + [button2 release]; + [button3 release]; + } + + int getResult() const + { + JUCE_AUTORELEASEPOOL + NSInteger r = getRawResult(); + return r == NSAlertDefaultReturn ? 1 : (r == NSAlertOtherReturn ? 2 : 0); + } + + void handleAsyncUpdate() + { + const int result = getResult(); + + if (callback != nullptr) + callback->modalStateFinished (result); + + delete this; + } + +private: + AlertWindow::AlertIconType iconType; + String title, message; + ModalComponentManager::Callback* callback; + NSString* button1; + NSString* button2; + NSString* button3; + + NSInteger getRawResult() const + { + NSString* messageString = juceStringToNS (message); + NSString* titleString = juceStringToNS (title); + + switch (iconType) + { + case AlertWindow::InfoIcon: return NSRunInformationalAlertPanel (titleString, messageString, button1, button2, button3); + case AlertWindow::WarningIcon: return NSRunCriticalAlertPanel (titleString, messageString, button1, button2, button3); + default: return NSRunAlertPanel (titleString, messageString, button1, button2, button3); + } + } +}; + +void JUCE_CALLTYPE NativeMessageBox::showMessageBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent) +{ + OSXMessageBox box (iconType, title, message, @"OK", nil, nil, 0, false); + (void) box.getResult(); +} + +void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent) +{ + new OSXMessageBox (iconType, title, message, @"OK", nil, nil, 0, true); +} + +bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent, + ModalComponentManager::Callback* callback) +{ + ScopedPointer mb (new OSXMessageBox (iconType, title, message, + @"OK", @"Cancel", nil, callback, callback != nullptr)); + if (callback == nullptr) + return mb->getResult() == 1; + + mb.release(); + return false; +} + +int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, + const String& title, const String& message, + Component* associatedComponent, + ModalComponentManager::Callback* callback) +{ + ScopedPointer mb (new OSXMessageBox (iconType, title, message, + @"Yes", @"Cancel", @"No", callback, callback != nullptr)); + if (callback == nullptr) + return mb->getResult(); + + mb.release(); + return 0; +} + +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool /*canMoveFiles*/) +{ + if (files.size() == 0) + return false; + + MouseInputSource* draggingSource = Desktop::getInstance().getDraggingMouseSource(0); + + if (draggingSource == nullptr) + { + jassertfalse; // This method must be called in response to a component's mouseDown or mouseDrag event! + return false; + } + + Component* sourceComp = draggingSource->getComponentUnderMouse(); + + if (sourceComp == nullptr) + { + jassertfalse; // This method must be called in response to a component's mouseDown or mouseDrag event! + return false; + } + + JUCE_AUTORELEASEPOOL + + NSView* view = (NSView*) sourceComp->getWindowHandle(); + + if (view == nil) + return false; + + NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; + [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] + owner: nil]; + + NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4]; + for (int i = 0; i < files.size(); ++i) + [filesArray addObject: juceStringToNS (files[i])]; + + [pboard setPropertyList: filesArray + forType: NSFilenamesPboardType]; + + NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow] + fromView: nil]; + dragPosition.x -= 16; + dragPosition.y -= 16; + + [view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])] + at: dragPosition + offset: NSMakeSize (0, 0) + event: [[view window] currentEvent] + pasteboard: pboard + source: view + slideBack: YES]; + + return true; +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/) +{ + jassertfalse; // not implemented! + return false; +} + +bool Desktop::canUseSemiTransparentWindows() noexcept +{ + return true; +} + +const Point MouseInputSource::getCurrentMousePosition() +{ + JUCE_AUTORELEASEPOOL + const NSPoint p ([NSEvent mouseLocation]); + return Point (roundToInt (p.x), roundToInt ([[[NSScreen screens] objectAtIndex: 0] frame].size.height - p.y)); +} + +void Desktop::setMousePosition (const Point& newPosition) +{ + // this rubbish needs to be done around the warp call, to avoid causing a + // bizarre glitch.. + CGAssociateMouseAndMouseCursorPosition (false); + CGWarpMouseCursorPosition (CGPointMake (newPosition.getX(), newPosition.getY())); + CGAssociateMouseAndMouseCursorPosition (true); +} + +Desktop::DisplayOrientation Desktop::getCurrentOrientation() const +{ + return upright; +} + +#ifndef __POWER__ // Some versions of the SDK omit this function.. + extern "C" { extern OSErr UpdateSystemActivity (UInt8); } +#endif + +class ScreenSaverDefeater : public Timer +{ +public: + ScreenSaverDefeater() + { + startTimer (10000); + timerCallback(); + } + + void timerCallback() + { + if (Process::isForegroundProcess()) + UpdateSystemActivity (1 /*UsrActivity*/); + } +}; + +static ScopedPointer screenSaverDefeater; + +void Desktop::setScreenSaverEnabled (const bool isEnabled) +{ + if (isEnabled) + screenSaverDefeater = nullptr; + else if (screenSaverDefeater == nullptr) + screenSaverDefeater = new ScreenSaverDefeater(); +} + +bool Desktop::isScreenSaverEnabled() +{ + return screenSaverDefeater == nullptr; +} + +class DisplaySettingsChangeCallback : public DeletedAtShutdown +{ +public: + DisplaySettingsChangeCallback() + { + CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, 0); + } + + ~DisplaySettingsChangeCallback() + { + CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, 0); + clearSingletonInstance(); + } + + static void displayReconfigurationCallBack (CGDirectDisplayID, CGDisplayChangeSummaryFlags, void*) + { + Desktop::getInstance().refreshMonitorSizes(); + } + + juce_DeclareSingleton_SingleThreaded_Minimal (DisplaySettingsChangeCallback); + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DisplaySettingsChangeCallback); +}; + +juce_ImplementSingleton_SingleThreaded (DisplaySettingsChangeCallback); + +void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) +{ + JUCE_AUTORELEASEPOOL + + DisplaySettingsChangeCallback::getInstance(); + + monitorCoords.clear(); + NSArray* screens = [NSScreen screens]; + const CGFloat mainScreenBottom = [[[NSScreen screens] objectAtIndex: 0] frame].size.height; + + for (unsigned int i = 0; i < [screens count]; ++i) + { + NSScreen* s = (NSScreen*) [screens objectAtIndex: i]; + + NSRect r = clipToWorkArea ? [s visibleFrame] + : [s frame]; + + r.origin.y = mainScreenBottom - (r.origin.y + r.size.height); + + monitorCoords.add (convertToRectInt (r)); + } + + jassert (monitorCoords.size() > 0); +} + +Image juce_createIconForFile (const File& file) +{ + JUCE_AUTORELEASEPOOL + + NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; + + CoreGraphicsImage* result = new CoreGraphicsImage (Image::ARGB, + (int) [image size].width, + (int) [image size].height, true); + + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: result->context flipped: false]]; + + [image drawAtPoint: NSMakePoint (0, 0) + fromRect: NSMakeRect (0, 0, [image size].width, [image size].height) + operation: NSCompositeSourceOver fraction: 1.0f]; + + [[NSGraphicsContext currentContext] flushGraphics]; + [NSGraphicsContext restoreGraphicsState]; + + return Image (result); +} + +void SystemClipboard::copyTextToClipboard (const String& text) +{ + [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] + owner: nil]; + + [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) + forType: NSStringPboardType]; +} + +String SystemClipboard::getTextFromClipboard() +{ + NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; + + return text == nil ? String::empty + : nsStringToJuce (text); +} + +#endif + +/*** End of inlined file: juce_mac_Windowing.mm ***/ + + /*** Start of inlined file: juce_mac_MouseCursor.mm ***/ // (This file gets included by juce_mac_NativeCode.mm, rather than being // compiled on its own). diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 8c0bd759bb..793a9c999c 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 54 -#define JUCE_BUILDNUMBER 8 +#define JUCE_BUILDNUMBER 9 /** Current Juce version number. diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index b7440774c8..8fa603b203 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 54 -#define JUCE_BUILDNUMBER 8 +#define JUCE_BUILDNUMBER 9 /** Current Juce version number. diff --git a/src/native/mac/juce_ios_MessageManager.mm b/src/native/mac/juce_ios_MessageManager.mm index 05c760139c..a70b08ce17 100644 --- a/src/native/mac/juce_ios_MessageManager.mm +++ b/src/native/mac/juce_ios_MessageManager.mm @@ -27,6 +27,43 @@ // compiled on its own). #if JUCE_INCLUDED_FILE +//============================================================================== +END_JUCE_NAMESPACE + +@interface JuceAppStartupDelegate : NSObject +{ +} + +- (void) applicationDidFinishLaunching: (UIApplication*) application; +- (void) applicationWillTerminate: (UIApplication*) application; + +@end + +@implementation JuceAppStartupDelegate + +- (void) applicationDidFinishLaunching: (UIApplication*) application +{ + initialiseJuce_GUI(); + + if (! JUCEApplication::createInstance()->initialiseApp (String::empty)) + exit (0); +} + +- (void) applicationWillTerminate: (UIApplication*) application +{ + JUCEApplication::appWillTerminateByForce(); +} + +@end + +BEGIN_JUCE_NAMESPACE + +int juce_iOSMain (int argc, const char* argv[]) +{ + return UIApplicationMain (argc, const_cast (argv), nil, @"JuceAppStartupDelegate"); +} + +//============================================================================== struct CallbackMessagePayload { MessageCallbackFunction* function; diff --git a/src/native/mac/juce_ios_UIViewComponentPeer.mm b/src/native/mac/juce_ios_UIViewComponentPeer.mm index 2416f38e04..15e742d361 100644 --- a/src/native/mac/juce_ios_UIViewComponentPeer.mm +++ b/src/native/mac/juce_ios_UIViewComponentPeer.mm @@ -1004,64 +1004,6 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) return new UIViewComponentPeer (this, styleFlags, (UIView*) windowToAttachTo); } -//============================================================================== -Image juce_createIconForFile (const File& file) -{ - return Image::null; -} - -//============================================================================== -void SystemClipboard::copyTextToClipboard (const String& text) -{ - [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) - forPasteboardType: @"public.text"]; -} - -String SystemClipboard::getTextFromClipboard() -{ - NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; - - return text == nil ? String::empty - : nsStringToJuce (text); -} - -//============================================================================== -void Desktop::createMouseInputSources() -{ - for (int i = 0; i < 10; ++i) - mouseSources.add (new MouseInputSource (i, false)); -} - -bool Desktop::canUseSemiTransparentWindows() noexcept -{ - return true; -} - -const Point MouseInputSource::getCurrentMousePosition() -{ - return juce_lastMousePos; -} - -void Desktop::setMousePosition (const Point&) -{ -} - -Desktop::DisplayOrientation Desktop::getCurrentOrientation() const -{ - return convertToJuceOrientation ([[UIApplication sharedApplication] statusBarOrientation]); -} - -void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) -{ - JUCE_AUTORELEASEPOOL - monitorCoords.clear(); - - CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] - : [[UIScreen mainScreen] bounds]; - - monitorCoords.add (UIViewComponentPeer::realScreenPosToRotated (convertToRectInt (r))); -} - //============================================================================== const int KeyPress::spaceKey = ' '; const int KeyPress::returnKey = 0x0d; diff --git a/src/native/mac/juce_ios_MiscUtilities.mm b/src/native/mac/juce_ios_Windowing.mm similarity index 80% rename from src/native/mac/juce_ios_MiscUtilities.mm rename to src/native/mac/juce_ios_Windowing.mm index 799ec0d1b4..6d472332fb 100644 --- a/src/native/mac/juce_ios_MiscUtilities.mm +++ b/src/native/mac/juce_ios_Windowing.mm @@ -28,53 +28,6 @@ #if JUCE_INCLUDED_FILE -//============================================================================== -END_JUCE_NAMESPACE - -@interface JuceAppStartupDelegate : NSObject -{ -} - -- (void) applicationDidFinishLaunching: (UIApplication*) application; -- (void) applicationWillTerminate: (UIApplication*) application; - -@end - -@implementation JuceAppStartupDelegate - -- (void) applicationDidFinishLaunching: (UIApplication*) application -{ - initialiseJuce_GUI(); - - if (! JUCEApplication::createInstance()->initialiseApp (String::empty)) - exit (0); -} - -- (void) applicationWillTerminate: (UIApplication*) application -{ - JUCEApplication::appWillTerminateByForce(); -} - -@end - -BEGIN_JUCE_NAMESPACE - -int juce_iOSMain (int argc, const char* argv[]) -{ - return UIApplicationMain (argc, const_cast (argv), nil, @"JuceAppStartupDelegate"); -} - -//============================================================================== -ScopedAutoReleasePool::ScopedAutoReleasePool() -{ - pool = [[NSAutoreleasePool alloc] init]; -} - -ScopedAutoReleasePool::~ScopedAutoReleasePool() -{ - [((NSAutoreleasePool*) pool) release]; -} - //============================================================================== void LookAndFeel::playAlertSound() { @@ -82,9 +35,6 @@ void LookAndFeel::playAlertSound() //AudioServicesPlaySystemSound (); } -//============================================================================== -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - //============================================================================== class iOSMessageBox; @@ -245,7 +195,62 @@ bool Desktop::isScreenSaverEnabled() return ! [[UIApplication sharedApplication] isIdleTimerDisabled]; } - -#endif +//============================================================================== +Image juce_createIconForFile (const File& file) +{ + return Image::null; +} + +//============================================================================== +void SystemClipboard::copyTextToClipboard (const String& text) +{ + [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) + forPasteboardType: @"public.text"]; +} + +String SystemClipboard::getTextFromClipboard() +{ + NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; + + return text == nil ? String::empty + : nsStringToJuce (text); +} + +//============================================================================== +void Desktop::createMouseInputSources() +{ + for (int i = 0; i < 10; ++i) + mouseSources.add (new MouseInputSource (i, false)); +} + +bool Desktop::canUseSemiTransparentWindows() noexcept +{ + return true; +} + +const Point MouseInputSource::getCurrentMousePosition() +{ + return juce_lastMousePos; +} + +void Desktop::setMousePosition (const Point&) +{ +} + +Desktop::DisplayOrientation Desktop::getCurrentOrientation() const +{ + return convertToJuceOrientation ([[UIApplication sharedApplication] statusBarOrientation]); +} + +void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) +{ + JUCE_AUTORELEASEPOOL + monitorCoords.clear(); + + CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] + : [[UIScreen mainScreen] bounds]; + + monitorCoords.add (UIViewComponentPeer::realScreenPosToRotated (convertToRectInt (r))); +} #endif diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 7af1fbb2e7..7eda3a4dce 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -1719,46 +1719,6 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) return new NSViewComponentPeer (this, styleFlags, (NSView*) windowToAttachTo); } -//============================================================================== -Image juce_createIconForFile (const File& file) -{ - JUCE_AUTORELEASEPOOL - - NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; - - CoreGraphicsImage* result = new CoreGraphicsImage (Image::ARGB, (int) [image size].width, (int) [image size].height, true); - - [NSGraphicsContext saveGraphicsState]; - [NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: result->context flipped: false]]; - - [image drawAtPoint: NSMakePoint (0, 0) - fromRect: NSMakeRect (0, 0, [image size].width, [image size].height) - operation: NSCompositeSourceOver fraction: 1.0f]; - - [[NSGraphicsContext currentContext] flushGraphics]; - [NSGraphicsContext restoreGraphicsState]; - - return Image (result); -} - -//============================================================================== -void SystemClipboard::copyTextToClipboard (const String& text) -{ - [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] - owner: nil]; - - [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) - forType: NSStringPboardType]; -} - -String SystemClipboard::getTextFromClipboard() -{ - NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; - - return text == nil ? String::empty - : nsStringToJuce (text); -} - //============================================================================== const int KeyPress::spaceKey = ' '; const int KeyPress::returnKey = 0x0d; diff --git a/src/native/mac/juce_mac_NativeCode.mm b/src/native/mac/juce_mac_NativeCode.mm index dc512f19b5..c0a90b6d82 100644 --- a/src/native/mac/juce_mac_NativeCode.mm +++ b/src/native/mac/juce_mac_NativeCode.mm @@ -118,13 +118,6 @@ BEGIN_JUCE_NAMESPACE #include "juce_mac_Threads.mm" #include "../common/juce_posix_SharedCode.h" #include "juce_mac_Files.mm" - -#if JUCE_IOS - #include "juce_ios_MiscUtilities.mm" -#else - #include "juce_mac_MiscUtilities.mm" -#endif - #include "juce_mac_Debugging.mm" #if ! JUCE_ONLY_BUILD_CORE_LIBRARY @@ -132,6 +125,7 @@ BEGIN_JUCE_NAMESPACE #include "juce_mac_Fonts.mm" #include "juce_mac_CoreGraphicsContext.mm" #include "juce_ios_UIViewComponentPeer.mm" + #include "juce_ios_Windowing.mm" #include "juce_ios_MessageManager.mm" #include "juce_mac_FileChooser.mm" #include "juce_mac_OpenGLComponent.mm" @@ -143,6 +137,7 @@ BEGIN_JUCE_NAMESPACE #include "juce_mac_Fonts.mm" // (must go before juce_mac_CoreGraphicsContext.mm) #include "juce_mac_CoreGraphicsContext.mm" #include "juce_mac_NSViewComponentPeer.mm" + #include "juce_mac_Windowing.mm" #include "juce_mac_MouseCursor.mm" #include "juce_mac_NSViewComponent.mm" #include "juce_mac_AppleRemote.mm" diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_Windowing.mm similarity index 85% rename from src/native/mac/juce_mac_MiscUtilities.mm rename to src/native/mac/juce_mac_Windowing.mm index 4625fa55c1..ded8321013 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_Windowing.mm @@ -28,26 +28,12 @@ #if JUCE_INCLUDED_FILE -//============================================================================== -ScopedAutoReleasePool::ScopedAutoReleasePool() -{ - pool = [[NSAutoreleasePool alloc] init]; -} - -ScopedAutoReleasePool::~ScopedAutoReleasePool() -{ - [((NSAutoreleasePool*) pool) release]; -} - //============================================================================== void LookAndFeel::playAlertSound() { NSBeep(); } -//============================================================================== -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - //============================================================================== class OSXMessageBox : public AsyncUpdater { @@ -336,5 +322,46 @@ void Desktop::getCurrentMonitorPositions (Array >& monitorCoords jassert (monitorCoords.size() > 0); } -#endif +//============================================================================== +Image juce_createIconForFile (const File& file) +{ + JUCE_AUTORELEASEPOOL + + NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; + + CoreGraphicsImage* result = new CoreGraphicsImage (Image::ARGB, + (int) [image size].width, + (int) [image size].height, true); + + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: result->context flipped: false]]; + + [image drawAtPoint: NSMakePoint (0, 0) + fromRect: NSMakeRect (0, 0, [image size].width, [image size].height) + operation: NSCompositeSourceOver fraction: 1.0f]; + + [[NSGraphicsContext currentContext] flushGraphics]; + [NSGraphicsContext restoreGraphicsState]; + + return Image (result); +} + +//============================================================================== +void SystemClipboard::copyTextToClipboard (const String& text) +{ + [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] + owner: nil]; + + [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) + forType: NSStringPboardType]; +} + +String SystemClipboard::getTextFromClipboard() +{ + NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; + + return text == nil ? String::empty + : nsStringToJuce (text); +} + #endif diff --git a/src/native/mac/juce_osx_ObjCHelpers.h b/src/native/mac/juce_osx_ObjCHelpers.h index dbd0894868..468e5fe51a 100644 --- a/src/native/mac/juce_osx_ObjCHelpers.h +++ b/src/native/mac/juce_osx_ObjCHelpers.h @@ -63,5 +63,16 @@ namespace } } +//============================================================================== +ScopedAutoReleasePool::ScopedAutoReleasePool() +{ + pool = [[NSAutoreleasePool alloc] init]; +} + +ScopedAutoReleasePool::~ScopedAutoReleasePool() +{ + [((NSAutoreleasePool*) pool) release]; +} + #endif // __JUCE_OSX_OBJCHELPERS_JUCEHEADER__