diff --git a/extras/Jucer (experimental)/Source/Application/jucer_CommonHeaders.h b/extras/Jucer (experimental)/Source/Application/jucer_CommonHeaders.h index c67d875d5a..2cbed2c226 100644 --- a/extras/Jucer (experimental)/Source/Application/jucer_CommonHeaders.h +++ b/extras/Jucer (experimental)/Source/Application/jucer_CommonHeaders.h @@ -46,8 +46,9 @@ const char* const projectItemDragType = "Project Items"; const char* const drawableItemDragType = "Drawable Items"; const char* const componentItemDragType = "Components"; -const char* const sourceFileExtensions = "cpp;mm;m;c;h;hpp"; -const char* const headerFileExtensions = "h;hpp"; +const char* const sourceFileExtensions = "cpp;mm;m;c;cc;cxx"; +const char* const headerFileExtensions = "h;hpp;hxx"; +const char* const sourceOrHeaderFileExtensions = "cpp;mm;m;c;cc;cxx;h;hpp;hxx"; #endif \ No newline at end of file diff --git a/extras/Jucer (experimental)/Source/Code Editor/jucer_SourceCodeEditor.cpp b/extras/Jucer (experimental)/Source/Code Editor/jucer_SourceCodeEditor.cpp index 37f64ca0fb..bc9fdfb629 100644 --- a/extras/Jucer (experimental)/Source/Code Editor/jucer_SourceCodeEditor.cpp +++ b/extras/Jucer (experimental)/Source/Code Editor/jucer_SourceCodeEditor.cpp @@ -57,10 +57,10 @@ void SourceCodeEditor::resized() bool SourceCodeEditor::isTextFile (const File& file) { - return file.hasFileExtension ("cpp;h;hpp;mm;m;c;txt;xml;plist;rtf;html;htm;php;py;rb;cs"); + return file.hasFileExtension ("cpp;h;hpp;mm;m;c;cc;cxx;txt;xml;plist;rtf;html;htm;php;py;rb;cs"); } bool SourceCodeEditor::isCppFile (const File& file) { - return file.hasFileExtension (sourceFileExtensions); + return file.hasFileExtension (sourceOrHeaderFileExtensions); } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp b/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp index 4d68d09efe..8d2551e1d9 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp @@ -264,7 +264,7 @@ const String Project::getRelativePathForFile (const File& file) const //============================================================================== bool Project::shouldBeAddedToBinaryResourcesByDefault (const File& file) { - return ! file.hasFileExtension (sourceFileExtensions); + return ! file.hasFileExtension (sourceOrHeaderFileExtensions); } //============================================================================== @@ -454,7 +454,7 @@ Project::Item Project::createNewItem (const File& file) Item item (*this, ValueTree (Tags::file)); item.initialiseNodeValues(); item.getName() = file.getFileName(); - item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m"); + item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m;cc;cxx"); item.getShouldAddToResourceValue() = shouldBeAddedToBinaryResourcesByDefault (file); return item; } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h index 2c2a7d3fc9..4607c34c16 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_MSVC.h @@ -597,7 +597,7 @@ protected: XmlElement* const group = createGroup (groupName, parent); for (int i = 0; i < files.size(); ++i) - if (files.getReference(i).hasFileExtension ("cpp;c;cc;h;hpp;rc;ico")) + if (files.getReference(i).hasFileExtension ("cpp;c;cc;cxx;h;hpp;hxx;rc;ico")) addFile (files.getReference(i), *group, false, useStdcall && shouldFileBeCompiledByDefault (files.getReference(i))); } @@ -1037,7 +1037,7 @@ private: if (projectItem.isGroup()) { out << "# Begin Group \"" << projectItem.getName() << '"' << newLine - << "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"" << newLine; + << "# PROP Default_Filter \"cpp;c;cc;cxx;rc;def;r;odl;idl;hpj;bat\"" << newLine; for (int i = 0; i < projectItem.getNumChildren(); ++i) writeFiles (out, projectItem.getChild (i)); @@ -1057,7 +1057,7 @@ private: { out << "# Begin Group \"" << groupName << '"' << newLine; for (int i = 0; i < files.size(); ++i) - if (files.getReference(i).hasFileExtension ("cpp;c;h")) + if (files.getReference(i).hasFileExtension ("cpp;cc;c;cxx;h;hpp;hxx")) writeFile (out, files.getReference(i), false); out << "# End Group" << newLine; @@ -1401,7 +1401,7 @@ protected: { jassert (file.getRoot() == RelativePath::buildTargetFolder); - if (file.hasFileExtension ("cpp;c")) + if (file.hasFileExtension ("cpp;cc;cxx;c")) { XmlElement* e = cpps.createNewChildElement ("ClCompile"); e->setAttribute ("Include", file.toWindowsStyle()); @@ -1440,7 +1440,7 @@ protected: { const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder); - if (path.hasFileExtension (headerFileExtensions) || (path.hasFileExtension ("cpp;c") && projectItem.shouldBeCompiled())) + if (path.hasFileExtension (headerFileExtensions) || (path.hasFileExtension ("cpp;cc;c;cxx") && projectItem.shouldBeCompiled())) addFileToCompile (path, cpps, headers, false, false); } } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h index 695ada3db8..9e12ab089b 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h @@ -771,7 +771,7 @@ private: static const String getFileType (const RelativePath& file) { - if (file.hasFileExtension (".cpp")) return "sourcecode.cpp.cpp"; + if (file.hasFileExtension ("cpp;cc;cxx")) return "sourcecode.cpp.cpp"; else if (file.hasFileExtension (".mm")) return "sourcecode.cpp.objcpp"; else if (file.hasFileExtension (".m")) return "sourcecode.c.objc"; else if (file.hasFileExtension (headerFileExtensions)) return "sourcecode.c.h"; @@ -1065,7 +1065,7 @@ private: bool shouldFileBeCompiledByDefault (const RelativePath& file) const { - return file.hasFileExtension ("cpp;mm;c;m"); + return file.hasFileExtension (sourceFileExtensions); } //============================================================================== diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExporter.cpp b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExporter.cpp index 278eae1807..e8ffc113eb 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExporter.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExporter.cpp @@ -146,7 +146,7 @@ const RelativePath ProjectExporter::getJucePathFromTargetFolder() const bool ProjectExporter::shouldFileBeCompiledByDefault (const RelativePath& file) const { - return file.hasFileExtension ("cpp;c"); + return file.hasFileExtension ("cpp;cc;c;cxx"); } void ProjectExporter::createPropertyEditors (Array & props) diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ResourceFile.cpp b/extras/Jucer (experimental)/Source/Project/jucer_ResourceFile.cpp index 4df18de113..63639555d8 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ResourceFile.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_ResourceFile.cpp @@ -44,7 +44,7 @@ ResourceFile::~ResourceFile() bool ResourceFile::isResourceFile (const File& file) { - if (file.hasFileExtension ("cpp;h")) + if (file.hasFileExtension ("cpp;cc;h")) { ScopedPointer in (file.createInputStream()); diff --git a/extras/Jucer (experimental)/Source/Project/jucer_TreeViewTypes.cpp b/extras/Jucer (experimental)/Source/Project/jucer_TreeViewTypes.cpp index aa58b454c7..7a1f7b988f 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_TreeViewTypes.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_TreeViewTypes.cpp @@ -171,7 +171,7 @@ const String SourceFileTreeViewItem::getDisplayName() const static const File findCorrespondingHeaderOrCpp (const File& f) { - if (f.hasFileExtension ("cpp;c;mm;m")) + if (f.hasFileExtension (sourceFileExtensions)) return f.withFileExtension (".h"); else if (f.hasFileExtension (headerFileExtensions)) return f.withFileExtension (".cpp"); diff --git a/extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp b/extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp index 57767df985..49b0ad3382 100644 --- a/extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp +++ b/extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp @@ -429,8 +429,7 @@ class AXBrowserPluginHolderComponent : public Component public: //============================================================================== AXBrowserPluginHolderComponent() - : child (0), - parentHWND (0), + : parentHWND (0), browser (0) { setOpaque (true); @@ -443,7 +442,7 @@ public: ~AXBrowserPluginHolderComponent() { setWindow (0); - deleteAndZero (child); + child = 0; } //============================================================================== @@ -522,7 +521,7 @@ public: private: //============================================================================== - BrowserPluginComponent* child; + ScopedPointer child; HWND parentHWND; IWebBrowser2* browser; }; @@ -581,17 +580,15 @@ class JuceActiveXObject : public IUnknown, { public: JuceActiveXObject() - : refCount (0) + : site (0), refCount (0) { log ("JuceActiveXObject"); - site = 0; - holderComp = 0; } ~JuceActiveXObject() { - deleteHolderComp(); log ("~JuceActiveXObject"); + holderComp = 0; } HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) @@ -670,26 +667,31 @@ public: void createHolderComp() { - if (numActivePlugins++ == 0) + if (holderComp == 0) { - log ("initialiseJuce_GUI()"); - initialiseJuce_GUI(); + if (numActivePlugins++ == 0) + { + log ("initialiseJuce_GUI()"); + initialiseJuce_GUI(); - browserVersionDesc = "Internet Explorer " + getExeVersion (getExePath(), "FileVersion"); - } + browserVersionDesc = "Internet Explorer " + getExeVersion (getExePath(), "FileVersion"); + } - if (holderComp == 0) holderComp = new AXBrowserPluginHolderComponent(); + } } void deleteHolderComp() { - deleteAndZero (holderComp); - - if (--numActivePlugins == 0) + if (holderComp != 0) { - log ("shutdownJuce_GUI()"); - shutdownJuce_GUI(); + holderComp = 0; + + if (--numActivePlugins == 0) + { + log ("shutdownJuce_GUI()"); + shutdownJuce_GUI(); + } } } @@ -735,7 +737,7 @@ public: private: IUnknown* site; int refCount; - AXBrowserPluginHolderComponent* holderComp; + ScopedPointer holderComp; IDispatchHelper iDispatchHelper; JuceActiveXObject (const JuceActiveXObject&); diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 6f8fb61cd6..cc7d369f25 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -253485,6 +253485,25 @@ bool File::isHidden() const return getFileName().startsWithChar ('.'); } +static const File juce_readlink (const char* const utf8, const File& defaultFile) +{ + const int size = 8192; + HeapBlock buffer; + buffer.malloc (size + 4); + + const size_t numBytes = readlink (utf8, buffer, size); + + if (numBytes > 0 && numBytes <= size) + return File (String::fromUTF8 (buffer, (int) numBytes)); + + return defaultFile; +} + +const File File::getLinkedTarget() const +{ + return juce_readlink (getFullPathName().toUTF8(), *this); +} + const char* juce_Argv0 = 0; // referenced from juce_Application.cpp const File File::getSpecialLocation (const SpecialLocationType type) @@ -253545,14 +253564,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) return juce_getExecutableFile(); case hostApplicationPath: - { - unsigned int size = 8192; - HeapBlock buffer; - buffer.calloc (size + 8); - - readlink ("/proc/self/exe", buffer.getData(), size); - return String::fromUTF8 (buffer, size); - } + return juce_readlink ("/proc/self/exe", juce_getExecutableFile()); default: jassertfalse; // unknown type? @@ -253567,18 +253579,6 @@ const String File::getVersion() const return String::empty; // xxx not yet implemented } -const File File::getLinkedTarget() const -{ - char buffer [4096]; - size_t numChars = readlink (getFullPathName().toUTF8(), - buffer, sizeof (buffer)); - - if (numChars > 0 && numChars <= sizeof (buffer)) - return File (String::fromUTF8 (buffer, (int) numChars)); - - return *this; -} - bool File::moveToTrash() const { if (! exists()) diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 09cdb26584..e934eafd03 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -64,7 +64,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 48 +#define JUCE_BUILDNUMBER 49 /** Current Juce version number. @@ -5963,7 +5963,7 @@ template inline Type Atomic::operator+= (const Type amountToAdd) throw() { #if JUCE_ATOMICS_MAC - return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) + return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) castTo32Bit (amountToAdd), (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) : (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value); #elif JUCE_ATOMICS_WINDOWS return sizeof (Type) == 4 ? (Type) (juce_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd) @@ -45921,10 +45921,10 @@ private: */ class JUCE_API Slider : public Component, public SettableTooltipClient, - private AsyncUpdater, - private ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug) - private LabelListener, - private Value::Listener + public AsyncUpdater, + public ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug) + public LabelListener, + public Value::Listener { public: diff --git a/src/core/juce_Atomic.h b/src/core/juce_Atomic.h index c69a45c01f..cc4cf7da29 100644 --- a/src/core/juce_Atomic.h +++ b/src/core/juce_Atomic.h @@ -264,7 +264,7 @@ template inline Type Atomic::operator+= (const Type amountToAdd) throw() { #if JUCE_ATOMICS_MAC - return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) + return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) castTo32Bit (amountToAdd), (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) : (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value); #elif JUCE_ATOMICS_WINDOWS return sizeof (Type) == 4 ? (Type) (juce_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd) diff --git a/src/gui/components/controls/juce_Slider.h b/src/gui/components/controls/juce_Slider.h index 2409674428..a526e4d566 100644 --- a/src/gui/components/controls/juce_Slider.h +++ b/src/gui/components/controls/juce_Slider.h @@ -55,10 +55,10 @@ */ class JUCE_API Slider : public Component, public SettableTooltipClient, - private AsyncUpdater, - private ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug) - private LabelListener, - private Value::Listener + public AsyncUpdater, + public ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug) + public LabelListener, + public Value::Listener { public: //============================================================================== diff --git a/src/native/linux/juce_linux_Files.cpp b/src/native/linux/juce_linux_Files.cpp index c5cc6db850..11302cbfa0 100644 --- a/src/native/linux/juce_linux_Files.cpp +++ b/src/native/linux/juce_linux_Files.cpp @@ -106,6 +106,26 @@ bool File::isHidden() const return getFileName().startsWithChar ('.'); } +//============================================================================== +static const File juce_readlink (const char* const utf8, const File& defaultFile) +{ + const int size = 8192; + HeapBlock buffer; + buffer.malloc (size + 4); + + const size_t numBytes = readlink (utf8, buffer, size); + + if (numBytes > 0 && numBytes <= size) + return File (String::fromUTF8 (buffer, (int) numBytes)); + + return defaultFile; +} + +const File File::getLinkedTarget() const +{ + return juce_readlink (getFullPathName().toUTF8(), *this); +} + //============================================================================== const char* juce_Argv0 = 0; // referenced from juce_Application.cpp @@ -167,14 +187,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) return juce_getExecutableFile(); case hostApplicationPath: - { - unsigned int size = 8192; - HeapBlock buffer; - buffer.calloc (size + 8); - - readlink ("/proc/self/exe", buffer.getData(), size); - return String::fromUTF8 (buffer, size); - } + return juce_readlink ("/proc/self/exe", juce_getExecutableFile()); default: jassertfalse; // unknown type? @@ -190,19 +203,6 @@ const String File::getVersion() const return String::empty; // xxx not yet implemented } -//============================================================================== -const File File::getLinkedTarget() const -{ - char buffer [4096]; - size_t numChars = readlink (getFullPathName().toUTF8(), - buffer, sizeof (buffer)); - - if (numChars > 0 && numChars <= sizeof (buffer)) - return File (String::fromUTF8 (buffer, (int) numChars)); - - return *this; -} - //============================================================================== bool File::moveToTrash() const {