summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/Makefile.am2
-rw-r--r--client/application.cpp6
-rw-r--r--client/canvas.h1
-rw-r--r--client/glz_decoder.h2
-rw-r--r--client/jpeg_decoder.h2
-rw-r--r--client/red_canvas_base.h26
-rw-r--r--client/red_gdi_canvas.cpp6
-rw-r--r--client/red_gdi_canvas.h4
-rw-r--r--client/red_gl_canvas.cpp6
-rw-r--r--client/red_gl_canvas.h5
-rw-r--r--client/red_sw_canvas.cpp6
-rw-r--r--client/red_sw_canvas.h4
-rw-r--r--client/windows/redc.vcproj8
-rw-r--r--client/zlib_decoder.h2
-rw-r--r--common/Makefile.am20
-rw-r--r--common/canvas_base.c4
-rw-r--r--common/canvas_base.h3
-rw-r--r--common/gdi_canvas.c5
-rw-r--r--common/gdi_canvas.h4
-rw-r--r--common/gl_canvas.c5
-rw-r--r--common/gl_canvas.h4
-rw-r--r--common/sw_canvas.c4
-rw-r--r--common/sw_canvas.h4
-rw-r--r--server/Makefile.am10
-rw-r--r--server/red_dispatcher.c4
-rw-r--r--server/red_worker.c4
-rw-r--r--server/reds_gl_canvas.c24
-rw-r--r--server/reds_gl_canvas.h27
-rw-r--r--server/reds_sw_canvas.c24
-rw-r--r--server/reds_sw_canvas.h26
30 files changed, 218 insertions, 34 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index 627bd8a7..2508267e 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -77,6 +77,7 @@ spicec_SOURCES = \
process_loop.h \
read_write_mutex.h \
record_channel.cpp \
+ red_canvas_base.h \
red_channel.cpp \
red_channel.h \
red_client.cpp \
@@ -208,7 +209,6 @@ endif
INCLUDES = \
- -DSW_CANVAS_CACHE \
-D__STDC_LIMIT_MACROS \
-I$(top_srcdir)/client/x11 \
-I$(top_srcdir)/common \
diff --git a/client/application.cpp b/client/application.cpp
index 292dae6a..9e2c7e19 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -31,8 +31,10 @@
#include "red_gdi_canvas.h"
#endif
#include "platform.h"
-#include "sw_canvas.h"
-#include "gl_canvas.h"
+#include "red_sw_canvas.h"
+#ifdef USE_OGL
+#include "red_gl_canvas.h"
+#endif
#include "quic.h"
#include "mutex.h"
#include "cmd_line_parser.h"
diff --git a/client/canvas.h b/client/canvas.h
index 4844c314..0b8f2b65 100644
--- a/client/canvas.h
+++ b/client/canvas.h
@@ -25,7 +25,6 @@
#include "messages.h"
#include "cache.hpp"
#include "shared_cache.hpp"
-#include "canvas_base.h"
#include "canvas_utils.h"
#include "glz_decoded_image.h"
#include "glz_decoder.h"
diff --git a/client/glz_decoder.h b/client/glz_decoder.h
index f046f8c8..35b0a3ed 100644
--- a/client/glz_decoder.h
+++ b/client/glz_decoder.h
@@ -22,7 +22,7 @@
#include "lz_common.h"
#include "glz_decoder_config.h"
#include "glz_decoder_window.h"
-#include "canvas_base.h"
+#include "red_canvas_base.h"
class GlzDecodeHandler {
public:
diff --git a/client/jpeg_decoder.h b/client/jpeg_decoder.h
index bd83b2e4..34aa3362 100644
--- a/client/jpeg_decoder.h
+++ b/client/jpeg_decoder.h
@@ -20,7 +20,7 @@
#define _H_JPEG_DECODER
#include "common.h"
-#include "canvas_base.h"
+#include "red_canvas_base.h"
#ifdef WIN32
/* We need some hacks to avoid warnings from the jpeg headers */
diff --git a/client/red_canvas_base.h b/client/red_canvas_base.h
new file mode 100644
index 00000000..bd59109c
--- /dev/null
+++ b/client/red_canvas_base.h
@@ -0,0 +1,26 @@
+/*
+ Copyright (C) 2011 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 _H_RED_CANVAS_BASE
+#define _H_RED_CANVAS_BASE
+
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
+#include "canvas_base.h"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
+#endif
diff --git a/client/red_gdi_canvas.cpp b/client/red_gdi_canvas.cpp
index 72b31df3..2e0b4538 100644
--- a/client/red_gdi_canvas.cpp
+++ b/client/red_gdi_canvas.cpp
@@ -23,6 +23,12 @@
#include "region.h"
#include "red_pixmap_gdi.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
+#include "gdi_canvas.c"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
GDICanvas::GDICanvas(int width, int height, uint32_t format,
PixmapCache& pixmap_cache, PaletteCache& palette_cache,
GlzDecoderWindow &glz_decoder_window, CSurfaces &csurfaces)
diff --git a/client/red_gdi_canvas.h b/client/red_gdi_canvas.h
index 643f3c6c..76de12bc 100644
--- a/client/red_gdi_canvas.h
+++ b/client/red_gdi_canvas.h
@@ -19,7 +19,11 @@
#define _H_GDICANVAS
#include "canvas.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
#include "gdi_canvas.h"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
#include "red_pixmap_gdi.h"
class RedPixmap;
diff --git a/client/red_gl_canvas.cpp b/client/red_gl_canvas.cpp
index d7841b94..db47aafa 100644
--- a/client/red_gl_canvas.cpp
+++ b/client/red_gl_canvas.cpp
@@ -24,6 +24,12 @@
#include "red_pixmap_gl.h"
#include <GL/glx.h>
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
+#include "gl_canvas.c"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
GCanvas::GCanvas(int width, int height, uint32_t format, RedWindow *win,
RenderType rendertype,
PixmapCache& pixmap_cache, PaletteCache& palette_cache,
diff --git a/client/red_gl_canvas.h b/client/red_gl_canvas.h
index 02609586..83e6512a 100644
--- a/client/red_gl_canvas.h
+++ b/client/red_gl_canvas.h
@@ -19,8 +19,13 @@
#define _H_GCANVAS
#include "canvas.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
#include "sw_canvas.h"
#include "gl_canvas.h"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
#include "red_pixmap_gl.h"
#include "red_window.h"
diff --git a/client/red_sw_canvas.cpp b/client/red_sw_canvas.cpp
index b580e61d..fec6605e 100644
--- a/client/red_sw_canvas.cpp
+++ b/client/red_sw_canvas.cpp
@@ -25,6 +25,12 @@
#include "region.h"
#include "red_pixmap_sw.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
+#include "sw_canvas.c"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
SCanvas::SCanvas(bool onscreen,
int width, int height, uint32_t format, RedWindow *win,
PixmapCache& pixmap_cache, PaletteCache& palette_cache,
diff --git a/client/red_sw_canvas.h b/client/red_sw_canvas.h
index ebac7109..2f807c7e 100644
--- a/client/red_sw_canvas.h
+++ b/client/red_sw_canvas.h
@@ -20,7 +20,11 @@
#define _H_CCANVAS
#include "canvas.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_CACHE
#include "sw_canvas.h"
+#undef SW_CANVAS_CACHE
+#undef SPICE_CANVAS_INTERNAL
class RedPixmap;
diff --git a/client/windows/redc.vcproj b/client/windows/redc.vcproj
index 0b1ecbf1..70eb1708 100644
--- a/client/windows/redc.vcproj
+++ b/client/windows/redc.vcproj
@@ -413,10 +413,6 @@
>
</File>
<File
- RelativePath="..\..\common\gdi_canvas.c"
- >
- </File>
- <File
RelativePath="..\generated_demarshallers.cpp"
>
</File>
@@ -637,10 +633,6 @@
>
</File>
<File
- RelativePath="..\..\common\sw_canvas.c"
- >
- </File>
- <File
RelativePath="..\threads.cpp"
>
</File>
diff --git a/client/zlib_decoder.h b/client/zlib_decoder.h
index 44440402..c91ed494 100644
--- a/client/zlib_decoder.h
+++ b/client/zlib_decoder.h
@@ -20,7 +20,7 @@
#define _H_ZLIB_DECODER
#include "common.h"
-#include "canvas_base.h"
+#include "red_canvas_base.h"
#ifndef __GNUC__
#define ZLIB_WINAPI
diff --git a/common/Makefile.am b/common/Makefile.am
index 0a2f9c16..501a6e15 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -6,7 +6,6 @@ NULL =
noinst_LTLIBRARIES = libspice-common.la
libspice_common_la_SOURCES = \
- canvas_base.h \
canvas_utils.c \
canvas_utils.h \
draw.h \
@@ -34,21 +33,10 @@ libspice_common_la_SOURCES = \
rop3.c \
rop3.h \
spice_common.h \
- sw_canvas.c \
- sw_canvas.h \
- $(NULL)
-
-if OS_WIN32
-libspice_common_la_SOURCES += \
- gdi_canvas.h \
- gdi_canvas.c \
$(NULL)
-endif
if SUPPORT_GL
libspice_common_la_SOURCES += \
- gl_canvas.h \
- gl_canvas.c \
gl_utils.h \
glc.h \
glc.c \
@@ -58,7 +46,6 @@ libspice_common_la_SOURCES += \
endif
INCLUDES = \
- -DSW_CANVAS_IMAGE_CACHE \
$(GL_CFLAGS) \
$(PIXMAN_CFLAGS) \
$(PROTOCOL_CFLAGS) \
@@ -69,6 +56,13 @@ INCLUDES = \
EXTRA_DIST = \
canvas_base.c \
+ canvas_base.h \
+ gdi_canvas.c \
+ gdi_canvas.h \
+ gl_canvas.c \
+ gl_canvas.h \
+ sw_canvas.c \
+ sw_canvas.h \
lz_compress_tmpl.c \
lz_decompress_tmpl.c \
quic_family_tmpl.c \
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 4dedfcf4..fe650feb 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -16,6 +16,10 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This file shouldn't be compiled directly"
+#endif
+
#include <stdarg.h>
#include <stdlib.h>
#include <setjmp.h>
diff --git a/common/canvas_base.h b/common/canvas_base.h
index ff0f972e..7c5f2755 100644
--- a/common/canvas_base.h
+++ b/common/canvas_base.h
@@ -19,6 +19,9 @@
#ifndef _H_CANVAS_BASE
#define _H_CANVAS_BASE
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This header shouldn't be included directly"
+#endif
#include "pixman_utils.h"
#include "lz.h"
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index 360e6bf1..27f644c1 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -16,6 +16,11 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This file shouldn't be compiled directly"
+#endif
+
#include <windows.h>
#include <wingdi.h>
#include "gdi_canvas.h"
diff --git a/common/gdi_canvas.h b/common/gdi_canvas.h
index 86be9e17..af5b2296 100644
--- a/common/gdi_canvas.h
+++ b/common/gdi_canvas.h
@@ -19,6 +19,10 @@
#ifndef _H__GDI_CANVAS
#define _H__GDI_CANVAS
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This header shouldn't be included directly"
+#endif
+
#include <stdint.h>
#ifdef __cplusplus
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 9867c4f2..844fc07e 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -16,11 +16,14 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This file shouldn't be compiled directly"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "gl_canvas.h"
#include "quic.h"
#include "rop3.h"
#include "region.h"
diff --git a/common/gl_canvas.h b/common/gl_canvas.h
index 67763791..40b67139 100644
--- a/common/gl_canvas.h
+++ b/common/gl_canvas.h
@@ -20,6 +20,10 @@
#include "canvas_base.h"
#include "region.h"
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This header shouldn't be included directly"
+#endif
+
#ifndef _H__GL_CANVAS
#define _H__GL_CANVAS
diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index 95ec292f..e1b13e0b 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -16,6 +16,10 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This file shouldn't be compiled directly"
+#endif
+
#include <math.h>
#include "sw_canvas.h"
#define CANVAS_USE_PIXMAN
diff --git a/common/sw_canvas.h b/common/sw_canvas.h
index 54655262..d8d26a97 100644
--- a/common/sw_canvas.h
+++ b/common/sw_canvas.h
@@ -19,6 +19,10 @@
#ifndef _H__CANVAS
#define _H__CANVAS
+#ifndef SPICE_CANVAS_INTERNAL
+#error "This header shouldn't be included directly"
+#endif
+
#include <stdint.h>
#include "draw.h"
diff --git a/server/Makefile.am b/server/Makefile.am
index 73a886fd..81649a4f 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -6,7 +6,6 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/common \
-DRED_STATISTICS \
- -DSW_CANVAS_IMAGE_CACHE \
$(Z_LIBS) \
$(CELT051_CFLAGS) \
$(PIXMAN_CFLAGS) \
@@ -89,6 +88,8 @@ libspice_server_la_SOURCES = \
red_worker.h \
reds.c \
reds.h \
+ reds_sw_canvas.c \
+ reds_sw_canvas.h \
snd_worker.c \
snd_worker.h \
spice-experimental.h \
@@ -105,6 +106,13 @@ libspice_server_la_SOURCES += \
$(NULL)
endif
+if SUPPORT_GL
+libspice_server_la_SOURCES += \
+ reds_gl_canvas.c \
+ reds_gl_canvas.h \
+ $(NULL)
+endif
+
if SUPPORT_SMARTCARD
libspice_server_la_SOURCES += \
smartcard.c \
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 06924580..c5cac589 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -28,9 +28,9 @@
#include "spice.h"
#include "red_worker.h"
#include "quic.h"
-#include "sw_canvas.h"
+#include "reds_sw_canvas.h"
#ifdef USE_OGL
-#include "gl_canvas.h"
+#include "reds_gl_canvas.h"
#endif // USE_OGL
#include "reds.h"
#include "red_dispatcher.h"
diff --git a/server/red_worker.c b/server/red_worker.c
index 49dffb47..8082139b 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -36,9 +36,9 @@
#include "region.h"
#include <spice/protocol.h>
#include "red_worker.h"
-#include "sw_canvas.h"
+#include "reds_sw_canvas.h"
#ifdef USE_OGL
-#include "gl_canvas.h"
+#include "reds_gl_canvas.h"
#include "ogl_ctx.h"
#endif /* USE_OGL */
#include "quic.h"
diff --git a/server/reds_gl_canvas.c b/server/reds_gl_canvas.c
new file mode 100644
index 00000000..4855a203
--- /dev/null
+++ b/server/reds_gl_canvas.c
@@ -0,0 +1,24 @@
+/*
+ Copyright (C) 2011 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/>.
+*/
+#include "config.h"
+
+#include "reds_gl_canvas.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_IMAGE_CACHE
+#include "gl_canvas.c"
+#undef SW_CANVAS_IMAGE_CACHE
+#undef SPICE_CANVAS_INTERNAL
diff --git a/server/reds_gl_canvas.h b/server/reds_gl_canvas.h
new file mode 100644
index 00000000..c20cca50
--- /dev/null
+++ b/server/reds_gl_canvas.h
@@ -0,0 +1,27 @@
+/*
+ Copyright (C) 2011 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 _H_REDS_GL_CANVAS
+#define _H_REDS_GL_CANVAS
+
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_IMAGE_CACHE
+#include "gl_canvas.h"
+#undef SW_CANVAS_IMAGE_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
+#endif
diff --git a/server/reds_sw_canvas.c b/server/reds_sw_canvas.c
new file mode 100644
index 00000000..428a9dce
--- /dev/null
+++ b/server/reds_sw_canvas.c
@@ -0,0 +1,24 @@
+/*
+ Copyright (C) 2011 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/>.
+*/
+#include "config.h"
+
+#include "reds_sw_canvas.h"
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_IMAGE_CACHE
+#include "sw_canvas.c"
+#undef SW_CANVAS_IMAGE_CACHE
+#undef SPICE_CANVAS_INTERNAL
diff --git a/server/reds_sw_canvas.h b/server/reds_sw_canvas.h
new file mode 100644
index 00000000..00e61562
--- /dev/null
+++ b/server/reds_sw_canvas.h
@@ -0,0 +1,26 @@
+/*
+ Copyright (C) 2011 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 _H_REDS_SW_CANVAS
+#define _H_REDS_SW_CANVAS
+
+#define SPICE_CANVAS_INTERNAL
+#define SW_CANVAS_IMAGE_CACHE
+#include "sw_canvas.h"
+#undef SW_CANVAS_IMAGE_CACHE
+#undef SPICE_CANVAS_INTERNAL
+
+#endif