diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-03-11 12:14:44 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-03-18 10:23:52 +0100 |
commit | 7c1c66a10e7741f021178a10298c89ee867cbc13 (patch) | |
tree | af30c0c6e95851621fa6b66e91a9735d1a1bccbb | |
parent | 457693fcfac7c178bdc9ca23295aa52d815ea0d6 (diff) |
new libspice api: spice_server_add_renderer()
-rw-r--r-- | server/reds.c | 15 | ||||
-rw-r--r-- | server/spice.h | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c index f8320fc..3f3ada4 100644 --- a/server/reds.c +++ b/server/reds.c @@ -79,6 +79,7 @@ static int spice_port = -1; static int spice_secure_port = -1; static char spice_addr[256]; static int spice_family = PF_UNSPEC; +static char *default_renderer = "cairo"; static int ticketing_enabled = 1; //Ticketing is enabled by default static pthread_mutex_t *lock_cs; @@ -5436,7 +5437,9 @@ int spice_server_init(SpiceServer *s, CoreInterface *core) { ASSERT(reds == s); do_spice_init(core); - red_dispatcher_add_renderer("cairo"); + if (default_renderer) { + red_dispatcher_add_renderer(default_renderer); + } return 0; } @@ -5581,6 +5584,16 @@ int spice_server_set_mouse_absolute(SpiceServer *s, int absolute) return 0; } +int spice_server_add_renderer(SpiceServer *s, const char *name) +{ + ASSERT(reds == s); + if (!red_dispatcher_add_renderer(name)) { + return -1; + } + default_renderer = NULL; + return 0; +} + int spice_server_add_interface(SpiceServer *s, VDInterface *interface) { ASSERT(reds == s); diff --git a/server/spice.h b/server/spice.h index c309c50..beba61c 100644 --- a/server/spice.h +++ b/server/spice.h @@ -84,4 +84,6 @@ int spice_server_set_channel_security(SpiceServer *s, int spice_server_set_mouse_absolute(SpiceServer *s, int absolute); +int spice_server_add_renderer(SpiceServer *s, const char *name); + #endif |