diff --git a/Builds/Linux/Makefile b/Builds/Linux/Makefile index d6ee416368..fadfcaa2eb 100644 --- a/Builds/Linux/Makefile +++ b/Builds/Linux/Makefile @@ -330,6 +330,22 @@ OBJECTS := \ $(OBJDIR)/juce_win32_WASAPI_c7c6c3c3.o \ $(OBJDIR)/juce_win32_WebBrowserComponent_2a4dd461.o \ $(OBJDIR)/juce_win32_Windowing_635b4f6a.o \ + $(OBJDIR)/juce_android_Audio_93f83bd6.o \ + $(OBJDIR)/juce_android_CameraDevice_d2743865.o \ + $(OBJDIR)/juce_android_FileChooser_205cbb5f.o \ + $(OBJDIR)/juce_android_Files_3b5721f7.o \ + $(OBJDIR)/juce_android_Fonts_2e035704.o \ + $(OBJDIR)/juce_android_GraphicsContext_d0fb27e4.o \ + $(OBJDIR)/juce_android_Messaging_59717284.o \ + $(OBJDIR)/juce_android_Midi_4fa64fab.o \ + $(OBJDIR)/juce_android_Misc_68ea73f6.o \ + $(OBJDIR)/juce_android_NativeCode_dc186dee.o \ + $(OBJDIR)/juce_android_Network_28d2276e.o \ + $(OBJDIR)/juce_android_OpenGLComponent_8fd9ef4e.o \ + $(OBJDIR)/juce_android_SystemStats_848ae670.o \ + $(OBJDIR)/juce_android_Threads_10a24b69.o \ + $(OBJDIR)/juce_android_WebBrowserComponent_178c6569.o \ + $(OBJDIR)/juce_android_Windowing_2a620a72.o \ $(OBJDIR)/juce_CharacterFunctions_b1a5ac62.o \ $(OBJDIR)/juce_Identifier_e99ee619.o \ $(OBJDIR)/juce_LocalisedStrings_3ddfa55e.o \ @@ -1820,6 +1836,86 @@ $(OBJDIR)/juce_win32_Windowing_635b4f6a.o: ../../src/native/windows/juce_win32_W @echo "Compiling juce_win32_Windowing.cpp" @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_android_Audio_93f83bd6.o: ../../src/native/android/juce_android_Audio.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Audio.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_CameraDevice_d2743865.o: ../../src/native/android/juce_android_CameraDevice.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_CameraDevice.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_FileChooser_205cbb5f.o: ../../src/native/android/juce_android_FileChooser.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_FileChooser.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Files_3b5721f7.o: ../../src/native/android/juce_android_Files.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Files.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Fonts_2e035704.o: ../../src/native/android/juce_android_Fonts.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Fonts.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_GraphicsContext_d0fb27e4.o: ../../src/native/android/juce_android_GraphicsContext.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_GraphicsContext.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Messaging_59717284.o: ../../src/native/android/juce_android_Messaging.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Messaging.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Midi_4fa64fab.o: ../../src/native/android/juce_android_Midi.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Midi.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Misc_68ea73f6.o: ../../src/native/android/juce_android_Misc.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Misc.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_NativeCode_dc186dee.o: ../../src/native/android/juce_android_NativeCode.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_NativeCode.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Network_28d2276e.o: ../../src/native/android/juce_android_Network.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Network.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_OpenGLComponent_8fd9ef4e.o: ../../src/native/android/juce_android_OpenGLComponent.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_OpenGLComponent.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_SystemStats_848ae670.o: ../../src/native/android/juce_android_SystemStats.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_SystemStats.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Threads_10a24b69.o: ../../src/native/android/juce_android_Threads.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Threads.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_WebBrowserComponent_178c6569.o: ../../src/native/android/juce_android_WebBrowserComponent.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_WebBrowserComponent.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_android_Windowing_2a620a72.o: ../../src/native/android/juce_android_Windowing.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling juce_android_Windowing.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_CharacterFunctions_b1a5ac62.o: ../../src/text/juce_CharacterFunctions.cpp -@mkdir -p $(OBJDIR) @echo "Compiling juce_CharacterFunctions.cpp" diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index 5ba34c1684..3c9be7d63b 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -325,6 +325,22 @@ 6801797B247CB3A6890C0AB0 = { isa = PBXBuildFile; fileRef = 5D32C8856093B33438AEB758; }; B0B82AB2D9B0950F67B11BEA = { isa = PBXBuildFile; fileRef = 8758E6857070D7E5406FDE3F; }; 379B4A89E5403B57A2009E76 = { isa = PBXBuildFile; fileRef = 8E8BE2F1C182E418BBA6903C; }; + 6ED121D4FEE575408B9612AB = { isa = PBXBuildFile; fileRef = 03B9D3D9042E85BDD691325E; }; + 9ADE436BC62FB84E297C1CA0 = { isa = PBXBuildFile; fileRef = 13C661B79E1E9508512A6B21; }; + 03D534E5B18011C3E03CDD40 = { isa = PBXBuildFile; fileRef = F2F68E50F42BD0F124E89E2C; }; + 06E2ED69E9FAC199D559F276 = { isa = PBXBuildFile; fileRef = 59C46E289F86C80D4341EAA3; }; + 9801CCC32F01818B39CFD88E = { isa = PBXBuildFile; fileRef = FA82460758BDCB2DCCE1EAAA; }; + FE553DDF4F83DABF13DF4A2B = { isa = PBXBuildFile; fileRef = CE06EEED7426AA45C27B629C; }; + 68DB48B0EC9E5E37C6B5281C = { isa = PBXBuildFile; fileRef = 1D74C9567283836ECC70E48B; }; + 96E9017FBE104E9EADC586B1 = { isa = PBXBuildFile; fileRef = 40216CE846A54CE706131A23; }; + BA6C6EF4C88D49C640DA7BF6 = { isa = PBXBuildFile; fileRef = E646726910F110DC34DD1662; }; + 0B124D9CE361014F815A5958 = { isa = PBXBuildFile; fileRef = 9AF9F1C0D766D4F894E4A7B0; }; + C701E3FCB168A3B4A31C4242 = { isa = PBXBuildFile; fileRef = A404CD721E2A0F0CAE9326C5; }; + 04F6D85CCF26A7F6DE589876 = { isa = PBXBuildFile; fileRef = 32B7C3609BDA01AA09740139; }; + 62912A2DA2F01212517938E7 = { isa = PBXBuildFile; fileRef = CEF7210E311274F1DFAB6882; }; + 36D770FCDAC86084A495B96E = { isa = PBXBuildFile; fileRef = 755C440534C0EB494572B3F3; }; + DA2A4714F1A6957A4F2B8D48 = { isa = PBXBuildFile; fileRef = EE855319AF344A05C92580C7; }; + CE9A64287FCEF00DD2BA6AEE = { isa = PBXBuildFile; fileRef = FCD02A40985242A8A6648311; }; 2AC6F3BFAAA21E21076A9F8D = { isa = PBXBuildFile; fileRef = 76E2084D2148068F9138A816; }; B8DD4DB0BD1A6B38BBF92413 = { isa = PBXBuildFile; fileRef = 8273A206FB309671284959DD; }; 63BEC07A51CB8E516B38ECD4 = { isa = PBXBuildFile; fileRef = 4A97C8D2FF6454DDD3AF4BE5; }; @@ -997,6 +1013,23 @@ 5D32C8856093B33438AEB758 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_WASAPI.cpp; path = ../../src/native/windows/juce_win32_WASAPI.cpp; sourceTree = SOURCE_ROOT; }; 8758E6857070D7E5406FDE3F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_WebBrowserComponent.cpp; path = ../../src/native/windows/juce_win32_WebBrowserComponent.cpp; sourceTree = SOURCE_ROOT; }; 8E8BE2F1C182E418BBA6903C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Windowing.cpp; path = ../../src/native/windows/juce_win32_Windowing.cpp; sourceTree = SOURCE_ROOT; }; + 03B9D3D9042E85BDD691325E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Audio.cpp; path = ../../src/native/android/juce_android_Audio.cpp; sourceTree = SOURCE_ROOT; }; + 13C661B79E1E9508512A6B21 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_CameraDevice.cpp; path = ../../src/native/android/juce_android_CameraDevice.cpp; sourceTree = SOURCE_ROOT; }; + F2F68E50F42BD0F124E89E2C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_FileChooser.cpp; path = ../../src/native/android/juce_android_FileChooser.cpp; sourceTree = SOURCE_ROOT; }; + 59C46E289F86C80D4341EAA3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Files.cpp; path = ../../src/native/android/juce_android_Files.cpp; sourceTree = SOURCE_ROOT; }; + FA82460758BDCB2DCCE1EAAA = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Fonts.cpp; path = ../../src/native/android/juce_android_Fonts.cpp; sourceTree = SOURCE_ROOT; }; + CE06EEED7426AA45C27B629C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_GraphicsContext.cpp; path = ../../src/native/android/juce_android_GraphicsContext.cpp; sourceTree = SOURCE_ROOT; }; + 1D74C9567283836ECC70E48B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Messaging.cpp; path = ../../src/native/android/juce_android_Messaging.cpp; sourceTree = SOURCE_ROOT; }; + 40216CE846A54CE706131A23 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Midi.cpp; path = ../../src/native/android/juce_android_Midi.cpp; sourceTree = SOURCE_ROOT; }; + E646726910F110DC34DD1662 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Misc.cpp; path = ../../src/native/android/juce_android_Misc.cpp; sourceTree = SOURCE_ROOT; }; + 9AF9F1C0D766D4F894E4A7B0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_NativeCode.cpp; path = ../../src/native/android/juce_android_NativeCode.cpp; sourceTree = SOURCE_ROOT; }; + 902C32F471DA6C435E80372B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_android_NativeIncludes.h; path = ../../src/native/android/juce_android_NativeIncludes.h; sourceTree = SOURCE_ROOT; }; + A404CD721E2A0F0CAE9326C5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Network.cpp; path = ../../src/native/android/juce_android_Network.cpp; sourceTree = SOURCE_ROOT; }; + 32B7C3609BDA01AA09740139 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_OpenGLComponent.cpp; path = ../../src/native/android/juce_android_OpenGLComponent.cpp; sourceTree = SOURCE_ROOT; }; + CEF7210E311274F1DFAB6882 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_SystemStats.cpp; path = ../../src/native/android/juce_android_SystemStats.cpp; sourceTree = SOURCE_ROOT; }; + 755C440534C0EB494572B3F3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Threads.cpp; path = ../../src/native/android/juce_android_Threads.cpp; sourceTree = SOURCE_ROOT; }; + EE855319AF344A05C92580C7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_WebBrowserComponent.cpp; path = ../../src/native/android/juce_android_WebBrowserComponent.cpp; sourceTree = SOURCE_ROOT; }; + FCD02A40985242A8A6648311 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Windowing.cpp; path = ../../src/native/android/juce_android_Windowing.cpp; sourceTree = SOURCE_ROOT; }; 76E2084D2148068F9138A816 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_CharacterFunctions.cpp; path = ../../src/text/juce_CharacterFunctions.cpp; sourceTree = SOURCE_ROOT; }; 33F16EE4F38C9B76E7FAEF78 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CharacterFunctions.h; path = ../../src/text/juce_CharacterFunctions.h; sourceTree = SOURCE_ROOT; }; 4007410FACA2F865FD8EF769 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CharPointer_UTF8.h; path = ../../src/text/juce_CharPointer_UTF8.h; sourceTree = SOURCE_ROOT; }; @@ -1798,11 +1831,30 @@ 5D32C8856093B33438AEB758, 8758E6857070D7E5406FDE3F, 8E8BE2F1C182E418BBA6903C ); name = windows; sourceTree = ""; }; + FBE56423C0482E49EF317C85 = { isa = PBXGroup; children = ( + 03B9D3D9042E85BDD691325E, + 13C661B79E1E9508512A6B21, + F2F68E50F42BD0F124E89E2C, + 59C46E289F86C80D4341EAA3, + FA82460758BDCB2DCCE1EAAA, + CE06EEED7426AA45C27B629C, + 1D74C9567283836ECC70E48B, + 40216CE846A54CE706131A23, + E646726910F110DC34DD1662, + 9AF9F1C0D766D4F894E4A7B0, + 902C32F471DA6C435E80372B, + A404CD721E2A0F0CAE9326C5, + 32B7C3609BDA01AA09740139, + CEF7210E311274F1DFAB6882, + 755C440534C0EB494572B3F3, + EE855319AF344A05C92580C7, + FCD02A40985242A8A6648311 ); name = android; sourceTree = ""; }; B3E58752D519C56B78A95ACE = { isa = PBXGroup; children = ( DDB94A7300C3D1F2E9E51C47, 1004A23965A4DB0FCC441ED3, 13513EE40AD6BAB30E26C88B, - 64DE2D4534D79E74C40A0DEE ); name = native; sourceTree = ""; }; + 64DE2D4534D79E74C40A0DEE, + FBE56423C0482E49EF317C85 ); name = native; sourceTree = ""; }; C6B52BCD0CB1B809D6DE555A = { isa = PBXGroup; children = ( 76E2084D2148068F9138A816, 33F16EE4F38C9B76E7FAEF78, @@ -2281,6 +2333,22 @@ 6801797B247CB3A6890C0AB0, B0B82AB2D9B0950F67B11BEA, 379B4A89E5403B57A2009E76, + 6ED121D4FEE575408B9612AB, + 9ADE436BC62FB84E297C1CA0, + 03D534E5B18011C3E03CDD40, + 06E2ED69E9FAC199D559F276, + 9801CCC32F01818B39CFD88E, + FE553DDF4F83DABF13DF4A2B, + 68DB48B0EC9E5E37C6B5281C, + 96E9017FBE104E9EADC586B1, + BA6C6EF4C88D49C640DA7BF6, + 0B124D9CE361014F815A5958, + C701E3FCB168A3B4A31C4242, + 04F6D85CCF26A7F6DE589876, + 62912A2DA2F01212517938E7, + 36D770FCDAC86084A495B96E, + DA2A4714F1A6957A4F2B8D48, + CE9A64287FCEF00DD2BA6AEE, 2AC6F3BFAAA21E21076A9F8D, B8DD4DB0BD1A6B38BBF92413, 63BEC07A51CB8E516B38ECD4, diff --git a/Builds/VisualStudio2005/Juce.vcproj b/Builds/VisualStudio2005/Juce.vcproj index fcca9b0494..750f9e7fa9 100644 --- a/Builds/VisualStudio2005/Juce.vcproj +++ b/Builds/VisualStudio2005/Juce.vcproj @@ -933,6 +933,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Builds/VisualStudio2008/Juce.vcproj b/Builds/VisualStudio2008/Juce.vcproj index 4c156b8154..2bdf1e7208 100644 --- a/Builds/VisualStudio2008/Juce.vcproj +++ b/Builds/VisualStudio2008/Juce.vcproj @@ -933,6 +933,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Builds/VisualStudio2008_DLL/Juce.vcproj b/Builds/VisualStudio2008_DLL/Juce.vcproj index 7209adf05c..392199c9bf 100644 --- a/Builds/VisualStudio2008_DLL/Juce.vcproj +++ b/Builds/VisualStudio2008_DLL/Juce.vcproj @@ -935,6 +935,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Builds/VisualStudio2010/Juce.vcxproj b/Builds/VisualStudio2010/Juce.vcxproj index 5cf3c98421..a25dcffc23 100644 --- a/Builds/VisualStudio2010/Juce.vcxproj +++ b/Builds/VisualStudio2010/Juce.vcxproj @@ -413,6 +413,22 @@ + + + + + + + + + + + + + + + + @@ -756,6 +772,7 @@ + diff --git a/Builds/VisualStudio2010/Juce.vcxproj.filters b/Builds/VisualStudio2010/Juce.vcxproj.filters index 176d340eda..66b57290c0 100644 --- a/Builds/VisualStudio2010/Juce.vcxproj.filters +++ b/Builds/VisualStudio2010/Juce.vcxproj.filters @@ -173,6 +173,9 @@ {CFBC5FA1-5A68-B012-A852-1D798CD2CBDF} + + {31BF14BA-F3B3-9EAE-8D43-0972CA67D1CF} + {56CD7BE1-9B0B-A873-6126-8F47C2268CD3} @@ -1174,6 +1177,54 @@ Juce\Source\native\windows + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + + + Juce\Source\native\android + Juce\Source\text @@ -2199,6 +2250,9 @@ Juce\Source\native\windows + + Juce\Source\native\android + Juce\Source\text diff --git a/Builds/iOS/Juce.xcodeproj/project.pbxproj b/Builds/iOS/Juce.xcodeproj/project.pbxproj index 7e7f336b0b..473e91ec8b 100644 --- a/Builds/iOS/Juce.xcodeproj/project.pbxproj +++ b/Builds/iOS/Juce.xcodeproj/project.pbxproj @@ -325,6 +325,22 @@ 6801797B247CB3A6890C0AB0 = { isa = PBXBuildFile; fileRef = 5D32C8856093B33438AEB758; }; B0B82AB2D9B0950F67B11BEA = { isa = PBXBuildFile; fileRef = 8758E6857070D7E5406FDE3F; }; 379B4A89E5403B57A2009E76 = { isa = PBXBuildFile; fileRef = 8E8BE2F1C182E418BBA6903C; }; + 6ED121D4FEE575408B9612AB = { isa = PBXBuildFile; fileRef = 03B9D3D9042E85BDD691325E; }; + 9ADE436BC62FB84E297C1CA0 = { isa = PBXBuildFile; fileRef = 13C661B79E1E9508512A6B21; }; + 03D534E5B18011C3E03CDD40 = { isa = PBXBuildFile; fileRef = F2F68E50F42BD0F124E89E2C; }; + 06E2ED69E9FAC199D559F276 = { isa = PBXBuildFile; fileRef = 59C46E289F86C80D4341EAA3; }; + 9801CCC32F01818B39CFD88E = { isa = PBXBuildFile; fileRef = FA82460758BDCB2DCCE1EAAA; }; + FE553DDF4F83DABF13DF4A2B = { isa = PBXBuildFile; fileRef = CE06EEED7426AA45C27B629C; }; + 68DB48B0EC9E5E37C6B5281C = { isa = PBXBuildFile; fileRef = 1D74C9567283836ECC70E48B; }; + 96E9017FBE104E9EADC586B1 = { isa = PBXBuildFile; fileRef = 40216CE846A54CE706131A23; }; + BA6C6EF4C88D49C640DA7BF6 = { isa = PBXBuildFile; fileRef = E646726910F110DC34DD1662; }; + 0B124D9CE361014F815A5958 = { isa = PBXBuildFile; fileRef = 9AF9F1C0D766D4F894E4A7B0; }; + C701E3FCB168A3B4A31C4242 = { isa = PBXBuildFile; fileRef = A404CD721E2A0F0CAE9326C5; }; + 04F6D85CCF26A7F6DE589876 = { isa = PBXBuildFile; fileRef = 32B7C3609BDA01AA09740139; }; + 62912A2DA2F01212517938E7 = { isa = PBXBuildFile; fileRef = CEF7210E311274F1DFAB6882; }; + 36D770FCDAC86084A495B96E = { isa = PBXBuildFile; fileRef = 755C440534C0EB494572B3F3; }; + DA2A4714F1A6957A4F2B8D48 = { isa = PBXBuildFile; fileRef = EE855319AF344A05C92580C7; }; + CE9A64287FCEF00DD2BA6AEE = { isa = PBXBuildFile; fileRef = FCD02A40985242A8A6648311; }; 2AC6F3BFAAA21E21076A9F8D = { isa = PBXBuildFile; fileRef = 76E2084D2148068F9138A816; }; B8DD4DB0BD1A6B38BBF92413 = { isa = PBXBuildFile; fileRef = 8273A206FB309671284959DD; }; 63BEC07A51CB8E516B38ECD4 = { isa = PBXBuildFile; fileRef = 4A97C8D2FF6454DDD3AF4BE5; }; @@ -997,6 +1013,23 @@ 5D32C8856093B33438AEB758 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_WASAPI.cpp; path = ../../src/native/windows/juce_win32_WASAPI.cpp; sourceTree = SOURCE_ROOT; }; 8758E6857070D7E5406FDE3F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_WebBrowserComponent.cpp; path = ../../src/native/windows/juce_win32_WebBrowserComponent.cpp; sourceTree = SOURCE_ROOT; }; 8E8BE2F1C182E418BBA6903C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_win32_Windowing.cpp; path = ../../src/native/windows/juce_win32_Windowing.cpp; sourceTree = SOURCE_ROOT; }; + 03B9D3D9042E85BDD691325E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Audio.cpp; path = ../../src/native/android/juce_android_Audio.cpp; sourceTree = SOURCE_ROOT; }; + 13C661B79E1E9508512A6B21 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_CameraDevice.cpp; path = ../../src/native/android/juce_android_CameraDevice.cpp; sourceTree = SOURCE_ROOT; }; + F2F68E50F42BD0F124E89E2C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_FileChooser.cpp; path = ../../src/native/android/juce_android_FileChooser.cpp; sourceTree = SOURCE_ROOT; }; + 59C46E289F86C80D4341EAA3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Files.cpp; path = ../../src/native/android/juce_android_Files.cpp; sourceTree = SOURCE_ROOT; }; + FA82460758BDCB2DCCE1EAAA = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Fonts.cpp; path = ../../src/native/android/juce_android_Fonts.cpp; sourceTree = SOURCE_ROOT; }; + CE06EEED7426AA45C27B629C = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_GraphicsContext.cpp; path = ../../src/native/android/juce_android_GraphicsContext.cpp; sourceTree = SOURCE_ROOT; }; + 1D74C9567283836ECC70E48B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Messaging.cpp; path = ../../src/native/android/juce_android_Messaging.cpp; sourceTree = SOURCE_ROOT; }; + 40216CE846A54CE706131A23 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Midi.cpp; path = ../../src/native/android/juce_android_Midi.cpp; sourceTree = SOURCE_ROOT; }; + E646726910F110DC34DD1662 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Misc.cpp; path = ../../src/native/android/juce_android_Misc.cpp; sourceTree = SOURCE_ROOT; }; + 9AF9F1C0D766D4F894E4A7B0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_NativeCode.cpp; path = ../../src/native/android/juce_android_NativeCode.cpp; sourceTree = SOURCE_ROOT; }; + 902C32F471DA6C435E80372B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_android_NativeIncludes.h; path = ../../src/native/android/juce_android_NativeIncludes.h; sourceTree = SOURCE_ROOT; }; + A404CD721E2A0F0CAE9326C5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Network.cpp; path = ../../src/native/android/juce_android_Network.cpp; sourceTree = SOURCE_ROOT; }; + 32B7C3609BDA01AA09740139 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_OpenGLComponent.cpp; path = ../../src/native/android/juce_android_OpenGLComponent.cpp; sourceTree = SOURCE_ROOT; }; + CEF7210E311274F1DFAB6882 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_SystemStats.cpp; path = ../../src/native/android/juce_android_SystemStats.cpp; sourceTree = SOURCE_ROOT; }; + 755C440534C0EB494572B3F3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Threads.cpp; path = ../../src/native/android/juce_android_Threads.cpp; sourceTree = SOURCE_ROOT; }; + EE855319AF344A05C92580C7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_WebBrowserComponent.cpp; path = ../../src/native/android/juce_android_WebBrowserComponent.cpp; sourceTree = SOURCE_ROOT; }; + FCD02A40985242A8A6648311 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_android_Windowing.cpp; path = ../../src/native/android/juce_android_Windowing.cpp; sourceTree = SOURCE_ROOT; }; 76E2084D2148068F9138A816 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_CharacterFunctions.cpp; path = ../../src/text/juce_CharacterFunctions.cpp; sourceTree = SOURCE_ROOT; }; 33F16EE4F38C9B76E7FAEF78 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CharacterFunctions.h; path = ../../src/text/juce_CharacterFunctions.h; sourceTree = SOURCE_ROOT; }; 4007410FACA2F865FD8EF769 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CharPointer_UTF8.h; path = ../../src/text/juce_CharPointer_UTF8.h; sourceTree = SOURCE_ROOT; }; @@ -1798,11 +1831,30 @@ 5D32C8856093B33438AEB758, 8758E6857070D7E5406FDE3F, 8E8BE2F1C182E418BBA6903C ); name = windows; sourceTree = ""; }; + FBE56423C0482E49EF317C85 = { isa = PBXGroup; children = ( + 03B9D3D9042E85BDD691325E, + 13C661B79E1E9508512A6B21, + F2F68E50F42BD0F124E89E2C, + 59C46E289F86C80D4341EAA3, + FA82460758BDCB2DCCE1EAAA, + CE06EEED7426AA45C27B629C, + 1D74C9567283836ECC70E48B, + 40216CE846A54CE706131A23, + E646726910F110DC34DD1662, + 9AF9F1C0D766D4F894E4A7B0, + 902C32F471DA6C435E80372B, + A404CD721E2A0F0CAE9326C5, + 32B7C3609BDA01AA09740139, + CEF7210E311274F1DFAB6882, + 755C440534C0EB494572B3F3, + EE855319AF344A05C92580C7, + FCD02A40985242A8A6648311 ); name = android; sourceTree = ""; }; B3E58752D519C56B78A95ACE = { isa = PBXGroup; children = ( DDB94A7300C3D1F2E9E51C47, 1004A23965A4DB0FCC441ED3, 13513EE40AD6BAB30E26C88B, - 64DE2D4534D79E74C40A0DEE ); name = native; sourceTree = ""; }; + 64DE2D4534D79E74C40A0DEE, + FBE56423C0482E49EF317C85 ); name = native; sourceTree = ""; }; C6B52BCD0CB1B809D6DE555A = { isa = PBXGroup; children = ( 76E2084D2148068F9138A816, 33F16EE4F38C9B76E7FAEF78, @@ -2285,6 +2337,22 @@ 6801797B247CB3A6890C0AB0, B0B82AB2D9B0950F67B11BEA, 379B4A89E5403B57A2009E76, + 6ED121D4FEE575408B9612AB, + 9ADE436BC62FB84E297C1CA0, + 03D534E5B18011C3E03CDD40, + 06E2ED69E9FAC199D559F276, + 9801CCC32F01818B39CFD88E, + FE553DDF4F83DABF13DF4A2B, + 68DB48B0EC9E5E37C6B5281C, + 96E9017FBE104E9EADC586B1, + BA6C6EF4C88D49C640DA7BF6, + 0B124D9CE361014F815A5958, + C701E3FCB168A3B4A31C4242, + 04F6D85CCF26A7F6DE589876, + 62912A2DA2F01212517938E7, + 36D770FCDAC86084A495B96E, + DA2A4714F1A6957A4F2B8D48, + CE9A64287FCEF00DD2BA6AEE, 2AC6F3BFAAA21E21076A9F8D, B8DD4DB0BD1A6B38BBF92413, 63BEC07A51CB8E516B38ECD4, diff --git a/Juce.jucer b/Juce.jucer index 9667fd5628..a57e48a41f 100644 --- a/Juce.jucer +++ b/Juce.jucer @@ -1429,6 +1429,42 @@ + + + + + + + + + + + + + + + + + + + anotherInstanceStarted (nsStringToJuce (filename)); + JUCEApplication::getInstance()->anotherInstanceStarted (quotedIfContainsSpaces (filename)); return YES; } @@ -275440,18 +275472,10 @@ public: { StringArray files; for (unsigned int i = 0; i < [filenames count]; ++i) - { - String filename (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - if (filename.containsChar (' ')) - filename = filename.quoted('"'); - - files.add (filename); - } + files.add (quotedIfContainsSpaces ((NSString*) [filenames objectAtIndex: i])); if (files.size() > 0 && JUCEApplication::getInstance() != 0) - { JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (" ")); - } } virtual void focusChanged() @@ -275487,6 +275511,15 @@ private: CFRunLoopRef runLoop; CFRunLoopSourceRef runLoopSource; MessageQueue messageQueue; + + static const String quotedIfContainsSpaces (NSString* file) + { + String s (nsStringToJuce (file)); + if (s.containsChar (' ')) + s = s.quoted ('"'); + + return s; + } }; END_JUCE_NAMESPACE @@ -278925,7 +278958,23 @@ const String File::getVolumeLabel() const int File::getVolumeSerialNumber() const { - return 0; // xxx + int result = 0; +/* int fd = open (getFullPathName().toUTF8(), O_RDONLY | O_NONBLOCK); + + char info [512]; + + #ifndef HDIO_GET_IDENTITY + #define HDIO_GET_IDENTITY 0x030d + #endif + + if (ioctl (fd, HDIO_GET_IDENTITY, info) == 0) + { + DBG (String (info + 20, 20)); + result = String (info + 20, 20).trim().getIntValue(); + } + + close (fd);*/ + return result; } void juce_runSystemCommand (const String& command) @@ -279178,7 +279227,7 @@ void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) bool File::copyInternal (const File& dest) const { - // TODO this is a brute-force copy, better to use an OS function if one exists.. + // TODO FileInputStream in (*this); @@ -279202,7 +279251,7 @@ bool File::copyInternal (const File& dest) const void File::findFileSystemRoots (Array& destArray) { - // TODO appropriate on android? + // TODO destArray.add (File ("/")); } @@ -279224,7 +279273,7 @@ bool File::isOnRemovableDrive() const bool File::isHidden() const { - // TODO is this appropriate for android? + // TODO return getFileName().startsWithChar ('.'); } @@ -279248,7 +279297,7 @@ namespace const File File::getLinkedTarget() const { - // TODO - same as linux? + // TODO return juce_readlink (getFullPathName().toUTF8(), *this); } @@ -279257,7 +279306,7 @@ const char* juce_Argv0 = 0; // referenced from juce_Application.cpp const File File::getSpecialLocation (const SpecialLocationType type) { - // TODO this stuff is all copied from linux, needs sanity-checking for android + // TODO switch (type) { @@ -279340,8 +279389,6 @@ bool File::moveToTrash() const return false; } -// TODO If the normal posix directory functions work, the following stuff should all be fine... - class DirectoryIterator::NativeIterator::Pimpl { public: @@ -279630,7 +279677,7 @@ void PlatformUtilities::beep() void Logger::outputDebugString (const String& text) { - // TODO is this ok..? + // TODO std::cerr << text << std::endl; } @@ -279655,7 +279702,7 @@ bool SystemStats::isOperatingSystem64Bit() namespace LinuxStatsHelpers { - // TODO would this work? If not, the CPU info functions aren't of huge importance.. + // TODO const String getCpuInfo (const char* const key) { StringArray lines; @@ -279693,7 +279740,7 @@ int SystemStats::getMemorySizeInMegabytes() int SystemStats::getPageSize() { - // TODO if this doesn't work, just return 0, it's not important + // TODO return sysconf (_SC_PAGESIZE); } @@ -279720,15 +279767,14 @@ const String SystemStats::getFullUserName() void SystemStats::initialiseStats() { - // TODO these flags should be set, but if we're only running on ARM they can all just be false - + // TODO const String flags (LinuxStatsHelpers::getCpuInfo ("flags")); cpuFlags.hasMMX = flags.contains ("mmx"); cpuFlags.hasSSE = flags.contains ("sse"); cpuFlags.hasSSE2 = flags.contains ("sse2"); cpuFlags.has3DNow = flags.contains ("3dnow"); - // TODO this should probably be set to the number of cores if possible + // TODO cpuFlags.numCpus = LinuxStatsHelpers::getCpuInfo ("processor").getIntValue() + 1; } @@ -279736,8 +279782,7 @@ void PlatformUtilities::fpuReset() {} uint32 juce_millisecondsSinceStartup() throw() { - // TODO must return a monotonically rising clock with decent accuracy - + // TODO timespec t; clock_gettime (CLOCK_MONOTONIC, &t); @@ -279786,14 +279831,10 @@ bool Time::setSystemTimeToThisTime() const live in juce_posix_SharedCode.h! */ -// TODO all the main thread code lives inside juce_posix_SharedCode.h, so if there's -// anything in there that doesn't work with android, it'd need to be #ifdef'ed out in that file and -// done in this file instead.. - // sets the process to 0=low priority, 1=normal, 2=high, 3=realtime void Process::setPriority (ProcessPriority prior) { - // TODO this might work, but if not, it might need tweaking + // TODO struct sched_param param; int policy, maxp, minp; @@ -279822,7 +279863,7 @@ void Process::setPriority (ProcessPriority prior) void Process::terminate() { - // TODO correct way to kill the process? + // TODO exit (0); } @@ -279850,8 +279891,7 @@ void Process::lowerPrivilege() {} void MACAddress::findAllAddresses (Array& result) { - // TODO not a big priority to do this - + // TODO } bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, @@ -279859,13 +279899,11 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd const String& bodyText, const StringArray& filesToAttach) { - // TODO might be nice, but low priority + // TODO return false; } -// TODO This class needs to act as a HTTP or FTP stream - class WebInputStream : public InputStream { public: @@ -279874,7 +279912,7 @@ public: URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, const String& headers_, int timeOutMs_, StringPairArray* responseHeaders) { - // TODO try to open, set this flag if it fails + // TODO openedOk = false; } @@ -279964,15 +280002,11 @@ bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages bool juce_postMessageToSystemQueue (Message* message) { - // TODO Must use some kind of mechanism to post the given message to the system - // queue, in such a way that juce_dispatchNextMessageOnSystemQueue will be able - // to deliver it when it arrives + // TODO return true; } -// TODO this stuff will probably work as it is.. - class AsyncFunctionCaller : public AsyncUpdater { public: @@ -280013,7 +280047,6 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func void MessageManager::broadcastMessage (const String&) { - // TODO no need to bother with this } #endif @@ -280029,26 +280062,20 @@ const StringArray Font::findAllTypefaceNames() { StringArray results; - // TODO find all the typefaces + // TODO return results; } void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed, String& defaultFallback) { - // TODO these need to be set to some kind of sensible defaults.. + // TODO defaultSans = "Verdana"; defaultSerif = "Times"; defaultFixed = "Lucida Console"; defaultFallback = "Tahoma"; } -// TODO the nature of this class depends on the way it's going to be drawn - if the rendering -// engine draws the glyphs itself (e.g. the CoreGraphicsContext), then this may only need -// to hold some kind of platform-specific font handle, which the rendering engine can use. -// If the glyphs are drawn as shapes (as done by the software renderer), then this will need -// to make sure the getOutlineForGlyph method works. - class AndroidTypeface : public Typeface { public: @@ -280060,35 +280087,28 @@ public: float getAscent() const { - return 0; // TODO this is the font's ascent expressed as a proportion of its height, so should be 0 -> 1.0f + return 0; // TODO } float getDescent() const { - return 0; // TODO this is font's decscent expressed as a proportion of its height, so should be 0 -> 1.0f + return 0; // TODO } float getStringWidth (const String& text) { - // TODO this must lay out the given text and return the width of the text as a multiple of the font's height + // TODO return 0; } void getGlyphPositions (const String& text, Array& glyphs, Array& xOffsets) { - // TODO this must lay out the given text, and return the set of glyph numbers used, and their - // positions, in the arrays provided. - // The glyph numbers are whatever is appropriate for use by the rendering engine, and the offsets - // are expressed as distances along the X axis from the left of the first character, and are - // measured in multiples of the font's height (like all other sizes in the typeface) + // TODO } bool getOutlineForGlyph (int glyphNumber, Path& destPath) { - // TODO must return the path that can be used to draw the given glyph number (where the glyph - // number will have been returned by the getGlyphPositions method). - // The path must have its origin at the character's left-hand baseline, and must be scaled so that - // the font's height maps onto a length of 1.0f in the path. + // TODO return false; } @@ -280110,8 +280130,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) // compiled on its own). #if JUCE_INCLUDED_FILE -// TODO - implement this lot! Probably need to make it wrap a Java2D graphics context. - +// TODO class AndroidLowLevelGraphicsContext : public LowLevelGraphicsContext { public: @@ -280253,15 +280272,6 @@ private: // compiled on its own). #if JUCE_INCLUDED_FILE -/* - TODO The main windowing object - - As well as implementing all the methods below, the ComponentPeer base class has a whole bunch - of callback methods like handlePaint, handleMouseEvent, handleKeyPress, handleFocusGain, etc which - must be called by the subclass when the appropriate events occur. - -*/ - class AndroidComponentPeer : public ComponentPeer { public: @@ -280269,8 +280279,7 @@ public: AndroidComponentPeer (Component* const component, const int windowStyleFlags) : ComponentPeer (component, windowStyleFlags) { - // TODO create the window, obeying the appropriate style flags, which - // are from the set of flags in ComponentPeer::StyleFlags + // TODO } ~AndroidComponentPeer() @@ -280279,7 +280288,7 @@ public: void* getNativeHandle() const { - return 0; // TODO gets returned by Component::getWindowHandle() so should be whatever makes sense + return 0; // TODO } void setVisible (bool shouldBeVisible) @@ -280292,7 +280301,7 @@ public: void setPosition (int x, int y) { - // TODO relative to desktop top-left + // TODO } void setSize (int w, int h) @@ -280301,36 +280310,36 @@ public: void setBounds (int x, int y, int w, int h, bool isNowFullScreen) { - // TODO relative to desktop top-left + // TODO } const Rectangle getBounds() const { - // TODO relative to desktop top-left + // TODO return Rectangle(); } const Point getScreenPosition() const { - // TODO relative to desktop top-left + // TODO return Point(); } const Point localToGlobal (const Point& relativePosition) { - // TODO probably ok as it is.. + // TODO return relativePosition + getScreenPosition(); } const Point globalToLocal (const Point& screenPosition) { - // TODO probably ok as it is.. + // TODO return screenPosition - getScreenPosition(); } void setMinimised (bool shouldBeMinimised) { - // TODO probably irrelevant on android + // TODO } bool isMinimised() const @@ -280350,12 +280359,12 @@ public: void setIcon (const Image& newIcon) { - // TODO probably irrelevant + // TODO } bool contains (const Point& position, bool trueIfInAChildWindow) const { - // TODO should check that other windows aren't in front of this point + // TODO return isPositiveAndBelow (position.getX(), component->getWidth()) && isPositiveAndBelow (position.getY(), component->getHeight()); @@ -280369,7 +280378,7 @@ public: bool setAlwaysOnTop (bool alwaysOnTop) { - // TODO probably not needed + // TODO return false; } @@ -280396,23 +280405,22 @@ public: void textInputRequired (const Point& position) { - // TODO called when the on-screen keyboard should appear - the position indicates roughly where - // the text entry position is + // TODO } void repaint (const Rectangle& area) { - // TODO invalidate the given area (relative to this window's top left) + // TODO } void performAnyPendingRepaintsNow() { - // TODO probably not needed + // TODO } void setAlpha (float newAlpha) { - // TODO changes the window's overall transparency + // TODO } private: @@ -280427,7 +280435,7 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void*) bool Desktop::canUseSemiTransparentWindows() throw() { - return true; // TODO presumably this is true + return true; // TODO } Desktop::DisplayOrientation Desktop::getCurrentOrientation() const @@ -280468,21 +280476,20 @@ void ModifierKeys::updateCurrentModifiers() throw() const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() { - // TODO must return the state of mouse buttons, so if there are any - // touches underway, this should set the left-button flag + // TODO return ModifierKeys(); } bool Process::isForegroundProcess() { - return true; // TODO ? + return true; // TODO } bool AlertWindow::showNativeDialogBox (const String& title, const String& bodyText, bool isOkCancel) { - // TODO just show a simple native box + // TODO } @@ -280493,7 +280500,7 @@ Image::SharedImage* Image::SharedImage::createNativeImage (PixelFormat format, i void Desktop::setScreenSaverEnabled (const bool isEnabled) { - // TODO low priority, but might need doing at some point + // TODO } bool Desktop::isScreenSaverEnabled() @@ -280507,7 +280514,7 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) { - // TODO must set the correct screen size in this rectangle.. + // TODO monitorCoords.add (Rectangle (0, 0, 640, 480)); } @@ -280516,7 +280523,7 @@ const Image juce_createIconForFile (const File& file) { Image image; - // TODO returns a file's icon.. No need to implement yet. + // TODO return image; } @@ -280624,7 +280631,7 @@ void FileChooser::showPlatformDialog (Array& results, bool selectMultipleFiles, FilePreviewComponent* extraInfoComponent) { - // TODO probably not important to implement this right away.. + // TODO } @@ -280660,8 +280667,6 @@ const String SystemClipboard::getTextFromClipboard() // compiled on its own). #if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER -// TODO this stuff isn't a high priority, but is where an embedded web browser would be done.. - WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_) : browser (0), blankPageShown (false), @@ -280759,8 +280764,7 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) // compiled on its own). #if JUCE_INCLUDED_FILE && JUCE_OPENGL -// TODO - not urgent to implement the opengl stuff.. - +// TODO OpenGLContext* OpenGLComponent::createContext() { return 0; @@ -280791,8 +280795,6 @@ void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, // compiled on its own). #if JUCE_INCLUDED_FILE -// TODO not a big priority, the stuff in here should act as stubs for the midi classes - const StringArray MidiOutput::getDevices() { StringArray devices; @@ -280891,7 +280893,7 @@ public: numInputChannels = 2; numOutputChannels = 2; - // TODO initialise as needed.. + // TODO } ~AndroidAudioIODevice() @@ -280902,7 +280904,7 @@ public: const StringArray getOutputChannelNames() { StringArray s; - s.add ("Left"); // TODO if the device is anything other than stereo, this might need to be smarter + s.add ("Left"); // TODO s.add ("Right"); return s; } @@ -280940,7 +280942,7 @@ public: activeInputChans.setRange (2, activeInputChans.getHighestBit(), false); numInputChannels = activeInputChans.countNumberOfSetBits(); - // TODO actually open it here, setting lastError if it fails.. + // TODO actualBufferSize = 0; // whatever is possible based on preferredBufferSize @@ -280955,18 +280957,18 @@ public: { isRunning = false; - // TODO close the device here + // TODO } } int getOutputLatencyInSamples() { - return 0; // TODO should be found out if poss + return 0; // TODO } int getInputLatencyInSamples() { - return 0; // TODO should be found out if poss + return 0; // TODO } bool isOpen() { return isRunning; } @@ -280978,7 +280980,7 @@ public: const String getLastError() { return lastError; } bool isPlaying() { return isRunning && callback != 0; } - // TODO the start/stop methods are probably ok to leave as they are... + // TODO void start (AudioIODeviceCallback* newCallback) { @@ -281023,7 +281025,7 @@ private: JUCE_DECLARE_NON_COPYABLE (AndroidAudioIODevice); }; -// TODO assuming there's only one type of audio device, this class is pretty much ok as it is... +// TODO class AndroidAudioIODeviceType : public AudioIODeviceType { public: @@ -281084,7 +281086,7 @@ AudioIODeviceType* juce_createAudioIODeviceType_Android() // compiled on its own). #if JUCE_INCLUDED_FILE && JUCE_USE_CAMERA -// TODO this is an internal data structure that can be used to hold all the platform-specific handles and stuff +// TODO class AndroidCameraInternal { public: @@ -281105,7 +281107,7 @@ CameraDevice::CameraDevice (const String& name_, int /*index*/) { internal = new AndroidCameraInternal(); - // TODO probably initialisation here + // TODO } CameraDevice::~CameraDevice() @@ -281117,7 +281119,7 @@ CameraDevice::~CameraDevice() Component* CameraDevice::createViewerComponent() { - // TODO returns some kind of Component that can preview the camera + // TODO return 0; } @@ -281157,7 +281159,7 @@ const StringArray CameraDevice::getAvailableDevices() { StringArray devs; - // TODO scan for devices.. + // TODO return devs; } @@ -281166,7 +281168,7 @@ CameraDevice* CameraDevice::openDevice (int index, int minWidth, int minHeight, int maxWidth, int maxHeight) { - // TODO opens a device, returning a new CameraDevice object if this works. + // TODO return 0; } diff --git a/src/native/android/juce_android_Audio.cpp b/src/native/android/juce_android_Audio.cpp new file mode 100644 index 0000000000..af01544460 --- /dev/null +++ b/src/native/android/juce_android_Audio.cpp @@ -0,0 +1,239 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +class AndroidAudioIODevice : public AudioIODevice +{ +public: + //============================================================================== + AndroidAudioIODevice (const String& deviceName) + : AudioIODevice (deviceName, "Audio"), + callback (0), + sampleRate (0), + numInputChannels (0), + numOutputChannels (0), + actualBufferSize (0), + isRunning (false) + { + numInputChannels = 2; + numOutputChannels = 2; + + // TODO + } + + ~AndroidAudioIODevice() + { + close(); + } + + const StringArray getOutputChannelNames() + { + StringArray s; + s.add ("Left"); // TODO + s.add ("Right"); + return s; + } + + const StringArray getInputChannelNames() + { + StringArray s; + s.add ("Left"); + s.add ("Right"); + return s; + } + + int getNumSampleRates() { return 1;} + double getSampleRate (int index) { return sampleRate; } + + int getNumBufferSizesAvailable() { return 1; } + int getBufferSizeSamples (int index) { return getDefaultBufferSize(); } + int getDefaultBufferSize() { return 1024; } + + const String open (const BigInteger& inputChannels, + const BigInteger& outputChannels, + double sampleRate, + int bufferSize) + { + close(); + + lastError = String::empty; + int preferredBufferSize = (bufferSize <= 0) ? getDefaultBufferSize() : bufferSize; + + activeOutputChans = outputChannels; + activeOutputChans.setRange (2, activeOutputChans.getHighestBit(), false); + numOutputChannels = activeOutputChans.countNumberOfSetBits(); + + activeInputChans = inputChannels; + activeInputChans.setRange (2, activeInputChans.getHighestBit(), false); + numInputChannels = activeInputChans.countNumberOfSetBits(); + + // TODO + + + + actualBufferSize = 0; // whatever is possible based on preferredBufferSize + + isRunning = true; + + return lastError; + } + + void close() + { + if (isRunning) + { + isRunning = false; + + // TODO + } + } + + int getOutputLatencyInSamples() + { + return 0; // TODO + } + + int getInputLatencyInSamples() + { + return 0; // TODO + } + + bool isOpen() { return isRunning; } + int getCurrentBufferSizeSamples() { return actualBufferSize; } + int getCurrentBitDepth() { return 16; } + double getCurrentSampleRate() { return sampleRate; } + const BigInteger getActiveOutputChannels() const { return activeOutputChans; } + const BigInteger getActiveInputChannels() const { return activeInputChans; } + const String getLastError() { return lastError; } + bool isPlaying() { return isRunning && callback != 0; } + + // TODO + + void start (AudioIODeviceCallback* newCallback) + { + if (isRunning && callback != newCallback) + { + if (newCallback != 0) + newCallback->audioDeviceAboutToStart (this); + + const ScopedLock sl (callbackLock); + callback = newCallback; + } + } + + void stop() + { + if (isRunning) + { + AudioIODeviceCallback* lastCallback; + + { + const ScopedLock sl (callbackLock); + lastCallback = callback; + callback = 0; + } + + if (lastCallback != 0) + lastCallback->audioDeviceStopped(); + } + } + +private: + //================================================================================================== + CriticalSection callbackLock; + AudioIODeviceCallback* callback; + double sampleRate; + int numInputChannels, numOutputChannels; + int actualBufferSize; + bool isRunning; + String lastError; + BigInteger activeOutputChans, activeInputChans; + + JUCE_DECLARE_NON_COPYABLE (AndroidAudioIODevice); +}; + +//============================================================================== +// TODO +class AndroidAudioIODeviceType : public AudioIODeviceType +{ +public: + AndroidAudioIODeviceType() + : AudioIODeviceType ("Android Audio") + { + } + + //============================================================================== + void scanForDevices() + { + } + + const StringArray getDeviceNames (bool wantInputNames) const + { + StringArray s; + s.add ("Android Audio"); + return s; + } + + int getDefaultDeviceIndex (bool forInput) const + { + return 0; + } + + int getIndexOfDevice (AudioIODevice* device, bool asInput) const + { + return device != 0 ? 0 : -1; + } + + bool hasSeparateInputsAndOutputs() const { return false; } + + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) + { + if (outputDeviceName.isNotEmpty() || inputDeviceName.isNotEmpty()) + return new AndroidAudioIODevice (outputDeviceName.isNotEmpty() ? outputDeviceName + : inputDeviceName); + + return 0; + } + +private: + //============================================================================== + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidAudioIODeviceType); +}; + + +//============================================================================== +AudioIODeviceType* juce_createAudioIODeviceType_Android() +{ + return new AndroidAudioIODeviceType(); +} + + +#endif diff --git a/src/native/android/juce_android_CameraDevice.cpp b/src/native/android/juce_android_CameraDevice.cpp new file mode 100644 index 0000000000..5e3cb40d8e --- /dev/null +++ b/src/native/android/juce_android_CameraDevice.cpp @@ -0,0 +1,122 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_USE_CAMERA + + +//============================================================================== +// TODO +class AndroidCameraInternal +{ +public: + AndroidCameraInternal() + { + } + + ~AndroidCameraInternal() + { + } + + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidCameraInternal); +}; + +//============================================================================== +CameraDevice::CameraDevice (const String& name_, int /*index*/) + : name (name_) +{ + internal = new AndroidCameraInternal(); + + // TODO +} + +CameraDevice::~CameraDevice() +{ + stopRecording(); + delete static_cast (internal); + internal = 0; +} + +Component* CameraDevice::createViewerComponent() +{ + // TODO + + return 0; +} + +const String CameraDevice::getFileExtension() +{ + return ".m4a"; // TODO correct? +} + +void CameraDevice::startRecordingToFile (const File& file, int quality) +{ + // TODO +} + +const Time CameraDevice::getTimeOfFirstRecordedFrame() const +{ + // TODO + return Time(); +} + +void CameraDevice::stopRecording() +{ + // TODO +} + +void CameraDevice::addListener (Listener* listenerToAdd) +{ + // TODO +} + +void CameraDevice::removeListener (Listener* listenerToRemove) +{ + // TODO +} + +const StringArray CameraDevice::getAvailableDevices() +{ + StringArray devs; + + // TODO + + return devs; +} + +CameraDevice* CameraDevice::openDevice (int index, + int minWidth, int minHeight, + int maxWidth, int maxHeight) +{ + // TODO + + return 0; +} + + +#endif diff --git a/src/native/android/juce_android_FileChooser.cpp b/src/native/android/juce_android_FileChooser.cpp new file mode 100644 index 0000000000..451b03e6d4 --- /dev/null +++ b/src/native/android/juce_android_FileChooser.cpp @@ -0,0 +1,49 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +void FileChooser::showPlatformDialog (Array& results, + const String& title, + const File& currentFileOrDirectory, + const String& filter, + bool selectsDirectory, + bool selectsFiles, + bool isSaveDialogue, + bool warnAboutOverwritingExistingFiles, + bool selectMultipleFiles, + FilePreviewComponent* extraInfoComponent) +{ + // TODO + + +} + + +#endif diff --git a/src/native/android/juce_android_Files.cpp b/src/native/android/juce_android_Files.cpp new file mode 100644 index 0000000000..8f85a3649d --- /dev/null +++ b/src/native/android/juce_android_Files.cpp @@ -0,0 +1,290 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +bool File::copyInternal (const File& dest) const +{ + // TODO + + FileInputStream in (*this); + + if (dest.deleteFile()) + { + { + FileOutputStream out (dest); + + if (out.failedToOpen()) + return false; + + if (out.writeFromInputStream (in, -1) == getSize()) + return true; + } + + dest.deleteFile(); + } + + return false; +} + +void File::findFileSystemRoots (Array& destArray) +{ + // TODO + + destArray.add (File ("/")); +} + +//============================================================================== +bool File::isOnCDRomDrive() const +{ + return false; +} + +bool File::isOnHardDisk() const +{ + return true; +} + +bool File::isOnRemovableDrive() const +{ + return false; +} + +bool File::isHidden() const +{ + // TODO + + return getFileName().startsWithChar ('.'); +} + +//============================================================================== +namespace +{ + const File juce_readlink (const String& file, const File& defaultFile) + { + const int size = 8192; + HeapBlock buffer; + buffer.malloc (size + 4); + + const size_t numBytes = readlink (file.toUTF8(), buffer, size); + + if (numBytes > 0 && numBytes <= size) + return File (file).getSiblingFile (String::fromUTF8 (buffer, (int) numBytes)); + + return defaultFile; + } +} + +const File File::getLinkedTarget() const +{ + // TODO + return juce_readlink (getFullPathName().toUTF8(), *this); +} + +//============================================================================== +const char* juce_Argv0 = 0; // referenced from juce_Application.cpp + +const File File::getSpecialLocation (const SpecialLocationType type) +{ + + + // TODO + + + + switch (type) + { + case userHomeDirectory: + { + const char* homeDir = getenv ("HOME"); + + if (homeDir == 0) + { + struct passwd* const pw = getpwuid (getuid()); + if (pw != 0) + homeDir = pw->pw_dir; + } + + return File (String::fromUTF8 (homeDir)); + } + + case userDocumentsDirectory: + case userMusicDirectory: + case userMoviesDirectory: + case userApplicationDataDirectory: + return File ("~"); + + case userDesktopDirectory: + return File ("~/Desktop"); + + case commonApplicationDataDirectory: + return File ("/var"); + + case globalApplicationsDirectory: + return File ("/usr"); + + case tempDirectory: + { + File tmp ("/var/tmp"); + + if (! tmp.isDirectory()) + { + tmp = "/tmp"; + + if (! tmp.isDirectory()) + tmp = File::getCurrentWorkingDirectory(); + } + + return tmp; + } + + case invokedExecutableFile: + if (juce_Argv0 != 0) + return File (String::fromUTF8 (juce_Argv0)); + // deliberate fall-through... + + case currentExecutableFile: + case currentApplicationFile: + return juce_getExecutableFile(); + + case hostApplicationPath: + return juce_readlink ("/proc/self/exe", juce_getExecutableFile()); + + default: + jassertfalse; // unknown type? + break; + } + + return File::nonexistent; +} + +//============================================================================== +const String File::getVersion() const +{ + return String::empty; +} + +//============================================================================== +bool File::moveToTrash() const +{ + if (! exists()) + return true; + + // TODO + + return false; +} + +//============================================================================== +class DirectoryIterator::NativeIterator::Pimpl +{ +public: + Pimpl (const File& directory, const String& wildCard_) + : parentDir (File::addTrailingSeparator (directory.getFullPathName())), + wildCard (wildCard_), + dir (opendir (directory.getFullPathName().toUTF8())) + { + wildcardUTF8 = wildCard.toUTF8(); + } + + ~Pimpl() + { + if (dir != 0) + closedir (dir); + } + + bool next (String& filenameFound, + bool* const isDir, bool* const isHidden, int64* const fileSize, + Time* const modTime, Time* const creationTime, bool* const isReadOnly) + { + if (dir != 0) + { + for (;;) + { + struct dirent* const de = readdir (dir); + + if (de == 0) + break; + + if (fnmatch (wildcardUTF8, de->d_name, FNM_CASEFOLD) == 0) + { + filenameFound = String::fromUTF8 (de->d_name); + + updateStatInfoForFile (parentDir + filenameFound, isDir, fileSize, modTime, creationTime, isReadOnly); + + if (isHidden != 0) + *isHidden = filenameFound.startsWithChar ('.'); + + return true; + } + } + } + + return false; + } + +private: + String parentDir, wildCard; + const char* wildcardUTF8; + DIR* dir; + + JUCE_DECLARE_NON_COPYABLE (Pimpl); +}; + + +DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildCard) + : pimpl (new DirectoryIterator::NativeIterator::Pimpl (directory, wildCard)) +{ +} + +DirectoryIterator::NativeIterator::~NativeIterator() +{ +} + +bool DirectoryIterator::NativeIterator::next (String& filenameFound, + bool* const isDir, bool* const isHidden, int64* const fileSize, + Time* const modTime, Time* const creationTime, bool* const isReadOnly) +{ + return pimpl->next (filenameFound, isDir, isHidden, fileSize, modTime, creationTime, isReadOnly); +} + + +//============================================================================== +bool PlatformUtilities::openDocument (const String& fileName, const String& parameters) +{ + +} + +void File::revealToUser() const +{ + +} + + +#endif diff --git a/src/native/android/juce_android_Fonts.cpp b/src/native/android/juce_android_Fonts.cpp new file mode 100644 index 0000000000..a71161244b --- /dev/null +++ b/src/native/android/juce_android_Fonts.cpp @@ -0,0 +1,98 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +const StringArray Font::findAllTypefaceNames() +{ + StringArray results; + + // TODO + + return results; +} + +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed, String& defaultFallback) +{ + // TODO + defaultSans = "Verdana"; + defaultSerif = "Times"; + defaultFixed = "Lucida Console"; + defaultFallback = "Tahoma"; +} + +//============================================================================== +class AndroidTypeface : public Typeface +{ +public: + AndroidTypeface (const Font& font) + : Typeface (font.getTypefaceName()) + { + // TODO + } + + float getAscent() const + { + return 0; // TODO + } + + float getDescent() const + { + return 0; // TODO + } + + float getStringWidth (const String& text) + { + // TODO + return 0; + } + + void getGlyphPositions (const String& text, Array& glyphs, Array& xOffsets) + { + // TODO + } + + bool getOutlineForGlyph (int glyphNumber, Path& destPath) + { + // TODO + return false; + } + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidTypeface); +}; + +//============================================================================== +const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) +{ + return new AndroidTypeface (font); +} + + +#endif diff --git a/src/native/android/juce_android_GraphicsContext.cpp b/src/native/android/juce_android_GraphicsContext.cpp new file mode 100644 index 0000000000..b8b022d2d5 --- /dev/null +++ b/src/native/android/juce_android_GraphicsContext.cpp @@ -0,0 +1,169 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +// TODO +class AndroidLowLevelGraphicsContext : public LowLevelGraphicsContext +{ +public: + AndroidLowLevelGraphicsContext() + { + } + + ~AndroidLowLevelGraphicsContext() + { + } + + bool isVectorDevice() const { return false; } + + //============================================================================== + void setOrigin (int x, int y) + { + } + + void addTransform (const AffineTransform& transform) + { + } + + float getScaleFactor() + { + return 1.0f; + } + + bool clipToRectangle (const Rectangle& r) + { + return false; + } + + bool clipToRectangleList (const RectangleList& clipRegion) + { + return false; + } + + void excludeClipRectangle (const Rectangle& r) + { + } + + void clipToPath (const Path& path, const AffineTransform& transform) + { + } + + void clipToImageAlpha (const Image& sourceImage, const AffineTransform& transform) + { + } + + bool clipRegionIntersects (const Rectangle& r) + { + return true; + } + + const Rectangle getClipBounds() const + { + return Rectangle(); + } + + bool isClipEmpty() const + { + return false; + } + + void saveState() + { + } + + void restoreState() + { + } + + void beginTransparencyLayer (float opacity) + { + } + + void endTransparencyLayer() + { + } + + //============================================================================== + void setFill (const FillType& fillType) + { + } + + void setOpacity (float newOpacity) + { + } + + void setInterpolationQuality (Graphics::ResamplingQuality quality) + { + } + + //============================================================================== + void fillRect (const Rectangle& r, bool replaceExistingContents) + { + } + + void fillPath (const Path& path, const AffineTransform& transform) + { + } + + void drawImage (const Image& sourceImage, const AffineTransform& transform, bool fillEntireClipAsTiles) + { + } + + void drawLine (const Line & line) + { + } + + void drawVerticalLine (int x, float top, float bottom) + { + } + + void drawHorizontalLine (int y, float left, float right) + { + } + + void setFont (const Font& newFont) + { + } + + const Font getFont() + { + return Font(); + } + + void drawGlyph (int glyphNumber, const AffineTransform& transform) + { + } + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidLowLevelGraphicsContext); +}; + + +#endif diff --git a/src/native/android/juce_android_Messaging.cpp b/src/native/android/juce_android_Messaging.cpp new file mode 100644 index 0000000000..9bcaedc019 --- /dev/null +++ b/src/native/android/juce_android_Messaging.cpp @@ -0,0 +1,114 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +void MessageManager::doPlatformSpecificInitialisation() +{ + +} + +void MessageManager::doPlatformSpecificShutdown() +{ + +} + +//============================================================================== +bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages) +{ + // TODO + + /* + The idea here is that this will check the system message queue, pull off a + message if there is one, deliver it, and return true if a message was delivered. + If the queue's empty, return false. + + If the message is one of our special ones (i.e. a Message object being delivered, + this must call MessageManager::getInstance()->deliverMessage() to deliver it + + + */ + + return true; +} + +//============================================================================== +bool juce_postMessageToSystemQueue (Message* message) +{ + // TODO + + return true; +} + +//============================================================================== +class AsyncFunctionCaller : public AsyncUpdater +{ +public: + static void* call (MessageCallbackFunction* func_, void* parameter_) + { + if (MessageManager::getInstance()->isThisTheMessageThread()) + return func_ (parameter_); + + AsyncFunctionCaller caller (func_, parameter_); + caller.triggerAsyncUpdate(); + caller.finished.wait(); + return caller.result; + } + + void handleAsyncUpdate() + { + result = (*func) (parameter); + finished.signal(); + } + +private: + WaitableEvent finished; + MessageCallbackFunction* func; + void* parameter; + void* volatile result; + + AsyncFunctionCaller (MessageCallbackFunction* func_, void* parameter_) + : result (0), func (func_), parameter (parameter_) + {} + + JUCE_DECLARE_NON_COPYABLE (AsyncFunctionCaller); +}; + +void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, void* parameter) +{ + return AsyncFunctionCaller::call (func, parameter); +} + +//============================================================================== +void MessageManager::broadcastMessage (const String&) +{ +} + + +#endif diff --git a/src/native/android/juce_android_Midi.cpp b/src/native/android/juce_android_Midi.cpp new file mode 100644 index 0000000000..ab0a2e14a7 --- /dev/null +++ b/src/native/android/juce_android_Midi.cpp @@ -0,0 +1,107 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +const StringArray MidiOutput::getDevices() +{ + StringArray devices; + + return devices; +} + +int MidiOutput::getDefaultDeviceIndex() +{ + return 0; +} + +MidiOutput* MidiOutput::openDevice (int index) +{ + return 0; +} + +MidiOutput::~MidiOutput() +{ +} + +void MidiOutput::reset() +{ +} + +bool MidiOutput::getVolume (float&, float&) +{ + return false; +} + +void MidiOutput::setVolume (float, float) +{ +} + +void MidiOutput::sendMessageNow (const MidiMessage&) +{ +} + +//============================================================================== +MidiInput::MidiInput (const String& name_) + : name (name_), + internal (0) +{ +} + +MidiInput::~MidiInput() +{ +} + +void MidiInput::start() +{ +} + +void MidiInput::stop() +{ +} + +int MidiInput::getDefaultDeviceIndex() +{ + return 0; +} + +const StringArray MidiInput::getDevices() +{ + StringArray devs; + + return devs; +} + +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) +{ + return 0; +} + + +#endif diff --git a/src/native/android/juce_android_Misc.cpp b/src/native/android/juce_android_Misc.cpp new file mode 100644 index 0000000000..66da48c55c --- /dev/null +++ b/src/native/android/juce_android_Misc.cpp @@ -0,0 +1,47 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +void SystemClipboard::copyTextToClipboard (const String& text) +{ + // TODO +} + +const String SystemClipboard::getTextFromClipboard() +{ + String result; + + // TODO + + return result; +} + + +#endif diff --git a/src/native/android/juce_android_NativeCode.cpp b/src/native/android/juce_android_NativeCode.cpp new file mode 100644 index 0000000000..f2f437c67f --- /dev/null +++ b/src/native/android/juce_android_NativeCode.cpp @@ -0,0 +1,117 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +/* + This file wraps together all the android-specific code, so that + we can include all the native headers just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the way of + the rest of the codebase. +*/ + +#include "../../core/juce_TargetPlatform.h" + +#if JUCE_ANDROID + +#undef JUCE_BUILD_NATIVE +#define JUCE_BUILD_NATIVE 1 + +#include "juce_android_NativeIncludes.h" +#include "../../core/juce_StandardHeader.h" + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +#include "../../core/juce_Singleton.h" +#include "../../maths/juce_Random.h" +#include "../../core/juce_SystemStats.h" +#include "../../threads/juce_Process.h" +#include "../../threads/juce_Thread.h" +#include "../../threads/juce_InterProcessLock.h" +#include "../../io/files/juce_FileInputStream.h" +#include "../../io/files/juce_FileOutputStream.h" +#include "../../io/files/juce_NamedPipe.h" +#include "../../io/files/juce_DirectoryIterator.h" +#include "../../io/network/juce_URL.h" +#include "../../io/network/juce_MACAddress.h" +#include "../../core/juce_PlatformUtilities.h" +#include "../../text/juce_LocalisedStrings.h" +#include "../../utilities/juce_DeletedAtShutdown.h" +#include "../../application/juce_Application.h" +#include "../../utilities/juce_SystemClipboard.h" +#include "../../events/juce_MessageManager.h" +#include "../../gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" +#include "../../gui/graphics/imaging/juce_ImageFileFormat.h" +#include "../../gui/graphics/imaging/juce_CameraDevice.h" +#include "../../gui/components/windows/juce_ComponentPeer.h" +#include "../../gui/components/windows/juce_AlertWindow.h" +#include "../../gui/components/juce_Desktop.h" +#include "../../gui/components/menus/juce_MenuBarModel.h" +#include "../../gui/components/special/juce_OpenGLComponent.h" +#include "../../gui/components/special/juce_QuickTimeMovieComponent.h" +#include "../../gui/components/mouse/juce_DragAndDropContainer.h" +#include "../../gui/components/mouse/juce_MouseInputSource.h" +#include "../../gui/components/keyboard/juce_KeyPressMappingSet.h" +#include "../../gui/components/layout/juce_ComponentMovementWatcher.h" +#include "../../gui/components/special/juce_ActiveXControlComponent.h" +#include "../../gui/components/special/juce_WebBrowserComponent.h" +#include "../../gui/components/special/juce_DropShadower.h" +#include "../../gui/components/special/juce_SystemTrayIconComponent.h" +#include "../../gui/components/filebrowser/juce_FileChooser.h" +#include "../../gui/components/lookandfeel/juce_LookAndFeel.h" +#include "../../audio/audio_file_formats/juce_AudioCDBurner.h" +#include "../../audio/audio_file_formats/juce_AudioCDReader.h" +#include "../../audio/audio_sources/juce_AudioSource.h" +#include "../../audio/dsp/juce_AudioDataConverters.h" +#include "../../audio/devices/juce_AudioIODeviceType.h" +#include "../../audio/devices/juce_MidiOutput.h" +#include "../../audio/devices/juce_MidiInput.h" +#include "../../containers/juce_ScopedValueSetter.h" +#include "../common/juce_MidiDataConcatenator.h" + +//============================================================================== +#define JUCE_INCLUDED_FILE 1 + +// Now include the actual code files.. +#include "../common/juce_posix_SharedCode.h" +#include "juce_android_Files.cpp" +#include "../common/juce_posix_NamedPipe.cpp" +#include "juce_android_SystemStats.cpp" +#include "juce_android_Threads.cpp" +#include "juce_android_Network.cpp" +#include "juce_android_Messaging.cpp" +#include "juce_android_Fonts.cpp" +#include "juce_android_GraphicsContext.cpp" +#include "juce_android_Windowing.cpp" +#include "juce_android_FileChooser.cpp" +#include "juce_android_Misc.cpp" +#include "juce_android_WebBrowserComponent.cpp" +#include "juce_android_OpenGLComponent.cpp" +#include "juce_android_Midi.cpp" +#include "juce_android_Audio.cpp" +#include "juce_android_CameraDevice.cpp" + +END_JUCE_NAMESPACE + +#endif diff --git a/src/native/android/juce_android_NativeIncludes.h b/src/native/android/juce_android_NativeIncludes.h new file mode 100644 index 0000000000..7e078097dc --- /dev/null +++ b/src/native/android/juce_android_NativeIncludes.h @@ -0,0 +1,54 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +//============================================================================== +#ifndef __JUCE_ANDROID_NATIVEINCLUDES_JUCEHEADER__ +#define __JUCE_ANDROID_NATIVEINCLUDES_JUCEHEADER__ + + +#include "../../core/juce_TargetPlatform.h" +#include "../../../juce_Config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if JUCE_OPENGL + #include +#endif + + +#endif // __JUCE_ANDROID_NATIVEINCLUDES_JUCEHEADER__ diff --git a/src/native/android/juce_android_Network.cpp b/src/native/android/juce_android_Network.cpp new file mode 100644 index 0000000000..900a8a8ce9 --- /dev/null +++ b/src/native/android/juce_android_Network.cpp @@ -0,0 +1,112 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +void MACAddress::findAllAddresses (Array& result) +{ + // TODO +} + + +bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, + const String& emailSubject, + const String& bodyText, + const StringArray& filesToAttach) +{ + // TODO + + return false; +} + + +//============================================================================== +class WebInputStream : public InputStream +{ +public: + //============================================================================== + WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_, + URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, + const String& headers_, int timeOutMs_, StringPairArray* responseHeaders) + { + // TODO + openedOk = false; + } + + ~WebInputStream() + { + } + + //============================================================================== + bool isExhausted() + { + return true; // TODO + } + + int64 getPosition() + { + return 0; // TODO + } + + int64 getTotalLength() + { + return -1; // TODO + } + + int read (void* buffer, int bytesToRead) + { + // TODO + return 0; + } + + bool setPosition (int64 wantedPos) + { + // TODO + return false; + } + + //============================================================================== + bool openedOk; + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream); +}; + +InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData, + OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, + const String& headers, const int timeOutMs, StringPairArray* responseHeaders) +{ + ScopedPointer wi (new WebInputStream (address, isPost, postData, + progressCallback, progressCallbackContext, + headers, timeOutMs, responseHeaders)); + + return wi->openedOk ? wi.release() : 0; +} + +#endif diff --git a/src/native/android/juce_android_OpenGLComponent.cpp b/src/native/android/juce_android_OpenGLComponent.cpp new file mode 100644 index 0000000000..18869f95f3 --- /dev/null +++ b/src/native/android/juce_android_OpenGLComponent.cpp @@ -0,0 +1,55 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_OPENGL + + +//============================================================================== +// TODO +OpenGLContext* OpenGLComponent::createContext() +{ + return 0; +} + +void* OpenGLComponent::getNativeWindowHandle() const +{ + return 0; +} + +void juce_glViewport (const int w, const int h) +{ +// glViewport (0, 0, w, h); +} + +void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, + OwnedArray & results) +{ + +} + + +#endif diff --git a/src/native/android/juce_android_SystemStats.cpp b/src/native/android/juce_android_SystemStats.cpp new file mode 100644 index 0000000000..aebbe08f2e --- /dev/null +++ b/src/native/android/juce_android_SystemStats.cpp @@ -0,0 +1,185 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +//============================================================================== +void PlatformUtilities::beep() +{ + // TODO +} + +//============================================================================== +void Logger::outputDebugString (const String& text) +{ + // TODO + std::cerr << text << std::endl; +} + +//============================================================================== +SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() +{ + return Android; +} + +const String SystemStats::getOperatingSystemName() +{ + return "Android"; +} + +bool SystemStats::isOperatingSystem64Bit() +{ + #if JUCE_64BIT + return true; + #else + return false; + #endif +} + +//============================================================================== +namespace LinuxStatsHelpers +{ + // TODO + const String getCpuInfo (const char* const key) + { + StringArray lines; + lines.addLines (File ("/proc/cpuinfo").loadFileAsString()); + + for (int i = lines.size(); --i >= 0;) // (NB - it's important that this runs in reverse order) + if (lines[i].startsWithIgnoreCase (key)) + return lines[i].fromFirstOccurrenceOf (":", false, false).trim(); + + return String::empty; + } +} + +const String SystemStats::getCpuVendor() +{ + return LinuxStatsHelpers::getCpuInfo ("vendor_id"); +} + +int SystemStats::getCpuSpeedInMegaherz() +{ + return roundToInt (LinuxStatsHelpers::getCpuInfo ("cpu MHz").getFloatValue()); +} + +int SystemStats::getMemorySizeInMegabytes() +{ + // TODO + + struct sysinfo sysi; + + if (sysinfo (&sysi) == 0) + return (sysi.totalram * sysi.mem_unit / (1024 * 1024)); + + return 0; +} + +int SystemStats::getPageSize() +{ + // TODO + return sysconf (_SC_PAGESIZE); +} + +//============================================================================== +const String SystemStats::getLogonName() +{ + // TODO + + const char* user = getenv ("USER"); + + if (user == 0) + { + struct passwd* const pw = getpwuid (getuid()); + if (pw != 0) + user = pw->pw_name; + } + + return String::fromUTF8 (user); +} + +const String SystemStats::getFullUserName() +{ + return getLogonName(); +} + +//============================================================================== +void SystemStats::initialiseStats() +{ + // TODO + const String flags (LinuxStatsHelpers::getCpuInfo ("flags")); + cpuFlags.hasMMX = flags.contains ("mmx"); + cpuFlags.hasSSE = flags.contains ("sse"); + cpuFlags.hasSSE2 = flags.contains ("sse2"); + cpuFlags.has3DNow = flags.contains ("3dnow"); + + // TODO + cpuFlags.numCpus = LinuxStatsHelpers::getCpuInfo ("processor").getIntValue() + 1; +} + +void PlatformUtilities::fpuReset() {} + +//============================================================================== +uint32 juce_millisecondsSinceStartup() throw() +{ + // TODO + timespec t; + clock_gettime (CLOCK_MONOTONIC, &t); + + return t.tv_sec * 1000 + t.tv_nsec / 1000000; +} + +int64 Time::getHighResolutionTicks() throw() +{ + // TODO + + timespec t; + clock_gettime (CLOCK_MONOTONIC, &t); + + return (t.tv_sec * (int64) 1000000) + (t.tv_nsec / (int64) 1000); +} + +int64 Time::getHighResolutionTicksPerSecond() throw() +{ + // TODO + + return 1000000; // (microseconds) +} + +double Time::getMillisecondCounterHiRes() throw() +{ + return getHighResolutionTicks() * 0.001; +} + +bool Time::setSystemTimeToThisTime() const +{ + jassertfalse; + return false; +} + + +#endif diff --git a/src/native/android/juce_android_Threads.cpp b/src/native/android/juce_android_Threads.cpp new file mode 100644 index 0000000000..0fea7ba812 --- /dev/null +++ b/src/native/android/juce_android_Threads.cpp @@ -0,0 +1,86 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +/* + Note that a lot of methods that you'd expect to find in this file actually + live in juce_posix_SharedCode.h! +*/ + +//============================================================================== +// sets the process to 0=low priority, 1=normal, 2=high, 3=realtime +void Process::setPriority (ProcessPriority prior) +{ + // TODO + + struct sched_param param; + int policy, maxp, minp; + + const int p = (int) prior; + + if (p <= 1) + policy = SCHED_OTHER; + else + policy = SCHED_RR; + + minp = sched_get_priority_min (policy); + maxp = sched_get_priority_max (policy); + + if (p < 2) + param.sched_priority = 0; + else if (p == 2 ) + // Set to middle of lower realtime priority range + param.sched_priority = minp + (maxp - minp) / 4; + else + // Set to middle of higher realtime priority range + param.sched_priority = minp + (3 * (maxp - minp) / 4); + + pthread_setschedparam (pthread_self(), policy, ¶m); +} + +void Process::terminate() +{ + // TODO + exit (0); +} + +JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() +{ + return false; +} + +JUCE_API bool JUCE_CALLTYPE Process::isRunningUnderDebugger() +{ + return juce_isRunningUnderDebugger(); +} + +void Process::raisePrivilege() {} +void Process::lowerPrivilege() {} + + +#endif diff --git a/src/native/android/juce_android_WebBrowserComponent.cpp b/src/native/android/juce_android_WebBrowserComponent.cpp new file mode 100644 index 0000000000..1e57256e02 --- /dev/null +++ b/src/native/android/juce_android_WebBrowserComponent.cpp @@ -0,0 +1,123 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_android_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER + + +//============================================================================== +WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_) + : browser (0), + blankPageShown (false), + unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_) +{ + setOpaque (true); +} + +WebBrowserComponent::~WebBrowserComponent() +{ +} + +//============================================================================== +void WebBrowserComponent::goToURL (const String& url, + const StringArray* headers, + const MemoryBlock* postData) +{ + lastURL = url; + + lastHeaders.clear(); + if (headers != 0) + lastHeaders = *headers; + + lastPostData.setSize (0); + if (postData != 0) + lastPostData = *postData; + + blankPageShown = false; + + +} + +void WebBrowserComponent::stop() +{ +} + +void WebBrowserComponent::goBack() +{ + lastURL = String::empty; + blankPageShown = false; + +} + +void WebBrowserComponent::goForward() +{ + lastURL = String::empty; + +} + +void WebBrowserComponent::refresh() +{ +} + +//============================================================================== +void WebBrowserComponent::paint (Graphics& g) +{ + g.fillAll (Colours::white); +} + +void WebBrowserComponent::checkWindowAssociation() +{ +} + +void WebBrowserComponent::reloadLastURL() +{ + if (lastURL.isNotEmpty()) + { + goToURL (lastURL, &lastHeaders, &lastPostData); + lastURL = String::empty; + } +} + +void WebBrowserComponent::parentHierarchyChanged() +{ + checkWindowAssociation(); +} + +void WebBrowserComponent::resized() +{ +} + +void WebBrowserComponent::visibilityChanged() +{ + checkWindowAssociation(); +} + +bool WebBrowserComponent::pageAboutToLoad (const String& url) +{ + return true; +} + +#endif diff --git a/src/native/android/juce_android_Windowing.cpp b/src/native/android/juce_android_Windowing.cpp new file mode 100644 index 0000000000..2c9cac4671 --- /dev/null +++ b/src/native/android/juce_android_Windowing.cpp @@ -0,0 +1,389 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-10 by Raw Material Software Ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the GNU General + Public License (Version 2), as published by the Free Software Foundation. + A copy of the license is included in the JUCE distribution, or can be found + online at www.gnu.org/licenses. + + JUCE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + ------------------------------------------------------------------------------ + + To release a closed-source product which uses JUCE, commercial licenses are + available: visit www.rawmaterialsoftware.com/juce for more information. + + ============================================================================== +*/ + +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +class AndroidComponentPeer : public ComponentPeer +{ +public: + //============================================================================== + AndroidComponentPeer (Component* const component, const int windowStyleFlags) + : ComponentPeer (component, windowStyleFlags) + { + // TODO + } + + ~AndroidComponentPeer() + { + } + + void* getNativeHandle() const + { + return 0; // TODO + } + + void setVisible (bool shouldBeVisible) + { + } + + void setTitle (const String& title) + { + } + + void setPosition (int x, int y) + { + // TODO + } + + void setSize (int w, int h) + { + } + + void setBounds (int x, int y, int w, int h, bool isNowFullScreen) + { + // TODO + } + + const Rectangle getBounds() const + { + // TODO + return Rectangle(); + } + + const Point getScreenPosition() const + { + // TODO + return Point(); + } + + const Point localToGlobal (const Point& relativePosition) + { + // TODO + return relativePosition + getScreenPosition(); + } + + const Point globalToLocal (const Point& screenPosition) + { + // TODO + return screenPosition - getScreenPosition(); + } + + void setMinimised (bool shouldBeMinimised) + { + // TODO + } + + bool isMinimised() const + { + } + + void setFullScreen (bool shouldBeFullScreen) + { + // TODO + } + + bool isFullScreen() const + { + // TODO + return false; + } + + void setIcon (const Image& newIcon) + { + // TODO + } + + bool contains (const Point& position, bool trueIfInAChildWindow) const + { + // TODO + + return isPositiveAndBelow (position.getX(), component->getWidth()) + && isPositiveAndBelow (position.getY(), component->getHeight()); + } + + const BorderSize getFrameSize() const + { + // TODO + return BorderSize(); + } + + bool setAlwaysOnTop (bool alwaysOnTop) + { + // TODO + return false; + } + + void toFront (bool makeActive) + { + // TODO + } + + void toBehind (ComponentPeer* other) + { + // TODO + } + + //============================================================================== + bool isFocused() const + { + // TODO + return false; + } + + void grabFocus() + { + // TODO + } + + void textInputRequired (const Point& position) + { + // TODO + } + + //============================================================================== + void repaint (const Rectangle& area) + { + // TODO + } + + void performAnyPendingRepaintsNow() + { + // TODO + } + + void setAlpha (float newAlpha) + { + // TODO + } + +private: + //============================================================================== + + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidComponentPeer); +}; + + +ComponentPeer* Component::createNewPeer (int styleFlags, void*) +{ + return new AndroidComponentPeer (this, styleFlags); +} + + +//============================================================================== +bool Desktop::canUseSemiTransparentWindows() throw() +{ + return true; // TODO +} + +Desktop::DisplayOrientation Desktop::getCurrentOrientation() const +{ + // TODO + return upright; +} + +void Desktop::createMouseInputSources() +{ + // This creates a mouse input source for each possible finger + + for (int i = 0; i < 10; ++i) + mouseSources.add (new MouseInputSource (i, false)); +} + +const Point MouseInputSource::getCurrentMousePosition() +{ + // TODO + return Point(); +} + +void Desktop::setMousePosition (const Point& newPosition) +{ + // not needed +} + +//============================================================================== +bool KeyPress::isKeyCurrentlyDown (const int keyCode) +{ + // TODO + return false; +} + +void ModifierKeys::updateCurrentModifiers() throw() +{ + // not needed +} + +const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() +{ + // TODO + return ModifierKeys(); +} + +//============================================================================== +bool Process::isForegroundProcess() +{ + return true; // TODO +} + +//============================================================================== +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) +{ + // TODO + +} + +//============================================================================== +Image::SharedImage* Image::SharedImage::createNativeImage (PixelFormat format, int width, int height, bool clearImage) +{ + return createSoftwareImage (format, width, height, clearImage); +} + +void Desktop::setScreenSaverEnabled (const bool isEnabled) +{ + // TODO +} + +bool Desktop::isScreenSaverEnabled() +{ + return true; +} + +//============================================================================== +void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool /*allowMenusAndBars*/) +{ +} + +//============================================================================== +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) +{ + // TODO + + monitorCoords.add (Rectangle (0, 0, 640, 480)); +} + +//============================================================================== +const Image juce_createIconForFile (const File& file) +{ + Image image; + + // TODO + + return image; +} + +//============================================================================== +void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) +{ + return 0; +} + +void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) +{ +} + +void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType type) +{ + return 0; +} + +//============================================================================== +void MouseCursor::showInWindow (ComponentPeer*) const {} +void MouseCursor::showInAllWindows() const {} + +//============================================================================== +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMove) +{ + return false; +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +{ + return false; +} + +//============================================================================== +const int extendedKeyModifier = 0x10000; + +const int KeyPress::spaceKey = ' '; +const int KeyPress::returnKey = 0x0d; +const int KeyPress::escapeKey = 0x1b; +const int KeyPress::backspaceKey = 0x7f; +const int KeyPress::leftKey = extendedKeyModifier + 1; +const int KeyPress::rightKey = extendedKeyModifier + 2; +const int KeyPress::upKey = extendedKeyModifier + 3; +const int KeyPress::downKey = extendedKeyModifier + 4; +const int KeyPress::pageUpKey = extendedKeyModifier + 5; +const int KeyPress::pageDownKey = extendedKeyModifier + 6; +const int KeyPress::endKey = extendedKeyModifier + 7; +const int KeyPress::homeKey = extendedKeyModifier + 8; +const int KeyPress::deleteKey = extendedKeyModifier + 9; +const int KeyPress::insertKey = -1; +const int KeyPress::tabKey = 9; +const int KeyPress::F1Key = extendedKeyModifier + 10; +const int KeyPress::F2Key = extendedKeyModifier + 11; +const int KeyPress::F3Key = extendedKeyModifier + 12; +const int KeyPress::F4Key = extendedKeyModifier + 13; +const int KeyPress::F5Key = extendedKeyModifier + 14; +const int KeyPress::F6Key = extendedKeyModifier + 16; +const int KeyPress::F7Key = extendedKeyModifier + 17; +const int KeyPress::F8Key = extendedKeyModifier + 18; +const int KeyPress::F9Key = extendedKeyModifier + 19; +const int KeyPress::F10Key = extendedKeyModifier + 20; +const int KeyPress::F11Key = extendedKeyModifier + 21; +const int KeyPress::F12Key = extendedKeyModifier + 22; +const int KeyPress::F13Key = extendedKeyModifier + 23; +const int KeyPress::F14Key = extendedKeyModifier + 24; +const int KeyPress::F15Key = extendedKeyModifier + 25; +const int KeyPress::F16Key = extendedKeyModifier + 26; +const int KeyPress::numberPad0 = extendedKeyModifier + 27; +const int KeyPress::numberPad1 = extendedKeyModifier + 28; +const int KeyPress::numberPad2 = extendedKeyModifier + 29; +const int KeyPress::numberPad3 = extendedKeyModifier + 30; +const int KeyPress::numberPad4 = extendedKeyModifier + 31; +const int KeyPress::numberPad5 = extendedKeyModifier + 32; +const int KeyPress::numberPad6 = extendedKeyModifier + 33; +const int KeyPress::numberPad7 = extendedKeyModifier + 34; +const int KeyPress::numberPad8 = extendedKeyModifier + 35; +const int KeyPress::numberPad9 = extendedKeyModifier + 36; +const int KeyPress::numberPadAdd = extendedKeyModifier + 37; +const int KeyPress::numberPadSubtract = extendedKeyModifier + 38; +const int KeyPress::numberPadMultiply = extendedKeyModifier + 39; +const int KeyPress::numberPadDivide = extendedKeyModifier + 40; +const int KeyPress::numberPadSeparator = extendedKeyModifier + 41; +const int KeyPress::numberPadDecimalPoint = extendedKeyModifier + 42; +const int KeyPress::numberPadEquals = extendedKeyModifier + 43; +const int KeyPress::numberPadDelete = extendedKeyModifier + 44; +const int KeyPress::playKey = extendedKeyModifier + 45; +const int KeyPress::stopKey = extendedKeyModifier + 46; +const int KeyPress::fastForwardKey = extendedKeyModifier + 47; +const int KeyPress::rewindKey = extendedKeyModifier + 48; + +#endif diff --git a/src/native/common/juce_posix_SharedCode.h b/src/native/common/juce_posix_SharedCode.h index f6fb06cc64..5823fce07a 100644 --- a/src/native/common/juce_posix_SharedCode.h +++ b/src/native/common/juce_posix_SharedCode.h @@ -551,7 +551,23 @@ const String File::getVolumeLabel() const int File::getVolumeSerialNumber() const { - return 0; // xxx + int result = 0; +/* int fd = open (getFullPathName().toUTF8(), O_RDONLY | O_NONBLOCK); + + char info [512]; + + #ifndef HDIO_GET_IDENTITY + #define HDIO_GET_IDENTITY 0x030d + #endif + + if (ioctl (fd, HDIO_GET_IDENTITY, info) == 0) + { + DBG (String (info + 20, 20)); + result = String (info + 20, 20).trim().getIntValue(); + } + + close (fd);*/ + return result; } //============================================================================== diff --git a/src/native/mac/juce_mac_MessageManager.mm b/src/native/mac/juce_mac_MessageManager.mm index 4510dc2226..e86aad887b 100644 --- a/src/native/mac/juce_mac_MessageManager.mm +++ b/src/native/mac/juce_mac_MessageManager.mm @@ -72,7 +72,7 @@ public: { if (JUCEApplication::getInstance() != 0) { - JUCEApplication::getInstance()->anotherInstanceStarted (nsStringToJuce (filename)); + JUCEApplication::getInstance()->anotherInstanceStarted (quotedIfContainsSpaces (filename)); return YES; } @@ -83,18 +83,10 @@ public: { StringArray files; for (unsigned int i = 0; i < [filenames count]; ++i) - { - String filename (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - if (filename.containsChar (' ')) - filename = filename.quoted('"'); - - files.add (filename); - } + files.add (quotedIfContainsSpaces ((NSString*) [filenames objectAtIndex: i])); if (files.size() > 0 && JUCEApplication::getInstance() != 0) - { JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (" ")); - } } virtual void focusChanged() @@ -130,6 +122,15 @@ private: CFRunLoopRef runLoop; CFRunLoopSourceRef runLoopSource; MessageQueue messageQueue; + + static const String quotedIfContainsSpaces (NSString* file) + { + String s (nsStringToJuce (file)); + if (s.containsChar (' ')) + s = s.quoted ('"'); + + return s; + } };