From 618d3fdf64e7adfd27aa2a6991bf460a3dec849d Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Wed, 20 Oct 2010 20:37:09 +0100 Subject: [PATCH] Tidied up some win32 linkage declarations. Fixed some component size constraining problems on mac and win32. --- .../Source/Utility/jucer_MiscUtilities.h | 8 +- .../plugins/juce_PluginDirectoryScanner.cpp | 55 ++++++------- .../plugins/juce_PluginDirectoryScanner.h | 5 ++ src/core/juce_Initialisation.cpp | 8 +- src/core/juce_Initialisation.h | 8 +- src/core/juce_StandardHeader.h | 4 +- .../components/lookandfeel/juce_LookAndFeel.h | 2 +- src/gui/graphics/geometry/juce_Path.cpp | 10 +-- src/native/linux/juce_linux_Threads.cpp | 4 +- src/native/mac/juce_mac_Debugging.mm | 4 +- .../mac/juce_mac_NSViewComponentPeer.mm | 21 +++-- src/native/windows/juce_win32_ASIO.cpp | 5 ++ .../windows/juce_win32_ActiveXComponent.cpp | 2 +- .../windows/juce_win32_NativeIncludes.h | 2 +- src/native/windows/juce_win32_Threads.cpp | 2 +- .../juce_win32_WebBrowserComponent.cpp | 12 +-- src/native/windows/juce_win32_Windowing.cpp | 78 +++++++++++-------- src/text/juce_String.cpp | 64 +++++++-------- src/text/juce_String.h | 66 ++++++++-------- 19 files changed, 197 insertions(+), 163 deletions(-) diff --git a/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.h b/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.h index d039fed14a..98ecf27548 100644 --- a/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.h +++ b/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.h @@ -178,10 +178,10 @@ public: if (dc != 0) { - dc->setMarker (DrawableComposite::contentLeftMarkerName, true, RelativeCoordinate (0)); - dc->setMarker (DrawableComposite::contentTopMarkerName, false, RelativeCoordinate (0)); - dc->setMarker (DrawableComposite::contentRightMarkerName, true, RelativeCoordinate (getWidth())); - dc->setMarker (DrawableComposite::contentBottomMarkerName, false, RelativeCoordinate (getHeight())); + const RelativeCoordinate origin, right (getWidth()), bottom (getHeight()); + + dc->setContentArea (RelativeRectangle (origin, right, origin, bottom)); + dc->resetBoundingBoxToContentArea(); } } diff --git a/src/audio/plugins/juce_PluginDirectoryScanner.cpp b/src/audio/plugins/juce_PluginDirectoryScanner.cpp index 2806ede58e..2eb2d38f18 100644 --- a/src/audio/plugins/juce_PluginDirectoryScanner.cpp +++ b/src/audio/plugins/juce_PluginDirectoryScanner.cpp @@ -76,35 +76,38 @@ bool PluginDirectoryScanner::scanNextFile (const bool dontRescanIfAlreadyInList) { String file (filesOrIdentifiersToScan [nextIndex]); - if (file.isNotEmpty()) + if (file.isNotEmpty() && ! list.isListingUpToDate (file)) { - if (! list.isListingUpToDate (file)) - { - OwnedArray typesFound; - - // Add this plugin to the end of the dead-man's pedal list in case it crashes... - StringArray crashedPlugins (getDeadMansPedalFile()); - crashedPlugins.removeString (file); - crashedPlugins.add (file); - setDeadMansPedalFile (crashedPlugins); - - list.scanAndAddFile (file, - dontRescanIfAlreadyInList, - typesFound, - format); - - // Managed to load without crashing, so remove it from the dead-man's-pedal.. - crashedPlugins.removeString (file); - setDeadMansPedalFile (crashedPlugins); - - if (typesFound.size() == 0) - failedFiles.add (file); - } - - ++nextIndex; - progress = nextIndex / (float) filesOrIdentifiersToScan.size(); + OwnedArray typesFound; + + // Add this plugin to the end of the dead-man's pedal list in case it crashes... + StringArray crashedPlugins (getDeadMansPedalFile()); + crashedPlugins.removeString (file); + crashedPlugins.add (file); + setDeadMansPedalFile (crashedPlugins); + + list.scanAndAddFile (file, + dontRescanIfAlreadyInList, + typesFound, + format); + + // Managed to load without crashing, so remove it from the dead-man's-pedal.. + crashedPlugins.removeString (file); + setDeadMansPedalFile (crashedPlugins); + + if (typesFound.size() == 0) + failedFiles.add (file); } + return skipNextFile(); +} + +bool PluginDirectoryScanner::skipNextFile() +{ + if (nextIndex >= filesOrIdentifiersToScan.size()) + return false; + + progress = ++nextIndex / (float) filesOrIdentifiersToScan.size(); return nextIndex < filesOrIdentifiersToScan.size(); } diff --git a/src/audio/plugins/juce_PluginDirectoryScanner.h b/src/audio/plugins/juce_PluginDirectoryScanner.h index 4aefc9704a..ad512a1f1e 100644 --- a/src/audio/plugins/juce_PluginDirectoryScanner.h +++ b/src/audio/plugins/juce_PluginDirectoryScanner.h @@ -83,6 +83,11 @@ public: */ bool scanNextFile (bool dontRescanIfAlreadyInList); + /** Skips over the next file without scanning it. + Returns false when there are no more files to try. + */ + bool skipNextFile(); + /** Returns the description of the plugin that will be scanned during the next call to scanNextFile(). diff --git a/src/core/juce_Initialisation.cpp b/src/core/juce_Initialisation.cpp index 86e0248887..0f047be1ba 100644 --- a/src/core/juce_Initialisation.cpp +++ b/src/core/juce_Initialisation.cpp @@ -54,7 +54,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== static bool juceInitialisedNonGUI = false; -void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI() +JUCE_API void JUCE_CALLTYPE initialiseJuce_NonGUI() { if (! juceInitialisedNonGUI) { @@ -80,7 +80,7 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI() static_jassert (sizeof (uint64) == 8); } -void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI() +JUCE_API void JUCE_CALLTYPE shutdownJuce_NonGUI() { if (juceInitialisedNonGUI) { @@ -108,7 +108,7 @@ void juce_setCurrentThreadName (const String& name); static bool juceInitialisedGUI = false; -void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI() +JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI() { if (! juceInitialisedGUI) { @@ -141,7 +141,7 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI() } } -void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI() +JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI() { if (juceInitialisedGUI) { diff --git a/src/core/juce_Initialisation.h b/src/core/juce_Initialisation.h index 83b4f05770..3beafd9dfa 100644 --- a/src/core/juce_Initialisation.h +++ b/src/core/juce_Initialisation.h @@ -39,7 +39,7 @@ @see shutdownJuce_GUI(), initialiseJuce_NonGUI() */ -void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI(); +JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI(); /** Clears up any static data being used by Juce's GUI classes. @@ -49,7 +49,7 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI(); @see initialiseJuce_GUI(), initialiseJuce_NonGUI() */ -void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); +JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI(); //============================================================================== @@ -63,7 +63,7 @@ void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); @see shutdownJuce_NonGUI, initialiseJuce_GUI */ -void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI(); +JUCE_API void JUCE_CALLTYPE initialiseJuce_NonGUI(); /** Clears up any static data being used by Juce's non-gui core classes. @@ -73,7 +73,7 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI(); @see initialiseJuce_NonGUI, initialiseJuce_GUI */ -void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI(); +JUCE_API void JUCE_CALLTYPE shutdownJuce_NonGUI(); //============================================================================== diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 062762f8b3..a1129234d4 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -147,10 +147,10 @@ // Now include some basics that are needed by most of the Juce classes... BEGIN_JUCE_NAMESPACE -extern bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger(); +extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger(); #if JUCE_LOG_ASSERTIONS - extern void JUCE_API juce_LogAssertion (const char* filename, int lineNum) throw(); + extern JUCE_API void juce_LogAssertion (const char* filename, int lineNum) throw(); #endif #include "juce_Memory.h" diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.h b/src/gui/components/lookandfeel/juce_LookAndFeel.h index a4a1125055..764d42e3cb 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.h +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.h @@ -641,7 +641,7 @@ public: private: - friend void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); + friend JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI(); static void clearDefaultLookAndFeel() throw(); // called at shutdown Array colourIds; diff --git a/src/gui/graphics/geometry/juce_Path.cpp b/src/gui/graphics/geometry/juce_Path.cpp index 2307c210dd..5b5105f921 100644 --- a/src/gui/graphics/geometry/juce_Path.cpp +++ b/src/gui/graphics/geometry/juce_Path.cpp @@ -456,15 +456,15 @@ void Path::addEllipse (const float x, const float y, const float hw = w * 0.5f; const float hw55 = hw * 0.55f; const float hh = h * 0.5f; - const float hh45 = hh * 0.55f; + const float hh55 = hh * 0.55f; const float cx = x + hw; const float cy = y + hh; startNewSubPath (cx, cy - hh); - cubicTo (cx + hw55, cy - hh, cx + hw, cy - hh45, cx + hw, cy); - cubicTo (cx + hw, cy + hh45, cx + hw55, cy + hh, cx, cy + hh); - cubicTo (cx - hw55, cy + hh, cx - hw, cy + hh45, cx - hw, cy); - cubicTo (cx - hw, cy - hh45, cx - hw55, cy - hh, cx, cy - hh); + cubicTo (cx + hw55, cy - hh, cx + hw, cy - hh55, cx + hw, cy); + cubicTo (cx + hw, cy + hh55, cx + hw55, cy + hh, cx, cy + hh); + cubicTo (cx - hw55, cy + hh, cx - hw, cy + hh55, cx - hw, cy); + cubicTo (cx - hw, cy - hh55, cx - hw55, cy - hh, cx, cy - hh); closeSubPath(); } diff --git a/src/native/linux/juce_linux_Threads.cpp b/src/native/linux/juce_linux_Threads.cpp index edc7fc53a0..7d4a3d5e2b 100644 --- a/src/native/linux/juce_linux_Threads.cpp +++ b/src/native/linux/juce_linux_Threads.cpp @@ -66,7 +66,7 @@ void Process::terminate() exit (0); } -bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger() +JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() { static char testResult = 0; @@ -84,7 +84,7 @@ bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger() return testResult < 0; } -bool JUCE_CALLTYPE Process::isRunningUnderDebugger() +JUCE_API bool JUCE_CALLTYPE Process::isRunningUnderDebugger() { return juce_isRunningUnderDebugger(); } diff --git a/src/native/mac/juce_mac_Debugging.mm b/src/native/mac/juce_mac_Debugging.mm index 74a0d8e303..41d79dcecc 100644 --- a/src/native/mac/juce_mac_Debugging.mm +++ b/src/native/mac/juce_mac_Debugging.mm @@ -33,7 +33,7 @@ void Logger::outputDebugString (const String& text) std::cerr << text << std::endl; } -bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger() +JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() { static char testResult = 0; @@ -49,7 +49,7 @@ bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger() return testResult > 0; } -bool JUCE_CALLTYPE Process::isRunningUnderDebugger() +JUCE_API bool JUCE_CALLTYPE Process::isRunningUnderDebugger() { return juce_isRunningUnderDebugger(); } diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 96eb6774fb..e5439a0b6f 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -1069,12 +1069,21 @@ NSRect NSViewComponentPeer::constrainRect (NSRect r) Rectangle pos (convertToRectInt (r)); Rectangle original (convertToRectInt (current)); - constrainer->checkBounds (pos, original, - Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), - pos.getY() != original.getY() && pos.getBottom() == original.getBottom(), - pos.getX() != original.getX() && pos.getRight() == original.getRight(), - pos.getY() == original.getY() && pos.getBottom() != original.getBottom(), - pos.getX() == original.getX() && pos.getRight() != original.getRight()); + if ([window inLiveResize]) + { + constrainer->checkBounds (pos, original, + Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), + false, false, true, true); + } + else + { + constrainer->checkBounds (pos, original, + Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), + pos.getY() != original.getY() && pos.getBottom() == original.getBottom(), + pos.getX() != original.getX() && pos.getRight() == original.getRight(), + pos.getY() == original.getY() && pos.getBottom() != original.getBottom(), + pos.getX() == original.getX() && pos.getRight() != original.getRight()); + } r.origin.x = pos.getX(); r.origin.y = [[[NSScreen screens] objectAtIndex: 0] frame].size.height - r.size.height - pos.getY(); diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index 80c80a1939..bc6005a6dd 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -38,6 +38,11 @@ #define log(a) {} #endif +/* The ASIO SDK *should* declare its callback functions as being __cdecl, but different versions seem + to be pretty random about whether or not they do this. If you hit an error using these functions + it'll be because you're trying to build using __stdcall, in which case you'd need to either get hold of + an ASIO SDK which correctly specifies __cdecl, or add the __cdecl keyword to its functions yourself. +*/ #define JUCE_ASIOCALLBACK __cdecl //============================================================================== diff --git a/src/native/windows/juce_win32_ActiveXComponent.cpp b/src/native/windows/juce_win32_ActiveXComponent.cpp index 881c020fc3..e1205355d9 100644 --- a/src/native/windows/juce_win32_ActiveXComponent.cpp +++ b/src/native/windows/juce_win32_ActiveXComponent.cpp @@ -142,7 +142,7 @@ namespace ActiveXHelpers inplaceSite->Release(); } - HRESULT __stdcall QueryInterface (REFIID type, void __RPC_FAR* __RPC_FAR* result) + HRESULT __stdcall QueryInterface (REFIID type, void** result) { if (type == IID_IOleInPlaceSite) { diff --git a/src/native/windows/juce_win32_NativeIncludes.h b/src/native/windows/juce_win32_NativeIncludes.h index 8777328dc3..9bf5a44e73 100644 --- a/src/native/windows/juce_win32_NativeIncludes.h +++ b/src/native/windows/juce_win32_NativeIncludes.h @@ -259,7 +259,7 @@ public: ComBaseClassHelper() : refCount (1) {} virtual ~ComBaseClassHelper() {} - HRESULT __stdcall QueryInterface (REFIID refId, void __RPC_FAR* __RPC_FAR* result) + HRESULT __stdcall QueryInterface (REFIID refId, void** result) { #ifndef __MINGW32__ if (refId == __uuidof (ComClass)) { AddRef(); *result = dynamic_cast (this); return S_OK; } diff --git a/src/native/windows/juce_win32_Threads.cpp b/src/native/windows/juce_win32_Threads.cpp index e215549e45..5939f6768e 100644 --- a/src/native/windows/juce_win32_Threads.cpp +++ b/src/native/windows/juce_win32_Threads.cpp @@ -273,7 +273,7 @@ void Process::setPriority (ProcessPriority prior) } } -bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger() +JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() { return IsDebuggerPresent() != FALSE; } diff --git a/src/native/windows/juce_win32_WebBrowserComponent.cpp b/src/native/windows/juce_win32_WebBrowserComponent.cpp index b9c56dca7b..47919168f3 100644 --- a/src/native/windows/juce_win32_WebBrowserComponent.cpp +++ b/src/native/windows/juce_win32_WebBrowserComponent.cpp @@ -158,14 +158,14 @@ private: } //============================================================================== - HRESULT __stdcall GetTypeInfoCount (UINT __RPC_FAR*) { return E_NOTIMPL; } - HRESULT __stdcall GetTypeInfo (UINT, LCID, ITypeInfo __RPC_FAR *__RPC_FAR*) { return E_NOTIMPL; } - HRESULT __stdcall GetIDsOfNames (REFIID, LPOLESTR __RPC_FAR*, UINT, LCID, DISPID __RPC_FAR*) { return E_NOTIMPL; } + HRESULT __stdcall GetTypeInfoCount (UINT*) { return E_NOTIMPL; } + HRESULT __stdcall GetTypeInfo (UINT, LCID, ITypeInfo**) { return E_NOTIMPL; } + HRESULT __stdcall GetIDsOfNames (REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return E_NOTIMPL; } HRESULT __stdcall Invoke (DISPID dispIdMember, REFIID /*riid*/, LCID /*lcid*/, - WORD /*wFlags*/, DISPPARAMS __RPC_FAR* pDispParams, - VARIANT __RPC_FAR* /*pVarResult*/, EXCEPINFO __RPC_FAR* /*pExcepInfo*/, - UINT __RPC_FAR* /*puArgErr*/) + WORD /*wFlags*/, DISPPARAMS* pDispParams, + VARIANT* /*pVarResult*/, EXCEPINFO* /*pExcepInfo*/, + UINT* /*puArgErr*/) { switch (dispIdMember) { diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 925759fbd8..12b53953e3 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -1833,36 +1833,48 @@ private: return 0; //============================================================================== + case WM_SIZING: + if (constrainer != 0 && (styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) + { + RECT* const r = (RECT*) lParam; + Rectangle pos (r->left, r->top, r->right - r->left, r->bottom - r->top); + + constrainer->checkBounds (pos, windowBorder.addedTo (component->getBounds()), + Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), + wParam == WMSZ_TOP || wParam == WMSZ_TOPLEFT || wParam == WMSZ_TOPRIGHT, + wParam == WMSZ_LEFT || wParam == WMSZ_TOPLEFT || wParam == WMSZ_BOTTOMLEFT, + wParam == WMSZ_BOTTOM || wParam == WMSZ_BOTTOMLEFT || wParam == WMSZ_BOTTOMRIGHT, + wParam == WMSZ_RIGHT || wParam == WMSZ_TOPRIGHT || wParam == WMSZ_BOTTOMRIGHT); + r->left = pos.getX(); + r->top = pos.getY(); + r->right = pos.getRight(); + r->bottom = pos.getBottom(); + } + return TRUE; + case WM_WINDOWPOSCHANGING: - if ((styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) + if (constrainer != 0 && (styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) { WINDOWPOS* const wp = (WINDOWPOS*) lParam; - if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE)) + if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE) + && ! Component::isMouseButtonDownAnywhere()) { - if (constrainer != 0) - { - const Rectangle current (component->getX() - windowBorder.getLeft(), - component->getY() - windowBorder.getTop(), - component->getWidth() + windowBorder.getLeftAndRight(), - component->getHeight() + windowBorder.getTopAndBottom()); - - Rectangle pos (wp->x, wp->y, wp->cx, wp->cy); - - constrainer->checkBounds (pos, current, - Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), - pos.getY() != current.getY() && pos.getBottom() == current.getBottom(), - pos.getX() != current.getX() && pos.getRight() == current.getRight(), - pos.getY() == current.getY() && pos.getBottom() != current.getBottom(), - pos.getX() == current.getX() && pos.getRight() != current.getRight()); - wp->x = pos.getX(); - wp->y = pos.getY(); - wp->cx = pos.getWidth(); - wp->cy = pos.getHeight(); - } + Rectangle pos (wp->x, wp->y, wp->cx, wp->cy); + const Rectangle current (windowBorder.addedTo (component->getBounds())); + + constrainer->checkBounds (pos, current, + Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), + pos.getY() != current.getY() && pos.getBottom() == current.getBottom(), + pos.getX() != current.getX() && pos.getRight() == current.getRight(), + pos.getY() == current.getY() && pos.getBottom() != current.getBottom(), + pos.getX() == current.getX() && pos.getRight() != current.getRight()); + wp->x = pos.getX(); + wp->y = pos.getY(); + wp->cx = pos.getWidth(); + wp->cy = pos.getHeight(); } } - return 0; case WM_WINDOWPOSCHANGED: @@ -2755,12 +2767,12 @@ public: { } - virtual ~JuceDataObject() + ~JuceDataObject() { jassert (refCount == 0); } - HRESULT __stdcall GetData (FORMATETC __RPC_FAR* pFormatEtc, STGMEDIUM __RPC_FAR* pMedium) + HRESULT __stdcall GetData (FORMATETC* pFormatEtc, STGMEDIUM* pMedium) { if ((pFormatEtc->tymed & format->tymed) != 0 && pFormatEtc->cfFormat == format->cfFormat @@ -2787,7 +2799,7 @@ public: return DV_E_FORMATETC; } - HRESULT __stdcall QueryGetData (FORMATETC __RPC_FAR* f) + HRESULT __stdcall QueryGetData (FORMATETC* f) { if (f == 0) return E_INVALIDARG; @@ -2800,13 +2812,13 @@ public: return DV_E_FORMATETC; } - HRESULT __stdcall GetCanonicalFormatEtc (FORMATETC __RPC_FAR*, FORMATETC __RPC_FAR* pFormatEtcOut) + HRESULT __stdcall GetCanonicalFormatEtc (FORMATETC*, FORMATETC* pFormatEtcOut) { pFormatEtcOut->ptd = 0; return E_NOTIMPL; } - HRESULT __stdcall EnumFormatEtc (DWORD direction, IEnumFORMATETC __RPC_FAR *__RPC_FAR *result) + HRESULT __stdcall EnumFormatEtc (DWORD direction, IEnumFORMATETC** result) { if (result == 0) return E_POINTER; @@ -2821,11 +2833,11 @@ public: return E_NOTIMPL; } - HRESULT __stdcall GetDataHere (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*) { return DATA_E_FORMATETC; } - HRESULT __stdcall SetData (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*, BOOL) { return E_NOTIMPL; } - HRESULT __stdcall DAdvise (FORMATETC __RPC_FAR*, DWORD, IAdviseSink __RPC_FAR*, DWORD __RPC_FAR*) { return OLE_E_ADVISENOTSUPPORTED; } - HRESULT __stdcall DUnadvise (DWORD) { return E_NOTIMPL; } - HRESULT __stdcall EnumDAdvise (IEnumSTATDATA __RPC_FAR *__RPC_FAR *) { return OLE_E_ADVISENOTSUPPORTED; } + HRESULT __stdcall GetDataHere (FORMATETC*, STGMEDIUM*) { return DATA_E_FORMATETC; } + HRESULT __stdcall SetData (FORMATETC*, STGMEDIUM*, BOOL) { return E_NOTIMPL; } + HRESULT __stdcall DAdvise (FORMATETC*, DWORD, IAdviseSink*, DWORD*) { return OLE_E_ADVISENOTSUPPORTED; } + HRESULT __stdcall DUnadvise (DWORD) { return E_NOTIMPL; } + HRESULT __stdcall EnumDAdvise (IEnumSTATDATA**) { return OLE_E_ADVISENOTSUPPORTED; } private: JuceDropSource* const dropSource; diff --git a/src/text/juce_String.cpp b/src/text/juce_String.cpp index 3ee8a75e8e..7047b0c1f4 100644 --- a/src/text/juce_String.cpp +++ b/src/text/juce_String.cpp @@ -495,52 +495,52 @@ int64 String::hashCode64() const throw() } //============================================================================== -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const String& string2) throw() { return string1.compare (string2) == 0; } -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const char* string2) throw() +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const char* string2) throw() { return string1.compare (string2) == 0; } -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const juce_wchar* string2) throw() +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const juce_wchar* string2) throw() { return string1.compare (string2) == 0; } -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const String& string2) throw() { return string1.compare (string2) != 0; } -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const char* string2) throw() +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const char* string2) throw() { return string1.compare (string2) != 0; } -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const juce_wchar* string2) throw() +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const juce_wchar* string2) throw() { return string1.compare (string2) != 0; } -bool JUCE_PUBLIC_FUNCTION operator> (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator> (const String& string1, const String& string2) throw() { return string1.compare (string2) > 0; } -bool JUCE_PUBLIC_FUNCTION operator< (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator< (const String& string1, const String& string2) throw() { return string1.compare (string2) < 0; } -bool JUCE_PUBLIC_FUNCTION operator>= (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator>= (const String& string1, const String& string2) throw() { return string1.compare (string2) >= 0; } -bool JUCE_PUBLIC_FUNCTION operator<= (const String& string1, const String& string2) throw() +JUCE_API bool JUCE_CALLTYPE operator<= (const String& string1, const String& string2) throw() { return string1.compare (string2) <= 0; } @@ -659,114 +659,114 @@ void String::append (const juce_wchar* const other, const int howMany) } //============================================================================== -const String JUCE_PUBLIC_FUNCTION operator+ (const char* const string1, const String& string2) +JUCE_API const String JUCE_CALLTYPE operator+ (const char* const string1, const String& string2) { String s (string1); return s += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar* const string1, const String& string2) +JUCE_API const String JUCE_CALLTYPE operator+ (const juce_wchar* const string1, const String& string2) { String s (string1); return s += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (const char string1, const String& string2) +JUCE_API const String JUCE_CALLTYPE operator+ (const char string1, const String& string2) { return String::charToString (string1) + string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar string1, const String& string2) +JUCE_API const String JUCE_CALLTYPE operator+ (const juce_wchar string1, const String& string2) { return String::charToString (string1) + string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const String& string2) +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const String& string2) { return string1 += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char* const string2) +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const char* const string2) { return string1 += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar* const string2) +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const juce_wchar* const string2) { return string1 += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char string2) +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const char string2) { return string1 += string2; } -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar string2) +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const juce_wchar string2) { return string1 += string2; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char characterToAppend) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const char characterToAppend) { return string1 += characterToAppend; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar characterToAppend) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const juce_wchar characterToAppend) { return string1 += characterToAppend; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char* const string2) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const char* const string2) { return string1 += string2; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar* const string2) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const juce_wchar* const string2) { return string1 += string2; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const String& string2) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const String& string2) { return string1 += string2; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const short number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const short number) { return string1 += (int) number; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const int number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const int number) { return string1 += number; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned int number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const unsigned int number) { return string1 += number; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const long number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const long number) { return string1 += (int) number; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned long number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const unsigned long number) { return string1 += (unsigned int) number; } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const float number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const float number) { return string1 += String (number); } -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const double number) +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const double number) { return string1 += String (number); } -OutputStream& JUCE_PUBLIC_FUNCTION operator<< (OutputStream& stream, const String& text) +JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const String& text) { // (This avoids using toUTF8() to prevent the memory bloat that it would leave behind // if lots of large, persistent strings were to be written to streams). diff --git a/src/text/juce_String.h b/src/text/juce_String.h index ab9b640aa1..1706b10cef 100644 --- a/src/text/juce_String.h +++ b/src/text/juce_String.h @@ -1061,86 +1061,86 @@ private: //============================================================================== /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (const char* string1, const String& string2); +JUCE_API const String JUCE_CALLTYPE operator+ (const char* string1, const String& string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar* string1, const String& string2); +JUCE_API const String JUCE_CALLTYPE operator+ (const juce_wchar* string1, const String& string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (char string1, const String& string2); +JUCE_API const String JUCE_CALLTYPE operator+ (char string1, const String& string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (juce_wchar string1, const String& string2); +JUCE_API const String JUCE_CALLTYPE operator+ (juce_wchar string1, const String& string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const String& string2); +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const String& string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char* string2); +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const char* string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar* string2); +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, const juce_wchar* string2); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, char characterToAppend); +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, char characterToAppend); /** Concatenates two strings. */ -const String JUCE_PUBLIC_FUNCTION operator+ (String string1, juce_wchar characterToAppend); +JUCE_API const String JUCE_CALLTYPE operator+ (String string1, juce_wchar characterToAppend); //============================================================================== /** Appends a character at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, char characterToAppend); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, char characterToAppend); /** Appends a character at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, juce_wchar characterToAppend); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, juce_wchar characterToAppend); /** Appends a string to the end of the first one. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char* string2); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const char* string2); /** Appends a string to the end of the first one. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar* string2); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const juce_wchar* string2); /** Appends a string to the end of the first one. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const String& string2); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const String& string2); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, short number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, short number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, int number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, unsigned int number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned int number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, long number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, long number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, unsigned long number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned long number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, float number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, float number); /** Appends a decimal number at the end of a string. */ -String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, double number); +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, double number); //============================================================================== /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const String& string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const char* string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const char* string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const juce_wchar* string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const juce_wchar* string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const String& string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const char* string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const char* string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const juce_wchar* string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const juce_wchar* string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator> (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator> (const String& string1, const String& string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator< (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator< (const String& string1, const String& string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator>= (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator>= (const String& string1, const String& string2) throw(); /** Case-sensitive comparison of two strings. */ -bool JUCE_PUBLIC_FUNCTION operator<= (const String& string1, const String& string2) throw(); +JUCE_API bool JUCE_CALLTYPE operator<= (const String& string1, const String& string2) throw(); //============================================================================== /** This streaming override allows you to pass a juce String directly into std output streams. This is very handy for writing strings to std::cout, std::cerr, etc. */ template -std::basic_ostream & JUCE_PUBLIC_FUNCTION operator<< (std::basic_ostream & stream, const String& stringToWrite) +JUCE_API std::basic_ostream & JUCE_CALLTYPE operator<< (std::basic_ostream & stream, const String& stringToWrite) { return stream << stringToWrite.toUTF8(); } /** Writes a string to an OutputStream as UTF8. */ -OutputStream& JUCE_PUBLIC_FUNCTION operator<< (OutputStream& stream, const String& text); +JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const String& text); #endif // __JUCE_STRING_JUCEHEADER__