diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-08-23 22:22:32 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-08-23 22:33:30 +0300 |
commit | 30ae83c268125383866d47a7ee3e4a5dfcf59f71 (patch) | |
tree | ab52f8ecd7ed9517d70e13b22843b7948f20c9e9 /include | |
parent | 02f6c270e79879188b2be670c6db4feb56bb064e (diff) |
fdo#82577: Handle KeyCode
Put the VCL KeyCode class in the vcl namespace. Avoids clash with the X11
KeyCode typedef.
Change-Id: I624c9d937f7c5f5986d313b6c5f060bd8bb7e028
Diffstat (limited to 'include')
-rw-r--r-- | include/postx.h | 1 | ||||
-rw-r--r-- | include/prex.h | 4 | ||||
-rw-r--r-- | include/svtools/acceleratorexecute.hxx | 6 | ||||
-rw-r--r-- | include/svtools/inettbc.hxx | 2 | ||||
-rw-r--r-- | include/vcl/accel.hxx | 12 | ||||
-rw-r--r-- | include/vcl/event.hxx | 15 | ||||
-rw-r--r-- | include/vcl/keycod.hxx | 15 | ||||
-rw-r--r-- | include/vcl/menu.hxx | 14 | ||||
-rw-r--r-- | include/vcl/split.hxx | 2 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 4 | ||||
-rw-r--r-- | include/vcl/toolbox.hxx | 4 |
11 files changed, 38 insertions, 41 deletions
diff --git a/include/postx.h b/include/postx.h index a55b710e6cea..677af6876627 100644 --- a/include/postx.h +++ b/include/postx.h @@ -27,7 +27,6 @@ /* X Types */ #undef Window #undef Font -#undef KeyCode #undef Region #undef Icon #undef Time diff --git a/include/prex.h b/include/prex.h index 995e829b260f..6a0db3676e66 100644 --- a/include/prex.h +++ b/include/prex.h @@ -31,7 +31,6 @@ #define Icon HIDE_XLIB_Icon /* Types from <X11/X.h> that clash, but we do use. */ -#define KeyCode XLIB_KeyCode #define Region XLIB_Region #define Time XLIB_Time #define Window XLIB_Window @@ -50,9 +49,6 @@ extern "C" { /* From <X11/Intrinsic.h> */ typedef unsigned long Pixel; -#undef KeyCode -#define KeyCode XLIB_KeyCode //undef in intrinsics - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx index e65547ede3e1..20b8a22633f8 100644 --- a/include/svtools/acceleratorexecute.hxx +++ b/include/svtools/acceleratorexecute.hxx @@ -185,7 +185,7 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit Attention: This state does not mean the success state of the corresponding execute. Because its done asynchronous! */ - bool execute(const KeyCode& aKey); + bool execute(const vcl::KeyCode& aKey); bool execute(const css::awt::KeyEvent& aKey); /** search the command for the given key event. @@ -196,8 +196,8 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit OUString findCommand(const ::com::sun::star::awt::KeyEvent& aKey); /** TODO document me */ - static css::awt::KeyEvent st_VCLKey2AWTKey(const KeyCode& aKey); - static KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey); + static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode& aKey); + static vcl::KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey); /** TODO document me */ diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 8bd931e2bec1..82e324887a68 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -45,7 +45,7 @@ friend class SvtURLBox_Impl; bool bNoSelection : 1; bool bIsAutoCompleteEnabled : 1; - SVT_DLLPRIVATE bool ProcessKey( const KeyCode& rCode ); + SVT_DLLPRIVATE bool ProcessKey( const vcl::KeyCode& rCode ); SVT_DLLPRIVATE void TryAutoComplete(); SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl(); DECL_DLLPRIVATE_LINK( AutoCompleteHdl_Impl, void* ); diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx index 362d2c788f3b..2e6e26d3e9d1 100644 --- a/include/vcl/accel.hxx +++ b/include/vcl/accel.hxx @@ -41,7 +41,7 @@ private: Link maSelectHdl; // Will be set by AcceleratorManager - KeyCode maCurKeyCode; + vcl::KeyCode maCurKeyCode; sal_uInt16 mnCurId; sal_uInt16 mnCurRepeat; bool mbIsCancel; @@ -50,10 +50,10 @@ private: SAL_DLLPRIVATE void ImplInit(); SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData ); SAL_DLLPRIVATE void ImplDeleteData(); - SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode, + SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode, bool bEnable, Accelerator* pAutoAccel ); - SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const; + SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const vcl::KeyCode& rKeyCode ) const; protected: SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); @@ -68,17 +68,17 @@ public: virtual void Deactivate(); virtual void Select(); - void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode ); + void InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ); void InsertItem( const ResId& rResId ); sal_uInt16 GetCurItemId() const { return mnCurId; } - const KeyCode& GetCurKeyCode() const { return maCurKeyCode; } + const vcl::KeyCode& GetCurKeyCode() const { return maCurKeyCode; } sal_uInt16 GetCurRepeat() const { return mnCurRepeat; } bool IsCancel() const { return mbIsCancel; } sal_uInt16 GetItemCount() const; sal_uInt16 GetItemId( sal_uInt16 nPos ) const; - KeyCode GetKeyCode( sal_uInt16 nItemId ) const; + vcl::KeyCode GetKeyCode( sal_uInt16 nItemId ) const; Accelerator* GetAccel( sal_uInt16 nItemId ) const; diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx index e43c1b1aa138..9f7ab05f8ecf 100644 --- a/include/vcl/event.hxx +++ b/include/vcl/event.hxx @@ -42,23 +42,20 @@ enum TextDirectionality { TextDirectionality_TopToBottom_RightToLeft }; - -// - KeyEvent - - class VCL_DLLPUBLIC KeyEvent { private: - KeyCode maKeyCode; - sal_uInt16 mnRepeat; + vcl::KeyCode maKeyCode; + sal_uInt16 mnRepeat; sal_Unicode mnCharCode; public: KeyEvent(); - KeyEvent( sal_Unicode nChar, const KeyCode& rKeyCode, + KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); - sal_Unicode GetCharCode() const { return mnCharCode; } - const KeyCode& GetKeyCode() const { return maKeyCode; } + sal_Unicode GetCharCode() const { return mnCharCode; } + const vcl::KeyCode& GetKeyCode() const { return maKeyCode; } sal_uInt16 GetRepeat() const { return mnRepeat; } KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const; @@ -72,7 +69,7 @@ inline KeyEvent::KeyEvent() mnRepeat = 0; } -inline KeyEvent::KeyEvent( sal_Unicode nChar, const KeyCode& rKeyCode, +inline KeyEvent::KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode, sal_uInt16 nRepeat ) : maKeyCode( rKeyCode ) diff --git a/include/vcl/keycod.hxx b/include/vcl/keycod.hxx index 20e80cf02eae..b7e745c365c9 100644 --- a/include/vcl/keycod.hxx +++ b/include/vcl/keycod.hxx @@ -28,6 +28,9 @@ class Window; +namespace vcl +{ + class VCL_DLLPUBLIC KeyCode { private: @@ -76,7 +79,9 @@ public: bool operator !=( const KeyCode& rKeyCode ) const; }; -inline KeyCode::KeyCode( sal_uInt16 nKey, bool bShift, bool bMod1, bool bMod2, bool bMod3 ) +} // namespace vcl + +inline vcl::KeyCode::KeyCode( sal_uInt16 nKey, bool bShift, bool bMod1, bool bMod2, bool bMod3 ) { nCode = nKey; if( bShift ) @@ -90,7 +95,7 @@ inline KeyCode::KeyCode( sal_uInt16 nKey, bool bShift, bool bMod1, bool bMod2, b eFunc = KEYFUNC_DONTKNOW; } -inline bool KeyCode::operator ==( const KeyCode& rKeyCode ) const +inline bool vcl::KeyCode::operator ==( const vcl::KeyCode& rKeyCode ) const { if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) ) return (nCode == rKeyCode.nCode); @@ -98,7 +103,7 @@ inline bool KeyCode::operator ==( const KeyCode& rKeyCode ) const return (GetFunction() == rKeyCode.GetFunction()); } -inline bool KeyCode::operator !=( const KeyCode& rKeyCode ) const +inline bool vcl::KeyCode::operator !=( const vcl::KeyCode& rKeyCode ) const { if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) ) return (nCode != rKeyCode.nCode); @@ -106,14 +111,14 @@ inline bool KeyCode::operator !=( const KeyCode& rKeyCode ) const return (GetFunction() != rKeyCode.GetFunction()); } -inline bool KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const +inline bool vcl::KeyCode::IsDefinedKeyCodeEqual( const vcl::KeyCode& rKeyCode ) const { if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) ) return (GetFullCode() == rKeyCode.GetFullCode()); return (GetFunction() == rKeyCode.GetFunction()); } -inline KeyCode& KeyCode::operator = ( const KeyCode& rKeyCode ) +inline vcl::KeyCode& vcl::KeyCode::operator = ( const vcl::KeyCode& rKeyCode ) { nCode = rKeyCode.nCode; eFunc = rKeyCode.eFunc; diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index d7b3550cfe4d..6642af32ddb6 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -20,13 +20,14 @@ #ifndef INCLUDED_VCL_MENU_HXX #define INCLUDED_VCL_MENU_HXX -#include <tools/solar.h> -#include <vcl/dllapi.h> +#include <rsc/rsc-vcl-shared-types.hxx> +#include <tools/color.hxx> #include <tools/rc.hxx> #include <tools/resid.hxx> -#include <rsc/rsc-vcl-shared-types.hxx> +#include <tools/solar.h> +#include <vcl/dllapi.h> #include <vcl/bitmapex.hxx> -#include <tools/color.hxx> +#include <vcl/keycod.hxx> #include <vcl/vclevent.hxx> #include <com/sun/star/uno/Reference.hxx> @@ -40,7 +41,6 @@ class MenuItemList; class HelpEvent; class Image; class PopupMenu; -class KeyCode; class KeyEvent; class MenuFloatingWindow; class Window; @@ -251,8 +251,8 @@ public: void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ); PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const; - void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ); - KeyCode GetAccelKey( sal_uInt16 nItemId ) const; + void SetAccelKey( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ); + vcl::KeyCode GetAccelKey( sal_uInt16 nItemId ) const; void CheckItem( sal_uInt16 nItemId, bool bCheck = true ); bool IsItemChecked( sal_uInt16 nItemId ) const; diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx index 65cc90ec17e9..ff42f32030b3 100644 --- a/include/vcl/split.hxx +++ b/include/vcl/split.hxx @@ -47,7 +47,7 @@ private: SAL_DLLPRIVATE void ImplDrawSplitter(); SAL_DLLPRIVATE void ImplSplitMousePos( Point& rPos ); SAL_DLLPRIVATE void ImplStartKbdSplitting(); - SAL_DLLPRIVATE void ImplKbdTracking( KeyCode aKeyCode ); + SAL_DLLPRIVATE void ImplKbdTracking( vcl::KeyCode aKeyCode ); SAL_DLLPRIVATE bool ImplSplitterActive(); SAL_DLLPRIVATE Splitter* ImplFindSibling(); SAL_DLLPRIVATE void ImplRestoreSplitter(); diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 8b3ef420b17f..f4b7abc97d2c 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -36,6 +36,7 @@ #include <tools/solar.h> #include <vcl/dllapi.h> #include <vcl/apptypes.hxx> +#include <vcl/keycod.hxx> #include <vcl/vclevent.hxx> #include <vcl/metric.hxx> #include <unotools/localedatawrapper.hxx> @@ -52,7 +53,6 @@ class WorkWindow; class MenuBar; class UnoWrapperBase; class Reflection; -class KeyCode; class NotifyEvent; class KeyEvent; class MouseEvent; @@ -1202,7 +1202,7 @@ public: @see GetReservedKeyCodeCount */ - static const KeyCode* GetReservedKeyCode( sal_uLong i ); + static const vcl::KeyCode* GetReservedKeyCode( sal_uLong i ); ///@} diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index f3328e4fe441..68448933b830 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -223,8 +223,8 @@ private: SAL_DLLPRIVATE bool ImplChangeHighlightUpDn( bool bUp, bool bNoCycle = false ); SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem ); SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine ); - SAL_DLLPRIVATE bool ImplOpenItem( KeyCode aKeyCode ); - SAL_DLLPRIVATE bool ImplActivateItem( KeyCode aKeyCode ); + SAL_DLLPRIVATE bool ImplOpenItem( vcl::KeyCode aKeyCode ); + SAL_DLLPRIVATE bool ImplActivateItem( vcl::KeyCode aKeyCode ); SAL_DLLPRIVATE void ImplShowFocus(); SAL_DLLPRIVATE void ImplHideFocus(); SAL_DLLPRIVATE void ImplUpdateInputEnable(); |