diff --git a/build/linux/platform_specific_code/juce_linux_Windowing.cpp b/build/linux/platform_specific_code/juce_linux_Windowing.cpp index e9db7dab93..9e65927deb 100644 --- a/build/linux/platform_specific_code/juce_linux_Windowing.cpp +++ b/build/linux/platform_specific_code/juce_linux_Windowing.cpp @@ -2543,18 +2543,18 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c } //============================================================================== -bool Desktop::canUseSemiTransparentWindows() +bool Desktop::canUseSemiTransparentWindows() throw() { return false; } -void Desktop::getMousePosition (int& x, int& y) +void Desktop::getMousePosition (int& x, int& y) throw() { int mouseMods; getMousePos (x, y, mouseMods); } -void Desktop::setMousePosition (int x, int y) +void Desktop::setMousePosition (int x, int y) throw() { Window root = RootWindow (display, DefaultScreen (display)); XWarpPointer (display, None, root, 0, 0, 0, 0, x, y); diff --git a/build/macosx/platform_specific_code/juce_mac_Windowing.cpp b/build/macosx/platform_specific_code/juce_mac_Windowing.cpp index 8b6594b85a..eb7fc8bb9b 100644 --- a/build/macosx/platform_specific_code/juce_mac_Windowing.cpp +++ b/build/macosx/platform_specific_code/juce_mac_Windowing.cpp @@ -2186,14 +2186,14 @@ bool Process::isForegroundProcess() throw() } //============================================================================== -bool Desktop::canUseSemiTransparentWindows() +bool Desktop::canUseSemiTransparentWindows() throw() { return true; } //============================================================================== -void Desktop::getMousePosition (int& x, int& y) +void Desktop::getMousePosition (int& x, int& y) throw() { CGrafPtr currentPort; GetPort (¤tPort); @@ -2222,7 +2222,7 @@ void Desktop::getMousePosition (int& x, int& y) SetPort (currentPort); } -void Desktop::setMousePosition (int x, int y) +void Desktop::setMousePosition (int x, int y) throw() { CGPoint pos = { x, y }; CGWarpMouseCursorPosition (pos); diff --git a/build/win32/platform_specific_code/juce_win32_Windowing.cpp b/build/win32/platform_specific_code/juce_win32_Windowing.cpp index 75e569465d..29fc88b3c1 100644 --- a/build/win32/platform_specific_code/juce_win32_Windowing.cpp +++ b/build/win32/platform_specific_code/juce_win32_Windowing.cpp @@ -117,7 +117,7 @@ static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int ho typedef BOOL (WINAPI* UpdateLayeredWinFunc) (HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD); static UpdateLayeredWinFunc updateLayeredWindow = 0; -bool Desktop::canUseSemiTransparentWindows() +bool Desktop::canUseSemiTransparentWindows() throw() { if (updateLayeredWindow == 0) { @@ -2241,7 +2241,7 @@ bool Process::isForegroundProcess() throw() } //============================================================================== -void Desktop::getMousePosition (int& x, int& y) +void Desktop::getMousePosition (int& x, int& y) throw() { POINT mousePos; GetCursorPos (&mousePos); @@ -2249,7 +2249,7 @@ void Desktop::getMousePosition (int& x, int& y) y = mousePos.y; } -void Desktop::setMousePosition (int x, int y) +void Desktop::setMousePosition (int x, int y) throw() { SetCursorPos (x, y); } diff --git a/src/juce_appframework/events/juce_AsyncUpdater.cpp b/src/juce_appframework/events/juce_AsyncUpdater.cpp index 28a5ea4dfd..54e636b1d9 100644 --- a/src/juce_appframework/events/juce_AsyncUpdater.cpp +++ b/src/juce_appframework/events/juce_AsyncUpdater.cpp @@ -37,7 +37,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -AsyncUpdater::AsyncUpdater() +AsyncUpdater::AsyncUpdater() throw() : asyncMessagePending (false) { internalAsyncHandler.owner = this; @@ -47,7 +47,7 @@ AsyncUpdater::~AsyncUpdater() { } -void AsyncUpdater::triggerAsyncUpdate() +void AsyncUpdater::triggerAsyncUpdate() throw() { if (! asyncMessagePending) { diff --git a/src/juce_appframework/events/juce_AsyncUpdater.h b/src/juce_appframework/events/juce_AsyncUpdater.h index abf908e990..a1dcc871e7 100644 --- a/src/juce_appframework/events/juce_AsyncUpdater.h +++ b/src/juce_appframework/events/juce_AsyncUpdater.h @@ -50,7 +50,7 @@ class JUCE_API AsyncUpdater public: //============================================================================== /** Creates an AsyncUpdater object. */ - AsyncUpdater(); + AsyncUpdater() throw(); /** Destructor. @@ -70,7 +70,7 @@ public: It's thread-safe to call this method from any number of threads without needing to worry about locking. */ - void triggerAsyncUpdate(); + void triggerAsyncUpdate() throw(); /** This will stop any pending updates from happening. diff --git a/src/juce_appframework/gui/components/juce_Desktop.cpp b/src/juce_appframework/gui/components/juce_Desktop.cpp index 6a7ca81f30..3c32e9691f 100644 --- a/src/juce_appframework/gui/components/juce_Desktop.cpp +++ b/src/juce_appframework/gui/components/juce_Desktop.cpp @@ -45,7 +45,7 @@ extern void juce_updateMultiMonitorInfo (Array & monitorCoords, //============================================================================== static Desktop* instance = 0; -Desktop::Desktop() +Desktop::Desktop() throw() : mouseListeners (2), desktopComponents (4), monitorCoordsClipped (2), @@ -56,7 +56,7 @@ Desktop::Desktop() refreshMonitorSizes(); } -Desktop::~Desktop() +Desktop::~Desktop() throw() { jassert (instance == this); instance = 0; @@ -66,7 +66,7 @@ Desktop::~Desktop() jassert (desktopComponents.size() == 0); } -Desktop& JUCE_CALLTYPE Desktop::getInstance() +Desktop& JUCE_CALLTYPE Desktop::getInstance() throw() { if (instance == 0) instance = new Desktop(); @@ -75,7 +75,7 @@ Desktop& JUCE_CALLTYPE Desktop::getInstance() } //============================================================================== -void Desktop::refreshMonitorSizes() +void Desktop::refreshMonitorSizes() throw() { monitorCoordsClipped.clear(); monitorCoordsUnclipped.clear(); @@ -85,18 +85,18 @@ void Desktop::refreshMonitorSizes() && monitorCoordsClipped.size() == monitorCoordsUnclipped.size()); } -int Desktop::getNumDisplayMonitors() const +int Desktop::getNumDisplayMonitors() const throw() { return monitorCoordsClipped.size(); } -const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const +const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw() { return clippedToWorkArea ? monitorCoordsClipped [index] : monitorCoordsUnclipped [index]; } -const RectangleList Desktop::getAllMonitorDisplayAreas (const bool clippedToWorkArea) const +const RectangleList Desktop::getAllMonitorDisplayAreas (const bool clippedToWorkArea) const throw() { RectangleList rl; @@ -106,12 +106,12 @@ const RectangleList Desktop::getAllMonitorDisplayAreas (const bool clippedToWork return rl; } -const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const +const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const throw() { return getDisplayMonitorCoordinates (0, clippedToWorkArea); } -const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const +const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const throw() { for (int i = getNumDisplayMonitors(); --i > 0;) { @@ -125,12 +125,12 @@ const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool cl } //============================================================================== -int Desktop::getNumComponents() const +int Desktop::getNumComponents() const throw() { return desktopComponents.size(); } -Component* Desktop::getComponent (const int index) const +Component* Desktop::getComponent (const int index) const throw() { return (Component*) desktopComponents [index]; } @@ -138,38 +138,34 @@ Component* Desktop::getComponent (const int index) const Component* Desktop::findComponentAt (const int screenX, const int screenY) const { - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) + for (int i = desktopComponents.size(); --i >= 0;) { - const ComponentPeer* const peer = ComponentPeer::getPeer (i); + Component* const c = (Component*) desktopComponents.getUnchecked(i); - Component* const c = peer->getComponent(); + int x = screenX, y = screenY; + c->globalPositionToRelative (x, y); - if (c != 0) - { - const int x = screenX - c->getScreenX(); - const int y = screenY - c->getScreenY(); - - if (c->contains (x, y)) - return c->getComponentAt (x, y); - } + if (c->contains (x, y)) + return c->getComponentAt (x, y); } return 0; } //============================================================================== -void Desktop::addDesktopComponent (Component* const c) +void Desktop::addDesktopComponent (Component* const c) throw() { + jassert (c != 0); jassert (! desktopComponents.contains (c)); desktopComponents.addIfNotAlreadyThere (c); } -void Desktop::removeDesktopComponent (Component* const c) +void Desktop::removeDesktopComponent (Component* const c) throw() { desktopComponents.removeValue (c); } -void Desktop::componentBroughtToFront (Component* const c) +void Desktop::componentBroughtToFront (Component* const c) throw() { const int index = desktopComponents.indexOf (c); jassert (index >= 0); @@ -184,13 +180,13 @@ extern int juce_recentMouseDownX [4]; extern int juce_recentMouseDownY [4]; extern int juce_MouseClickCounter; -void Desktop::getLastMouseDownPosition (int& x, int& y) +void Desktop::getLastMouseDownPosition (int& x, int& y) throw() { x = juce_recentMouseDownX [0]; y = juce_recentMouseDownY [0]; } -int Desktop::getMouseButtonClickCounter() +int Desktop::getMouseButtonClickCounter() throw() { return juce_MouseClickCounter; } @@ -227,7 +223,7 @@ void Desktop::removeFocusChangeListener (FocusChangeListener* const listener) th focusListeners.removeValue (listener); } -void Desktop::triggerFocusCallback() +void Desktop::triggerFocusCallback() throw() { triggerAsyncUpdate(); } @@ -294,7 +290,7 @@ void Desktop::sendMouseMove() } } -void Desktop::resetTimer() +void Desktop::resetTimer() throw() { if (mouseListeners.size() == 0) stopTimer(); diff --git a/src/juce_appframework/gui/components/juce_Desktop.h b/src/juce_appframework/gui/components/juce_Desktop.h index 28aca93551..e897088c90 100644 --- a/src/juce_appframework/gui/components/juce_Desktop.h +++ b/src/juce_appframework/gui/components/juce_Desktop.h @@ -70,7 +70,7 @@ public: //============================================================================== /** There's only one dektop object, and this method will return it. */ - static Desktop& JUCE_CALLTYPE getInstance(); + static Desktop& JUCE_CALLTYPE getInstance() throw(); //============================================================================== /** Returns a list of the positions of all the monitors available. @@ -80,14 +80,14 @@ public: If clippedToWorkArea is true, it will exclude any areas like the taskbar on Windows, or the menu bar on Mac. If clippedToWorkArea is false, the entire monitor area is returned. */ - const RectangleList getAllMonitorDisplayAreas (const bool clippedToWorkArea = true) const; + const RectangleList getAllMonitorDisplayAreas (const bool clippedToWorkArea = true) const throw(); /** Returns the position and size of the main monitor. If clippedToWorkArea is true, it will exclude any areas like the taskbar on Windows, or the menu bar on Mac. If clippedToWorkArea is false, the entire monitor area is returned. */ - const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const; + const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const throw(); /** Returns the position and size of the monitor which contains this co-ordinate. @@ -97,7 +97,7 @@ public: If clippedToWorkArea is true, it will exclude any areas like the taskbar on Windows, or the menu bar on Mac. If clippedToWorkArea is false, the entire monitor area is returned. */ - const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const; + const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const throw(); //============================================================================== @@ -105,24 +105,24 @@ public: The co-ordinates are relative to the top-left of the main monitor. */ - static void getMousePosition (int& x, int& y); + static void getMousePosition (int& x, int& y) throw(); /** Makes the mouse pointer jump to a given location. The co-ordinates are relative to the top-left of the main monitor. */ - static void setMousePosition (int x, int y); + static void setMousePosition (int x, int y) throw(); /** Returns the last position at which a mouse button was pressed. */ - static void getLastMouseDownPosition (int& x, int& y); + static void getLastMouseDownPosition (int& x, int& y) throw(); /** Returns the number of times the mouse button has been clicked since the app started. Each mouse-down event increments this number by 1. */ - static int getMouseButtonClickCounter(); + static int getMouseButtonClickCounter() throw(); //============================================================================== /** Registers a MouseListener that will receive all mouse events that occur on @@ -154,7 +154,7 @@ public: @see getComponent, Component::addToDesktop */ - int getNumComponents() const; + int getNumComponents() const throw(); /** Returns one of the top-level desktop window components. @@ -163,7 +163,7 @@ public: @see getNumComponents, Component::addToDesktop */ - Component* getComponent (const int index) const; + Component* getComponent (const int index) const throw(); /** Finds the component at a given screen location. @@ -183,10 +183,10 @@ public: (Called internally by the native code). */ - void refreshMonitorSizes(); + void refreshMonitorSizes() throw(); /** True if the OS supports semitransparent windows */ - static bool canUseSemiTransparentWindows(); + static bool canUseSemiTransparentWindows() throw(); private: @@ -198,23 +198,24 @@ private: friend class DeletedAtShutdown; friend class TopLevelWindowManager; - Desktop(); - ~Desktop(); + Desktop() throw(); + ~Desktop() throw(); Array monitorCoordsClipped, monitorCoordsUnclipped; int lastMouseX, lastMouseY; void timerCallback(); void sendMouseMove(); - void resetTimer(); - int getNumDisplayMonitors() const; - const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const; + void resetTimer() throw(); - void addDesktopComponent (Component* const c); - void removeDesktopComponent (Component* const c); - void componentBroughtToFront (Component* const c); + int getNumDisplayMonitors() const throw(); + const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw(); - void triggerFocusCallback(); + void addDesktopComponent (Component* const c) throw(); + void removeDesktopComponent (Component* const c) throw(); + void componentBroughtToFront (Component* const c) throw(); + + void triggerFocusCallback() throw(); void handleAsyncUpdate(); Desktop (const Desktop&);