Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
src
include
common
mir
input
android
event_conversion_helpers.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2015 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Robert Carr <robert.carr@canonical.com>
17
*/
18
19
#ifndef MIR_INPUT_EVENT_CONVERSION_HELPERS_H_
20
#define MIR_INPUT_EVENT_CONVERSION_HELPERS_H_
21
22
#include "
mir_toolkit/event.h
"
23
24
namespace
mir
25
{
26
namespace
input
27
{
28
namespace
android
29
{
30
MirInputEventModifiers
mir_modifiers_from_android
(int32_t android_modifiers);
31
int32_t
android_modifiers_from_mir
(
MirInputEventModifiers
modifiers);
32
33
MirKeyboardAction
mir_keyboard_action_from_android
(int32_t android_action, int32_t repeat_count);
34
// Mir differentiates between mir_keyboard_action_down
35
// and mir_keyboard_action_repeat whereas android encodes
36
// keyrepeats as AKEY_EVENT_ACTION_DOWN and a repeatCount of > 0
37
// Thus when converting from MirKeyboardAction to an android
38
// action we must also fetch a repeat count for the android event.
39
int32_t
android_keyboard_action_from_mir
(int32_t& repeat_count_out,
MirKeyboardAction
action);
40
41
MirPointerButtons
mir_pointer_buttons_from_android
(int32_t android_state);
42
int32_t
android_pointer_buttons_from_mir
(
MirPointerButtons
buttons);
43
44
MirTouchTooltype
mir_tool_type_from_android
(int32_t android_tooltype);
45
int32_t
android_tool_type_from_mir
(
MirTouchTooltype
mir_tooltype);
46
47
MirPointerAction
mir_pointer_action_from_masked_android
(int32_t android_action);
48
MirTouchAction
mir_touch_action_from_masked_android
(int32_t android_action);
49
50
bool
android_source_id_is_pointer_device
(int32_t source_id);
51
52
int32_t
android_pointer_action_from_mir
(
MirPointerAction
action,
MirPointerButtons
buttons_pressed);
53
int32_t
extract_masked_android_action_from
(
MirEvent
const
& ev);
54
int32_t
extract_android_action_from
(
MirEvent
const
& ev);
55
56
}
57
}
58
}
59
60
#endif // MIR_INPUT_EVENT_CONVERSION_HELPERS_H_
mir::input::android::mir_modifiers_from_android
MirInputEventModifiers mir_modifiers_from_android(int32_t android_modifiers)
mir
All things Mir.
Definition:
atomic_callback.h:25
mir::input::android::mir_tool_type_from_android
MirTouchTooltype mir_tool_type_from_android(int32_t android_tooltype)
mir::input::android::android_pointer_action_from_mir
int32_t android_pointer_action_from_mir(MirPointerAction action, MirPointerButtons buttons_pressed)
mir::input::android::extract_android_action_from
int32_t extract_android_action_from(MirEvent const &ev)
mir::input::android::android_keyboard_action_from_mir
int32_t android_keyboard_action_from_mir(int32_t &repeat_count_out, MirKeyboardAction action)
mir::input::android::mir_pointer_action_from_masked_android
MirPointerAction mir_pointer_action_from_masked_android(int32_t android_action)
MirPointerAction
MirPointerAction
Possible pointer actions.
Definition:
pointer_event.h:40
mir::input::android::extract_masked_android_action_from
int32_t extract_masked_android_action_from(MirEvent const &ev)
mir::input::android::mir_pointer_buttons_from_android
MirPointerButtons mir_pointer_buttons_from_android(int32_t android_state)
MirKeyboardAction
MirKeyboardAction
Possible actions for changing key state.
Definition:
keyboard_event.h:46
MirInputEventModifiers
unsigned int MirInputEventModifiers
Definition:
input_event.h:66
event.h
mir::input::android::android_source_id_is_pointer_device
bool android_source_id_is_pointer_device(int32_t source_id)
mir::input::android::mir_keyboard_action_from_android
MirKeyboardAction mir_keyboard_action_from_android(int32_t android_action, int32_t repeat_count)
mir::input::android::android_modifiers_from_mir
int32_t android_modifiers_from_mir(MirInputEventModifiers modifiers)
MirTouchTooltype
MirTouchTooltype
Identifiers for per-touch tool types.
Definition:
touch_event.h:78
MirPointerButtons
unsigned int MirPointerButtons
Definition:
pointer_event.h:85
mir::input::android::mir_touch_action_from_masked_android
MirTouchAction mir_touch_action_from_masked_android(int32_t android_action)
mir::input::android::android_tool_type_from_mir
int32_t android_tool_type_from_mir(MirTouchTooltype mir_tooltype)
mir::input::android::android_pointer_buttons_from_mir
int32_t android_pointer_buttons_from_mir(MirPointerButtons buttons)
android
Definition:
android_input_receiver.h:36
MirTouchAction
MirTouchAction
Possible per touch actions for state changing.
Definition:
touch_event.h:45
MirEvent
Definition:
event.h:30
Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016