Kaydet (Commit) 2c797c39 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Noel Grandin

kill YIELD_GUARD macro

Change-Id: I81990df584255f4a286cd078bcf15917c00ad504
Reviewed-on: https://gerrit.libreoffice.org/17687Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 4498c5e1
......@@ -20,18 +20,17 @@
#ifndef INCLUDED_VCL_INC_OSX_SALINST_H
#define INCLUDED_VCL_INC_OSX_SALINST_H
#include "comphelper/solarmutex.hxx"
#include "osl/thread.hxx"
#include "osl/conditn.h"
#include <list>
#include <comphelper/solarmutex.hxx>
#include <osl/conditn.h>
#include <osl/thread.hxx>
#ifdef MACOSX
#include "osx/osxvcltypes.h"
#endif
#include "salinst.hxx"
#include <list>
class AquaSalFrame;
class ApplicationEvent;
class Image;
......@@ -51,8 +50,6 @@ public:
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
#define YIELD_GUARD osl::Guard< comphelper::SolarMutex > aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
class AquaSalInstance : public SalInstance
{
struct SalUserEvent
......@@ -86,7 +83,8 @@ public:
virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) SAL_OVERRIDE;
virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) SAL_OVERRIDE;
virtual void DestroyFrame( SalFrame* pFrame ) SAL_OVERRIDE;
virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow = true ) SAL_OVERRIDE;
virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData,
bool bShow = true ) SAL_OVERRIDE;
virtual void DestroyObject( SalObject* pObject ) SAL_OVERRIDE;
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long &nDX, long &nDY,
......@@ -109,21 +107,24 @@ public:
virtual sal_uLong ReleaseYieldMutex() SAL_OVERRIDE;
virtual void AcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE;
virtual bool CheckYieldMutex() SAL_OVERRIDE;
virtual void DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE;
virtual void DoYield(bool bWait, bool bHandleAllCurrentEvents,
sal_uLong nReleased) SAL_OVERRIDE;
virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE;
virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) SAL_OVERRIDE;
virtual void DestroyMenu( SalMenu* ) SAL_OVERRIDE;
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) SAL_OVERRIDE;
virtual void DestroyMenuItem( SalMenuItem* ) SAL_OVERRIDE;
virtual SalSession* CreateSalSession() SAL_OVERRIDE;
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) SAL_OVERRIDE;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) SAL_OVERRIDE;
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType,
int& rReturnedBytes ) SAL_OVERRIDE;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType,
const OUString& rDocumentService) SAL_OVERRIDE;
// dtrans implementation
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource() SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget() SAL_OVERRIDE;
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(
const css::uno::Sequence< css::uno::Any >& i_rArguments ) SAL_OVERRIDE;
virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() SAL_OVERRIDE;
virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() SAL_OVERRIDE;
static void handleAppDefinedEvent( NSEvent* pEvent );
......
......@@ -20,11 +20,11 @@
#ifndef INCLUDED_VCL_INC_SALDATABASIC_HXX
#define INCLUDED_VCL_INC_SALDATABASIC_HXX
#include <svdata.hxx>
#include <salinst.hxx>
#include <osl/module.h>
#include <vcl/dllapi.h>
#include "vcl/dllapi.h"
#include "svdata.hxx"
#include "salinst.hxx"
#ifdef IOS
#include "quartz/salgdi.h"
......
......@@ -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 ..
......
......@@ -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];
}
......
......@@ -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,7 +37,7 @@
-(void)menuNeedsUpdate: (NSMenu*)pMenu
{
(void)pMenu;
YIELD_GUARD;
SolarMutexGuard aGuard;
if( mpMenu )
{
......@@ -76,7 +77,7 @@
-(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() )
......
......@@ -17,22 +17,22 @@
* 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
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment