diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-14 12:00:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-14 12:00:41 +0200 |
commit | 68041a0546fc6a05608411365c8382937aafac79 (patch) | |
tree | c0676833d41c491956c71b946f7c69ca0a34f734 /vcl | |
parent | 741d9990bf9d9dfcba1166a12ffb1d846c912181 (diff) |
convert INPUTCONTEXT_ constants to scoped enum
Change-Id: I5b99e42a3e85527b27d515c468d2ed66386fc9df
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/osx/salframe.h | 2 | ||||
-rw-r--r-- | vcl/inc/salwtype.hxx | 10 | ||||
-rw-r--r-- | vcl/osx/salframe.cxx | 6 | ||||
-rw-r--r-- | vcl/osx/salframeview.mm | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 4 |
10 files changed, 22 insertions, 28 deletions
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 4db73fb84c56..b030d3934ee5 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -90,7 +90,7 @@ public: Rectangle maInvalidRect; - sal_uLong mnICOptions; + InputContextFlags mnICOptions; // To prevent display sleep during presentation IOPMAssertionID mnAssertionID; diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index c20c45442b3a..b464b5c27131 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -30,6 +30,7 @@ class SalObject; namespace vcl { class Window; } class FontSelectPattern; +enum class InputContextFlags; // - SalEvent - @@ -266,18 +267,11 @@ struct SalFrameState // - SalInputContext - -// Have to match DEFINEs in inputctx.hxx, as these are not converted -#define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008) -#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010) - struct SalInputContext { FontSelectPattern* mpFont; LanguageType meLanguage; - sal_uLong mnOptions; + InputContextFlags mnOptions; }; struct SalSwipeEvent diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index b23b3e64ff75..af1327f3d568 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -76,7 +76,7 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) : mePointerStyle( POINTER_ARROW ), mnTrackingRectTag( 0 ), mrClippingPath( 0 ), - mnICOptions( 0 ) + mnICOptions( InputContextFlags::NONE ) { maSysData.nSize = sizeof( SystemEnvData ); @@ -919,13 +919,13 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext ) { if (!pContext) { - mnICOptions = 0; + mnICOptions = InputContextFlags::NONE; return; } mnICOptions = pContext->mnOptions; - if(!(pContext->mnOptions & SAL_INPUTCONTEXT_TEXT)) + if(!(pContext->mnOptions & InputContextFlags::Text)) return; } diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 2867295bbc6f..8036a0f11f9e 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -1684,7 +1684,7 @@ private: #if OSL_DEBUG_LEVEL > 1 // fprintf( stderr, "SalFrameView: doCommandBySelector %s\n", (char*)aSelector ); #endif - if( (mpFrame->mnICOptions & SAL_INPUTCONTEXT_TEXT) != 0 && + if( (mpFrame->mnICOptions & InputContextFlags::Text) && aSelector != NULL && [self respondsToSelector: aSelector] ) { [self performSelector: aSelector]; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index c64228210d00..3ff87466a41f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1943,7 +1943,7 @@ void Edit::GetFocus() Invalidate(); } - SetInputContext( InputContext( GetFont(), !IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + SetInputContext( InputContext( GetFont(), !IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } Control::GetFocus(); diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 7311148bacf8..a7259326762c 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -210,7 +210,7 @@ void TextEngine::SetFont( const vcl::Font& rFont ) for ( sal_uInt16 nView = mpViews->size(); nView; ) { TextView* pView = (*mpViews)[ --nView ]; - pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } } } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index a3758ec304b8..691fba86b2ac 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -208,7 +208,7 @@ TextView::TextView( TextEngine* pEng, vcl::Window* pWindow ) : mpImpl->mpCursor = new vcl::Cursor; mpImpl->mpCursor->Show(); pWindow->SetCursor( mpImpl->mpCursor ); - pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) ); + pWindow->SetInputContext( InputContext( pEng->GetFont(), InputContextFlags::Text|InputContextFlags::ExtText ) ); if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT ) mpImpl->mbHighlightSelection = true; @@ -1227,7 +1227,7 @@ void TextView::SetReadOnly( bool bReadOnly ) else HideCursor(); - GetWindow()->SetInputContext( InputContext( mpImpl->mpTextEngine->GetFont(), bReadOnly ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + GetWindow()->SetInputContext( InputContext( mpImpl->mpTextEngine->GetFont(), bReadOnly ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } } diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 610314a9c384..4f428dcdec2b 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2463,13 +2463,13 @@ void X11SalFrame::Sync() void X11SalFrame::SetInputContext( SalInputContext* pContext ) { - if (pContext == NULL) + if (pContext == NULL) return; - // 1. We should create an input context for this frame - // only when SAL_INPUTCONTEXT_TEXT is set. + // 1. We should create an input context for this frame + // only when InputContextFlags::Text is set. - if (!(pContext->mnOptions & SAL_INPUTCONTEXT_TEXT)) + if (!(pContext->mnOptions & InputContextFlags::Text)) { if( mpInputContext ) mpInputContext->Unmap( this ); @@ -2477,9 +2477,9 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) } // 2. We should use on-the-spot inputstyle - // only when SAL_INPUTCONTEXT_EXTTEXTINPUT is set. + // only when InputContextFlags::ExtTExt is set. - if (mpInputContext == NULL) + if (mpInputContext == NULL) { vcl::I18NStatus& rStatus( vcl::I18NStatus::get() ); rStatus.setParent( this ); @@ -2490,10 +2490,10 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) if (mbInputFocus) mpInputContext->SetICFocus( this ); } - } + } else mpInputContext->Map( this ); - return; + return; } void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags ) diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 7fea4a9c60dc..8ca6a53da0ac 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -2915,7 +2915,7 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext ) if( ! pContext ) return; - if( ! (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) ) + if( ! (pContext->mnOptions & InputContextFlags::Text) ) return; // create a new im context diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 999cb660544c..fae12e695f06 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2219,7 +2219,7 @@ void WinSalFrame::Sync() static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext ) { WinSalFrame* pFrame = GetWindowPtr( hWnd ); - bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0; + bool bIME(pContext->mnOptions & InputContextFlags::Text); if ( bIME ) { if ( !pFrame->mbIME ) @@ -2238,7 +2238,7 @@ static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pCont // When the application can't handle IME messages, then the // System should handle the IME handling - if ( !(pContext->mnOptions & SAL_INPUTCONTEXT_EXTTEXTINPUT) ) + if ( !(pContext->mnOptions & InputContextFlags::ExtText) ) pFrame->mbHandleIME = FALSE; // Set the Font for IME Handling |