diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-15 11:10:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-19 16:25:28 +0000 |
commit | 45cf94410091478a09cc1eadc1b5510a5548ad15 (patch) | |
tree | 4b0a16ecdf1595099fa62c2a3b792863ebe83ec4 /include | |
parent | 75bc77bb35f46f8035edbf945f25f62148c518a7 (diff) |
Resolves: fdo#32664 pass keyboard media keys through to the OS
if we didn't make use of them.
(cherry picked from commit 508c020cf5f7999f0c23d972133f9b6bf85de245)
Conflicts:
sw/source/uibase/docvw/edtwin.cxx
vcl/osx/salinst.cxx
vcl/win/source/window/salframe.cxx
Change-Id: Iee1c2fef5966a614b068c832bf8c6b51973b4c8a
Reviewed-on: https://gerrit.libreoffice.org/13993
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/cmdevt.hxx | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx index 439e9692d9e4..623356b9c876 100644 --- a/include/vcl/cmdevt.hxx +++ b/include/vcl/cmdevt.hxx @@ -270,10 +270,7 @@ class VCL_DLLPUBLIC CommandDialogData int GetDialogId() const { return m_nDialogId; } }; - // Media Commands - - #define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner. #define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner. #define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide. @@ -297,11 +294,22 @@ class VCL_DLLPUBLIC CommandDialogData #define MEDIA_COMMAND_NEXTTRACK_HOLD ((sal_Int16)21)// Button Right holding pressed. #define MEDIA_COMMAND_PREVIOUSTRACK_HOLD ((sal_Int16)22)// Button Left holding pressed. - +class VCL_DLLPUBLIC CommandMediaData +{ + sal_Int16 m_nMediaId; + bool m_bPassThroughToOS; +public: + CommandMediaData(sal_Int16 nMediaId) + : m_nMediaId(nMediaId) + , m_bPassThroughToOS(true) + { + } + sal_Int16 GetMediaId() const { return m_nMediaId; } + void SetPassThroughToOS(bool bPassThroughToOS) { m_bPassThroughToOS = bPassThroughToOS; } + bool GetPassThroughToOS() const { return m_bPassThroughToOS; } +}; // - CommandSelectionChangeData - - - class VCL_DLLPUBLIC CommandSelectionChangeData { private: @@ -377,7 +385,7 @@ public: const CommandScrollData* GetAutoScrollData() const; const CommandModKeyData* GetModKeyData() const; const CommandDialogData* GetDialogData() const; - sal_Int16 GetMediaCommand() const; + CommandMediaData* GetMediaData() const; const CommandSelectionChangeData* GetSelectionChangeData() const; }; @@ -445,12 +453,12 @@ inline const CommandDialogData* CommandEvent::GetDialogData() const return NULL; } -inline sal_Int16 CommandEvent::GetMediaCommand() const +inline CommandMediaData* CommandEvent::GetMediaData() const { if( mnCommand == COMMAND_MEDIA ) - return *(const sal_Int16*)(mpData); + return (CommandMediaData*)(mpData); else - return 0; + return NULL; } inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const |