diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-08-12 21:38:20 -0500 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-08-13 06:59:30 +0000 |
commit | 2c797c39478b485c0285eb351d23e0d4e0fa7585 (patch) | |
tree | ec066cc6e261daed38926cea8aa86d25d68d3b4c /vcl/osx | |
parent | 4498c5e1d0e0c98055d6ce6ad22c840e89b401cc (diff) |
kill YIELD_GUARD macro
Change-Id: I81990df584255f4a286cd078bcf15917c00ad504
Reviewed-on: https://gerrit.libreoffice.org/17687
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salframeview.mm | 58 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 22 | ||||
-rw-r--r-- | vcl/osx/salnsmenu.mm | 21 | ||||
-rw-r--r-- | vcl/osx/salnstimer.mm | 8 | ||||
-rw-r--r-- | vcl/osx/saltimer.cxx | 6 | ||||
-rw-r--r-- | vcl/osx/vclnsapp.mm | 29 |
6 files changed, 77 insertions, 67 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 1e15ee2bf87c..062acec6cf49 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -17,19 +17,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + #include <sal/alloca.h> #include <sal/macros.h> +#include <tools/helpers.hxx> -#include "tools/helpers.hxx" -#include "vcl/window.hxx" -#include "vcl/svapp.hxx" #include <vcl/settings.hxx> +#include <vcl/svapp.hxx> +#include <vcl/window.hxx> -#include "osx/salinst.h" -#include "quartz/salgdi.h" +#include "osx/a11yfactory.h" #include "osx/salframe.h" #include "osx/salframeview.h" -#include "osx/a11yfactory.h" +#include "osx/salinst.h" +#include "quartz/salgdi.h" #include "quartz/utils.h" #define WHEEL_EVENT_FACTOR 1.5 @@ -249,7 +251,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidBecomeKey: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -280,7 +282,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidResignKey: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -292,7 +294,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidChangeScreen: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) mpFrame->screenParametersChanged(); @@ -301,7 +303,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidMove: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -313,7 +315,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidResize: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -326,7 +328,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidMiniaturize: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -339,7 +341,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidDeminiaturize: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { @@ -352,7 +354,7 @@ static AquaSalFrame* getMouseContainerFrame() -(BOOL)windowShouldClose: (NSNotification*)pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; BOOL bRet = YES; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) @@ -371,7 +373,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidEnterFullScreen: (NSNotification*)pNotification { - YIELD_GUARD; + SolarMutexGuard aGuard; if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) return; @@ -381,7 +383,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)windowDidExitFullScreen: (NSNotification*)pNotification { - YIELD_GUARD; + SolarMutexGuard aGuard; if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) return; @@ -392,7 +394,7 @@ static AquaSalFrame* getMouseContainerFrame() -(void)dockMenuItemTriggered: (id)sender { (void)sender; - YIELD_GUARD; + SolarMutexGuard aGuard; if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) mpFrame->ToTop( SAL_FRAME_TOTOP_RESTOREWHENMIN | SAL_FRAME_TOTOP_GRABFOCUS ); @@ -552,7 +554,7 @@ private: -(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; AquaSalFrame* pDispatchFrame = AquaSalFrame::GetCaptureFrame(); bool bIsCaptured = false; @@ -740,7 +742,7 @@ private: - (void)magnifyWithEvent: (NSEvent*)pEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; // TODO: ?? -(float)magnification; if( AquaSalFrame::isAlive( mpFrame ) ) @@ -814,7 +816,7 @@ private: - (void)swipeWithEvent: (NSEvent*)pEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; if( AquaSalFrame::isAlive( mpFrame ) ) { @@ -874,7 +876,7 @@ private: -(void)scrollWheel: (NSEvent*)pEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; if( AquaSalFrame::isAlive( mpFrame ) ) { @@ -941,7 +943,7 @@ private: -(void)keyDown: (NSEvent*)pEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; if( AquaSalFrame::isAlive( mpFrame ) ) { @@ -1003,7 +1005,7 @@ private: -(void)flagsChanged: (NSEvent*)pEvent { - YIELD_GUARD; + SolarMutexGuard aGuard; if( AquaSalFrame::isAlive( mpFrame ) ) { @@ -1016,7 +1018,7 @@ private: { (void) replacementRange; // FIXME: surely it must be used - YIELD_GUARD; + SolarMutexGuard aGuard; if( AquaSalFrame::isAlive( mpFrame ) ) { @@ -1484,7 +1486,7 @@ private: -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod { - YIELD_GUARD; + SolarMutexGuard aGuard; long nRet = 0; if( AquaSalFrame::isAlive( mpFrame ) ) @@ -1588,7 +1590,7 @@ private: { (void) replacementRange; // FIXME - use it! - YIELD_GUARD; + SolarMutexGuard aGuard; if( ![aString isKindOfClass:[NSAttributedString class]] ) aString = [[[NSAttributedString alloc] initWithString:aString] autorelease]; @@ -1709,7 +1711,7 @@ private: (void) aRange; (void) actualRange; - YIELD_GUARD; + SolarMutexGuard aGuard; SalExtTextInputPosEvent aPosEvent; mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void *>(&aPosEvent) ); @@ -1730,7 +1732,7 @@ private: //TODO: odd cast really needed for fdo#74121? } --(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext +-(css::accessibility::XAccessibleContext *)accessibleContext { if ( !mpReferenceWrapper ) { // some frames never become visible .. diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 0abc5fe3ad9c..b0144a829278 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -17,14 +17,17 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <comphelper/string.hxx> +#include <sal/config.h> + +#include <objc/objc-runtime.h> -#include "rtl/ustrbuf.hxx" +#include <comphelper/string.hxx> +#include <rtl/ustrbuf.hxx> -#include "vcl/cmdevt.hxx" -#include "vcl/floatwin.hxx" -#include "vcl/window.hxx" -#include "vcl/svapp.hxx" +#include <vcl/cmdevt.hxx> +#include <vcl/floatwin.hxx> +#include <vcl/window.hxx> +#include <vcl/svapp.hxx> #include "osx/saldata.hxx" #include "osx/salinst.h" @@ -33,12 +36,9 @@ #include "osx/salframe.h" #include "osx/a11ywrapper.h" #include "quartz/utils.h" - #include "svids.hrc" #include "window.h" -#include <objc/objc-runtime.h> - namespace { void releaseButtonEntry( AquaSalMenu::MenuBarButtonEntry& i_rEntry ) @@ -94,14 +94,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; -(void)showPreferences: (id) sender { (void)sender; - YIELD_GUARD; + SolarMutexGuard aGuard; [self showDialog: ShowDialogId::Preferences]; } -(void)showAbout: (id) sender { (void)sender; - YIELD_GUARD; + SolarMutexGuard aGuard; [self showDialog: ShowDialogId::About]; } diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm index d2aaed9e9e3a..23aac611dd7f 100644 --- a/vcl/osx/salnsmenu.mm +++ b/vcl/osx/salnsmenu.mm @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <vcl/window.hxx> #include "osx/salinst.h" #include "osx/saldata.hxx" @@ -24,8 +27,6 @@ #include "osx/salmenu.h" #include "osx/salnsmenu.h" -#include "vcl/window.hxx" - @implementation SalNSMenu -(id)initWithMenu: (AquaSalMenu*)pMenu { @@ -36,8 +37,8 @@ -(void)menuNeedsUpdate: (NSMenu*)pMenu { (void)pMenu; - YIELD_GUARD; - + SolarMutexGuard aGuard; + if( mpMenu ) { const AquaSalFrame* pFrame = mpMenu->getFrame(); @@ -76,8 +77,8 @@ -(void)menuItemTriggered: (id)aSender { (void)aSender; - YIELD_GUARD; - + SolarMutexGuard aGuard; + const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : NULL; if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() ) { @@ -93,13 +94,13 @@ if( pPopupMenu ) { // FIXME: revise this ugly code - + // select handlers in vcl are dispatch on the original menu // if not consumed by the select handler of the current menu // however since only the starting menu ever came into Execute // the hierarchy is not build up. Workaround this by getting // the menu it should have been - + // get started from hierarchy in vcl menus AquaSalMenu* pParentMenu = mpMenuItem->mpParentMenu; Menu* pCurMenu = mpMenuItem->mpVCLMenu; @@ -108,7 +109,7 @@ pCurMenu = pParentMenu->mpVCLMenu; pParentMenu = pParentMenu->mpParentSalMenu; } - + pPopupMenu->SetSelectedEntry( mpMenuItem->mnId ); pPopupMenu->ImplSelectWithStart( pCurMenu ); } @@ -168,7 +169,7 @@ } return; } - + aImgRect.origin.x += aFromRect.size.width + 2; } } diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm index 49c7526615ba..307f1944079b 100644 --- a/vcl/osx/salnstimer.mm +++ b/vcl/osx/salnstimer.mm @@ -17,27 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> #include "osx/saltimer.h" #include "osx/salnstimer.h" #include "osx/salinst.h" #include "osx/saldata.hxx" - #include "svdata.hxx" @implementation TimerCallbackCaller -(void)timerElapsed:(NSTimer*)pTimer { (void)pTimer; - ImplSVData* pSVData = ImplGetSVData(); if( AquaSalTimer::bDispatchTimer ) { - YIELD_GUARD; + SolarMutexGuard aGuard; + ImplSVData* pSVData = ImplGetSVData(); if( pSVData->mpSalTimer ) { bool idle = true; // TODO pSVData->mpSalTimer->CallCallback( idle ); - + // NSTimer does not end nextEventMatchingMask of NSApplication // so we need to wakeup a waiting Yield to inform it something happened GetSalData()->mpFirstInstance->wakeupYield(); diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx index 377044730e76..eb62693e85a6 100644 --- a/vcl/osx/saltimer.cxx +++ b/vcl/osx/saltimer.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + #include "osx/saltimer.h" #include "osx/salnstimer.h" #include "osx/saldata.hxx" @@ -36,8 +38,10 @@ void ImplSalStartTimer( sal_uLong nMS ) if( AquaSalTimer::pRunningTimer != nil ) { if( [AquaSalTimer::pRunningTimer timeInterval] == aTI ) + { // set new fire date [AquaSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]]; + } else { [AquaSalTimer::pRunningTimer invalidate]; @@ -89,7 +93,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent ) NSTimeInterval current = [NSDate timeIntervalSinceReferenceDate]; if( (posted - current) <= 0.0 ) { - YIELD_GUARD; + SolarMutexGuard aGuard; if( pSVData->mpSalTimer ) { // timer already elapsed since event posted diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm index f7c9a4b14627..6cbf5222e43a 100644 --- a/vcl/osx/vclnsapp.mm +++ b/vcl/osx/vclnsapp.mm @@ -17,25 +17,24 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> #include <config_features.h> -#include "sal/config.h" -#include "sal/main.h" #include <vector> -#include "vcl/window.hxx" -#include "vcl/svapp.hxx" -#include "vcl/cmdevt.hxx" +#include <sal/main.h> +#include <vcl/cmdevt.hxx> +#include <vcl/svapp.hxx> +#include <vcl/window.hxx> -#include "osx/vclnsapp.h" -#include "osx/salinst.h" +#include "impimagetree.hxx" #include "osx/saldata.hxx" #include "osx/salframe.h" #include "osx/salframeview.h" +#include "osx/salinst.h" +#include "osx/vclnsapp.h" #include "quartz/utils.h" -#include "impimagetree.hxx" - #include "premac.h" #include <objc/objc-runtime.h> #import "Carbon/Carbon.h" @@ -79,7 +78,9 @@ { NSEventType eType = [pEvent type]; if( eType == NSApplicationDefined ) + { AquaSalInstance::handleAppDefinedEvent( pEvent ); + } else if( eType == NSKeyDown && ([pEvent modifierFlags] & NSCommandKeyMask) != 0 ) { NSWindow* pKeyWin = [NSApp keyWindow]; @@ -166,9 +167,11 @@ bHandled = GetSalData()->maKeyEventAnswer[ pEvent ]; } else + { bHandled = true; // event handled already or main menu just handled it - + } GetSalData()->maKeyEventAnswer.erase( pEvent ); + if( bHandled ) return; } @@ -395,7 +398,7 @@ (void)app; NSApplicationTerminateReply aReply = NSTerminateNow; { - YIELD_GUARD; + SolarMutexGuard aGuard; SalData* pSalData = GetSalData(); if( ! pSalData->maFrames.empty() ) @@ -421,7 +424,7 @@ -(void)systemColorsChanged: (NSNotification*) pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; const SalData* pSalData = GetSalData(); if( !pSalData->maFrames.empty() ) @@ -431,7 +434,7 @@ -(void)screenParametersChanged: (NSNotification*) pNotification { (void)pNotification; - YIELD_GUARD; + SolarMutexGuard aGuard; SalData* pSalData = GetSalData(); std::list< AquaSalFrame* >::iterator it; |