2 * Copyright (C) 2013 Canonical Ltd
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
19 #ifndef INPUT_STACK_COMPATIBILITY_LAYER_FLAGS_MOTION_H_
20 #define INPUT_STACK_COMPATIBILITY_LAYER_FLAGS_MOTION_H_
27 * Motion event actions.
30 /* Bit shift for the action bits holding the pointer index as
31 * defined by ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_MASK.
33 #define ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
36 /* Bit mask of the parts of the action code that are the action itself.
38 ISCL_MOTION_EVENT_ACTION_MASK
= 0xff,
40 /* Bits in the action code that represent a pointer index, used with
41 * ISCL_MOTION_EVENT_ACTION_POINTER_DOWN and ISCL_MOTION_EVENT_ACTION_POINTER_UP. Shifting
42 * down by ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
43 * index where the data for the pointer going up or down can be found.
45 ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_MASK
= 0xff00,
47 /* A pressed gesture has started, the motion contains the initial starting location.
49 ISCL_MOTION_EVENT_ACTION_DOWN
= 0,
51 /* A pressed gesture has finished, the motion contains the final release location
52 * as well as any intermediate points since the last down or move event.
54 ISCL_MOTION_EVENT_ACTION_UP
= 1,
56 /* A change has happened during a press gesture (between ISCL_MOTION_EVENT_ACTION_DOWN and
57 * ISCL_MOTION_EVENT_ACTION_UP). The motion contains the most recent point, as well as
58 * any intermediate points since the last down or move event.
60 ISCL_MOTION_EVENT_ACTION_MOVE
= 2,
62 /* The current gesture has been aborted.
63 * You will not receive any more points in it. You should treat this as
64 * an up event, but not perform any action that you normally would.
66 ISCL_MOTION_EVENT_ACTION_CANCEL
= 3,
68 /* A movement has happened outside of the normal bounds of the UI element.
69 * This does not provide a full gesture, but only the initial location of the movement/touch.
71 ISCL_MOTION_EVENT_ACTION_OUTSIDE
= 4,
73 /* A non-primary pointer has gone down.
74 * The bits in ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
76 ISCL_MOTION_EVENT_ACTION_POINTER_DOWN
= 5,
78 /* A non-primary pointer has gone up.
79 * The bits in ISCL_MOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
81 ISCL_MOTION_EVENT_ACTION_POINTER_UP
= 6,
83 /* A change happened but the pointer is not down (unlike ISCL_MOTION_EVENT_ACTION_MOVE).
84 * The motion contains the most recent point, as well as any intermediate points since
85 * the last hover move event.
87 ISCL_MOTION_EVENT_ACTION_HOVER_MOVE
= 7,
89 /* The motion event contains relative vertical and/or horizontal scroll offsets.
90 * Use getAxisValue to retrieve the information from ISCL_MOTION_EVENT_AXIS_VSCROLL
91 * and ISCL_MOTION_EVENT_AXIS_HSCROLL.
92 * The pointer may or may not be down when this event is dispatched.
93 * This action is always delivered to the winder under the pointer, which
94 * may not be the window currently touched.
96 ISCL_MOTION_EVENT_ACTION_SCROLL
= 8,
98 /* The pointer is not down but has entered the boundaries of a window or view.
100 ISCL_MOTION_EVENT_ACTION_HOVER_ENTER
= 9,
102 /* The pointer is not down but has exited the boundaries of a window or view.
104 ISCL_MOTION_EVENT_ACTION_HOVER_EXIT
= 10,
108 * Motion event flags.
112 /* This flag indicates that the window that received this motion event is partly
113 * or wholly obscured by another visible window above it. This flag is set to true
114 * even if the event did not directly pass through the obscured area.
115 * A security sensitive application can check this flag to identify situations in which
116 * a malicious application may have covered up part of its content for the purpose
117 * of misleading the user or hijacking touches. An appropriate response might be
118 * to drop the suspect touches or to take additional precautions to confirm the user's
121 ISCL_MOTION_EVENT_FLAG_WINDOW_IS_OBSCURED
= 0x1,
125 * Motion event edge touch flags.
129 /* No edges intersected */
130 ISCL_MOTION_EVENT_EDGE_FLAG_NONE
= 0,
132 /* Flag indicating the motion event intersected the top edge of the screen. */
133 ISCL_MOTION_EVENT_EDGE_FLAG_TOP
= 0x01,
135 /* Flag indicating the motion event intersected the bottom edge of the screen. */
136 ISCL_MOTION_EVENT_EDGE_FLAG_BOTTOM
= 0x02,
138 /* Flag indicating the motion event intersected the left edge of the screen. */
139 ISCL_MOTION_EVENT_EDGE_FLAG_LEFT
= 0x04,
141 /* Flag indicating the motion event intersected the right edge of the screen. */
142 ISCL_MOTION_EVENT_EDGE_FLAG_RIGHT
= 0x08
149 #endif // INPUT_STACK_COMPATIBILITY_LAYER_FLAGS_MOTION_H_