diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-10-24 16:59:30 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-11-27 14:27:18 +0100 |
commit | 6f798ba1f75360e6c66260b0ac2de76efa0a7d1d (patch) | |
tree | 7cea10af758345cf11475b018b0b36d5488f36b3 /server/spice-input.h | |
parent | d26604ce65ff51e2820a27e16b62a2eb17ab994d (diff) | |
download | spice-6f798ba1f75360e6c66260b0ac2de76efa0a7d1d.tar.gz spice-6f798ba1f75360e6c66260b0ac2de76efa0a7d1d.tar.xz spice-6f798ba1f75360e6c66260b0ac2de76efa0a7d1d.zip |
Split spice.h
Make it easier to read the Spice server API.
Diffstat (limited to 'server/spice-input.h')
-rw-r--r-- | server/spice-input.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/server/spice-input.h b/server/spice-input.h new file mode 100644 index 00000000..dc07c4fe --- /dev/null +++ b/server/spice-input.h @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2009-2014 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.1 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/>. + */ + +#ifndef SPICE_INPUT_H_ +#define SPICE_INPUT_H_ + +#if !defined(SPICE_H_INSIDE) && !defined(SPICE_SERVER_INTERNAL) +#error "Only spice.h can be included directly." +#endif + +#include "spice-core.h" + +/* input interfaces */ + +#define SPICE_INTERFACE_KEYBOARD "keyboard" +#define SPICE_INTERFACE_KEYBOARD_MAJOR 1 +#define SPICE_INTERFACE_KEYBOARD_MINOR 1 +typedef struct SpiceKbdInterface SpiceKbdInterface; +typedef struct SpiceKbdInstance SpiceKbdInstance; +typedef struct SpiceKbdState SpiceKbdState; + +struct SpiceKbdInterface { + SpiceBaseInterface base; + + void (*push_scan_freg)(SpiceKbdInstance *sin, uint8_t frag); + uint8_t (*get_leds)(SpiceKbdInstance *sin); +}; + +struct SpiceKbdInstance { + SpiceBaseInstance base; + SpiceKbdState *st; +}; + +int spice_server_kbd_leds(SpiceKbdInstance *sin, int leds); + +#define SPICE_INTERFACE_MOUSE "mouse" +#define SPICE_INTERFACE_MOUSE_MAJOR 1 +#define SPICE_INTERFACE_MOUSE_MINOR 1 +typedef struct SpiceMouseInterface SpiceMouseInterface; +typedef struct SpiceMouseInstance SpiceMouseInstance; +typedef struct SpiceMouseState SpiceMouseState; + +struct SpiceMouseInterface { + SpiceBaseInterface base; + + void (*motion)(SpiceMouseInstance *sin, int dx, int dy, int dz, + uint32_t buttons_state); + void (*buttons)(SpiceMouseInstance *sin, uint32_t buttons_state); +}; + +struct SpiceMouseInstance { + SpiceBaseInstance base; + SpiceMouseState *st; +}; + +#define SPICE_INTERFACE_TABLET "tablet" +#define SPICE_INTERFACE_TABLET_MAJOR 1 +#define SPICE_INTERFACE_TABLET_MINOR 1 +typedef struct SpiceTabletInterface SpiceTabletInterface; +typedef struct SpiceTabletInstance SpiceTabletInstance; +typedef struct SpiceTabletState SpiceTabletState; + +struct SpiceTabletInterface { + SpiceBaseInterface base; + + void (*set_logical_size)(SpiceTabletInstance* tablet, int width, int height); + void (*position)(SpiceTabletInstance* tablet, int x, int y, uint32_t buttons_state); + void (*wheel)(SpiceTabletInstance* tablet, int wheel_moution, uint32_t buttons_state); + void (*buttons)(SpiceTabletInstance* tablet, uint32_t buttons_state); +}; + +struct SpiceTabletInstance { + SpiceBaseInstance base; + SpiceTabletState *st; +}; + +#endif /* SPICE_INPUT_H_ */ |