From 098400ef311696b5842d52718561288970fb53de Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Mon, 19 Sep 2011 12:30:43 +0100 Subject: [PATCH] Removed the Image::setPixelData method - this can be done with Image::BitmapData instead. OSX file chooser options change for aliased files. --- extras/JuceDemo/Source/ApplicationStartup.cpp | 6 +++--- modules/juce_core/text/juce_CharPointer_UTF8.h | 1 + modules/juce_graphics/images/juce_Image.cpp | 18 ------------------ modules/juce_graphics/images/juce_Image.h | 9 +-------- .../native/juce_mac_FileChooser.mm | 2 ++ 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/extras/JuceDemo/Source/ApplicationStartup.cpp b/extras/JuceDemo/Source/ApplicationStartup.cpp index 24bf7dcba2..093d763d11 100644 --- a/extras/JuceDemo/Source/ApplicationStartup.cpp +++ b/extras/JuceDemo/Source/ApplicationStartup.cpp @@ -43,13 +43,13 @@ public: //============================================================================== void initialise (const String& /*commandLine*/) { - #if JUCE_IOS || JUCE_ANDROID + #if JUCE_IOS || JUCE_ANDROID theMainWindow.setVisible (true); theMainWindow.setFullScreen (true); - #else + #else theMainWindow.centreWithSize (700, 600); theMainWindow.setVisible (true); - #endif + #endif // this little function just demonstrates a few system info calls Logger::outputDebugString (collectSomeSystemInfo()); diff --git a/modules/juce_core/text/juce_CharPointer_UTF8.h b/modules/juce_core/text/juce_CharPointer_UTF8.h index 66ebe0be1c..82371b5cf1 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF8.h +++ b/modules/juce_core/text/juce_CharPointer_UTF8.h @@ -289,6 +289,7 @@ public: */ size_t sizeInBytes() const noexcept { + jassert (data != nullptr); return strlen (data) + 1; } diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index cb86d1ac85..7266a76f9b 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -334,24 +334,6 @@ void Image::BitmapData::setPixelColour (const int x, const int y, const Colour& } } -void Image::setPixelData (int x, int y, int w, int h, - const uint8* const sourcePixelData, const int sourceLineStride) -{ - jassert (x >= 0 && y >= 0 && w > 0 && h > 0 && x + w <= getWidth() && y + h <= getHeight()); - - if (Rectangle::intersectRectangles (x, y, w, h, 0, 0, getWidth(), getHeight())) - { - const BitmapData dest (*this, x, y, w, h, BitmapData::writeOnly); - - for (int i = 0; i < h; ++i) - { - memcpy (dest.getLinePointer(i), - sourcePixelData + sourceLineStride * i, - (size_t) (w * dest.pixelStride)); - } - } -} - //============================================================================== void Image::clear (const Rectangle& area, const Colour& colourToClearTo) { diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index a81254f81b..8953f7eb66 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -352,14 +352,7 @@ public: JUCE_DECLARE_NON_COPYABLE (BitmapData); }; - /** Copies some pixel values to a rectangle of the image. - - The format of the pixel data must match that of the image itself, and the - rectangle supplied must be within the image's bounds. - */ - void setPixelData (int destX, int destY, int destW, int destH, - const uint8* sourcePixelData, int sourceLineStride); - + //============================================================================== /** Copies a section of the image to somewhere else within itself. */ void moveImageSection (int destX, int destY, int sourceX, int sourceY, diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 6841c843c6..f134203dcf 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -125,6 +125,7 @@ void FileChooser::showPlatformDialog (Array& results, [openPanel setCanChooseDirectories: selectsDirectory]; [openPanel setCanChooseFiles: selectsFiles]; [openPanel setAllowsMultipleSelection: selectMultipleFiles]; + [openPanel setResolvesAliases: YES]; } [panel setDelegate: delegate]; @@ -156,6 +157,7 @@ void FileChooser::showPlatformDialog (Array& results, { NSOpenPanel* openPanel = (NSOpenPanel*) panel; NSArray* urls = [openPanel filenames]; + for (unsigned int i = 0; i < [urls count]; ++i) { NSString* f = [urls objectAtIndex: i];