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