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 @@ ...@@ -20,18 +20,17 @@
#ifndef INCLUDED_VCL_INC_OSX_SALINST_H #ifndef INCLUDED_VCL_INC_OSX_SALINST_H
#define INCLUDED_VCL_INC_OSX_SALINST_H #define INCLUDED_VCL_INC_OSX_SALINST_H
#include "comphelper/solarmutex.hxx" #include <list>
#include "osl/thread.hxx"
#include "osl/conditn.h" #include <comphelper/solarmutex.hxx>
#include <osl/conditn.h>
#include <osl/thread.hxx>
#ifdef MACOSX #ifdef MACOSX
#include "osx/osxvcltypes.h" #include "osx/osxvcltypes.h"
#endif #endif
#include "salinst.hxx" #include "salinst.hxx"
#include <list>
class AquaSalFrame; class AquaSalFrame;
class ApplicationEvent; class ApplicationEvent;
class Image; class Image;
...@@ -39,7 +38,7 @@ class Image; ...@@ -39,7 +38,7 @@ class Image;
class SalYieldMutex : public comphelper::SolarMutex class SalYieldMutex : public comphelper::SolarMutex
{ {
osl::Mutex m_mutex; osl::Mutex m_mutex;
sal_uLong mnCount; sal_uLong mnCount;
oslThreadIdentifier mnThreadId; oslThreadIdentifier mnThreadId;
public: public:
...@@ -51,8 +50,6 @@ public: ...@@ -51,8 +50,6 @@ public:
oslThreadIdentifier GetThreadId() const { return mnThreadId; } oslThreadIdentifier GetThreadId() const { return mnThreadId; }
}; };
#define YIELD_GUARD osl::Guard< comphelper::SolarMutex > aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
class AquaSalInstance : public SalInstance class AquaSalInstance : public SalInstance
{ {
struct SalUserEvent struct SalUserEvent
...@@ -68,7 +65,7 @@ class AquaSalInstance : public SalInstance ...@@ -68,7 +65,7 @@ class AquaSalInstance : public SalInstance
public: public:
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
OUString maDefaultPrinter; OUString maDefaultPrinter;
oslThreadIdentifier maMainThread; oslThreadIdentifier maMainThread;
bool mbWaitingYield; bool mbWaitingYield;
int mnActivePrintJobs; int mnActivePrintJobs;
...@@ -86,12 +83,13 @@ public: ...@@ -86,12 +83,13 @@ public:
virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) SAL_OVERRIDE; virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) SAL_OVERRIDE;
virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) SAL_OVERRIDE; virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) SAL_OVERRIDE;
virtual void DestroyFrame( SalFrame* pFrame ) 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 void DestroyObject( SalObject* pObject ) SAL_OVERRIDE;
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long &nDX, long &nDY, long &nDX, long &nDY,
sal_uInt16 nBitCount, sal_uInt16 nBitCount,
const SystemGraphicsData *pData ) SAL_OVERRIDE; const SystemGraphicsData *pData ) SAL_OVERRIDE;
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData ) SAL_OVERRIDE; ImplJobSetup* pSetupData ) SAL_OVERRIDE;
virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ) SAL_OVERRIDE; virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ) SAL_OVERRIDE;
...@@ -102,28 +100,31 @@ public: ...@@ -102,28 +100,31 @@ public:
virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) SAL_OVERRIDE; virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) SAL_OVERRIDE;
virtual OUString GetDefaultPrinter() SAL_OVERRIDE; virtual OUString GetDefaultPrinter() SAL_OVERRIDE;
virtual SalTimer* CreateSalTimer() SAL_OVERRIDE; virtual SalTimer* CreateSalTimer() SAL_OVERRIDE;
virtual SalI18NImeStatus* CreateI18NImeStatus() SAL_OVERRIDE; virtual SalI18NImeStatus* CreateI18NImeStatus() SAL_OVERRIDE;
virtual SalSystem* CreateSalSystem() SAL_OVERRIDE; virtual SalSystem* CreateSalSystem() SAL_OVERRIDE;
virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE; virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE;
virtual comphelper::SolarMutex* GetYieldMutex() SAL_OVERRIDE; virtual comphelper::SolarMutex* GetYieldMutex() SAL_OVERRIDE;
virtual sal_uLong ReleaseYieldMutex() SAL_OVERRIDE; virtual sal_uLong ReleaseYieldMutex() SAL_OVERRIDE;
virtual void AcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE; virtual void AcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE;
virtual bool CheckYieldMutex() 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 bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE;
virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) SAL_OVERRIDE; virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) SAL_OVERRIDE;
virtual void DestroyMenu( SalMenu* ) SAL_OVERRIDE; virtual void DestroyMenu( SalMenu* ) SAL_OVERRIDE;
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) SAL_OVERRIDE; virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) SAL_OVERRIDE;
virtual void DestroyMenuItem( SalMenuItem* ) SAL_OVERRIDE; virtual void DestroyMenuItem( SalMenuItem* ) SAL_OVERRIDE;
virtual SalSession* CreateSalSession() SAL_OVERRIDE; virtual SalSession* CreateSalSession() SAL_OVERRIDE;
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) SAL_OVERRIDE; virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType,
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) SAL_OVERRIDE; int& rReturnedBytes ) SAL_OVERRIDE;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType,
const OUString& rDocumentService) SAL_OVERRIDE;
// dtrans implementation // dtrans implementation
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(
CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ) SAL_OVERRIDE; const css::uno::Sequence< css::uno::Any >& i_rArguments ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource() SAL_OVERRIDE; virtual css::uno::Reference< css::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 > CreateDropTarget() SAL_OVERRIDE;
static void handleAppDefinedEvent( NSEvent* pEvent ); static void handleAppDefinedEvent( NSEvent* pEvent );
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#ifndef INCLUDED_VCL_INC_SALDATABASIC_HXX #ifndef INCLUDED_VCL_INC_SALDATABASIC_HXX
#define INCLUDED_VCL_INC_SALDATABASIC_HXX #define INCLUDED_VCL_INC_SALDATABASIC_HXX
#include <svdata.hxx>
#include <salinst.hxx>
#include <osl/module.h> #include <osl/module.h>
#include <vcl/dllapi.h>
#include "vcl/dllapi.h" #include "svdata.hxx"
#include "salinst.hxx"
#ifdef IOS #ifdef IOS
#include "quartz/salgdi.h" #include "quartz/salgdi.h"
......
...@@ -17,19 +17,21 @@ ...@@ -17,19 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <sal/alloca.h> #include <sal/alloca.h>
#include <sal/macros.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/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include "osx/salinst.h" #include "osx/a11yfactory.h"
#include "quartz/salgdi.h"
#include "osx/salframe.h" #include "osx/salframe.h"
#include "osx/salframeview.h" #include "osx/salframeview.h"
#include "osx/a11yfactory.h" #include "osx/salinst.h"
#include "quartz/salgdi.h"
#include "quartz/utils.h" #include "quartz/utils.h"
#define WHEEL_EVENT_FACTOR 1.5 #define WHEEL_EVENT_FACTOR 1.5
...@@ -249,7 +251,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -249,7 +251,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidBecomeKey: (NSNotification*)pNotification -(void)windowDidBecomeKey: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -280,7 +282,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -280,7 +282,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidResignKey: (NSNotification*)pNotification -(void)windowDidResignKey: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -292,7 +294,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -292,7 +294,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidChangeScreen: (NSNotification*)pNotification -(void)windowDidChangeScreen: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
mpFrame->screenParametersChanged(); mpFrame->screenParametersChanged();
...@@ -301,7 +303,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -301,7 +303,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidMove: (NSNotification*)pNotification -(void)windowDidMove: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -313,7 +315,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -313,7 +315,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidResize: (NSNotification*)pNotification -(void)windowDidResize: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -326,7 +328,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -326,7 +328,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidMiniaturize: (NSNotification*)pNotification -(void)windowDidMiniaturize: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -339,7 +341,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -339,7 +341,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidDeminiaturize: (NSNotification*)pNotification -(void)windowDidDeminiaturize: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -352,7 +354,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -352,7 +354,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(BOOL)windowShouldClose: (NSNotification*)pNotification -(BOOL)windowShouldClose: (NSNotification*)pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
BOOL bRet = YES; BOOL bRet = YES;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
...@@ -371,7 +373,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -371,7 +373,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidEnterFullScreen: (NSNotification*)pNotification -(void)windowDidEnterFullScreen: (NSNotification*)pNotification
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) if( !mpFrame || !AquaSalFrame::isAlive( mpFrame))
return; return;
...@@ -381,7 +383,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -381,7 +383,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)windowDidExitFullScreen: (NSNotification*)pNotification -(void)windowDidExitFullScreen: (NSNotification*)pNotification
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) if( !mpFrame || !AquaSalFrame::isAlive( mpFrame))
return; return;
...@@ -392,7 +394,7 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -392,7 +394,7 @@ static AquaSalFrame* getMouseContainerFrame()
-(void)dockMenuItemTriggered: (id)sender -(void)dockMenuItemTriggered: (id)sender
{ {
(void)sender; (void)sender;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
mpFrame->ToTop( SAL_FRAME_TOTOP_RESTOREWHENMIN | SAL_FRAME_TOTOP_GRABFOCUS ); mpFrame->ToTop( SAL_FRAME_TOTOP_RESTOREWHENMIN | SAL_FRAME_TOTOP_GRABFOCUS );
...@@ -552,7 +554,7 @@ private: ...@@ -552,7 +554,7 @@ private:
-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent -(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
AquaSalFrame* pDispatchFrame = AquaSalFrame::GetCaptureFrame(); AquaSalFrame* pDispatchFrame = AquaSalFrame::GetCaptureFrame();
bool bIsCaptured = false; bool bIsCaptured = false;
...@@ -740,7 +742,7 @@ private: ...@@ -740,7 +742,7 @@ private:
- (void)magnifyWithEvent: (NSEvent*)pEvent - (void)magnifyWithEvent: (NSEvent*)pEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
// TODO: ?? -(float)magnification; // TODO: ?? -(float)magnification;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
...@@ -814,7 +816,7 @@ private: ...@@ -814,7 +816,7 @@ private:
- (void)swipeWithEvent: (NSEvent*)pEvent - (void)swipeWithEvent: (NSEvent*)pEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -874,7 +876,7 @@ private: ...@@ -874,7 +876,7 @@ private:
-(void)scrollWheel: (NSEvent*)pEvent -(void)scrollWheel: (NSEvent*)pEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -941,7 +943,7 @@ private: ...@@ -941,7 +943,7 @@ private:
-(void)keyDown: (NSEvent*)pEvent -(void)keyDown: (NSEvent*)pEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -1003,7 +1005,7 @@ private: ...@@ -1003,7 +1005,7 @@ private:
-(void)flagsChanged: (NSEvent*)pEvent -(void)flagsChanged: (NSEvent*)pEvent
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -1016,7 +1018,7 @@ private: ...@@ -1016,7 +1018,7 @@ private:
{ {
(void) replacementRange; // FIXME: surely it must be used (void) replacementRange; // FIXME: surely it must be used
YIELD_GUARD; SolarMutexGuard aGuard;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
{ {
...@@ -1484,7 +1486,7 @@ private: ...@@ -1484,7 +1486,7 @@ private:
-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
long nRet = 0; long nRet = 0;
if( AquaSalFrame::isAlive( mpFrame ) ) if( AquaSalFrame::isAlive( mpFrame ) )
...@@ -1588,7 +1590,7 @@ private: ...@@ -1588,7 +1590,7 @@ private:
{ {
(void) replacementRange; // FIXME - use it! (void) replacementRange; // FIXME - use it!
YIELD_GUARD; SolarMutexGuard aGuard;
if( ![aString isKindOfClass:[NSAttributedString class]] ) if( ![aString isKindOfClass:[NSAttributedString class]] )
aString = [[[NSAttributedString alloc] initWithString:aString] autorelease]; aString = [[[NSAttributedString alloc] initWithString:aString] autorelease];
...@@ -1709,7 +1711,7 @@ private: ...@@ -1709,7 +1711,7 @@ private:
(void) aRange; (void) aRange;
(void) actualRange; (void) actualRange;
YIELD_GUARD; SolarMutexGuard aGuard;
SalExtTextInputPosEvent aPosEvent; SalExtTextInputPosEvent aPosEvent;
mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void *>(&aPosEvent) ); mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void *>(&aPosEvent) );
...@@ -1730,7 +1732,7 @@ private: ...@@ -1730,7 +1732,7 @@ private:
//TODO: odd cast really needed for fdo#74121? //TODO: odd cast really needed for fdo#74121?
} }
-(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext -(css::accessibility::XAccessibleContext *)accessibleContext
{ {
if ( !mpReferenceWrapper ) { if ( !mpReferenceWrapper ) {
// some frames never become visible .. // some frames never become visible ..
......
...@@ -17,14 +17,17 @@ ...@@ -17,14 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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/cmdevt.hxx>
#include "vcl/floatwin.hxx" #include <vcl/floatwin.hxx>
#include "vcl/window.hxx" #include <vcl/window.hxx>
#include "vcl/svapp.hxx" #include <vcl/svapp.hxx>
#include "osx/saldata.hxx" #include "osx/saldata.hxx"
#include "osx/salinst.h" #include "osx/salinst.h"
...@@ -33,12 +36,9 @@ ...@@ -33,12 +36,9 @@
#include "osx/salframe.h" #include "osx/salframe.h"
#include "osx/a11ywrapper.h" #include "osx/a11ywrapper.h"
#include "quartz/utils.h" #include "quartz/utils.h"
#include "svids.hrc" #include "svids.hrc"
#include "window.h" #include "window.h"
#include <objc/objc-runtime.h>
namespace { namespace {
void releaseButtonEntry( AquaSalMenu::MenuBarButtonEntry& i_rEntry ) void releaseButtonEntry( AquaSalMenu::MenuBarButtonEntry& i_rEntry )
...@@ -94,14 +94,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; ...@@ -94,14 +94,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
-(void)showPreferences: (id) sender -(void)showPreferences: (id) sender
{ {
(void)sender; (void)sender;
YIELD_GUARD; SolarMutexGuard aGuard;
[self showDialog: ShowDialogId::Preferences]; [self showDialog: ShowDialogId::Preferences];
} }
-(void)showAbout: (id) sender -(void)showAbout: (id) sender
{ {
(void)sender; (void)sender;
YIELD_GUARD; SolarMutexGuard aGuard;
[self showDialog: ShowDialogId::About]; [self showDialog: ShowDialogId::About];
} }
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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/salinst.h"
#include "osx/saldata.hxx" #include "osx/saldata.hxx"
...@@ -24,8 +27,6 @@ ...@@ -24,8 +27,6 @@
#include "osx/salmenu.h" #include "osx/salmenu.h"
#include "osx/salnsmenu.h" #include "osx/salnsmenu.h"
#include "vcl/window.hxx"
@implementation SalNSMenu @implementation SalNSMenu
-(id)initWithMenu: (AquaSalMenu*)pMenu -(id)initWithMenu: (AquaSalMenu*)pMenu
{ {
...@@ -36,8 +37,8 @@ ...@@ -36,8 +37,8 @@
-(void)menuNeedsUpdate: (NSMenu*)pMenu -(void)menuNeedsUpdate: (NSMenu*)pMenu
{ {
(void)pMenu; (void)pMenu;
YIELD_GUARD; SolarMutexGuard aGuard;
if( mpMenu ) if( mpMenu )
{ {
const AquaSalFrame* pFrame = mpMenu->getFrame(); const AquaSalFrame* pFrame = mpMenu->getFrame();
...@@ -76,8 +77,8 @@ ...@@ -76,8 +77,8 @@
-(void)menuItemTriggered: (id)aSender -(void)menuItemTriggered: (id)aSender
{ {
(void)aSender; (void)aSender;
YIELD_GUARD; SolarMutexGuard aGuard;
const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : NULL; const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : NULL;
if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() ) if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() )
{ {
...@@ -93,13 +94,13 @@ ...@@ -93,13 +94,13 @@
if( pPopupMenu ) if( pPopupMenu )
{ {
// FIXME: revise this ugly code // FIXME: revise this ugly code
// select handlers in vcl are dispatch on the original menu // select handlers in vcl are dispatch on the original menu
// if not consumed by the select handler of the current menu // if not consumed by the select handler of the current menu
// however since only the starting menu ever came into Execute // however since only the starting menu ever came into Execute
// the hierarchy is not build up. Workaround this by getting // the hierarchy is not build up. Workaround this by getting
// the menu it should have been // the menu it should have been
// get started from hierarchy in vcl menus // get started from hierarchy in vcl menus
AquaSalMenu* pParentMenu = mpMenuItem->mpParentMenu; AquaSalMenu* pParentMenu = mpMenuItem->mpParentMenu;
Menu* pCurMenu = mpMenuItem->mpVCLMenu; Menu* pCurMenu = mpMenuItem->mpVCLMenu;
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
pCurMenu = pParentMenu->mpVCLMenu; pCurMenu = pParentMenu->mpVCLMenu;
pParentMenu = pParentMenu->mpParentSalMenu; pParentMenu = pParentMenu->mpParentSalMenu;
} }
pPopupMenu->SetSelectedEntry( mpMenuItem->mnId ); pPopupMenu->SetSelectedEntry( mpMenuItem->mnId );
pPopupMenu->ImplSelectWithStart( pCurMenu ); pPopupMenu->ImplSelectWithStart( pCurMenu );
} }
...@@ -168,7 +169,7 @@ ...@@ -168,7 +169,7 @@
} }
return; return;
} }
aImgRect.origin.x += aFromRect.size.width + 2; aImgRect.origin.x += aFromRect.size.width + 2;
} }
} }
......
...@@ -17,27 +17,27 @@ ...@@ -17,27 +17,27 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include "osx/saltimer.h" #include "osx/saltimer.h"
#include "osx/salnstimer.h" #include "osx/salnstimer.h"
#include "osx/salinst.h" #include "osx/salinst.h"
#include "osx/saldata.hxx" #include "osx/saldata.hxx"
#include "svdata.hxx" #include "svdata.hxx"
@implementation TimerCallbackCaller @implementation TimerCallbackCaller
-(void)timerElapsed:(NSTimer*)pTimer -(void)timerElapsed:(NSTimer*)pTimer
{ {
(void)pTimer; (void)pTimer;
ImplSVData* pSVData = ImplGetSVData();
if( AquaSalTimer::bDispatchTimer ) if( AquaSalTimer::bDispatchTimer )
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->mpSalTimer ) if( pSVData->mpSalTimer )
{ {
bool idle = true; // TODO bool idle = true; // TODO
pSVData->mpSalTimer->CallCallback( idle ); pSVData->mpSalTimer->CallCallback( idle );
// NSTimer does not end nextEventMatchingMask of NSApplication // NSTimer does not end nextEventMatchingMask of NSApplication
// so we need to wakeup a waiting Yield to inform it something happened // so we need to wakeup a waiting Yield to inform it something happened
GetSalData()->mpFirstInstance->wakeupYield(); GetSalData()->mpFirstInstance->wakeupYield();
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include "osx/saltimer.h" #include "osx/saltimer.h"
#include "osx/salnstimer.h" #include "osx/salnstimer.h"
#include "osx/saldata.hxx" #include "osx/saldata.hxx"
...@@ -36,8 +38,10 @@ void ImplSalStartTimer( sal_uLong nMS ) ...@@ -36,8 +38,10 @@ void ImplSalStartTimer( sal_uLong nMS )
if( AquaSalTimer::pRunningTimer != nil ) if( AquaSalTimer::pRunningTimer != nil )
{ {
if( [AquaSalTimer::pRunningTimer timeInterval] == aTI ) if( [AquaSalTimer::pRunningTimer timeInterval] == aTI )
{
// set new fire date // set new fire date
[AquaSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]]; [AquaSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]];
}
else else
{ {
[AquaSalTimer::pRunningTimer invalidate]; [AquaSalTimer::pRunningTimer invalidate];
...@@ -89,7 +93,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent ) ...@@ -89,7 +93,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
NSTimeInterval current = [NSDate timeIntervalSinceReferenceDate]; NSTimeInterval current = [NSDate timeIntervalSinceReferenceDate];
if( (posted - current) <= 0.0 ) if( (posted - current) <= 0.0 )
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
if( pSVData->mpSalTimer ) if( pSVData->mpSalTimer )
{ {
// timer already elapsed since event posted // timer already elapsed since event posted
......
...@@ -17,25 +17,24 @@ ...@@ -17,25 +17,24 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <config_features.h> #include <config_features.h>
#include "sal/config.h"
#include "sal/main.h"
#include <vector> #include <vector>
#include "vcl/window.hxx" #include <sal/main.h>
#include "vcl/svapp.hxx" #include <vcl/cmdevt.hxx>
#include "vcl/cmdevt.hxx" #include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include "osx/vclnsapp.h" #include "impimagetree.hxx"
#include "osx/salinst.h"
#include "osx/saldata.hxx" #include "osx/saldata.hxx"
#include "osx/salframe.h" #include "osx/salframe.h"
#include "osx/salframeview.h" #include "osx/salframeview.h"
#include "osx/salinst.h"
#include "osx/vclnsapp.h"
#include "quartz/utils.h" #include "quartz/utils.h"
#include "impimagetree.hxx"
#include "premac.h" #include "premac.h"
#include <objc/objc-runtime.h> #include <objc/objc-runtime.h>
#import "Carbon/Carbon.h" #import "Carbon/Carbon.h"
...@@ -79,7 +78,9 @@ ...@@ -79,7 +78,9 @@
{ {
NSEventType eType = [pEvent type]; NSEventType eType = [pEvent type];
if( eType == NSApplicationDefined ) if( eType == NSApplicationDefined )
{
AquaSalInstance::handleAppDefinedEvent( pEvent ); AquaSalInstance::handleAppDefinedEvent( pEvent );
}
else if( eType == NSKeyDown && ([pEvent modifierFlags] & NSCommandKeyMask) != 0 ) else if( eType == NSKeyDown && ([pEvent modifierFlags] & NSCommandKeyMask) != 0 )
{ {
NSWindow* pKeyWin = [NSApp keyWindow]; NSWindow* pKeyWin = [NSApp keyWindow];
...@@ -166,9 +167,11 @@ ...@@ -166,9 +167,11 @@
bHandled = GetSalData()->maKeyEventAnswer[ pEvent ]; bHandled = GetSalData()->maKeyEventAnswer[ pEvent ];
} }
else else
{
bHandled = true; // event handled already or main menu just handled it bHandled = true; // event handled already or main menu just handled it
}
GetSalData()->maKeyEventAnswer.erase( pEvent ); GetSalData()->maKeyEventAnswer.erase( pEvent );
if( bHandled ) if( bHandled )
return; return;
} }
...@@ -395,7 +398,7 @@ ...@@ -395,7 +398,7 @@
(void)app; (void)app;
NSApplicationTerminateReply aReply = NSTerminateNow; NSApplicationTerminateReply aReply = NSTerminateNow;
{ {
YIELD_GUARD; SolarMutexGuard aGuard;
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
if( ! pSalData->maFrames.empty() ) if( ! pSalData->maFrames.empty() )
...@@ -421,7 +424,7 @@ ...@@ -421,7 +424,7 @@
-(void)systemColorsChanged: (NSNotification*) pNotification -(void)systemColorsChanged: (NSNotification*) pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
const SalData* pSalData = GetSalData(); const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() ) if( !pSalData->maFrames.empty() )
...@@ -431,7 +434,7 @@ ...@@ -431,7 +434,7 @@
-(void)screenParametersChanged: (NSNotification*) pNotification -(void)screenParametersChanged: (NSNotification*) pNotification
{ {
(void)pNotification; (void)pNotification;
YIELD_GUARD; SolarMutexGuard aGuard;
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
std::list< AquaSalFrame* >::iterator it; 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