4
* Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
5
* Copyright (C) 2009-2010 Daniel P. Berrange <dan@berrange.com>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.0 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
#ifndef VNC_FRAMEBUFFER_H
23
#define VNC_FRAMEBUFFER_H
25
#include <glib-object.h>
27
#include <vncpixelformat.h>
28
#include <vnccolormap.h>
32
#define VNC_TYPE_FRAMEBUFFER (vnc_framebuffer_get_type ())
33
#define VNC_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VNC_TYPE_FRAMEBUFFER, VncFramebuffer))
34
#define VNC_IS_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VNC_TYPE_FRAMEBUFFER))
35
#define VNC_FRAMEBUFFER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), VNC_TYPE_FRAMEBUFFER, VncFramebufferInterface))
38
typedef struct _VncFramebuffer VncFramebuffer; /* Dummy object */
39
typedef struct _VncFramebufferInterface VncFramebufferInterface;
41
struct _VncFramebufferInterface {
42
GTypeInterface parent;
44
guint16 (*get_width)(VncFramebuffer *fb);
45
guint16 (*get_height)(VncFramebuffer *fb);
46
int (*get_rowstride)(VncFramebuffer *fb);
47
guint8 *(*get_buffer)(VncFramebuffer *fb);
48
const VncPixelFormat *(*get_local_format)(VncFramebuffer *fb);
49
const VncPixelFormat *(*get_remote_format)(VncFramebuffer *fb);
50
gboolean (*perfect_format_match)(VncFramebuffer *fb);
52
void (*set_pixel_at)(VncFramebuffer *fb,
53
guint8 *src, /* One remote pixel */
54
guint16 x, guint16 y);
55
void (*fill)(VncFramebuffer *fb,
56
guint8 *src, /* One remote pixel */
58
guint16 width, guint16 height);
59
void (*copyrect)(VncFramebuffer *fb,
60
guint16 srcx, guint16 srcy,
61
guint16 dstx, guint16 dsty,
62
guint16 width, guint16 height);
63
void (*blt)(VncFramebuffer *fb,
64
guint8 *src, /* Remote pixel array */
67
guint16 width, guint16 height);
68
void (*rgb24_blt)(VncFramebuffer *fb,
69
guint8 *src, /* rgb24 pixel array */
72
guint16 width, guint16 height);
73
void (*set_color_map)(VncFramebuffer *fb,
76
/* Do not add fields to this struct */
79
GType vnc_framebuffer_get_type(void) G_GNUC_CONST;
82
guint16 vnc_framebuffer_get_width(VncFramebuffer *fb);
83
guint16 vnc_framebuffer_get_height(VncFramebuffer *fb);
84
int vnc_framebuffer_get_rowstride(VncFramebuffer *fb);
86
guint8 *vnc_framebuffer_get_buffer(VncFramebuffer *fb);
88
const VncPixelFormat *vnc_framebuffer_get_local_format(VncFramebuffer *fb);
89
const VncPixelFormat *vnc_framebuffer_get_remote_format(VncFramebuffer *fb);
90
gboolean vnc_framebuffer_perfect_format_match(VncFramebuffer *fb);
92
void vnc_framebuffer_set_pixel_at(VncFramebuffer *fb,
93
guint8 *src, /* One remote pixel */
94
guint16 x, guint16 y);
96
void vnc_framebuffer_fill(VncFramebuffer *fb,
97
guint8 *src, /* One remote pixel */
99
guint16 width, guint16 height);
101
void vnc_framebuffer_copyrect(VncFramebuffer *fb,
102
guint16 srcx, guint16 srcy,
103
guint16 dstx, guint16 dsty,
104
guint16 width, guint16 height);
106
void vnc_framebuffer_blt(VncFramebuffer *fb,
107
guint8 *src, /* Remote pixel array */
109
guint16 x, guint16 y,
110
guint16 width, guint16 height);
112
void vnc_framebuffer_rgb24_blt(VncFramebuffer *fb,
113
guint8 *src, /* rgb24 pixel array */
115
guint16 x, guint16 y,
116
guint16 width, guint16 height);
118
void vnc_framebuffer_set_color_map(VncFramebuffer *fb,
124
#endif /* VNC_FRAMEBUFFER_H */