Program Listing for File toolkit_event.h

Return to documentation for file (include/miral/miral/toolkit_event.h)

/*
 * Copyright © Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 or 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MIRAL_TOOLKIT_EVENT_H_
#define MIRAL_TOOLKIT_EVENT_H_

#include <mir_toolkit/events/enums.h>

#include <xkbcommon/xkbcommon.h>

struct MirEvent;
struct MirKeyboardEvent;
struct MirTouchEvent;
struct MirPointerEvent;
struct MirInputEvent;

typedef int32_t MirTouchId;

namespace miral
{
namespace toolkit
{
MirEventType mir_event_get_type(MirEvent const* event);

MirInputEvent const* mir_event_get_input_event(MirEvent const* event);

// * Retrieves the device id responsible for generating an input event.
// *
// * \param [in] event The input event
// * \return           The id of the generating device
// */
//MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* event);

int64_t mir_input_event_get_event_time(MirInputEvent const* event);

MirInputEventType mir_input_event_get_type(MirInputEvent const* event);

MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* event);

MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* event);

MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* event);

MirEvent const* mir_input_event_get_event(MirInputEvent const* event);

MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const* event);

xkb_keysym_t mir_keyboard_event_keysym(MirKeyboardEvent const* event);

int mir_keyboard_event_scan_code(MirKeyboardEvent const* event);

char const* mir_keyboard_event_key_text(MirKeyboardEvent const* event);

MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const* event);

MirInputEvent const* mir_keyboard_event_input_event(MirKeyboardEvent const* event);

MirInputEventModifiers mir_touch_event_modifiers(MirTouchEvent const* event);

unsigned int mir_touch_event_point_count(MirTouchEvent const* event);

MirTouchId mir_touch_event_id(MirTouchEvent const* event, unsigned int touch_index);

MirTouchAction mir_touch_event_action(MirTouchEvent const* event, unsigned int touch_index);

MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const* event, unsigned int touch_index);


float mir_touch_event_axis_value(MirTouchEvent const* event, unsigned int touch_index, MirTouchAxis axis);

MirInputEvent const* mir_touch_event_input_event(MirTouchEvent const* event);


MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const* event);

MirPointerAction mir_pointer_event_action(MirPointerEvent const* event);

bool mir_pointer_event_button_state(MirPointerEvent const* event,
    MirPointerButton button);

MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* event);

float mir_pointer_event_axis_value(MirPointerEvent const* event,
    MirPointerAxis axis);

MirInputEvent const* mir_pointer_event_input_event(MirPointerEvent const* event);
}
}

#endif //MIRAL_TOOLKIT_EVENT_H_