This file is indexed.

/usr/include/mircommon/mir_toolkit/event.h is in mircommon-dev 0.1.8+14.04.20140411-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
 * Copyright © 2013 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Thomas Voss <thomas.voss@canonical.com>
 */

#ifndef MIR_TOOLKIT_EVENT_H_
#define MIR_TOOLKIT_EVENT_H_

#include <stddef.h>
#include <stdint.h>
#include "mir_toolkit/common.h"

#ifdef __cplusplus
/**
 * \addtogroup mir_toolkit
 * @{
 */
extern "C" {
#endif
/* TODO: To the moon. */
#define MIR_INPUT_EVENT_MAX_POINTER_COUNT 16

typedef int64_t nsecs_t;

typedef enum
{
    mir_event_type_key,
    mir_event_type_motion,
    mir_event_type_surface,
    mir_event_type_resize
} MirEventType;

typedef enum {
    mir_key_action_down     = 0,
    mir_key_action_up       = 1,
    mir_key_action_multiple = 2
} MirKeyAction;

typedef enum {
    mir_key_flag_woke_here           = 0x1,
    mir_key_flag_soft_keyboard       = 0x2,
    mir_key_flag_keep_touch_mode     = 0x4,
    mir_key_flag_from_system         = 0x8,
    mir_key_flag_editor_action       = 0x10,
    mir_key_flag_canceled            = 0x20,
    mir_key_flag_virtual_hard_key    = 0x40,
    mir_key_flag_long_press          = 0x80,
    mir_key_flag_canceled_long_press = 0x100,
    mir_key_flag_tracking            = 0x200,
    mir_key_flag_fallback            = 0x400
} MirKeyFlag;

typedef enum {
    mir_key_modifier_none        = 0,
    mir_key_modifier_alt         = 0x02,
    mir_key_modifier_alt_left    = 0x10,
    mir_key_modifier_alt_right   = 0x20,
    mir_key_modifier_shift       = 0x01,
    mir_key_modifier_shift_left  = 0x40,
    mir_key_modifier_shift_right = 0x80,
    mir_key_modifier_sym         = 0x04,
    mir_key_modifier_function    = 0x08,
    mir_key_modifier_ctrl        = 0x1000,
    mir_key_modifier_ctrl_left   = 0x2000,
    mir_key_modifier_ctrl_right  = 0x4000,
    mir_key_modifier_meta        = 0x10000,
    mir_key_modifier_meta_left   = 0x20000,
    mir_key_modifier_meta_right  = 0x40000,
    mir_key_modifier_caps_lock   = 0x100000,
    mir_key_modifier_num_lock    = 0x200000,
    mir_key_modifier_scroll_lock = 0x400000
} MirKeyModifier;

typedef enum {
    mir_motion_action_down         = 0,
    mir_motion_action_up           = 1,
    mir_motion_action_move         = 2,
    mir_motion_action_cancel       = 3,
    mir_motion_action_outside      = 4,
    mir_motion_action_pointer_down = 5,
    mir_motion_action_pointer_up   = 6,
    mir_motion_action_hover_move   = 7,
    mir_motion_action_scroll       = 8,
    mir_motion_action_hover_enter  = 9,
    mir_motion_action_hover_exit   = 10
} MirMotionAction;

typedef enum {
    mir_motion_flag_window_is_obscured = 0x1
} MirMotionFlag;

typedef enum {
    mir_motion_button_primary   = 1 << 0,
    mir_motion_button_secondary = 1 << 1,
    mir_motion_button_tertiary  = 1 << 2,
    mir_motion_button_back      = 1 << 3,
    mir_motion_button_forward   = 1 << 4
} MirMotionButton;

typedef enum {
   mir_motion_tool_type_unknown = 0,
   mir_motion_tool_type_finger  = 1,
   mir_motion_tool_type_stylus  = 2,
   mir_motion_tool_type_mouse   = 3,
   mir_motion_tool_type_eraser  = 4
} MirMotionToolType;

typedef struct
{
    MirEventType type;

    int32_t device_id;
    int32_t source_id;
    MirKeyAction action;
    MirKeyFlag flags;
    unsigned int modifiers;

    int32_t key_code;
    int32_t scan_code;
    int32_t repeat_count;
    nsecs_t down_time;
    nsecs_t event_time;
    int is_system_key;
} MirKeyEvent;

typedef struct
{
    MirEventType type;

    int32_t device_id;
    int32_t source_id;
    /*
     * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
     * encodes some non enumerable values in it. It's convenient to keep things
     * this way for now until we can drop SF/Hybris support in QtUbuntu.
     */
    int action;
    MirMotionFlag flags;
    unsigned int modifiers;

    int32_t edge_flags;
    MirMotionButton button_state;
    float x_offset;
    float y_offset;
    float x_precision;
    float y_precision;
    nsecs_t down_time;
    nsecs_t event_time;

    size_t pointer_count;
    struct
    {
        int id;
        float x, raw_x;
        float y, raw_y;
        float touch_major;
        float touch_minor;
        float size;
        float pressure;
        float orientation;
        float vscroll;
        float hscroll;
        MirMotionToolType tool_type;

        int unused1;
        int unused2;
        int unused3;
    } pointer_coordinates[MIR_INPUT_EVENT_MAX_POINTER_COUNT];

    int unused0;
    int unused1;
    int unused2;
    int unused3;
} MirMotionEvent;

typedef struct
{
    MirEventType type;

    int id;
    MirSurfaceAttrib attrib;
    int value;
} MirSurfaceEvent;

typedef struct
{
    MirEventType type;

    int surface_id;
    int width;
    int height;
} MirResizeEvent;

typedef union
{
    MirEventType    type;
    MirKeyEvent     key;
    MirMotionEvent  motion;
    MirSurfaceEvent surface;
    MirResizeEvent  resize;
} MirEvent;

#ifdef __cplusplus
}
/**@}*/
#endif

#endif /* MIR_TOOLKIT_EVENT_H_ */