[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/win

2017-10-20 Thread Jan-Marek Glogowski
 vcl/inc/osx/salinst.h |6 -
 vcl/inc/win/saldata.hxx   |4 -
 vcl/inc/win/saltimer.h|2 
 vcl/osx/vclnsapp.mm   |2 
 vcl/win/app/salinst.cxx   |  144 --
 vcl/win/window/salobj.cxx |6 -
 6 files changed, 73 insertions(+), 91 deletions(-)

New commits:
commit 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
Author: Jan-Marek Glogowski 
Date:   Mon Oct 16 17:04:24 2017 +0200

WIN message handling cleanup and refactoring

Replace a lot of duplicated case code with macros.
Some minor constifications of function parameters.

I restrained from shorten the SAL_MSG_* via preprocessor concat,
so a grep will still find the whole names.

Change-Id: If1f2477fc8817b4ae7816e807154e35004bb4da9
Reviewed-on: https://gerrit.libreoffice.org/43531
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 01e50af77b99..a80af4fb5ee7 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -63,6 +63,8 @@ public:
 
 class AquaSalInstance : public SalInstance, public SalUserEventList
 {
+friend class AquaSalFrame;
+
 bool RunInMainYield( bool bHandleAllCurrentEvents );
 
 virtual void TriggerUserEventProcessing() override;
@@ -81,7 +83,6 @@ public:
 
 static std::list aAppEventList;
 
-public:
 AquaSalInstance();
 virtual ~AquaSalInstance() override;
 
@@ -136,9 +137,6 @@ public:
 // this is needed to avoid duplicate open events through a) command line 
and b) NSApp's openFile
 static bool isOnCommandLine( const OUString& );
 
-public:
-friend class AquaSalFrame;
-
 void delayedSettingsChanged( bool bInvalidate );
 
 // Is this the NSAppThread?
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 0f3e05b8f31a..659fd68f7dda 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -180,8 +180,8 @@ bool ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, 
LPARAM lParam );
 bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, 
LRESULT& rlResult );
 
 WinSalObject* ImplFindSalObject( HWND hWndChild );
-bool ImplSalPreDispatchMsg( MSG* pMsg );
-void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
+bool ImplSalPreDispatchMsg( const MSG* pMsg );
+void ImplSalPostDispatchMsg( const MSG* pMsg );
 
 void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Font& 
rFont );
 
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index b7d1a1e0d0f1..61d284d82ddb 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -25,7 +25,7 @@
 class WinSalTimer final : public SalTimer, protected VersionedEvent
 {
 // for access to Impl* functions
-friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, 
LPARAM lParam, int& rDef );
+friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, 
LPARAM lParam, bool& rDef );
 // for access to GetNextVersionedEvent
 friend void CALLBACK SalTimerProc( PVOID data, BOOLEAN );
 // for access to ImplHandleElapsedTimer
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 4dd8ceac8169..23b22c360eeb 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -66,7 +66,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint
modifierFlags: 0
-   timestamp: 0
+   timestamp: [[NSProcessInfo processInfo] 
systemUptime]
windowNumber: 0
context: nil
subtype: AquaSalInstance::AppExecuteSVMain
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 693411a0583c..68ad7deb994d 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -459,14 +459,14 @@ void WinSalInstance::AcquireYieldMutex( sal_uInt32 nCount 
)
 mpSalYieldMutex->acquire( nCount );
 }
 
-static LRESULT ImplSalDispatchMessage( MSG* pMsg )
+static LRESULT ImplSalDispatchMessage( const MSG* pMsg )
 {
 SalData* pSalData = GetSalData();
 if ( pSalData->mpFirstObject && ImplSalPreDispatchMsg( pMsg ) )
 return 0;
 LRESULT lResult = DispatchMessageW( pMsg );
 if ( pSalData->mpFirstObject )
-ImplSalPostDispatchMsg( pMsg, lResult );
+ImplSalPostDispatchMsg( pMsg );
 return lResult;
 }
 
@@ -569,124 +569,108 @@ bool WinSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 return bDidWork;
 }
 
-LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, 
int& rDef )
+#define CASE_NOYIELDLOCK( salmsg, function ) \
+case salmsg: \
+assert( !pInst->mbNoYieldLock ); \
+pInst->mbNoYieldLock = true; \
+function; \
+   

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/win

2016-05-10 Thread Noel Grandin
 vcl/inc/osx/salframeview.h  |4 +++-
 vcl/inc/osx/salinst.h   |2 +-
 vcl/osx/salframe.cxx|4 ++--
 vcl/osx/salframeview.mm |2 +-
 vcl/osx/salinst.cxx |2 +-
 vcl/win/window/salframe.cxx |2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit f6fb8a152797de4c5339b2fa5a3adf0e2ee0c349
Author: Noel Grandin 
Date:   Tue May 10 12:16:45 2016 +0200

fix OSX and Windows builds

after my "Convert SALEVENT to scoped enum" commit

Change-Id: Ib4a3f0e18fa5d8160446d5b5cd505bae651da7d5

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index bb922b8..0d32266 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -22,6 +22,8 @@
 
 #include "osx/a11ywrapper.h"
 
+enum class SalEvent;
+
 @interface SalFrameWindow : NSWindow
 {
 AquaSalFrame*   mpFrame;
@@ -103,7 +105,7 @@
 -(void)swipeWithEvent: (NSEvent*)pEvent;
 -(void)keyDown: (NSEvent*)pEvent;
 -(void)flagsChanged: (NSEvent*)pEvent;
--(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(sal_uInt16)nEvent;
+-(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(SalEvent)nEvent;
 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar;
 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar modifiers: (unsigned int)nMod;
 -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar modifiers: (unsigned int)nMod;
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 82bdfde..20f3e3e 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -141,7 +141,7 @@ public:
  public:
 friend class AquaSalFrame;
 
-void PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData );
+void PostUserEvent( AquaSalFrame* pFrame, SalEvent nType, void* pData );
 void delayedSettingsChanged( bool bInvalidate );
 
 bool isNSAppThread() const;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index a084520..a1498c5 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1245,7 +1245,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long 
nWidth, long nHeight, sal_u
 // #i113170# may not be the main thread if called from UNO API
 SalData::ensureThreadAutoreleasePool();
 
-sal_uInt16 nEvent = 0;
+SalEvent nEvent = SalEvent::NONE;
 
 if( [mpNSWindow isMiniaturized] )
 [mpNSWindow deminiaturize: NSApp]; // expand the window
@@ -1314,7 +1314,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long 
nWidth, long nHeight, sal_u
 
 UpdateFrameGeometry();
 
-if (nEvent)
+if (nEvent != SalEvent::NONE)
 CallCallback(nEvent, nullptr);
 
 if( mbShown && bPaint )
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 246ca40..6906f9b 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -549,7 +549,7 @@ private:
 }
 }
 
--(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(sal_uInt16)nEvent
+-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(SalEvent)nEvent
 {
 SolarMutexGuard aGuard;
 
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 2d57b4a..10e3f2f 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -387,7 +387,7 @@ void AquaSalInstance::wakeupYield()
 }
 }
 
-void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, 
void* pData )
+void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, SalEvent nType, 
void* pData )
 {
 {
 osl::MutexGuard g( maUserEventListMutex );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 47aa4dd..2f057d3 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1434,7 +1434,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long 
nWidth, long nHeight,
 UpdateFrameGeometry( mhWnd, this );
 
 // Notification -- really ???
-if( nEvent )
+if( nEvent != SalEvent::NONE )
 CallCallback( nEvent, NULL );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits