spice/server/inputs-channel-client.h
Frediano Ziglio afc4171c98 red-channel: Use RedChannelCapabilities directly to pass capabilities
For each channel there are two set of capabilities, one
for the common ones and one for the specific ones.
A single set were almost always passed using 2 arguments,
a number of elements and an array but then before using
these were converted to a GArray.
Use a single structure (already available) to pass all
channel capabilites using a single argument.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-02 15:34:58 +00:00

83 lines
3.0 KiB
C

/*
Copyright (C) 2009-2015 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 _INPUTS_CHANNEL_CLIENT_H_
#define _INPUTS_CHANNEL_CLIENT_H_
#include <glib-object.h>
#include "red-channel-client.h"
#include "inputs-channel.h"
G_BEGIN_DECLS
#define TYPE_INPUTS_CHANNEL_CLIENT inputs_channel_client_get_type()
#define INPUTS_CHANNEL_CLIENT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_INPUTS_CHANNEL_CLIENT, InputsChannelClient))
#define INPUTS_CHANNEL_CLIENT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), TYPE_INPUTS_CHANNEL_CLIENT, InputsChannelClientClass))
#define IS_INPUTS_CHANNEL_CLIENT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_INPUTS_CHANNEL_CLIENT))
#define IS_INPUTS_CHANNEL_CLIENT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_INPUTS_CHANNEL_CLIENT))
#define INPUTS_CHANNEL_CLIENT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_INPUTS_CHANNEL_CLIENT, InputsChannelClientClass))
typedef struct InputsChannelClient InputsChannelClient;
typedef struct InputsChannelClientClass InputsChannelClientClass;
typedef struct InputsChannelClientPrivate InputsChannelClientPrivate;
struct InputsChannelClient
{
RedChannelClient parent;
InputsChannelClientPrivate *priv;
};
struct InputsChannelClientClass
{
RedChannelClientClass parent_class;
};
GType inputs_channel_client_get_type(void) G_GNUC_CONST;
RedChannelClient* inputs_channel_client_create(RedChannel *channel,
RedClient *client,
RedsStream *stream,
int monitor_latency,
RedChannelCapabilities *caps);
uint16_t inputs_channel_client_get_motion_count(InputsChannelClient* self);
/* only for migration */
void inputs_channel_client_set_motion_count(InputsChannelClient* self, uint16_t count);
void inputs_channel_client_on_mouse_motion(InputsChannelClient* self);
void inputs_channel_client_send_migrate_data(RedChannelClient *rcc,
SpiceMarshaller *m, RedPipeItem *item);
void inputs_channel_client_handle_migrate_data(InputsChannelClient *icc, uint16_t motion_count);
G_END_DECLS
enum {
RED_PIPE_ITEM_INPUTS_INIT = RED_PIPE_ITEM_TYPE_CHANNEL_BASE,
RED_PIPE_ITEM_MOUSE_MOTION_ACK,
RED_PIPE_ITEM_KEY_MODIFIERS,
RED_PIPE_ITEM_MIGRATE_DATA,
};
#endif /* _INPUTS_CHANNEL_CLIENT_H_ */