/usr/include/mirclient/mir_toolkit/events/input/pointer_event.h is in libmirclient-dev 0.26.3+16.04.20170605-0ubuntu1.1.
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 | /*
* Copyright © 2015 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: Robert Carr <robert.carr@canonical.com>
*/
#ifndef MIR_TOOLKIT_POINTER_EVENT_H_
#define MIR_TOOLKIT_POINTER_EVENT_H_
#include <stdbool.h>
#ifdef __cplusplus
/**
* \addtogroup mir_toolkit
* @{
*/
extern "C" {
#endif
/**
* An event type describing a change in pointer device state.
*/
typedef struct MirPointerEvent MirPointerEvent;
/**
* Possible pointer actions
*/
typedef enum {
/* A pointer button has come up */
mir_pointer_action_button_up = 0,
/* A pointer button has gone down */
mir_pointer_action_button_down = 1,
/* The pointer has entered the surface to which this event was delivered */
mir_pointer_action_enter = 2,
/* The pointer has left the surface to which this event was delivered */
mir_pointer_action_leave = 3,
/* Axis values have changed for the pointer */
mir_pointer_action_motion = 4,
mir_pointer_actions
} MirPointerAction;
/**
* Identifiers for pointer axis
*/
typedef enum {
/* Absolute axis containing the x coordinate of the pointer */
mir_pointer_axis_x = 0,
/* Absolute axis containing the y coordinate of the pointer */
mir_pointer_axis_y = 1,
/* Relative axis containing ticks reported by the vertical scroll wheel */
mir_pointer_axis_vscroll = 2,
/* Relative axis containing ticks reported by the horizontal scroll wheel */
mir_pointer_axis_hscroll = 3,
/* Relative axis containing the last reported x differential from the pointer */
mir_pointer_axis_relative_x = 4,
/* Relative axis containing the last reported y differential from the pointer */
mir_pointer_axis_relative_y = 5,
mir_pointer_axes
} MirPointerAxis;
/*
* Identifiers for pointer buttons
*/
typedef enum {
mir_pointer_button_primary = 1 << 0,
mir_pointer_button_secondary = 1 << 1,
mir_pointer_button_tertiary = 1 << 2,
mir_pointer_button_back = 1 << 3,
mir_pointer_button_forward = 1 << 4,
mir_pointer_button_side = 1 << 5,
mir_pointer_button_extra = 1 << 6,
mir_pointer_button_task = 1 << 7
} MirPointerButton;
typedef unsigned int MirPointerButtons;
/**
* Retrieve the modifier keys pressed when the pointer action occured.
*
* \param [in] event The pointer event
* \return The modifier mask
*/
MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const* event);
/**
* Retrieve the action which occured to generate a given pointer event.
*
* \param [in] event The pointer event
* \return Action performed by the pointer
*/
MirPointerAction mir_pointer_event_action(MirPointerEvent const* event);
/**
* Retrieve the state of a given pointer button when the action occurred.
*
* \param [in] event The pointer event
* \param [in] button The button to check
*
* \return Whether the given button is depressed
*/
bool mir_pointer_event_button_state(MirPointerEvent const* event,
MirPointerButton button);
/**
* Retreive the pointer button state as a masked set of values.
*
* \param [in] event The pointer event
*
* \return The button state
*/
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* event);
/**
* Retrieve the axis value reported by a given pointer event.
*
* \param [in] event The pointer event
* \param [in] axis The axis to retreive a value from
* \return The value of the given axis
*/
float mir_pointer_event_axis_value(MirPointerEvent const* event,
MirPointerAxis axis);
/**
* Retrieve the corresponding input event.
*
* \param [in] event The pointer event
* \return The input event
*/
MirInputEvent const* mir_pointer_event_input_event(MirPointerEvent const* event);
#ifdef __cplusplus
}
/**@}*/
#endif
#endif /* MIR_TOOLKIT_POINTER_EVENT_H_ */
|