summaryrefslogtreecommitdiffstats
path: root/client/glz_decoder.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-03-02 15:41:08 +0100
committerAlexander Larsson <alexl@redhat.com>2010-03-08 19:45:27 +0100
commitc0fdcd1a10d0eae92fec9e00382b445d669c7428 (patch)
tree590429cdba9b115c90e5beaec90f1981ed513121 /client/glz_decoder.cpp
parent04b35fe7ff6b09885a2af9ef8627b45b892e3fb0 (diff)
downloadspice-c0fdcd1a10d0eae92fec9e00382b445d669c7428.tar.gz
spice-c0fdcd1a10d0eae92fec9e00382b445d669c7428.tar.xz
spice-c0fdcd1a10d0eae92fec9e00382b445d669c7428.zip
Make canvas Glz decoder integration nicer
We use a dynamic interface similar to e.g. SpiceImageCache instead of passing both function and opaque
Diffstat (limited to 'client/glz_decoder.cpp')
-rw-r--r--client/glz_decoder.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/glz_decoder.cpp b/client/glz_decoder.cpp
index 0453aaae..30eecc14 100644
--- a/client/glz_decoder.cpp
+++ b/client/glz_decoder.cpp
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2009 Red Hat, Inc.
@@ -19,12 +20,25 @@
#include "glz_decoder_config.h"
#include "glz_decoder.h"
+static void op_decode (SpiceGlzDecoder *decoder,
+ uint8_t *data,
+ SpicePalette *plt,
+ void *usr_data)
+{
+ GlzDecoder* _decoder = static_cast<GlzDecoder*>(decoder);
+ _decoder->decode(data, plt, usr_data);
+}
+
GlzDecoder::GlzDecoder(GlzDecoderWindow &images_window,
GlzDecodeHandler &usr_handler, GlzDecoderDebug &debug_calls)
: _images_window (images_window)
, _usr_handler (usr_handler)
, _debug_calls (debug_calls)
{
+ static SpiceGlzDecoderOps decoder_ops = {
+ op_decode,
+ };
+ ops = &decoder_ops;
}
GlzDecoder::~GlzDecoder()