Mir
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);
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 
43 
44 MirTouchTooltype mir_tool_type_from_android(int32_t android_tooltype);
45 int32_t android_tool_type_from_mir(MirTouchTooltype mir_tooltype);
46 
49 
50 bool android_source_id_is_pointer_device(int32_t source_id);
51 
54 int32_t extract_android_action_from(MirEvent const& ev);
55 
56 }
57 }
58 }
59 
60 #endif // MIR_INPUT_EVENT_CONVERSION_HELPERS_H_
MirInputEventModifiers mir_modifiers_from_android(int32_t android_modifiers)
All things Mir.
Definition: atomic_callback.h:25
MirTouchTooltype mir_tool_type_from_android(int32_t android_tooltype)
int32_t android_pointer_action_from_mir(MirPointerAction action, MirPointerButtons buttons_pressed)
int32_t extract_android_action_from(MirEvent const &ev)
int32_t android_keyboard_action_from_mir(int32_t &repeat_count_out, MirKeyboardAction action)
MirPointerAction mir_pointer_action_from_masked_android(int32_t android_action)
MirPointerAction
Possible pointer actions.
Definition: pointer_event.h:40
int32_t extract_masked_android_action_from(MirEvent const &ev)
MirPointerButtons mir_pointer_buttons_from_android(int32_t android_state)
MirKeyboardAction
Possible actions for changing key state.
Definition: keyboard_event.h:46
unsigned int MirInputEventModifiers
Definition: input_event.h:66
bool android_source_id_is_pointer_device(int32_t source_id)
MirKeyboardAction mir_keyboard_action_from_android(int32_t android_action, int32_t repeat_count)
int32_t android_modifiers_from_mir(MirInputEventModifiers modifiers)
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_event.h:78
unsigned int MirPointerButtons
Definition: pointer_event.h:85
MirTouchAction mir_touch_action_from_masked_android(int32_t android_action)
int32_t android_tool_type_from_mir(MirTouchTooltype mir_tooltype)
int32_t android_pointer_buttons_from_mir(MirPointerButtons buttons)
Definition: android_input_receiver.h:36
MirTouchAction
Possible per touch actions for state changing.
Definition: touch_event.h:45
Definition: event.h:30

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016