From: Christophe Fergeau <cfergeau@xxxxxxxxxx> --- server/reds.c | 43 +++++++++++++++++++++++++++++++++++++++++++ server/reds.h | 11 +++++++++++ 2 files changed, 54 insertions(+) diff --git a/server/reds.c b/server/reds.c index 7006420..51092eb 100644 --- a/server/reds.c +++ b/server/reds.c @@ -4084,6 +4084,49 @@ void reds_core_watch_remove(RedsState *reds, SpiceWatch *watch) reds->core->watch_remove(watch); } +SpiceTimer *reds_core_timer_add(RedsState *reds, + SpiceTimerFunc func, + void *opaque) +{ + g_return_val_if_fail(reds != NULL, NULL); + g_return_val_if_fail(reds->core != NULL, NULL); + g_return_val_if_fail(reds->core->timer_add != NULL, NULL); + + return reds->core->timer_add(reds->core, func, opaque); + +} + +void reds_core_timer_start(RedsState *reds, + SpiceTimer *timer, + uint32_t ms) +{ + g_return_if_fail(reds != NULL); + g_return_if_fail(reds->core != NULL); + g_return_if_fail(reds->core->timer_start != NULL); + + return reds->core->timer_start(timer, ms); +} + +void reds_core_timer_cancel(RedsState *reds, + SpiceTimer *timer) +{ + g_return_if_fail(reds != NULL); + g_return_if_fail(reds->core != NULL); + g_return_if_fail(reds->core->timer_cancel != NULL); + + return reds->core->timer_cancel(timer); +} + +void reds_core_timer_remove(RedsState *reds, + SpiceTimer *timer) +{ + g_return_if_fail(reds != NULL); + g_return_if_fail(reds->core != NULL); + g_return_if_fail(reds->core->timer_remove != NULL); + + return reds->core->timer_remove(timer); +} + void reds_update_client_mouse_allowed(RedsState *reds) { static int allowed = FALSE; diff --git a/server/reds.h b/server/reds.h index 6dd0c81..174f48a 100644 --- a/server/reds.h +++ b/server/reds.h @@ -127,4 +127,15 @@ void reds_core_watch_update_mask(RedsState *reds, int event_mask); void reds_core_watch_remove(RedsState *reds, SpiceWatch *watch); +SpiceTimer *reds_core_timer_add(RedsState *reds, + SpiceTimerFunc func, + void *opaque); +void reds_core_timer_start(RedsState *reds, + SpiceTimer *timer, + uint32_t ms); +void reds_core_timer_cancel(RedsState *reds, + SpiceTimer *timer); +void reds_core_timer_remove(RedsState *reds, + SpiceTimer *timer); + #endif -- 2.5.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel