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 | |
parent | fa52e2090651fc2b2f3ba77b8f0af196d705730f (diff) |
fdo#84938: convert VCL_INPUT_ #defines to 'enum class'
Change-Id: I155e45f58974a2b946c4a7703b350bcbfbad342e
33 files changed, 92 insertions, 79 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index af0cf51f2fcd..d861111bfd58 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1533,7 +1533,7 @@ int Desktop::Main() (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && (!bExistsRecoveryData ) && (!bExistsSessionData ) && - (!Application::AnyInput( VCL_INPUT_APPEVENT ) )) + (!Application::AnyInput( VclInputFlags::APPEVENT ) )) { SAL_INFO( "desktop.app", "{ create BackingComponent" ); ShowBackingComponent(this); @@ -2413,7 +2413,7 @@ void Desktop::OpenClients() if ( xList->hasElements() ) return; - if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || Application::AnyInput( VCL_INPUT_APPEVENT ) ) + if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || Application::AnyInput( VclInputFlags::APPEVENT ) ) // soffice was started as tray icon ... return; diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 1208536e3c9e..32b9adea417a 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1382,7 +1382,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v DBG_ASSERT( !bReadOnly, "ReadOnly but modified???" ); // Idle-Formatter only when AnyInput. if ( bAllowIdle && pImpEditEngine->GetStatus().UseIdleFormatter() - && Application::AnyInput( VCL_INPUT_KEYBOARD) ) + && Application::AnyInput( VclInputFlags::KEYBOARD) ) pImpEditEngine->IdleFormatAndUpdate( pEditView ); else pImpEditEngine->FormatAndUpdate( pEditView ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 39db002f1e85..055b198a11de 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -309,7 +309,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) IMPL_LINK_NOARG(ImpEditEngine, OnlineSpellHdl) { - if ( !Application::AnyInput( VCL_INPUT_KEYBOARD ) && GetUpdateMode() && IsFormatted() ) + if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) && GetUpdateMode() && IsFormatted() ) DoOnlineSpelling(); else aOnlineSpellIdle.Start(); diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 095bf735788c..bf7560603500 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -582,7 +582,7 @@ bool FormulaDlg_Impl::CalcValue( const OUString& rStrExp, OUString& rStrResult ) { // Only calculate the value when there isn't any more keyboard input: - if ( !Application::AnyInput( VCL_INPUT_KEYBOARD ) ) + if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) ) { bResult = m_pHelper->calculateValue(rStrExp,rStrResult); } @@ -620,7 +620,7 @@ bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp) { // Only calculate the value when there isn't any more keyboard input: - if ( !Application::AnyInput( VCL_INPUT_KEYBOARD ) ) + if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) ) { pStructPage->ClearStruct(); diff --git a/include/vcl/apptypes.hxx b/include/vcl/apptypes.hxx index bc0307cf8d86..adc1b88f6d52 100644 --- a/include/vcl/apptypes.hxx +++ b/include/vcl/apptypes.hxx @@ -22,6 +22,7 @@ #include <vcl/dllapi.h> #include <tools/rtti.hxx> +#include <o3tl/typed_flags_set.hxx> #define EXC_RSCNOTLOADED ((sal_uInt16)0x0100) #define EXC_SYSTEM ((sal_uInt16)0x0300) @@ -31,14 +32,22 @@ #define EXC_MAJORTYPE ((sal_uInt16)0xFF00) #define EXC_MINORTYPE ((sal_uInt16)0x00FF) -#define VCL_INPUT_MOUSE 0x0001 -#define VCL_INPUT_KEYBOARD 0x0002 -#define VCL_INPUT_PAINT 0x0004 -#define VCL_INPUT_TIMER 0x0008 -#define VCL_INPUT_OTHER 0x0010 -#define VCL_INPUT_APPEVENT 0x0020 -#define VCL_INPUT_MOUSEANDKEYBOARD (VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD) -#define VCL_INPUT_ANY (VCL_INPUT_MOUSEANDKEYBOARD | VCL_INPUT_PAINT | VCL_INPUT_TIMER | VCL_INPUT_OTHER | VCL_INPUT_APPEVENT) +enum class VclInputFlags { + NONE = 0x0000, + MOUSE = 0x0001, + KEYBOARD = 0x0002, + PAINT = 0x0004, + TIMER = 0x0008, + OTHER = 0x0010, + APPEVENT = 0x0020, +}; +namespace o3tl +{ + template<> struct typed_flags<VclInputFlags> : is_typed_flags<VclInputFlags, 0x003f> {}; +} + +#define VCL_INPUT_MOUSEANDKEYBOARD (VclInputFlags::MOUSE | VclInputFlags::KEYBOARD) +#define VCL_INPUT_ANY (VCL_INPUT_MOUSEANDKEYBOARD | VclInputFlags::PAINT | VclInputFlags::TIMER | VclInputFlags::OTHER | VclInputFlags::APPEVENT) #endif // INCLUDED_VCL_APPTYPES_HXX diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 227f68340907..089c4846fe5e 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -649,7 +649,7 @@ public: @see GetLastInputInterval */ - static bool AnyInput( sal_uInt16 nType = VCL_INPUT_ANY ); + static bool AnyInput( VclInputFlags nType = VCL_INPUT_ANY ); /** The interval from the last time that input was received. diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 7d7eca82fb36..42b5b958f0c2 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -454,7 +454,6 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress } #define CALCMAX 1000 // Berechnungen -#define ABORT_EVENTS (VCL_INPUT_ANY & ~VCL_INPUT_TIMER & ~VCL_INPUT_OTHER) namespace { @@ -683,6 +682,9 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers // Quit if either 1) its duration exceeds 50 ms, or 2) there is any // pending event after processing 32 cells. + VclInputFlags ABORT_EVENTS = VCL_INPUT_ANY; + ABORT_EVENTS &= ~VclInputFlags::TIMER; + ABORT_EVENTS &= ~VclInputFlags::OTHER; if ((50L < tools::Time::GetSystemTicks() - aScope.getStartTime()) || (nCount > 31 && Application::AnyInput(ABORT_EVENTS))) nCount = CALCMAX; } diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx index 1d2ec693ba20..2bdb2b102c96 100644 --- a/sc/source/core/tool/chartlis.cxx +++ b/sc/source/core/tool/chartlis.cxx @@ -594,7 +594,7 @@ void ScChartListenerCollection::StartTimer() IMPL_LINK_NOARG(ScChartListenerCollection, TimerHdl) { - if ( Application::AnyInput( VCL_INPUT_KEYBOARD ) ) + if ( Application::AnyInput( VclInputFlags::KEYBOARD ) ) { aIdle.Start(); return 0; diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index bfb85ca4bf91..588075e76f04 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1916,7 +1916,7 @@ IMPL_LINK_NOARG(ScModule, IdleHandler) IMPL_LINK_NOARG(ScModule, SpellTimerHdl) { - if ( Application::AnyInput( VCL_INPUT_KEYBOARD ) ) + if ( Application::AnyInput( VclInputFlags::KEYBOARD ) ) { aSpellIdle.Start(); return 0; // Later again ... diff --git a/sd/source/ui/tools/IdleDetection.cxx b/sd/source/ui/tools/IdleDetection.cxx index eae76b92d062..df7c23e337f1 100644 --- a/sd/source/ui/tools/IdleDetection.cxx +++ b/sd/source/ui/tools/IdleDetection.cxx @@ -43,7 +43,7 @@ sal_Int32 IdleDetection::GetIdleState (const vcl::Window* pWindow) sal_Int32 IdleDetection::CheckInputPending (void) { - if (Application::AnyInput(VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD | VCL_INPUT_PAINT)) + if (Application::AnyInput(VclInputFlags::MOUSE | VclInputFlags::KEYBOARD | VclInputFlags::PAINT)) return IDET_SYSTEM_EVENT_PENDING; else return IDET_IDLE; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 1670aae75604..5f396ff57fd1 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -809,7 +809,7 @@ void SvtMatchContext_Impl::doExecute() void SvtURLBox::TryAutoComplete() { - if( Application::AnyInput( VCL_INPUT_KEYBOARD ) ) return; + if( Application::AnyInput( VclInputFlags::KEYBOARD ) ) return; OUString aCurText = GetText(); Selection aSelection( GetSelection() ); diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 897dc7eb9695..a3c4e7ca74d0 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -70,7 +70,7 @@ class SwLayAction std::clock_t nStartTicks; // The Action's starting time; if too much time passes the // WaitCrsr can be enabled via CheckWaitCrsr() - sal_uInt16 nInputType; // Which input should terminate processing + VclInputFlags nInputType; // Which input should terminate processing sal_uInt16 nEndPage; // StatBar control sal_uInt16 nCheckPageNum; // CheckPageDesc() was delayed if != USHRT_MAX // check from this page onwards @@ -137,13 +137,13 @@ public: bool IsPaintExtraData() const { return bPaintExtraData;} bool IsInterrupt() const { return IsInput(); } - sal_uInt16 GetInputType() const { return nInputType; } + VclInputFlags GetInputType() const { return nInputType; } // adjusting Action to the wanted behaviour void SetPaint ( bool bNew ) { bPaint = bNew; } void SetComplete ( bool bNew ) { bComplete = bNew; } void SetStatBar ( bool bNew ); - void SetInputType ( sal_uInt16 nNew ) { nInputType = nNew; } + void SetInputType ( VclInputFlags nNew ) { nInputType = nNew; } void SetCalcLayout ( bool bNew ) { bCalcLayout = bNew; } void SetReschedule ( bool bNew ) { bReschedule = bNew; } void SetWaitAllowed ( bool bNew ) { bWaitAllowed = bNew; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 75978819b1cb..71093be75c76 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -113,7 +113,7 @@ void SwLayAction::CheckWaitCrsr() inline void SwLayAction::CheckIdleEnd() { if ( !IsInput() ) - bInput = GetInputType() && Application::AnyInput( GetInputType() ); + bInput = bool(GetInputType()) && Application::AnyInput( GetInputType() ); } void SwLayAction::SetStatBar( bool bNew ) @@ -283,7 +283,7 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) : pWait( 0 ), nPreInvaPage( USHRT_MAX ), nStartTicks( std::clock() ), - nInputType( 0 ), + nInputType( VclInputFlags::NONE ), nEndPage( USHRT_MAX ), nCheckPageNum( USHRT_MAX ) { @@ -308,7 +308,7 @@ void SwLayAction::Reset() { pOptTab = 0; nStartTicks = std::clock(); - nInputType = 0; + nInputType = VclInputFlags::NONE; nEndPage = nPreInvaPage = nCheckPageNum = USHRT_MAX; bPaint = bComplete = bWaitAllowed = bCheckPages = true; bInput = bAgain = bNextCycle = bCalcLayout = bIdle = bReschedule = @@ -1935,7 +1935,7 @@ bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob ) bAllValid = false; if ( aRepaint.HasArea() ) pImp->GetShell()->InvalidateWindows( aRepaint ); - if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VCL_INPUT_OTHER|VCL_INPUT_PAINT ) ) + if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VclInputFlags::OTHER|VclInputFlags::PAINT ) ) return true; break; } @@ -1966,7 +1966,7 @@ bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob ) // #i122885# handle smarttag problems gracefully and provide diagnostics SAL_WARN( "sw.core", "SMART_TAGS Exception:" << e.Message); } - if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VCL_INPUT_OTHER|VCL_INPUT_PAINT ) ) + if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VclInputFlags::OTHER|VclInputFlags::PAINT ) ) return true; break; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 228bbee9089b..9c17966e9282 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3615,7 +3615,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const if ( rRect.IsOver( aPaintRect ) ) { if ( bCnt && pFrm->IsCompletePaint() && - !rRect.IsInside( aPaintRect ) && Application::AnyInput( VCL_INPUT_KEYBOARD ) ) + !rRect.IsInside( aPaintRect ) && Application::AnyInput( VclInputFlags::KEYBOARD ) ) { //fix(8104): It may happen, that the processing wasn't complete //but some parts of the paragraph were still repainted. diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 27ec8a394605..580117f7c05d 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -265,7 +265,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) aAction.SetComplete( false ); if ( mnLockPaint ) aAction.SetPaint( false ); - aAction.SetInputType( VCL_INPUT_KEYBOARD ); + aAction.SetInputType( VclInputFlags::KEYBOARD ); aAction.Action(); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d5e19024189a..f9ed3382493f 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -2409,7 +2409,7 @@ KEYINPUT_CHECKTABLE_INSDEL: comphelper::string::padToLength(aBuf, m_aInBuffer.getLength() + aKeyEvent.GetRepeat() + 1, aCh); m_aInBuffer = aBuf.makeStringAndClear(); - bFlushCharBuffer = Application::AnyInput( VCL_INPUT_KEYBOARD ); + bFlushCharBuffer = Application::AnyInput( VclInputFlags::KEYBOARD ); bFlushBuffer = !bFlushCharBuffer; if( bFlushCharBuffer ) m_aKeyInputFlushTimer.Start(); 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 ) ) |