From 9493dc10f3c3160a8398bbbb8bc2983d35ed8a98 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 5 Sep 2012 18:11:48 -0700 Subject: [PATCH] Added resource handlers to guac_resource. --- libguac/include/resource.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/libguac/include/resource.h b/libguac/include/resource.h index 5e03cd0d..0260542c 100644 --- a/libguac/include/resource.h +++ b/libguac/include/resource.h @@ -56,6 +56,16 @@ * @file resource.h */ +/** + * Handler which begins resource transfer when the client accepts an exposed resource. + */ +typedef int guac_resource_accept_handler(guac_resource* resource, const char* mimetype); + +/** + * Handler which cancels resource transfer when the client rejects an exposed resource. + */ +typedef int guac_resource_reject_handler(guac_resource* resource); + /** * Represents a single resource which can be requested or exposed via * the Guacamole protocol. @@ -67,6 +77,16 @@ typedef struct guac_resource { */ int index; + /** + * Handler which will be called when this resource is accepted by the client. + */ + guac_resource_accept_handler* accept_handler; + + /** + * Handler which will be called when this resource is rejected by the client. + */ + guac_resource_reject_handler* reject_handler; + /** * Arbitrary data associated with this resource. */ @@ -74,16 +94,4 @@ typedef struct guac_resource { } guac_resource; -/** - * Handler which will be called whenever a resource has been accepted by the - * client. - */ -typedef int guac_resource_accept_handler(guac_resource* resource, const char* mimetype); - -/** - * Handler which will be called whenever a resource has been rejected by the - * client. - */ -typedef int guac_resource_reject_handler(guac_resource* resource); - #endif