diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-01 16:49:23 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-07 11:20:43 +0200 |
commit | 8aa3cb98adb8675ff3f09d2c1da35d2423e57493 (patch) | |
tree | 3e7f2df75f1176a64034be8c7de592dc92996054 /vcl | |
parent | fa52e2090651fc2b2f3ba77b8f0af196d705730f (diff) |
fdo#84938: convert VCL_INPUT_ #defines to 'enum class'
Change-Id: I155e45f58974a2b946c4a7703b350bcbfbad342e
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/android/androidinst.cxx | 4 | ||||
-rw-r--r-- | vcl/headless/svpinst.cxx | 4 | ||||
-rw-r--r-- | vcl/inc/android/androidinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/osx/salinst.h | 2 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 2 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 2 | ||||
-rw-r--r-- | vcl/ios/iosinst.cxx | 4 | ||||
-rw-r--r-- | vcl/osx/salinst.cxx | 18 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/app/salinst.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/generic/window/salobj.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkinst.cxx | 14 | ||||
-rw-r--r-- | vcl/win/source/app/salinst.cxx | 14 |
17 files changed, 50 insertions, 48 deletions
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 172c72c6b453..42c9816e02cc 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -197,9 +197,9 @@ AndroidSalInstance::~AndroidSalInstance() LOGI("destroyed Android Sal Instance"); } -bool AndroidSalInstance::AnyInput( sal_uInt16 nType ) +bool AndroidSalInstance::AnyInput( VclInputFlags nType ) { - if( (nType & VCL_INPUT_TIMER) != 0 ) + if( nType & VclInputFlags::TIMER ) return CheckTimeout( false ); // Unfortunately there is no way to check for a specific type of diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx index 3bb44e0c161a..1325e3ff45c5 100644 --- a/vcl/headless/svpinst.cxx +++ b/vcl/headless/svpinst.cxx @@ -348,9 +348,9 @@ void SvpSalInstance::DoReleaseYield( int nTimeoutMS ) } } -bool SvpSalInstance::AnyInput( sal_uInt16 nType ) +bool SvpSalInstance::AnyInput( VclInputFlags nType ) { - if( (nType & VCL_INPUT_TIMER) != 0 ) + if( nType & VclInputFlags::TIMER ) return CheckTimeout( false ); return false; } diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx index 76067efeac01..79dad74d9bb8 100644 --- a/vcl/inc/android/androidinst.hxx +++ b/vcl/inc/android/androidinst.hxx @@ -40,7 +40,7 @@ public: SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); // mainloop pieces - virtual bool AnyInput( sal_uInt16 nType ); + virtual bool AnyInput( VclInputFlags nType ); void RedrawWindows(ANativeWindow_Buffer *pBuffer); SalFrame *getFocusFrame() const; diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx index 2e2d8339c7f8..800fbc130ab6 100644 --- a/vcl/inc/headless/svpinst.hxx +++ b/vcl/inc/headless/svpinst.hxx @@ -156,7 +156,7 @@ public: // must returned by UserEvent (SalFrame::PostEvent) // and timer virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; - virtual bool AnyInput( sal_uInt16 nType ) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; // may return NULL to disable session management virtual SalSession* CreateSalSession() SAL_OVERRIDE; diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index 8a88a2616f73..b37035cce7c9 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -109,7 +109,7 @@ public: virtual void AcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE; virtual bool CheckYieldMutex() SAL_OVERRIDE; virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; - virtual bool AnyInput( sal_uInt16 nType ) 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; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index fb2addaf7684..6a89e407fa03 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -56,6 +56,7 @@ class SalSession; struct SystemGraphicsData; struct SystemWindowData; class Menu; +enum class VclInputFlags; class VCL_PLUGIN_PUBLIC SalInstance { @@ -125,7 +126,7 @@ public: // must returned by UserEvent (SalFrame::PostEvent) // and timer virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) = 0; - virtual bool AnyInput( sal_uInt16 nType ) = 0; + virtual bool AnyInput( VclInputFlags nType ) = 0; // menus virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pMenu ); diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 3cabea3d0d26..e8fb76c374f4 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -83,7 +83,7 @@ public: virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE; virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; - virtual bool AnyInput( sal_uInt16 nType ) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; virtual GenPspGraphics *CreatePrintGraphics() SAL_OVERRIDE; diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index c2df7a87f182..c2fe9b6f497f 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -66,7 +66,7 @@ public: virtual SalSession* CreateSalSession() SAL_OVERRIDE; virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; - virtual bool AnyInput( sal_uInt16 nType ) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) SAL_OVERRIDE; virtual void FillFontPathList( std::list< OString >& o_rFontPaths ) SAL_OVERRIDE; diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index a6ccbb57f216..15237a205e59 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -63,7 +63,7 @@ public: virtual bool CheckYieldMutex(); virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); - virtual bool AnyInput( sal_uInt16 nType ); + virtual bool AnyInput( VclInputFlags nType ); virtual SalMenu* CreateMenu( bool bMenuBar, Menu* ); virtual void DestroyMenu( SalMenu* ); virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index f3fe0b3c3529..2b1c26e17359 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -92,9 +92,9 @@ IosSalInstance::~IosSalInstance() #if 0 -bool IosSalInstance::AnyInput( sal_uInt16 nType ) +bool IosSalInstance::AnyInput( VclInputFlags nType ) { - if( (nType & VCL_INPUT_TIMER) != 0 ) + if( nType & VclInputFlags::TIMER ) return CheckTimeout( false ); // Unfortunately there is no way to check for a specific type of diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 411cfba81586..ed420914638e 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -699,17 +699,17 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) } } -bool AquaSalInstance::AnyInput( sal_uInt16 nType ) +bool AquaSalInstance::AnyInput( VclInputFlags nType ) { - if( nType & VCL_INPUT_APPEVENT ) + if( nType & VclInputFlags::APPEVENT ) { if( ! aAppEventList.empty() ) return true; - if( nType == VCL_INPUT_APPEVENT ) + if( nType == VclInputFlags::APPEVENT ) return false; } - if( nType & VCL_INPUT_TIMER ) + if( nType & VclInputFlags::TIMER ) { if( AquaSalTimer::pRunningTimer ) { @@ -722,7 +722,7 @@ bool AquaSalInstance::AnyInput( sal_uInt16 nType ) } unsigned/*NSUInteger*/ nEventMask = 0; - if( nType & VCL_INPUT_MOUSE) + if( nType & VclInputFlags::MOUSE) nEventMask |= NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSOtherMouseUpMask | @@ -730,12 +730,12 @@ bool AquaSalInstance::AnyInput( sal_uInt16 nType ) NSScrollWheelMask | // NSMouseMovedMask | NSMouseEnteredMask | NSMouseExitedMask; - if( nType & VCL_INPUT_KEYBOARD) + if( nType & VclInputFlags::KEYBOARD) nEventMask |= NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask; - if( nType & VCL_INPUT_OTHER) + if( nType & VclInputFlags::OTHER) nEventMask |= NSTabletPoint; - // TODO: VCL_INPUT_PAINT / more VCL_INPUT_OTHER - if( !nType) + // TODO: VclInputFlags::PAINT / more VclInputFlags::OTHER + if( !bool(nType) ) return false; NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: nil diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 9a4ce120faa2..1dc1fb04ddac 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -448,7 +448,7 @@ sal_uInt16 Application::GetDispatchLevel() return ImplGetSVData()->maAppData.mnDispatchLevel; } -bool Application::AnyInput( sal_uInt16 nType ) +bool Application::AnyInput( VclInputFlags nType ) { return ImplGetSVData()->mpDefInst->AnyInput( nType ); } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 8e32b78578a5..e135eee12bf2 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -788,7 +788,7 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( bModified ) { // Idle-Formatter only if AnyInput - if ( bAllowIdle && Application::AnyInput( VCL_INPUT_KEYBOARD) ) + if ( bAllowIdle && Application::AnyInput( VclInputFlags::KEYBOARD) ) mpImpl->mpTextEngine->IdleFormatAndUpdate( this ); else mpImpl->mpTextEngine->FormatAndUpdate( this); diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 0b43371fc377..3a9d7d400681 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -80,8 +80,8 @@ X11SalInstance::~X11SalInstance() struct PredicateReturn { - sal_uInt16 nType; - bool bRet; + VclInputFlags nType; + bool bRet; }; extern "C" { @@ -92,7 +92,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) if ( pPre->bRet ) return False; - sal_uInt16 nType; + VclInputFlags nType; switch( pEvent->type ) { @@ -101,36 +101,36 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) case MotionNotify: case EnterNotify: case LeaveNotify: - nType = VCL_INPUT_MOUSE; + nType = VclInputFlags::MOUSE; break; case KeyPress: //case KeyRelease: - nType = VCL_INPUT_KEYBOARD; + nType = VclInputFlags::KEYBOARD; break; case Expose: case GraphicsExpose: case NoExpose: - nType = VCL_INPUT_PAINT; + nType = VclInputFlags::PAINT; break; default: - nType = 0; + nType = VclInputFlags::NONE; } - if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & VCL_INPUT_OTHER) ) ) + if ( (nType & pPre->nType) || ( nType == VclInputFlags::NONE && (pPre->nType & VclInputFlags::OTHER) ) ) pPre->bRet = true; return False; } } -bool X11SalInstance::AnyInput(sal_uInt16 nType) +bool X11SalInstance::AnyInput(VclInputFlags nType) { SalGenericData *pData = GetGenericData(); Display *pDisplay = vcl_sal::getSalDisplay(pData)->GetDisplay(); bool bRet = false; - if( (nType & VCL_INPUT_TIMER) && (mpXLib && mpXLib->CheckTimeout(false)) ) + if( (nType & VclInputFlags::TIMER) && (mpXLib && mpXLib->CheckTimeout(false)) ) bRet = true; else if (XPending(pDisplay) ) { diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx index cfb983d03228..7a7dbf988eb0 100644 --- a/vcl/unx/generic/window/salobj.cxx +++ b/vcl/unx/generic/window/salobj.cxx @@ -27,6 +27,7 @@ #include <tools/debug.hxx> #include <vcl/keycodes.hxx> +#include <vcl/event.hxx> #include <unx/salunx.h> #include <unx/saldata.hxx> diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index c80f14653987..c93dbe2bd7c7 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -128,17 +128,17 @@ static sal_uInt16 categorizeEvent(const GdkEvent *pEvent) case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: case GDK_SCROLL: - nType = VCL_INPUT_MOUSE; + nType = VclInputFlags::MOUSE; break; case GDK_KEY_PRESS: case GDK_KEY_RELEASE: - nType = VCL_INPUT_KEYBOARD; + nType = VclInputFlags::KEYBOARD; break; case GDK_EXPOSE: - nType = VCL_INPUT_PAINT; + nType = VclInputFlags::PAINT; break; default: - nType = VCL_INPUT_OTHER; + nType = VclInputFlags::OTHER; break; } return nType; @@ -405,10 +405,10 @@ bool GtkInstance::IsTimerExpired() return false; } -bool GtkInstance::AnyInput( sal_uInt16 nType ) +bool GtkInstance::AnyInput( VclInputFlags nType ) { EnsureInit(); - if( (nType & VCL_INPUT_TIMER) && IsTimerExpired() ) + if( (nType & VclInputFlags::TIMER) && IsTimerExpired() ) return true; #if !GTK_CHECK_VERSION(3,0,0) bool bRet = X11SalInstance::AnyInput(nType); @@ -426,7 +426,7 @@ bool GtkInstance::AnyInput( sal_uInt16 nType ) { aEvents.push(pEvent); sal_uInt16 nEventType = categorizeEvent(pEvent); - if ( (nEventType & nType) || ( ! nEventType && (nType & VCL_INPUT_OTHER) ) ) + if ( (nEventType & nType) || ( ! nEventType && (nType & VclInputFlags::OTHER) ) ) { bRet = true; break; diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 1091856fd962..1154ac1caa6d 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -788,11 +788,11 @@ LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPa return nRet; } -bool WinSalInstance::AnyInput( sal_uInt16 nType ) +bool WinSalInstance::AnyInput( VclInputFlags nType ) { MSG aMsg; - if ( (nType & (VCL_INPUT_ANY)) == (VCL_INPUT_ANY) ) + if ( (nType & VCL_INPUT_ANY) == VCL_INPUT_ANY ) { // revert bugfix for #108919# which never reported timeouts when called from the timer handler // which made the application completely unresponsive during background formatting @@ -801,7 +801,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType ) } else { - if ( nType & VCL_INPUT_MOUSE ) + if ( nType & VclInputFlags::MOUSE ) { // Test for mouse input if ( PeekMessageW( &aMsg, 0, WM_MOUSEFIRST, WM_MOUSELAST, @@ -809,7 +809,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType ) return true; } - if ( nType & VCL_INPUT_KEYBOARD ) + if ( nType & VclInputFlags::KEYBOARD ) { // Test for key input if ( PeekMessageW( &aMsg, 0, WM_KEYDOWN, WM_KEYDOWN, @@ -824,7 +824,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType ) } } - if ( nType & VCL_INPUT_PAINT ) + if ( nType & VclInputFlags::PAINT ) { // Test for paint input if ( PeekMessageW( &aMsg, 0, WM_PAINT, WM_PAINT, @@ -848,7 +848,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType ) return true; } - if ( nType & VCL_INPUT_TIMER ) + if ( nType & VclInputFlags::TIMER ) { // Test for timer input if ( PeekMessageW( &aMsg, 0, WM_TIMER, WM_TIMER, @@ -857,7 +857,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType ) } - if ( nType & VCL_INPUT_OTHER ) + if ( nType & VclInputFlags::OTHER ) { // Test for any input if ( PeekMessageW( &aMsg, 0, 0, 0, PM_NOREMOVE | PM_NOYIELD ) ) |