| @@ -2930,6 +2930,7 @@ | |||||
| GCC_WARN_ABOUT_RETURN_TYPE = YES; | GCC_WARN_ABOUT_RETURN_TYPE = YES; | ||||
| GCC_WARN_UNUSED_VARIABLE = YES; | GCC_WARN_UNUSED_VARIABLE = YES; | ||||
| PRODUCT_NAME = jucedebug; | PRODUCT_NAME = jucedebug; | ||||
| RUN_CLANG_STATIC_ANALYZER = YES; | |||||
| SYMROOT = ../../bin; | SYMROOT = ../../bin; | ||||
| USER_HEADER_SEARCH_PATHS = "~/stuff/vstsdk2.4 $(inherited)"; | USER_HEADER_SEARCH_PATHS = "~/stuff/vstsdk2.4 $(inherited)"; | ||||
| }; | }; | ||||
| @@ -2951,6 +2952,7 @@ | |||||
| GCC_WARN_ABOUT_RETURN_TYPE = YES; | GCC_WARN_ABOUT_RETURN_TYPE = YES; | ||||
| GCC_WARN_UNUSED_VARIABLE = YES; | GCC_WARN_UNUSED_VARIABLE = YES; | ||||
| PRODUCT_NAME = juce; | PRODUCT_NAME = juce; | ||||
| RUN_CLANG_STATIC_ANALYZER = YES; | |||||
| SYMROOT = ../../bin; | SYMROOT = ../../bin; | ||||
| USER_HEADER_SEARCH_PATHS = "~/stuff/vstsdk2.4 $(inherited)"; | USER_HEADER_SEARCH_PATHS = "~/stuff/vstsdk2.4 $(inherited)"; | ||||
| }; | }; | ||||
| @@ -66,7 +66,7 @@ static void updateComponentPos (Component* const comp) | |||||
| { | { | ||||
| HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) | HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) | ||||
| comp->getComponentProperty ("dummyViewRef", false, String::empty).getHexValue64(); | comp->getComponentProperty ("dummyViewRef", false, String::empty).getHexValue64(); | ||||
| HIRect r; | HIRect r; | ||||
| HIViewGetFrame (dummyView, &r); | HIViewGetFrame (dummyView, &r); | ||||
| HIViewRef root; | HIViewRef root; | ||||
| @@ -66,7 +66,7 @@ public: | |||||
| void paint (Graphics& g) | void paint (Graphics& g) | ||||
| { | { | ||||
| getLookAndFeel().drawLevelMeter (g, getWidth(), getHeight(), | |||||
| getLookAndFeel().drawLevelMeter (g, getWidth(), getHeight(), | |||||
| (float) exp (log (level) / 3.0)); // (add a bit of a skew to make the level more obvious) | (float) exp (log (level) / 3.0)); // (add a bit of a skew to make the level more obvious) | ||||
| } | } | ||||
| @@ -149,15 +149,15 @@ Drawable* Drawable::readFromBinaryStream (InputStream& input) | |||||
| return 0; | return 0; | ||||
| DrawableComposite* result = 0; | DrawableComposite* result = 0; | ||||
| if (memcmp (header, "JuceDrw1", sizeof (header)) == 0) | if (memcmp (header, "JuceDrw1", sizeof (header)) == 0) | ||||
| { | { | ||||
| result = new DrawableComposite(); | result = new DrawableComposite(); | ||||
| if (! result->readBinary (input)) | if (! result->readBinary (input)) | ||||
| deleteAndZero (result); | deleteAndZero (result); | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| @@ -184,11 +184,11 @@ public: | |||||
| /** | /** | ||||
| */ | */ | ||||
| bool writeToBinaryStream (OutputStream& output) const; | bool writeToBinaryStream (OutputStream& output) const; | ||||
| /** | /** | ||||
| */ | */ | ||||
| static Drawable* readFromXml (const XmlElement& xml); | static Drawable* readFromXml (const XmlElement& xml); | ||||
| /** | /** | ||||
| */ | */ | ||||
| XmlElement* createXml() const; | XmlElement* createXml() const; | ||||
| @@ -312,7 +312,7 @@ bool DrawableComposite::readXml (const XmlElement& xml) | |||||
| } | } | ||||
| d->setName (e->getStringAttribute (T("id"))); | d->setName (e->getStringAttribute (T("id"))); | ||||
| if (! d->readXml (*e)) | if (! d->readXml (*e)) | ||||
| { | { | ||||
| jassertfalse; | jassertfalse; | ||||
| @@ -322,13 +322,13 @@ bool DrawableComposite::readXml (const XmlElement& xml) | |||||
| AffineTransform transform; | AffineTransform transform; | ||||
| const String transformAtt (e->getStringAttribute (T("transform"))); | const String transformAtt (e->getStringAttribute (T("transform"))); | ||||
| if (transformAtt.isNotEmpty()) | if (transformAtt.isNotEmpty()) | ||||
| { | { | ||||
| StringArray tokens; | StringArray tokens; | ||||
| tokens.addTokens (transformAtt.trim(), false); | tokens.addTokens (transformAtt.trim(), false); | ||||
| tokens.removeEmptyStrings (true); | tokens.removeEmptyStrings (true); | ||||
| if (tokens.size() == 6) | if (tokens.size() == 6) | ||||
| { | { | ||||
| float f[6]; | float f[6]; | ||||
| @@ -338,7 +338,7 @@ bool DrawableComposite::readXml (const XmlElement& xml) | |||||
| transform = AffineTransform (f[0], f[1], f[2], f[3], f[4], f[5]); | transform = AffineTransform (f[0], f[1], f[2], f[3], f[4], f[5]); | ||||
| } | } | ||||
| } | } | ||||
| insertDrawable (d, transform); | insertDrawable (d, transform); | ||||
| } | } | ||||
| @@ -371,7 +371,7 @@ void DrawableComposite::writeXml (XmlElement& xml) const | |||||
| if (transform != 0) | if (transform != 0) | ||||
| { | { | ||||
| String t; | String t; | ||||
| t << transform->mat00 << " " << transform->mat01 << " " << transform->mat02 << " " | |||||
| t << transform->mat00 << " " << transform->mat01 << " " << transform->mat02 << " " | |||||
| << transform->mat10 << " " << transform->mat11 << " " << transform->mat12; | << transform->mat10 << " " << transform->mat11 << " " << transform->mat12; | ||||
| e->setAttribute (T("transform"), t); | e->setAttribute (T("transform"), t); | ||||
| @@ -161,9 +161,9 @@ bool DrawableImage::readBinary (InputStream& input) | |||||
| { | { | ||||
| opacity = input.readFloat(); | opacity = input.readFloat(); | ||||
| overlayColour = Colour (input.readInt()); | overlayColour = Colour (input.readInt()); | ||||
| const int dataLen = input.readInt(); | const int dataLen = input.readInt(); | ||||
| if (dataLen > 0) | if (dataLen > 0) | ||||
| { | { | ||||
| MemoryBlock imageData; | MemoryBlock imageData; | ||||
| @@ -172,7 +172,7 @@ bool DrawableImage::readBinary (InputStream& input) | |||||
| Image* im = ImageFileFormat::loadFrom (imageData.getData(), imageData.getSize()); | Image* im = ImageFileFormat::loadFrom (imageData.getData(), imageData.getSize()); | ||||
| if (im == 0) | if (im == 0) | ||||
| return false; | return false; | ||||
| setImage (im, true); | setImage (im, true); | ||||
| } | } | ||||
| @@ -182,7 +182,7 @@ bool DrawableImage::readBinary (InputStream& input) | |||||
| bool DrawableImage::writeBinary (OutputStream& output) const | bool DrawableImage::writeBinary (OutputStream& output) const | ||||
| { | { | ||||
| MemoryOutputStream imageData; | MemoryOutputStream imageData; | ||||
| if (image != 0) | if (image != 0) | ||||
| { | { | ||||
| PNGImageFormat pngFormat; | PNGImageFormat pngFormat; | ||||
| @@ -201,14 +201,14 @@ bool DrawableImage::readXml (const XmlElement& xml) | |||||
| { | { | ||||
| opacity = (float) xml.getDoubleAttribute (T("opacity"), 1.0); | opacity = (float) xml.getDoubleAttribute (T("opacity"), 1.0); | ||||
| overlayColour = Colour (xml.getStringAttribute (T("overlay"), T("0")).getHexValue32()); | overlayColour = Colour (xml.getStringAttribute (T("overlay"), T("0")).getHexValue32()); | ||||
| MemoryBlock imageData; | MemoryBlock imageData; | ||||
| if (imageData.fromBase64Encoding (xml.getAllSubText())) | if (imageData.fromBase64Encoding (xml.getAllSubText())) | ||||
| { | { | ||||
| Image* const im = ImageFileFormat::loadFrom (imageData.getData(), imageData.getSize()); | Image* const im = ImageFileFormat::loadFrom (imageData.getData(), imageData.getSize()); | ||||
| if (im == 0) | if (im == 0) | ||||
| return false; | return false; | ||||
| setImage (im, true); | setImage (im, true); | ||||
| } | } | ||||
| @@ -219,7 +219,7 @@ void DrawableImage::writeXml (XmlElement& xml) const | |||||
| { | { | ||||
| if (opacity < 1.0f) | if (opacity < 1.0f) | ||||
| xml.setAttribute (T("opacity"), (double) opacity); | xml.setAttribute (T("opacity"), (double) opacity); | ||||
| if (! overlayColour.isTransparent()) | if (! overlayColour.isTransparent()) | ||||
| xml.setAttribute (T("overlay"), String::toHexString ((int) overlayColour.getARGB())); | xml.setAttribute (T("overlay"), String::toHexString ((int) overlayColour.getARGB())); | ||||
| @@ -160,7 +160,7 @@ static Brush* readBrushFromBinary (InputStream& input) | |||||
| gradient.x2 = input.readFloat(); | gradient.x2 = input.readFloat(); | ||||
| gradient.y2 = input.readFloat(); | gradient.y2 = input.readFloat(); | ||||
| gradient.isRadial = input.readByte() != 0; | gradient.isRadial = input.readByte() != 0; | ||||
| const int numColours = input.readCompressedInt(); | const int numColours = input.readCompressedInt(); | ||||
| for (int i = 0; i < numColours; ++i) | for (int i = 0; i < numColours; ++i) | ||||
| { | { | ||||
| @@ -215,7 +215,7 @@ static void writeBrushToBinary (OutputStream& output, const Brush* const brush) | |||||
| output.writeByte (g.isRadial ? 1 : 0); | output.writeByte (g.isRadial ? 1 : 0); | ||||
| output.writeCompressedInt (g.getNumColours()); | output.writeCompressedInt (g.getNumColours()); | ||||
| for (int i = 0; i < g.getNumColours(); ++i) | for (int i = 0; i < g.getNumColours(); ++i) | ||||
| { | { | ||||
| output.writeFloat ((float) g.getColourPosition (i)); | output.writeFloat ((float) g.getColourPosition (i)); | ||||
| @@ -274,7 +274,7 @@ static XmlElement* writeBrushToXml (const String& tagName, const Brush* brush) | |||||
| return 0; | return 0; | ||||
| XmlElement* const xml = new XmlElement (tagName); | XmlElement* const xml = new XmlElement (tagName); | ||||
| const SolidColourBrush* cb; | const SolidColourBrush* cb; | ||||
| const GradientBrush* gb; | const GradientBrush* gb; | ||||
| const ImageBrush* ib; | const ImageBrush* ib; | ||||
| @@ -307,7 +307,7 @@ static XmlElement* writeBrushToXml (const String& tagName, const Brush* brush) | |||||
| jassertfalse; //xxx TODO | jassertfalse; //xxx TODO | ||||
| } | } | ||||
| return xml; | return xml; | ||||
| } | } | ||||
| @@ -322,7 +322,7 @@ bool DrawablePath::readBinary (InputStream& input) | |||||
| const float strokeThickness = input.readFloat(); | const float strokeThickness = input.readFloat(); | ||||
| const int jointStyle = input.readByte(); | const int jointStyle = input.readByte(); | ||||
| const int endStyle = input.readByte(); | const int endStyle = input.readByte(); | ||||
| strokeType = PathStrokeType (strokeThickness, | strokeType = PathStrokeType (strokeThickness, | ||||
| jointStyle == 1 ? PathStrokeType::curved | jointStyle == 1 ? PathStrokeType::curved | ||||
| : (jointStyle == 2 ? PathStrokeType::beveled | : (jointStyle == 2 ? PathStrokeType::beveled | ||||
| @@ -378,7 +378,7 @@ bool DrawablePath::readXml (const XmlElement& xml) | |||||
| endStyle.equalsIgnoreCase (T("square")) ? PathStrokeType::square | endStyle.equalsIgnoreCase (T("square")) ? PathStrokeType::square | ||||
| : (endStyle.equalsIgnoreCase (T("round")) ? PathStrokeType::rounded | : (endStyle.equalsIgnoreCase (T("round")) ? PathStrokeType::rounded | ||||
| : PathStrokeType::butt)); | : PathStrokeType::butt)); | ||||
| path.clear(); | path.clear(); | ||||
| path.restoreFromString (xml.getAllSubText()); | path.restoreFromString (xml.getAllSubText()); | ||||
| updateOutline(); | updateOutline(); | ||||
| @@ -391,10 +391,10 @@ void DrawablePath::writeXml (XmlElement& xml) const | |||||
| xml.addChildElement (writeBrushToXml (T("stroke"), strokeBrush)); | xml.addChildElement (writeBrushToXml (T("stroke"), strokeBrush)); | ||||
| xml.setAttribute (T("strokeWidth"), (double) strokeType.getStrokeThickness()); | xml.setAttribute (T("strokeWidth"), (double) strokeType.getStrokeThickness()); | ||||
| xml.setAttribute (T("jointStyle"), | |||||
| xml.setAttribute (T("jointStyle"), | |||||
| strokeType.getJointStyle() == PathStrokeType::mitered ? T("miter") | strokeType.getJointStyle() == PathStrokeType::mitered ? T("miter") | ||||
| : (strokeType.getJointStyle() == PathStrokeType::curved ? T("curved") : T("bevel"))); | : (strokeType.getJointStyle() == PathStrokeType::curved ? T("curved") : T("bevel"))); | ||||
| xml.setAttribute (T("capStyle"), | |||||
| xml.setAttribute (T("capStyle"), | |||||
| strokeType.getEndStyle() == PathStrokeType::butt ? T("butt") | strokeType.getEndStyle() == PathStrokeType::butt ? T("butt") | ||||
| : (strokeType.getEndStyle() == PathStrokeType::square ? T("square") : T("round"))); | : (strokeType.getEndStyle() == PathStrokeType::square ? T("square") : T("round"))); | ||||
| @@ -203,21 +203,21 @@ | |||||
| #ifndef __JUCE_AUDIOFORMATWRITER_JUCEHEADER__ | #ifndef __JUCE_AUDIOFORMATWRITER_JUCEHEADER__ | ||||
| #include "audio/audio_file_formats/juce_AudioFormatWriter.h" | #include "audio/audio_file_formats/juce_AudioFormatWriter.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_AUDIOTHUMBNAIL_JUCEHEADER__ | |||||
| #include "audio/audio_file_formats/juce_AudioThumbnail.h" | |||||
| #ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ | |||||
| #include "audio/audio_file_formats/juce_AudioThumbnailCache.h" | |||||
| #endif | #endif | ||||
| #ifndef __JUCE_AUDIOSUBSECTIONREADER_JUCEHEADER__ | #ifndef __JUCE_AUDIOSUBSECTIONREADER_JUCEHEADER__ | ||||
| #include "audio/audio_file_formats/juce_AudioSubsectionReader.h" | #include "audio/audio_file_formats/juce_AudioSubsectionReader.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ | |||||
| #include "audio/audio_file_formats/juce_AudioThumbnailCache.h" | |||||
| #endif | |||||
| #ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ | #ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ | ||||
| #include "audio/audio_file_formats/juce_FlacAudioFormat.h" | #include "audio/audio_file_formats/juce_FlacAudioFormat.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ | #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ | ||||
| #include "audio/audio_file_formats/juce_WavAudioFormat.h" | #include "audio/audio_file_formats/juce_WavAudioFormat.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_AUDIOTHUMBNAIL_JUCEHEADER__ | |||||
| #include "audio/audio_file_formats/juce_AudioThumbnail.h" | |||||
| #endif | |||||
| #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ | #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ | ||||
| #include "audio/audio_file_formats/juce_OggVorbisAudioFormat.h" | #include "audio/audio_file_formats/juce_OggVorbisAudioFormat.h" | ||||
| #endif | #endif | ||||
| @@ -371,20 +371,20 @@ | |||||
| #ifndef __JUCE_IMAGEFILEFORMAT_JUCEHEADER__ | #ifndef __JUCE_IMAGEFILEFORMAT_JUCEHEADER__ | ||||
| #include "gui/graphics/imaging/juce_ImageFileFormat.h" | #include "gui/graphics/imaging/juce_ImageFileFormat.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_DRAWABLETEXT_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_DrawableText.h" | |||||
| #endif | |||||
| #ifndef __JUCE_DRAWABLEPATH_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_DrawablePath.h" | |||||
| #endif | |||||
| #ifndef __JUCE_DRAWABLECOMPOSITE_JUCEHEADER__ | #ifndef __JUCE_DRAWABLECOMPOSITE_JUCEHEADER__ | ||||
| #include "gui/graphics/drawables/juce_DrawableComposite.h" | #include "gui/graphics/drawables/juce_DrawableComposite.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_DRAWABLE_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_Drawable.h" | |||||
| #endif | |||||
| #ifndef __JUCE_DRAWABLEIMAGE_JUCEHEADER__ | #ifndef __JUCE_DRAWABLEIMAGE_JUCEHEADER__ | ||||
| #include "gui/graphics/drawables/juce_DrawableImage.h" | #include "gui/graphics/drawables/juce_DrawableImage.h" | ||||
| #endif | #endif | ||||
| #ifndef __JUCE_DRAWABLEPATH_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_DrawablePath.h" | |||||
| #endif | |||||
| #ifndef __JUCE_DRAWABLETEXT_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_DrawableText.h" | |||||
| #ifndef __JUCE_DRAWABLE_JUCEHEADER__ | |||||
| #include "gui/graphics/drawables/juce_Drawable.h" | |||||
| #endif | #endif | ||||
| #ifndef __JUCE_COMPONENT_JUCEHEADER__ | #ifndef __JUCE_COMPONENT_JUCEHEADER__ | ||||
| #include "gui/components/juce_Component.h" | #include "gui/components/juce_Component.h" | ||||