spice/server/cursor-channel.h
Marc-André Lureau f99fac0f42 server: start separate display/cursor channel headers
Just move some declarations around

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-23 16:32:47 +01:00

80 lines
2.1 KiB
C

/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2009 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 CURSOR_CHANNEL_H_
# define CURSOR_CHANNEL_H_
#include "red_worker.h"
#include "stat.h"
#define CLIENT_CURSOR_CACHE_SIZE 256
#define CURSOR_CACHE_HASH_SHIFT 8
#define CURSOR_CACHE_HASH_SIZE (1 << CURSOR_CACHE_HASH_SHIFT)
#define CURSOR_CACHE_HASH_MASK (CURSOR_CACHE_HASH_SIZE - 1)
#define CURSOR_CACHE_HASH_KEY(id) ((id) & CURSOR_CACHE_HASH_MASK)
typedef struct CursorItem {
uint32_t group_id;
int refs;
RedCursorCmd *red_cursor;
} CursorItem;
typedef struct CursorPipeItem {
PipeItem base;
CursorItem *cursor_item;
int refs;
} CursorPipeItem;
typedef struct LocalCursor {
CursorItem base;
SpicePoint16 position;
uint32_t data_size;
SpiceCursor red_cursor;
} LocalCursor;
typedef struct CursorChannelClient {
CommonChannelClient common;
CacheItem *cursor_cache[CURSOR_CACHE_HASH_SIZE];
Ring cursor_cache_lru;
long cursor_cache_available;
uint32_t cursor_cache_items;
} CursorChannelClient;
typedef struct CursorChannel {
CommonChannel common; // Must be the first thing
#ifdef RED_STATISTICS
StatNodeRef stat;
#endif
} CursorChannel;
typedef struct _CursorItem _CursorItem;
struct _CursorItem {
union {
CursorItem cursor_item;
_CursorItem *next;
} u;
};
G_STATIC_ASSERT(sizeof(CursorItem) <= QXL_CURSUR_DEVICE_DATA_SIZE);
#endif /* CURSOR_CHANNEL_H_ */