diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
commit | 238883621ee13e53f535fb56c4dc8510e39a7f3b (patch) | |
tree | 3fea36e0243440f0e5c96364a0fe36269966c8fd /vcl | |
parent | 845ab68981c2aacf81af53adbf9d2d4d2e9d5527 (diff) | |
parent | 9103c81b03961788743d6248099f6a7f35f735d9 (diff) |
CWS-TOOLING: integrate CWS mib19
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/inc/salobj.h | 1 | ||||
-rw-r--r-- | vcl/aqua/source/window/salobj.cxx | 6 | ||||
-rw-r--r-- | vcl/inc/vcl/salframe.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/salobj.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/window.h | 3 | ||||
-rwxr-xr-x | vcl/inc/vcl/window.hxx | 3 | ||||
-rw-r--r-- | vcl/os2/inc/salobj.h | 1 | ||||
-rw-r--r-- | vcl/os2/source/window/salobj.cxx | 6 | ||||
-rwxr-xr-x | vcl/source/window/window.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkobject.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/headless/svpdummies.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/headless/svpdummies.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/inc/plugins/gtk/gtkobject.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/inc/salobj.h | 1 | ||||
-rw-r--r-- | vcl/unx/source/window/salobj.cxx | 7 | ||||
-rw-r--r-- | vcl/win/inc/saldata.hxx | 1 | ||||
-rw-r--r-- | vcl/win/inc/salobj.h | 2 | ||||
-rw-r--r-- | vcl/win/source/app/salinst.cxx | 15 | ||||
-rw-r--r-- | vcl/win/source/gdi/salprn.cxx | 15 | ||||
-rw-r--r-- | vcl/win/source/window/salobj.cxx | 50 |
20 files changed, 120 insertions, 10 deletions
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h index 0041b22c16a0..56b07cea4262 100644 --- a/vcl/aqua/inc/salobj.h +++ b/vcl/aqua/inc/salobj.h @@ -81,6 +81,7 @@ public: virtual void SetBackground(); virtual void SetBackground( SalColor nSalColor ); virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx index 07d337dcc81a..f300929f04fe 100644 --- a/vcl/aqua/source/window/salobj.cxx +++ b/vcl/aqua/source/window/salobj.cxx @@ -237,3 +237,9 @@ const SystemEnvData* AquaSalObject::GetSystemData() const return &maSysData; } +// ----------------------------------------------------------------------- + +void AquaSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx index 08548d7dda40..d82a2099f315 100644 --- a/vcl/inc/vcl/salframe.hxx +++ b/vcl/inc/vcl/salframe.hxx @@ -270,7 +270,6 @@ public: // done setting up the clipregion virtual void EndSetClipRegion() = 0; - // Callbacks (indepent part in vcl/source/window/winproc.cxx) // for default message handling return 0 void SetCallback( Window* pWindow, SALFRAMEPROC pProc ) diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx index e453bf5c6f87..adf0e0a3d45d 100644 --- a/vcl/inc/vcl/salobj.hxx +++ b/vcl/inc/vcl/salobj.hxx @@ -73,6 +73,8 @@ public: virtual const SystemEnvData* GetSystemData() const = 0; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0; + void SetCallback( void* pInst, SALOBJECTPROC pProc ) { m_pInst = pInst; m_pCallback = pProc; } long CallCallback( USHORT nEvent, const void* pEvent ) diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index 4a7f1c644400..73b6f1078ca9 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -357,7 +357,8 @@ public: mbDisableAccessibleLabelForRelation:1, mbDisableAccessibleLabeledByRelation:1, mbHelpTextDynamic:1, - mbFakeFocusSet:1; + mbFakeFocusSet:1, + mbInterceptChildWindowKeyDown:1; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; }; diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 700a87695085..fa136f6d514d 100755 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -1114,6 +1114,9 @@ public: */ void doLazyDelete(); + // let the window intercept the KeyDown messages of the system children + void InterceptChildWindowKeyDown( sal_Bool bIntercept ); + virtual XubString GetSurroundingText() const; virtual Selection GetSurroundingTextSelection() const; diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h index 5b4ac21ccdd6..04fdef90bf67 100644 --- a/vcl/os2/inc/salobj.h +++ b/vcl/os2/inc/salobj.h @@ -64,6 +64,7 @@ public: virtual void SetBackground(); virtual void SetBackground( SalColor nSalColor ); virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/os2/source/window/salobj.cxx b/vcl/os2/source/window/salobj.cxx index 85ed1a606d08..e55ce448f7d0 100644 --- a/vcl/os2/source/window/salobj.cxx +++ b/vcl/os2/source/window/salobj.cxx @@ -566,3 +566,9 @@ void Os2SalObject::SetCallback( void* pInst, SALOBJECTPROC pProc ) } #endif +// ----------------------------------------------------------------------- + +void Os2SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f6bedc1bfa25..fe2af486c53a 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -4786,6 +4786,13 @@ void Window::doLazyDelete() } // ----------------------------------------------------------------------- +void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept ) +{ + if( mpWindowImpl->mpSysObj ) + mpWindowImpl->mpSysObj->InterceptChildWindowKeyDown( bIntercept ); +} + +// ----------------------------------------------------------------------- void Window::MouseMove( const MouseEvent& rMEvt ) { diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index 2a2bbe78078a..c5f5a168f653 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -209,3 +209,8 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object ) pThis->m_pSocket = NULL; } } + +void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 5983ff18c34f..0a67b147804a 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -61,6 +61,7 @@ void SvpSalObject::GrabFocus() {} void SvpSalObject::SetBackground() {} void SvpSalObject::SetBackground( SalColor ) {} const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; } +void SvpSalObject::InterceptChildWindowKeyDown( sal_Bool ) {} // SalI18NImeStatus SvpImeStatus::~SvpImeStatus() {} diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx index febf7eef6bbe..ea7667ce51ca 100644 --- a/vcl/unx/headless/svpdummies.hxx +++ b/vcl/unx/headless/svpdummies.hxx @@ -58,6 +58,8 @@ public: virtual void SetBackground( SalColor nSalColor ); virtual const SystemEnvData* GetSystemData() const; + + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; class SvpImeStatus : public SalI18NImeStatus diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index ea740249f1c6..9d3f235b8894 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -64,6 +64,7 @@ public: virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h index fa9f1309c8ca..d7d9334f281b 100644 --- a/vcl/unx/inc/salobj.h +++ b/vcl/unx/inc/salobj.h @@ -98,6 +98,7 @@ public: virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 647b95ae032c..2ff6d05c35c6 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -559,3 +559,10 @@ long X11SalObject::Dispatch( XEvent* pEvent ) } return 0; } + +// ----------------------------------------------------------------------- + +void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx index ec67272ed07f..f95f1e0ca96b 100644 --- a/vcl/win/inc/saldata.hxx +++ b/vcl/win/inc/saldata.hxx @@ -213,6 +213,7 @@ void ImplSalYieldMutexAcquire(); void ImplSalYieldMutexRelease(); ULONG ImplSalReleaseYieldMutex(); void ImplSalAcquireYieldMutex( ULONG nCount ); +sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg ); // \\WIN\SOURCE\WINDOW\SALFRAME.CXX LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ); diff --git a/vcl/win/inc/salobj.h b/vcl/win/inc/salobj.h index 11ae96931321..ae7ea5271800 100644 --- a/vcl/win/inc/salobj.h +++ b/vcl/win/inc/salobj.h @@ -46,6 +46,7 @@ public: RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data RECT* mpNextClipRect; // Naechstes ClipRegion-Rect BOOL mbFirstClipRect; // Flag for first cliprect to insert + sal_Bool mbInterceptChildWindowKeyDown; // Intercept the KeyDown event sent to system child window WinSalObject* mpNextObject; // pointer to next object @@ -64,6 +65,7 @@ public: virtual void SetBackground(); virtual void SetBackground( SalColor nSalColor ); virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 419723ee6442..a05d2d0b6502 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -719,8 +719,12 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents ) { if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) ) { - TranslateMessage( &aMsg ); - ImplSalDispatchMessage( &aMsg ); + if ( !ImplInterceptChildWindowKeyDown( aMsg ) ) + { + TranslateMessage( &aMsg ); + ImplSalDispatchMessage( &aMsg ); + } + bOneEvent = bWasMsg = true; } else @@ -731,8 +735,11 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents ) { if ( ImplGetMessage( &aMsg, 0, 0, 0 ) ) { - TranslateMessage( &aMsg ); - ImplSalDispatchMessage( &aMsg ); + if ( !ImplInterceptChildWindowKeyDown( aMsg ) ) + { + TranslateMessage( &aMsg ); + ImplSalDispatchMessage( &aMsg ); + } } } } diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index 9d8d41723f64..702ff639ed84 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -1798,8 +1798,11 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) MSG aMsg; if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) ) { - TranslateMessage( &aMsg ); - ImplDispatchMessage( &aMsg ); + if ( !ImplInterceptChildWindowKeyDown( aMsg ) ) + { + TranslateMessage( &aMsg ); + ImplDispatchMessage( &aMsg ); + } i++; if ( i > 15 ) bWhile = FALSE; @@ -2060,8 +2063,12 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName, MSG aMsg; if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) ) { - TranslateMessage( &aMsg ); - ImplDispatchMessage( &aMsg ); + if ( !ImplInterceptChildWindowKeyDown( aMsg ) ) + { + TranslateMessage( &aMsg ); + ImplDispatchMessage( &aMsg ); + } + i++; if ( i > 15 ) bWhile = FALSE; diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx index 2f657968284f..6d00242ef313 100644 --- a/vcl/win/source/window/salobj.cxx +++ b/vcl/win/source/window/salobj.cxx @@ -39,6 +39,7 @@ #include <salframe.h> #include <salobj.h> #include <tools/debug.hxx> +#include <vcl/svapp.hxx> // ======================================================================= @@ -103,6 +104,46 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd ) // ----------------------------------------------------------------------- +sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg ) +{ + sal_Bool bResult = sal_False; + if ( rMsg.message == WM_KEYDOWN ) + { + wchar_t pClassName[10]; + sal_Int32 nLen = GetClassNameW( rMsg.hwnd, pClassName, 10 ); + if ( !( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) ) + { + // look for the first SalObject in the parent hierarchy + HWND hWin = rMsg.hwnd; + HWND hLastOLEWindow = hWin; + WinSalObject* pSalObj = NULL; + do + { + hLastOLEWindow = hWin; + hWin = ::GetParent( hWin ); + if ( hWin ) + { + nLen = GetClassNameW( hWin, pClassName, 10 ); + if ( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) + pSalObj = GetSalObjWindowPtr( hWin ); + } + } while( hWin && !pSalObj ); + + if ( pSalObj && pSalObj->mbInterceptChildWindowKeyDown && pSalObj->maSysData.hWnd ) + { + bResult = ( 1 == ImplSendMessage( pSalObj->maSysData.hWnd, rMsg.message, rMsg.wParam, rMsg.lParam ) ); + } + } + } + + return bResult; +} + +// ----------------------------------------------------------------------- + + +// ----------------------------------------------------------------------- + LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) { // Used for Unicode and none Unicode @@ -623,6 +664,7 @@ WinSalObject::WinSalObject() mhLastFocusWnd = 0; maSysData.nSize = sizeof( SystemEnvData ); mpStdClipRgnData = NULL; + mbInterceptChildWindowKeyDown = sal_False; // Insert object in objectlist mpNextObject = pSalData->mpFirstObject; @@ -836,3 +878,11 @@ const SystemEnvData* WinSalObject::GetSystemData() const { return &maSysData; } + +// ----------------------------------------------------------------------- + +void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept ) +{ + mbInterceptChildWindowKeyDown = bIntercept; +} + |