diff --git a/extras/Jucer (experimental)/Source/Project/jucer_NewProjectWizard.cpp b/extras/Jucer (experimental)/Source/Project/jucer_NewProjectWizard.cpp index 210372b3ac..a0b535e108 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_NewProjectWizard.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_NewProjectWizard.cpp @@ -239,7 +239,7 @@ public: project.getProjectType() = Project::audioPlugin; project.getObjectiveCClassSuffix() = project.getProjectUID(); - + Project::Item group (project.createNewGroup()); project.getMainGroup().addChild (group, 0); group.getName() = "Source"; diff --git a/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp b/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp index c54869031c..4d68d09efe 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_Project.cpp @@ -349,7 +349,7 @@ void Project::createPropertyEditors (Array & props) props.add (new TextPropertyComponent (getObjectiveCClassSuffix(), "Objective-C Name Suffix", 256, false)); props.getLast()->setTooltip ("An optional string which will be appended to objective-C class names. If you're building a plugin, it's important to define this, to avoid name clashes between multiple plugin modules that are dynamically loaded into the same address space."); - + if (isAudioPlugin()) { props.add (new BooleanPropertyComponent (shouldBuildVST(), "Build VST", "Enabled")); diff --git a/extras/Jucer (experimental)/Source/Project/jucer_Project.h b/extras/Jucer (experimental)/Source/Project/jucer_Project.h index d8be1ef273..4687f493a7 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_Project.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_Project.h @@ -108,12 +108,12 @@ public: const Image getSmallIcon(); Value getObjectiveCClassSuffix() const { return getProjectValue ("objCSuffix"); } - + Value shouldBuildVST() const { return getProjectValue ("buildVST"); } Value shouldBuildRTAS() const { return getProjectValue ("buildRTAS"); } Value shouldBuildAU() const { return getProjectValue ("buildAU"); } bool shouldAddVSTFolderToPath() { return (isAudioPlugin() && (bool) shouldBuildVST().getValue()) || getJuceConfigFlag ("JUCE_PLUGINHOST_VST").toString() == configFlagEnabled; } - + Value getPluginName() const { return getProjectValue ("pluginName"); } Value getPluginDesc() const { return getProjectValue ("pluginDesc"); } Value getPluginManufacturer() const { return getProjectValue ("pluginManufacturer"); } diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h index 4312599dfe..3fb09af813 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectSaver.h @@ -363,10 +363,10 @@ private: << "#define JucePlugin_RTASCategory " << ((bool) project.getPluginIsSynth().getValue() ? "ePlugInCategory_SWGenerators" : "ePlugInCategory_None") << newLine << "#define JucePlugin_RTASManufacturerCode JucePlugin_ManufacturerCode" << newLine << "#define JucePlugin_RTASProductId JucePlugin_PluginCode" << newLine; - + if (project.getObjectiveCClassSuffix().toString().isNotEmpty()) out << "#define JUCE_ObjCExtraSuffix " << project.getObjectiveCClassSuffix().toString() << newLine; - + out << "#define JUCE_USE_VSTSDK_2_4 1" << newLine << newLine << "#endif // " << headerGuard << newLine; diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index b7341fff0b..bfcf314e8a 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -9180,7 +9180,7 @@ public: } } - ~ZipInputStream() throw() + ~ZipInputStream() { #if JUCE_DEBUG if (inputStream != 0 && inputStream == file.inputStream) @@ -9191,12 +9191,12 @@ public: delete inputStream; } - int64 getTotalLength() throw() + int64 getTotalLength() { return zipEntryInfo.compressedSize; } - int read (void* buffer, int howMany) throw() + int read (void* buffer, int howMany) { if (headerSize <= 0) return 0; @@ -9224,17 +9224,17 @@ public: return num; } - bool isExhausted() throw() + bool isExhausted() { return headerSize <= 0 || pos >= zipEntryInfo.compressedSize; } - int64 getPosition() throw() + int64 getPosition() { return pos; } - bool setPosition (int64 newPos) throw() + bool setPosition (int64 newPos) { pos = jlimit ((int64) 0, (int64) zipEntryInfo.compressedSize, newPos); return true; @@ -9252,8 +9252,7 @@ private: ZipInputStream& operator= (const ZipInputStream&); }; -ZipFile::ZipFile (InputStream* const source_, - const bool deleteStreamWhenDestroyed) throw() +ZipFile::ZipFile (InputStream* const source_, const bool deleteStreamWhenDestroyed) : inputStream (source_) #if JUCE_DEBUG , numOpenStreams (0) @@ -9285,7 +9284,7 @@ ZipFile::ZipFile (InputSource* const inputSource_) init(); } -ZipFile::~ZipFile() throw() +ZipFile::~ZipFile() { #if JUCE_DEBUG entries.clear(); @@ -9307,7 +9306,6 @@ int ZipFile::getNumEntries() const throw() const ZipFile::ZipEntry* ZipFile::getEntry (const int index) const throw() { ZipEntryInfo* const zei = entries [index]; - return zei != 0 ? &(zei->entry) : 0; } @@ -60986,7 +60984,7 @@ void ComponentMovementWatcher::componentMovedOrResized (Component&, bool wasMove componentMovedOrResized (wasMoved, wasResized); } -void ComponentMovementWatcher::registerWithParentComps() throw() +void ComponentMovementWatcher::registerWithParentComps() { Component* p = component->getParentComponent(); @@ -60998,7 +60996,7 @@ void ComponentMovementWatcher::registerWithParentComps() throw() } } -void ComponentMovementWatcher::unregister() throw() +void ComponentMovementWatcher::unregister() { for (int i = registeredParentComps.size(); --i >= 0;) registeredParentComps.getUnchecked(i)->removeComponentListener (this); @@ -239277,7 +239275,7 @@ static HPALETTE palette = 0; static bool createPaletteIfNeeded = true; static bool shouldDeactivateTitleBar = true; -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw(); +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY); #define WM_TRAYNOTIFY WM_USER + 100 using ::abs; @@ -241511,7 +241509,7 @@ void juce_updateMultiMonitorInfo (Array >& monitorCoords, const } } -static const Image createImageFromHBITMAP (HBITMAP bitmap) throw() +static const Image createImageFromHBITMAP (HBITMAP bitmap) { Image im; @@ -241550,7 +241548,7 @@ static const Image createImageFromHBITMAP (HBITMAP bitmap) throw() return im; } -static const Image createImageFromHICON (HICON icon) throw() +static const Image createImageFromHICON (HICON icon) { ICONINFO info; @@ -241579,7 +241577,7 @@ static const Image createImageFromHICON (HICON icon) throw() return Image(); } -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw() +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) { WindowsBitmapImage* nativeBitmap = new WindowsBitmapImage (Image::ARGB, image.getWidth(), image.getHeight(), true); Image bitmap (nativeBitmap); @@ -241910,15 +241908,14 @@ private: JuceDataObject& operator= (const JuceDataObject&); }; -static HDROP createHDrop (const StringArray& fileNames) throw() +static HDROP createHDrop (const StringArray& fileNames) { int totalChars = 0; for (int i = fileNames.size(); --i >= 0;) totalChars += fileNames[i].length() + 1; HDROP hDrop = (HDROP) GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, - sizeof (DROPFILES) - + sizeof (WCHAR) * (totalChars + 2)); + sizeof (DROPFILES) + sizeof (WCHAR) * (totalChars + 2)); if (hDrop != 0) { @@ -241943,7 +241940,7 @@ static HDROP createHDrop (const StringArray& fileNames) throw() return hDrop; } -static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) throw() +static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) { JuceDropSource* const source = new JuceDropSource(); JuceDataObject* const data = new JuceDataObject (source, format, medium); @@ -244010,14 +244007,17 @@ public: ~WindowedGLContext() { - makeInactive(); - - wglDeleteContext (renderContext); - + deleteContext(); ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); delete nativeWindow; } + void deleteContext() + { + makeInactive(); + wglDeleteContext (renderContext); + } + bool makeActive() const throw() { jassert (renderContext != 0); @@ -259132,15 +259132,21 @@ public: ~WindowedGLContext() { - makeInactive(); - ScopedXLock xlock; - glXDestroyContext (display, renderContext); + deleteContext(); XUnmapWindow (display, embeddedWindow); XDestroyWindow (display, embeddedWindow); } + void deleteContext() + { + makeInactive(); + + ScopedXLock xlock; + glXDestroyContext (display, renderContext); + } + bool makeActive() const throw() { jassert (renderContext != 0); @@ -266813,10 +266819,15 @@ public: } ~WindowedGLContext() + { + deleteContext(); + viewHolder = 0; + } + + void deleteContext() { makeInactive(); [renderContext clearDrawable]; - viewHolder = 0; } bool makeActive() const throw() @@ -272397,10 +272408,15 @@ public: } ~WindowedGLContext() + { + deleteContext(); + viewHolder = 0; + } + + void deleteContext() { makeInactive(); [renderContext clearDrawable]; - viewHolder = 0; } bool makeActive() const throw() diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 7126e602fb..f81e2e48bd 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -15750,8 +15750,7 @@ public: @param deleteStreamWhenDestroyed if set to true, the object passed-in will be deleted when this ZipFile object is deleted */ - ZipFile (InputStream* inputStream, - bool deleteStreamWhenDestroyed) throw(); + ZipFile (InputStream* inputStream, bool deleteStreamWhenDestroyed); /** Creates a ZipFile based for a file. */ ZipFile (const File& file); @@ -15764,7 +15763,7 @@ public: ZipFile (InputSource* inputSource); /** Destructor. */ - ~ZipFile() throw(); + ~ZipFile(); /** Contains information about one of the entries in a ZipFile. @@ -51455,8 +51454,8 @@ private: bool reentrant; Rectangle lastBounds; - void unregister() throw(); - void registerWithParentComps() throw(); + void unregister(); + void registerWithParentComps(); ComponentMovementWatcher (const ComponentMovementWatcher&); ComponentMovementWatcher& operator= (const ComponentMovementWatcher&); @@ -56878,6 +56877,12 @@ public: */ virtual void* getRawContext() const throw() = 0; + /** Deletes the context. + This doesn't touch other resources, such as window handles, etc. + You'll probably never have to call this method directly. + */ + virtual void deleteContext() = 0; + /** Returns the context that's currently in active use by the calling thread. Returns 0 if there isn't an active context. @@ -57050,10 +57055,8 @@ public: */ void* getNativeWindowHandle() const; - /** Call this to manually delete the current GL context, if there is one. - This can be useful to cause a clear-out of the context, which will be automatically - re-created when it's needed. - */ + /** Delete the context. + This can be called back on the same thread that created the context. */ void deleteContext(); juce_UseDebuggingNewOperator diff --git a/src/gui/components/layout/juce_ComponentMovementWatcher.cpp b/src/gui/components/layout/juce_ComponentMovementWatcher.cpp index 793c27c729..0a1e649011 100644 --- a/src/gui/components/layout/juce_ComponentMovementWatcher.cpp +++ b/src/gui/components/layout/juce_ComponentMovementWatcher.cpp @@ -101,7 +101,7 @@ void ComponentMovementWatcher::componentMovedOrResized (Component&, bool wasMove componentMovedOrResized (wasMoved, wasResized); } -void ComponentMovementWatcher::registerWithParentComps() throw() +void ComponentMovementWatcher::registerWithParentComps() { Component* p = component->getParentComponent(); @@ -113,7 +113,7 @@ void ComponentMovementWatcher::registerWithParentComps() throw() } } -void ComponentMovementWatcher::unregister() throw() +void ComponentMovementWatcher::unregister() { for (int i = registeredParentComps.size(); --i >= 0;) registeredParentComps.getUnchecked(i)->removeComponentListener (this); diff --git a/src/gui/components/layout/juce_ComponentMovementWatcher.h b/src/gui/components/layout/juce_ComponentMovementWatcher.h index c1905afc88..8c18968773 100644 --- a/src/gui/components/layout/juce_ComponentMovementWatcher.h +++ b/src/gui/components/layout/juce_ComponentMovementWatcher.h @@ -82,8 +82,8 @@ private: bool reentrant; Rectangle lastBounds; - void unregister() throw(); - void registerWithParentComps() throw(); + void unregister(); + void registerWithParentComps(); ComponentMovementWatcher (const ComponentMovementWatcher&); ComponentMovementWatcher& operator= (const ComponentMovementWatcher&); diff --git a/src/gui/components/special/juce_OpenGLComponent.h b/src/gui/components/special/juce_OpenGLComponent.h index 8a68a72d21..d3ce5a5124 100644 --- a/src/gui/components/special/juce_OpenGLComponent.h +++ b/src/gui/components/special/juce_OpenGLComponent.h @@ -146,6 +146,12 @@ public: */ virtual void* getRawContext() const throw() = 0; + /** Deletes the context. + This doesn't touch other resources, such as window handles, etc. + You'll probably never have to call this method directly. + */ + virtual void deleteContext() = 0; + //============================================================================== /** Returns the context that's currently in active use by the calling thread. @@ -330,10 +336,8 @@ public: */ void* getNativeWindowHandle() const; - /** Call this to manually delete the current GL context, if there is one. - This can be useful to cause a clear-out of the context, which will be automatically - re-created when it's needed. - */ + /** Delete the context. + This can be called back on the same thread that created the context. */ void deleteContext(); juce_UseDebuggingNewOperator diff --git a/src/io/files/juce_ZipFile.cpp b/src/io/files/juce_ZipFile.cpp index 2fee334c04..a8685dbd45 100644 --- a/src/io/files/juce_ZipFile.cpp +++ b/src/io/files/juce_ZipFile.cpp @@ -83,7 +83,7 @@ public: } } - ~ZipInputStream() throw() + ~ZipInputStream() { #if JUCE_DEBUG if (inputStream != 0 && inputStream == file.inputStream) @@ -94,12 +94,12 @@ public: delete inputStream; } - int64 getTotalLength() throw() + int64 getTotalLength() { return zipEntryInfo.compressedSize; } - int read (void* buffer, int howMany) throw() + int read (void* buffer, int howMany) { if (headerSize <= 0) return 0; @@ -127,17 +127,17 @@ public: return num; } - bool isExhausted() throw() + bool isExhausted() { return headerSize <= 0 || pos >= zipEntryInfo.compressedSize; } - int64 getPosition() throw() + int64 getPosition() { return pos; } - bool setPosition (int64 newPos) throw() + bool setPosition (int64 newPos) { pos = jlimit ((int64) 0, (int64) zipEntryInfo.compressedSize, newPos); return true; @@ -158,8 +158,7 @@ private: //============================================================================== -ZipFile::ZipFile (InputStream* const source_, - const bool deleteStreamWhenDestroyed) throw() +ZipFile::ZipFile (InputStream* const source_, const bool deleteStreamWhenDestroyed) : inputStream (source_) #if JUCE_DEBUG , numOpenStreams (0) @@ -191,7 +190,7 @@ ZipFile::ZipFile (InputSource* const inputSource_) init(); } -ZipFile::~ZipFile() throw() +ZipFile::~ZipFile() { #if JUCE_DEBUG entries.clear(); @@ -214,7 +213,6 @@ int ZipFile::getNumEntries() const throw() const ZipFile::ZipEntry* ZipFile::getEntry (const int index) const throw() { ZipEntryInfo* const zei = entries [index]; - return zei != 0 ? &(zei->entry) : 0; } diff --git a/src/io/files/juce_ZipFile.h b/src/io/files/juce_ZipFile.h index a5d157c1c3..48e6c648c3 100644 --- a/src/io/files/juce_ZipFile.h +++ b/src/io/files/juce_ZipFile.h @@ -50,8 +50,7 @@ public: @param deleteStreamWhenDestroyed if set to true, the object passed-in will be deleted when this ZipFile object is deleted */ - ZipFile (InputStream* inputStream, - bool deleteStreamWhenDestroyed) throw(); + ZipFile (InputStream* inputStream, bool deleteStreamWhenDestroyed); /** Creates a ZipFile based for a file. */ ZipFile (const File& file); @@ -64,7 +63,7 @@ public: ZipFile (InputSource* inputSource); /** Destructor. */ - ~ZipFile() throw(); + ~ZipFile(); //============================================================================== /** diff --git a/src/native/linux/juce_linux_Windowing.cpp b/src/native/linux/juce_linux_Windowing.cpp index 6c5cf6c7fd..5a1704cd1a 100644 --- a/src/native/linux/juce_linux_Windowing.cpp +++ b/src/native/linux/juce_linux_Windowing.cpp @@ -3233,15 +3233,21 @@ public: ~WindowedGLContext() { - makeInactive(); - ScopedXLock xlock; - glXDestroyContext (display, renderContext); + deleteContext(); XUnmapWindow (display, embeddedWindow); XDestroyWindow (display, embeddedWindow); } + void deleteContext() + { + makeInactive(); + + ScopedXLock xlock; + glXDestroyContext (display, renderContext); + } + bool makeActive() const throw() { jassert (renderContext != 0); diff --git a/src/native/mac/juce_mac_OpenGLComponent.mm b/src/native/mac/juce_mac_OpenGLComponent.mm index 512723979c..3c5f0b655c 100644 --- a/src/native/mac/juce_mac_OpenGLComponent.mm +++ b/src/native/mac/juce_mac_OpenGLComponent.mm @@ -175,10 +175,15 @@ public: } ~WindowedGLContext() + { + deleteContext(); + viewHolder = 0; + } + + void deleteContext() { makeInactive(); [renderContext clearDrawable]; - viewHolder = 0; } bool makeActive() const throw() diff --git a/src/native/windows/juce_win32_OpenGLComponent.cpp b/src/native/windows/juce_win32_OpenGLComponent.cpp index 9df13b5f7a..f7e5b16913 100644 --- a/src/native/windows/juce_win32_OpenGLComponent.cpp +++ b/src/native/windows/juce_win32_OpenGLComponent.cpp @@ -115,14 +115,17 @@ public: ~WindowedGLContext() { - makeInactive(); - - wglDeleteContext (renderContext); - + deleteContext(); ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); delete nativeWindow; } + void deleteContext() + { + makeInactive(); + wglDeleteContext (renderContext); + } + bool makeActive() const throw() { jassert (renderContext != 0); diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index a97e4e68f0..ec940ae75e 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -58,7 +58,7 @@ static HPALETTE palette = 0; static bool createPaletteIfNeeded = true; static bool shouldDeactivateTitleBar = true; -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw(); +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY); #define WM_TRAYNOTIFY WM_USER + 100 using ::abs; @@ -2338,7 +2338,7 @@ void juce_updateMultiMonitorInfo (Array >& monitorCoords, const } //============================================================================== -static const Image createImageFromHBITMAP (HBITMAP bitmap) throw() +static const Image createImageFromHBITMAP (HBITMAP bitmap) { Image im; @@ -2377,7 +2377,7 @@ static const Image createImageFromHBITMAP (HBITMAP bitmap) throw() return im; } -static const Image createImageFromHICON (HICON icon) throw() +static const Image createImageFromHICON (HICON icon) { ICONINFO info; @@ -2406,7 +2406,7 @@ static const Image createImageFromHICON (HICON icon) throw() return Image(); } -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw() +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) { WindowsBitmapImage* nativeBitmap = new WindowsBitmapImage (Image::ARGB, image.getWidth(), image.getHeight(), true); Image bitmap (nativeBitmap); @@ -2742,15 +2742,14 @@ private: JuceDataObject& operator= (const JuceDataObject&); }; -static HDROP createHDrop (const StringArray& fileNames) throw() +static HDROP createHDrop (const StringArray& fileNames) { int totalChars = 0; for (int i = fileNames.size(); --i >= 0;) totalChars += fileNames[i].length() + 1; HDROP hDrop = (HDROP) GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, - sizeof (DROPFILES) - + sizeof (WCHAR) * (totalChars + 2)); + sizeof (DROPFILES) + sizeof (WCHAR) * (totalChars + 2)); if (hDrop != 0) { @@ -2775,7 +2774,7 @@ static HDROP createHDrop (const StringArray& fileNames) throw() return hDrop; } -static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) throw() +static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) { JuceDropSource* const source = new JuceDropSource(); JuceDataObject* const data = new JuceDataObject (source, format, medium);