2016-05-03 03:27:57 +00:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Red Hat inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Author: Jonas Ådahl <jadahl@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
|
|
|
|
#define __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2016-06-16 23:39:56 +00:00
|
|
|
#include "clutter-device-manager.h"
|
|
|
|
|
2016-05-03 03:27:57 +00:00
|
|
|
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE (clutter_virtual_input_device_get_type ())
|
2016-07-11 16:39:32 +00:00
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-05-03 03:27:57 +00:00
|
|
|
G_DECLARE_DERIVABLE_TYPE (ClutterVirtualInputDevice,
|
|
|
|
clutter_virtual_input_device,
|
|
|
|
CLUTTER, VIRTUAL_INPUT_DEVICE,
|
|
|
|
GObject)
|
|
|
|
|
|
|
|
typedef enum _ClutterButtonState
|
|
|
|
{
|
|
|
|
CLUTTER_BUTTON_STATE_RELEASED,
|
|
|
|
CLUTTER_BUTTON_STATE_PRESSED
|
|
|
|
} ClutterButtonState;
|
|
|
|
|
|
|
|
typedef enum _ClutterKeyState
|
|
|
|
{
|
|
|
|
CLUTTER_KEY_STATE_RELEASED,
|
|
|
|
CLUTTER_KEY_STATE_PRESSED
|
|
|
|
} ClutterKeyState;
|
|
|
|
|
|
|
|
struct _ClutterVirtualInputDeviceClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
void (*notify_relative_motion) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double dx,
|
|
|
|
double dy);
|
|
|
|
|
|
|
|
void (*notify_absolute_motion) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
|
|
|
void (*notify_button) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t button,
|
|
|
|
ClutterButtonState button_state);
|
|
|
|
|
|
|
|
void (*notify_key) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t key,
|
|
|
|
ClutterKeyState key_state);
|
2016-07-20 16:00:56 +00:00
|
|
|
void (*notify_keyval) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t keyval,
|
|
|
|
ClutterKeyState key_state);
|
2016-08-23 07:39:02 +00:00
|
|
|
|
|
|
|
void (*notify_discrete_scroll) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
ClutterScrollDirection direction,
|
|
|
|
ClutterScrollSource scroll_source);
|
2018-01-29 06:21:11 +00:00
|
|
|
|
|
|
|
void (*notify_scroll_continuous) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double dx,
|
|
|
|
double dy,
|
|
|
|
ClutterScrollSource scroll_source,
|
|
|
|
ClutterScrollFinishFlags finish_flags);
|
|
|
|
|
|
|
|
void (*notify_touch_down) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
|
|
|
void (*notify_touch_motion) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
|
|
|
void (*notify_touch_up) (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot);
|
2016-05-03 03:27:57 +00:00
|
|
|
};
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-05-03 03:27:57 +00:00
|
|
|
void clutter_virtual_input_device_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double dx,
|
|
|
|
double dy);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-05-03 03:27:57 +00:00
|
|
|
void clutter_virtual_input_device_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-05-03 03:27:57 +00:00
|
|
|
void clutter_virtual_input_device_notify_button (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t button,
|
|
|
|
ClutterButtonState button_state);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-05-03 03:27:57 +00:00
|
|
|
void clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t key,
|
|
|
|
ClutterKeyState key_state);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-07-20 16:00:56 +00:00
|
|
|
void clutter_virtual_input_device_notify_keyval (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
uint32_t keyval,
|
|
|
|
ClutterKeyState key_state);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-08-23 07:39:02 +00:00
|
|
|
void clutter_virtual_input_device_notify_discrete_scroll (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
ClutterScrollDirection direction,
|
|
|
|
ClutterScrollSource scroll_source);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2018-01-29 06:21:11 +00:00
|
|
|
void clutter_virtual_input_device_notify_scroll_continuous (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
double dx,
|
|
|
|
double dy,
|
|
|
|
ClutterScrollSource scroll_source,
|
|
|
|
ClutterScrollFinishFlags finish_flags);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2018-01-29 06:21:11 +00:00
|
|
|
void clutter_virtual_input_device_notify_touch_down (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2018-01-29 06:21:11 +00:00
|
|
|
void clutter_virtual_input_device_notify_touch_motion (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot,
|
|
|
|
double x,
|
|
|
|
double y);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2018-01-29 06:21:11 +00:00
|
|
|
void clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *virtual_device,
|
|
|
|
uint64_t time_us,
|
|
|
|
int slot);
|
2016-08-23 07:39:02 +00:00
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2016-06-16 23:39:56 +00:00
|
|
|
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
|
|
|
|
2016-06-22 09:38:00 +00:00
|
|
|
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
|
|
|
|
|
2016-05-03 03:27:57 +00:00
|
|
|
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
|