#ifndef _GUAC_RDP_DEFAULT_POINTER_H
#define _GUAC_RDP_DEFAULT_POINTER_H
+#include <cairo/cairo.h>
+#include <guacamole/client.h>
+
/**
- * Embedded 11x16 24-bit RGBA cursor graphic.
+ * Width of the embedded mouse cursor graphic.
+ */
+extern const int guac_rdp_default_pointer_width;
+
+/**
+ * Height of the embedded mouse cursor graphic.
+ */
+extern const int guac_rdp_default_pointer_height;
+
+/**
+ * Number of bytes in each row of the embedded mouse cursor graphic.
+ */
+extern const int guac_rdp_default_pointer_stride;
+
+/**
+ * The Cairo grapic format of the mouse cursor graphic.
+ */
+extern const cairo_format_t guac_rdp_default_pointer_format;
+
+/**
+ * Embedded mouse cursor graphic.
*/
extern unsigned char guac_rdp_default_pointer[];
+/**
+ * Set the cursor of the remote display to the embedded cursor graphic.
+ *
+ * @param client The guac_client to send the cursor to.
+ */
+void guac_rdp_pointer_set_default(guac_client* client);
+
#endif
void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_set(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer);
-void guac_rdp_pointer_set_default(guac_client* client);
#endif
#include "rdp_glyph.h"
#include "rdp_pointer.h"
#include "rdp_gdi.h"
+#include "default_pointer.h"
/* Client plugin arguments */
const char* GUAC_CLIENT_ARGS[] = {
*
* ***** END LICENSE BLOCK ***** */
+#include <cairo/cairo.h>
+#include <guacamole/client.h>
+#include <guacamole/protocol.h>
+#include <guacamole/socket.h>
+
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
+/* Dimensions */
+const int guac_rdp_default_pointer_width = 11;
+const int guac_rdp_default_pointer_height = 16;
+
+/* Format */
+const cairo_format_t guac_rdp_default_pointer_format = CAIRO_FORMAT_ARGB32;
+const int guac_rdp_default_pointer_stride = 44;
+
/* Embedded pointer graphic */
unsigned char guac_rdp_default_pointer[] = {
};
+
+void guac_rdp_pointer_set_default(guac_client* client) {
+
+ guac_socket* socket = client->socket;
+
+ /* Draw to buffer */
+ guac_layer* cursor = guac_client_alloc_buffer(client);
+
+ cairo_surface_t* graphic = cairo_image_surface_create_for_data(
+ guac_rdp_default_pointer,
+ guac_rdp_default_pointer_format,
+ guac_rdp_default_pointer_width,
+ guac_rdp_default_pointer_height,
+ guac_rdp_default_pointer_stride);
+
+ guac_protocol_send_png(socket, GUAC_COMP_SRC, cursor, 0, 0, graphic);
+ cairo_surface_destroy(graphic);
+
+ /* Set cursor */
+ guac_protocol_send_cursor(socket, 0, 0, cursor,
+ 0, 0,
+ guac_rdp_default_pointer_width,
+ guac_rdp_default_pointer_height);
+
+ /* Free buffer */
+ guac_client_free_buffer(client, cursor);
+
+}
+
}
-void guac_rdp_pointer_set_default(guac_client* client) {
-
- guac_socket* socket = client->socket;
-
- /* Draw to buffer */
- guac_layer* cursor = guac_client_alloc_buffer(client);
-
- cairo_surface_t* graphic = cairo_image_surface_create_for_data(
- guac_rdp_default_pointer,
- CAIRO_FORMAT_ARGB32,
- 11, 16, 11*4);
-
- guac_protocol_send_png(socket, GUAC_COMP_OVER, cursor, 0, 0, graphic);
- cairo_surface_destroy(graphic);
-
- /* Set cursor */
- guac_protocol_send_cursor(socket, 0, 0, cursor, 0, 0, 11, 16);
-
- /* Free buffer */
- guac_client_free_buffer(client, cursor);
-
-}
-