diff --git a/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c b/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c index 8c9a31d64f..5cd8e15f13 100644 --- a/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c +++ b/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c @@ -264,7 +264,7 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx) byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + //memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ if(0 != ctx->internal_buf) { free(ctx->internal_buf); ctx->internal_buf = 0; diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm index 09f4413939..bdb4c86878 100644 --- a/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -121,9 +121,14 @@ namespace CoreTextTypeLayout CTParagraphStyleSetting settings[] = { - { kCTParagraphStyleSpecifierAlignment, sizeof (CTTextAlignment), &ctTextAlignment }, - { kCTParagraphStyleSpecifierLineBreakMode, sizeof (CTLineBreakMode), &ctLineBreakMode }, - { kCTParagraphStyleSpecifierLineSpacing, sizeof (CGFloat), &ctLineSpacing } + { kCTParagraphStyleSpecifierAlignment, sizeof (CTTextAlignment), &ctTextAlignment }, + { kCTParagraphStyleSpecifierLineBreakMode, sizeof (CTLineBreakMode), &ctLineBreakMode }, + + #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + { kCTParagraphStyleSpecifierLineSpacingAdjustment, sizeof (CGFloat), &ctLineSpacing } + #else + { kCTParagraphStyleSpecifierLineSpacing, sizeof (CGFloat), &ctLineSpacing } + #endif }; CTParagraphStyleRef ctParagraphStyleRef = CTParagraphStyleCreate (settings, numElementsInArray (settings)); diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 375dbdef2b..ca6ea12957 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -193,20 +193,27 @@ void FileChooser::showPlatformDialog (Array& results, filename = currentFileOrDirectory.getFileName(); } + #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + [panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]]; + [panel setNameFieldStringValue: juceStringToNS (filename)]; + + if ([panel runModal] == NSOKButton) + #else if ([panel runModalForDirectory: juceStringToNS (directory) file: juceStringToNS (filename)] == NSOKButton) + #endif { if (isSaveDialogue) { - results.add (File (nsStringToJuce ([panel filename]))); + results.add (File (nsStringToJuce ([[panel URL] path]))); } else { NSOpenPanel* openPanel = (NSOpenPanel*) panel; - NSArray* urls = [openPanel filenames]; + NSArray* urls = [openPanel URLs]; for (unsigned int i = 0; i < [urls count]; ++i) - results.add (File (nsStringToJuce ([urls objectAtIndex: i]))); + results.add (File (nsStringToJuce ([[urls objectAtIndex: i] path]))); } } diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 5218795631..3aec5dff6e 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -38,8 +38,14 @@ extern CheckEventBlockedByModalComps isEventBlockedByModalComps; END_JUCE_NAMESPACE @interface NSEvent (JuceDeviceDelta) - - (float) deviceDeltaX; - - (float) deviceDeltaY; + - (CGFloat) deviceDeltaX; + - (CGFloat) deviceDeltaY; + +#if ! (defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) + - (CGFloat) scrollingDeltaX; + - (CGFloat) scrollingDeltaX; + - (BOOL) hasPreciseScrollingDeltas; +#endif @end #define JuceNSView MakeObjCClassName(JuceNSView) @@ -1560,8 +1566,21 @@ void NSViewComponentPeer::redirectMouseWheel (NSEvent* ev) @try { - x = [ev deviceDeltaX] * 0.5f; - y = [ev deviceDeltaY] * 0.5f; + #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ([ev respondsToSelector: @selector (hasPreciseScrollingDeltas)]) + { + if ([ev hasPreciseScrollingDeltas]) + { + x = [ev scrollingDeltaX] * 0.5f; + y = [ev scrollingDeltaY] * 0.5f; + } + } + else + #endif + { + x = [ev deviceDeltaX] * 0.5f; + y = [ev deviceDeltaY] * 0.5f; + } } @catch (...) {}