mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-01 13:10:43 +00:00
These functions were implementing the same stuff as empty messages functions provided by RedChannel so reuse them. The implementation seems a bit different but the result is the same. Specifically: - RedEmptyMsgPipeItem::msg is int while RedVerbItem::verb was uint16_t however this data goes into the message type which is uint16_t (a 16 bit on the network protocol); - red_channel_client_send_empty_msg calls red_channel_client_begin_send_message while red_marshall_verb does not. However red_marshall_verb is called only by cursor_channel_send_item and dcc_send_item which always calls red_channel_client_begin_send_message. Note that in dcc_send_item when an empty message is sent red_channel_client_send_message_pending always returns true; - when a PipeItem is created red_channel_client_pipe_add_empty_msg calls red_channel_client_push while red_pipe_add_verb does not. This actually make very little difference as this kind of item are never removed from the queue and a push is forced in every case running the event handler for the stream watch (see prepare_pipe_add and red_channel_client_event). Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
76 lines
2.5 KiB
C
76 lines
2.5 KiB
C
/*
|
|
Copyright (C) 2009-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.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 _COMMON_GRAPHICS_CHANNEL_H
|
|
#define _COMMON_GRAPHICS_CHANNEL_H
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include "red-channel.h"
|
|
#include "red-channel-client.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
int common_channel_config_socket(RedChannelClient *rcc);
|
|
|
|
#define COMMON_CLIENT_TIMEOUT (NSEC_PER_SEC * 30)
|
|
|
|
#define TYPE_COMMON_GRAPHICS_CHANNEL common_graphics_channel_get_type()
|
|
|
|
#define COMMON_GRAPHICS_CHANNEL(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_COMMON_GRAPHICS_CHANNEL, CommonGraphicsChannel))
|
|
#define COMMON_GRAPHICS_CHANNEL_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), TYPE_COMMON_GRAPHICS_CHANNEL, CommonGraphicsChannelClass))
|
|
#define COMMON_IS_GRAPHICS_CHANNEL(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_COMMON_GRAPHICS_CHANNEL))
|
|
#define COMMON_IS_GRAPHICS_CHANNEL_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_COMMON_GRAPHICS_CHANNEL))
|
|
#define COMMON_GRAPHICS_CHANNEL_GET_CLASS(obj) \
|
|
(G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_COMMON_GRAPHICS_CHANNEL, CommonGraphicsChannelClass))
|
|
|
|
typedef struct CommonGraphicsChannel CommonGraphicsChannel;
|
|
typedef struct CommonGraphicsChannelClass CommonGraphicsChannelClass;
|
|
typedef struct CommonGraphicsChannelPrivate CommonGraphicsChannelPrivate;
|
|
|
|
struct CommonGraphicsChannel
|
|
{
|
|
RedChannel parent;
|
|
|
|
CommonGraphicsChannelPrivate *priv;
|
|
};
|
|
|
|
struct CommonGraphicsChannelClass
|
|
{
|
|
RedChannelClass parent_class;
|
|
};
|
|
|
|
GType common_graphics_channel_get_type(void) G_GNUC_CONST;
|
|
|
|
void common_graphics_channel_set_during_target_migrate(CommonGraphicsChannel *self, gboolean value);
|
|
gboolean common_graphics_channel_get_during_target_migrate(CommonGraphicsChannel *self);
|
|
QXLInstance* common_graphics_channel_get_qxl(CommonGraphicsChannel *self);
|
|
|
|
enum {
|
|
RED_PIPE_ITEM_TYPE_INVAL_ONE = RED_PIPE_ITEM_TYPE_CHANNEL_BASE,
|
|
|
|
RED_PIPE_ITEM_TYPE_COMMON_LAST
|
|
};
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* _COMMON_GRAPHICS_CHANNEL_H */
|