guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [4/6] incubator-guacamole-server git commit: GUACAMOLE-169: Use proper namespace for internal common headers.
Date Tue, 24 Jan 2017 19:43:25 GMT
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/cursor.c
----------------------------------------------------------------------
diff --git a/src/common/cursor.c b/src/common/cursor.c
new file mode 100644
index 0000000..6dd000f
--- /dev/null
+++ b/src/common/cursor.c
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "common/blank_cursor.h"
+#include "common/dot_cursor.h"
+#include "common/cursor.h"
+#include "common/ibar_cursor.h"
+#include "common/pointer_cursor.h"
+#include "common/surface.h"
+
+#include <cairo/cairo.h>
+#include <guacamole/client.h>
+#include <guacamole/layer.h>
+#include <guacamole/protocol.h>
+#include <guacamole/socket.h>
+#include <guacamole/user.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+guac_common_cursor* guac_common_cursor_alloc(guac_client* client) {
+
+    guac_common_cursor* cursor = malloc(sizeof(guac_common_cursor));
+    if (cursor == NULL)
+        return NULL;
+
+    /* Associate cursor with client and allocate cursor layer */
+    cursor->client = client;
+    cursor->layer= guac_client_alloc_layer(client);
+
+    /* Allocate initial image buffer */
+    cursor->image_buffer_size = GUAC_COMMON_CURSOR_DEFAULT_SIZE;
+    cursor->image_buffer = malloc(cursor->image_buffer_size);
+
+    /* No cursor image yet */
+    cursor->width = 0;
+    cursor->height = 0;
+    cursor->surface = NULL;
+    cursor->hotspot_x = 0;
+    cursor->hotspot_y = 0;
+
+    /* No user has moved the mouse yet */
+    cursor->user = NULL;
+
+    /* Start cursor in upper-left */
+    cursor->x = 0;
+    cursor->y = 0;
+
+    return cursor;
+
+}
+
+void guac_common_cursor_free(guac_common_cursor* cursor) {
+
+    guac_client* client = cursor->client;
+    guac_layer* layer = cursor->layer;
+    cairo_surface_t* surface = cursor->surface;
+
+    /* Free image buffer and surface */
+    free(cursor->image_buffer);
+    if (surface != NULL)
+        cairo_surface_destroy(surface);
+
+    /* Destroy layer within remotely-connected client */
+    guac_protocol_send_dispose(client->socket, layer);
+
+    /* Return layer to pool */
+    guac_client_free_layer(client, layer);
+
+    free(cursor);
+
+}
+
+void guac_common_cursor_dup(guac_common_cursor* cursor, guac_user* user,
+        guac_socket* socket) {
+
+    /* Synchronize location */
+    guac_protocol_send_move(socket, cursor->layer, GUAC_DEFAULT_LAYER,
+            cursor->x - cursor->hotspot_x,
+            cursor->y - cursor->hotspot_y,
+            0);
+
+    /* Synchronize cursor image */
+    if (cursor->surface != NULL) {
+        guac_protocol_send_size(socket, cursor->layer,
+                cursor->width, cursor->height);
+
+        guac_user_stream_png(user, socket, GUAC_COMP_SRC,
+                cursor->layer, 0, 0, cursor->surface);
+    }
+
+    guac_socket_flush(socket);
+
+}
+
+/**
+ * Callback for guac_client_for_user() which shows the cursor layer for the
+ * given user (if they exist). The cursor layer is normally hidden when a user
+ * is moving the mouse, and will only be shown if a DIFFERENT user is moving
+ * the mouse.
+ *
+ * @param user
+ *     The user to show the cursor to, or NULL if that user does not exist.
+ *
+ * @param data
+ *     A pointer to the guac_common_cursor structure describing the cursor to
+ *     be shown.
+ *
+ * @return
+ *     Always NULL.
+ */
+static void* guac_common_cursor_show(guac_user* user, void* data) {
+
+    guac_common_cursor* cursor = (guac_common_cursor*) data;
+
+    /* Make cursor layer visible to given user */
+    if (user != NULL) {
+        guac_protocol_send_shade(user->socket, cursor->layer, 255);
+        guac_socket_flush(user->socket);
+    }
+
+    return NULL;
+
+}
+
+void guac_common_cursor_move(guac_common_cursor* cursor, guac_user* user,
+        int x, int y) {
+
+    guac_user* last_user = cursor->user;
+
+    /* Update current user of cursor */
+    if (last_user != user) {
+
+        cursor->user = user;
+
+        /* Make cursor layer visible to previous user */
+        guac_client_for_user(cursor->client, last_user,
+                guac_common_cursor_show, cursor);
+
+        /* Show hardware cursor */
+        guac_protocol_send_cursor(user->socket,
+                cursor->hotspot_x, cursor->hotspot_y,
+                cursor->layer, 0, 0, cursor->width, cursor->height);
+
+        /* Hide cursor layer from new user */
+        guac_protocol_send_shade(user->socket, cursor->layer, 0);
+        guac_socket_flush(user->socket);
+
+    }
+
+    /* Update cursor position */
+    cursor->x = x;
+    cursor->y = y;
+
+    guac_protocol_send_move(cursor->client->socket, cursor->layer,
+            GUAC_DEFAULT_LAYER,
+            x - cursor->hotspot_x,
+            y - cursor->hotspot_y,
+            0);
+
+    guac_socket_flush(cursor->client->socket);
+
+}
+
+/**
+ * Ensures the cursor image buffer has enough room to fit an image with the 
+ * given characteristics. Existing image buffer data may be destroyed.
+ *
+ * @param cursor
+ *     The cursor whose buffer size should be checked. If this cursor lacks
+ *     sufficient space to contain a cursor image of the specified width,
+ *     height, and stride, the current contents of this cursor will be
+ *     destroyed and replaced with an new buffer having sufficient space.
+ *
+ * @param width
+ *     The required cursor width, in pixels.
+ *
+ * @param height
+ *     The required cursor height, in pixels.
+ *
+ * @param stride
+ *     The number of bytes in each row of image data.
+ */
+static void guac_common_cursor_resize(guac_common_cursor* cursor,
+        int width, int height, int stride) {
+
+    int minimum_size = height * stride;
+
+    /* Grow image buffer if necessary */
+    if (cursor->image_buffer_size < minimum_size) {
+
+        /* Calculate new size */
+        cursor->image_buffer_size = minimum_size*2;
+
+        /* Destructively reallocate image buffer */
+        free(cursor->image_buffer);
+        cursor->image_buffer = malloc(cursor->image_buffer_size);
+
+    }
+
+}
+
+/**
+ * Callback for guac_client_foreach_user() which sends the current cursor image
+ * as PNG data to each connected client.
+ *
+ * @param user
+ *     The user to send the cursor image to.
+ *
+ * @param data
+ *     A pointer to the guac_common_cursor structure containing the cursor
+ *     image that should be sent to the given user.
+ *
+ * @return
+ *     Always NULL.
+ */
+static void* __send_user_cursor_image(guac_user* user, void* data) {
+
+    guac_common_cursor* cursor = (guac_common_cursor*) data;
+
+    guac_user_stream_png(user, user->socket, GUAC_COMP_SRC,
+            cursor->layer, 0, 0, cursor->surface);
+
+    return NULL;
+
+}
+
+/**
+ * Callback for guac_client_for_user() which updates the hardware cursor and
+ * hotspot for the given user (if they exist). The hardware cursor image is
+ * normally hidden when a user is not moving the mouse, and will only be shown
+ * if that user begins moving the mouse.
+ *
+ * @param user
+ *     The user whose hardware cursor should be updated, or NULL if that user
+ *     does not exist.
+ *
+ * @param data
+ *     A pointer to the guac_common_cursor structure describing the cursor to
+ *     be sent as the hardware cursor.
+ *
+ * @return
+ *     Always NULL.
+ */
+static void* guac_common_cursor_update(guac_user* user, void* data) {
+
+    guac_common_cursor* cursor = (guac_common_cursor*) data;
+
+    /* Update hardware cursor of current user */
+    if (user != NULL) {
+        guac_protocol_send_cursor(user->socket,
+                cursor->hotspot_x, cursor->hotspot_y,
+                cursor->layer, 0, 0, cursor->width, cursor->height);
+
+        guac_socket_flush(user->socket);
+    }
+
+    return NULL;
+
+}
+
+void guac_common_cursor_set_argb(guac_common_cursor* cursor, int hx, int hy,
+    unsigned const char* data, int width, int height, int stride) {
+
+    /* Copy image data */
+    guac_common_cursor_resize(cursor, width, height, stride);
+    memcpy(cursor->image_buffer, data, height * stride);
+
+    if (cursor->surface != NULL)
+        cairo_surface_destroy(cursor->surface);
+
+    cursor->surface = cairo_image_surface_create_for_data(cursor->image_buffer,
+            CAIRO_FORMAT_ARGB32, width, height, stride);
+
+    /* Set new cursor parameters */
+    cursor->width = width;
+    cursor->height = height;
+    cursor->hotspot_x = hx;
+    cursor->hotspot_y = hy;
+
+    /* Update location based on new hotspot */
+    guac_protocol_send_move(cursor->client->socket, cursor->layer,
+            GUAC_DEFAULT_LAYER,
+            cursor->x - hx,
+            cursor->y - hy,
+            0);
+
+    /* Broadcast new cursor image to all users */
+    guac_protocol_send_size(cursor->client->socket, cursor->layer,
+            width, height);
+
+    guac_client_foreach_user(cursor->client, __send_user_cursor_image, cursor);
+
+    guac_socket_flush(cursor->client->socket);
+
+    /* Update hardware cursor of current user (if they are indeed valid) */
+    if (cursor->user != NULL)
+        guac_client_for_user(cursor->client, cursor->user,
+                guac_common_cursor_update, cursor);
+
+}
+
+void guac_common_cursor_set_surface(guac_common_cursor* cursor, int hx, int hy,
+    guac_common_surface* surface) {
+
+    /* Set cursor to surface contents */
+    guac_common_cursor_set_argb(cursor, hx, hy, surface->buffer,
+            surface->width, surface->height, surface->stride);
+
+}
+
+void guac_common_cursor_set_pointer(guac_common_cursor* cursor) {
+
+    guac_common_cursor_set_argb(cursor, 0, 0,
+            guac_common_pointer_cursor,
+            guac_common_pointer_cursor_width,
+            guac_common_pointer_cursor_height,
+            guac_common_pointer_cursor_stride);
+
+}
+
+void guac_common_cursor_set_dot(guac_common_cursor* cursor) {
+
+     guac_common_cursor_set_argb(cursor, 2, 2,
+            guac_common_dot_cursor,
+            guac_common_dot_cursor_width,
+            guac_common_dot_cursor_height,
+            guac_common_dot_cursor_stride);
+
+}
+
+void guac_common_cursor_set_ibar(guac_common_cursor* cursor) {
+
+     guac_common_cursor_set_argb(cursor,
+            guac_common_ibar_cursor_width / 2,
+            guac_common_ibar_cursor_height / 2,
+            guac_common_ibar_cursor,
+            guac_common_ibar_cursor_width,
+            guac_common_ibar_cursor_height,
+            guac_common_ibar_cursor_stride);
+
+}
+
+void guac_common_cursor_set_blank(guac_common_cursor* cursor) {
+
+     guac_common_cursor_set_argb(cursor, 0, 0,
+            guac_common_blank_cursor,
+            guac_common_blank_cursor_width,
+            guac_common_blank_cursor_height,
+            guac_common_blank_cursor_stride);
+
+}
+
+void guac_common_cursor_remove_user(guac_common_cursor* cursor,
+        guac_user* user) {
+
+    /* Disassociate from given user */
+    if (cursor->user == user)
+        cursor->user = NULL;
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/display.c
----------------------------------------------------------------------
diff --git a/src/common/display.c b/src/common/display.c
new file mode 100644
index 0000000..38a2ad4
--- /dev/null
+++ b/src/common/display.c
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "common/cursor.h"
+#include "common/display.h"
+#include "common/surface.h"
+
+#include <guacamole/client.h>
+#include <guacamole/socket.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+/**
+ * Synchronizes all surfaces within the given linked list to the given socket.
+ * If the provided pointer to the linked list is NULL, this function has no
+ * effect.
+ *
+ * @param layers
+ *     The head element of the linked list of layers to synchronize, which may
+ *     be NULL if the list is currently empty.
+ *
+ * @param user
+ *     The user receiving the layers.
+ *
+ * @param socket
+ *     The socket over which each layer should be sent.
+ */
+static void guac_common_display_dup_layers(guac_common_display_layer* layers,
+        guac_user* user, guac_socket* socket) {
+
+    guac_common_display_layer* current = layers;
+
+    /* Synchronize all surfaces in given list */
+    while (current != NULL) {
+        guac_common_surface_dup(current->surface, user, socket);
+        current = current->next;
+    }
+
+}
+
+/**
+ * Frees all layers and associated surfaces within the given list, as well as
+ * their corresponding list elements. If the provided pointer to the linked
+ * list is NULL, this function has no effect.
+ *
+ * @param layers
+ *     The head element of the linked list of layers to free, which may be NULL
+ *     if the list is currently empty.
+ *
+ * @param client
+ *     The client owning the layers wrapped by each of the layers in the list.
+ */
+static void guac_common_display_free_layers(guac_common_display_layer* layers,
+        guac_client* client) {
+
+    guac_common_display_layer* current = layers;
+
+    /* Free each surface in given list */
+    while (current != NULL) {
+
+        guac_common_display_layer* next = current->next;
+        guac_layer* layer = current->layer;
+
+        /* Free surface */
+        guac_common_surface_free(current->surface);
+
+        /* Destroy layer within remotely-connected client */
+        guac_protocol_send_dispose(client->socket, layer);
+
+        /* Free layer or buffer depending on index */
+        if (layer->index < 0)
+            guac_client_free_buffer(client, layer);
+        else if (layer->index > 0)
+            guac_client_free_layer(client, layer);
+
+        /* Free current element and advance to next */
+        free(current);
+        current = next;
+
+    }
+
+}
+
+guac_common_display* guac_common_display_alloc(guac_client* client,
+        int width, int height) {
+
+    /* Allocate display */
+    guac_common_display* display = malloc(sizeof(guac_common_display));
+    if (display == NULL)
+        return NULL;
+
+    /* Associate display with given client */
+    display->client = client;
+
+    /* Allocate shared cursor */
+    display->cursor = guac_common_cursor_alloc(client);
+
+    display->default_surface = guac_common_surface_alloc(client,
+            client->socket, GUAC_DEFAULT_LAYER, width, height);
+
+    /* No initial layers or buffers */
+    display->layers = NULL;
+    display->buffers = NULL;
+
+    return display;
+
+}
+
+void guac_common_display_free(guac_common_display* display) {
+
+    /* Free shared cursor */
+    guac_common_cursor_free(display->cursor);
+
+    /* Free default surface */
+    guac_common_surface_free(display->default_surface);
+
+    /* Free all layers and buffers */
+    guac_common_display_free_layers(display->buffers, display->client);
+    guac_common_display_free_layers(display->layers, display->client);
+
+    free(display);
+
+}
+
+void guac_common_display_dup(guac_common_display* display, guac_user* user,
+        guac_socket* socket) {
+
+    /* Sunchronize shared cursor */
+    guac_common_cursor_dup(display->cursor, user, socket);
+
+    /* Synchronize default surface */
+    guac_common_surface_dup(display->default_surface, user, socket);
+
+    /* Synchronize all layers and buffers */
+    guac_common_display_dup_layers(display->layers, user, socket);
+    guac_common_display_dup_layers(display->buffers, user, socket);
+
+}
+
+void guac_common_display_flush(guac_common_display* display) {
+    guac_common_surface_flush(display->default_surface);
+}
+
+/**
+ * Allocates and inserts a new element into the given linked list of display
+ * layers, associating it with the given layer and surface.
+ *
+ * @param head
+ *     A pointer to the head pointer of the list of layers. The head pointer
+ *     will be updated by this function to point to the newly-allocated
+ *     display layer.
+ *
+ * @param layer
+ *     The Guacamole layer to associated with the new display layer.
+ *
+ * @param surface
+ *     The surface associated with the given Guacamole layer and which should
+ *     be associated with the new display layer.
+ *
+ * @return
+ *     The newly-allocated display layer, which has been associated with the
+ *     provided layer and surface.
+ */
+static guac_common_display_layer* guac_common_display_add_layer(
+        guac_common_display_layer** head, guac_layer* layer,
+        guac_common_surface* surface) {
+
+    guac_common_display_layer* old_head = *head;
+
+    guac_common_display_layer* display_layer =
+        malloc(sizeof(guac_common_display_layer));
+
+    /* Init layer/surface pair */
+    display_layer->layer = layer;
+    display_layer->surface = surface;
+
+    /* Insert list element as the new head */
+    display_layer->prev = NULL;
+    display_layer->next = old_head;
+    *head = display_layer;
+
+    /* Update old head to point to new element, if it existed */
+    if (old_head != NULL)
+        old_head->prev = display_layer;
+
+    return display_layer;
+
+}
+
+/**
+ * Removes the given display layer from the linked list whose head pointer is
+ * provided.
+ *
+ * @param head
+ *     A pointer to the head pointer of the list of layers. The head pointer
+ *     will be updated by this function if necessary, and will be set to NULL
+ *     if the display layer being removed is the only layer in the list.
+ *
+ * @param display_layer
+ *     The display layer to remove from the given list.
+ */
+static void guac_common_display_remove_layer(guac_common_display_layer** head,
+        guac_common_display_layer* display_layer) {
+
+    /* Update previous element, if it exists */
+    if (display_layer->prev != NULL)
+        display_layer->prev->next = display_layer->next;
+
+    /* If there is no previous element, update the list head */
+    else
+        *head = display_layer->next;
+
+    /* Update next element, if it exists */
+    if (display_layer->next != NULL)
+        display_layer->next->prev = display_layer->prev;
+
+}
+
+guac_common_display_layer* guac_common_display_alloc_layer(
+        guac_common_display* display, int width, int height) {
+
+    guac_layer* layer;
+    guac_common_surface* surface;
+
+    /* Allocate Guacamole layer */
+    layer = guac_client_alloc_layer(display->client);
+
+    /* Allocate corresponding surface */
+    surface = guac_common_surface_alloc(display->client,
+            display->client->socket, layer, width, height);
+
+    /* Add layer and surface to list */
+    return guac_common_display_add_layer(&display->layers, layer, surface);
+
+}
+
+guac_common_display_layer* guac_common_display_alloc_buffer(
+        guac_common_display* display, int width, int height) {
+
+    guac_layer* buffer;
+    guac_common_surface* surface;
+
+    /* Allocate Guacamole buffer */
+    buffer = guac_client_alloc_buffer(display->client);
+
+    /* Allocate corresponding surface */
+    surface = guac_common_surface_alloc(display->client,
+            display->client->socket, buffer, width, height);
+
+    /* Add buffer and surface to list */
+    return guac_common_display_add_layer(&display->buffers, buffer, surface);
+
+}
+
+void guac_common_display_free_layer(guac_common_display* display,
+        guac_common_display_layer* display_layer) {
+
+    /* Remove list element from list */
+    guac_common_display_remove_layer(&display->layers, display_layer);
+
+    /* Free associated layer and surface */
+    guac_common_surface_free(display_layer->surface);
+    guac_client_free_layer(display->client, display_layer->layer);
+
+    /* Free list element */
+    free(display_layer);
+
+}
+
+void guac_common_display_free_buffer(guac_common_display* display,
+        guac_common_display_layer* display_buffer) {
+
+    /* Remove list element from list */
+    guac_common_display_remove_layer(&display->buffers, display_buffer);
+
+    /* Free associated layer and surface */
+    guac_common_surface_free(display_buffer->surface);
+    guac_client_free_buffer(display->client, display_buffer->layer);
+
+    /* Free list element */
+    free(display_buffer);
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/dot_cursor.c
----------------------------------------------------------------------
diff --git a/src/common/dot_cursor.c b/src/common/dot_cursor.c
new file mode 100644
index 0000000..fde79b0
--- /dev/null
+++ b/src/common/dot_cursor.c
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "config.h"
+
+#include <cairo/cairo.h>
+#include <guacamole/client.h>
+#include <guacamole/layer.h>
+#include <guacamole/protocol.h>
+#include <guacamole/socket.h>
+#include <guacamole/user.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_common_dot_cursor_width  = 5;
+const int guac_common_dot_cursor_height = 5;
+
+/* Format */
+const cairo_format_t guac_common_dot_cursor_format = CAIRO_FORMAT_ARGB32;
+const int guac_common_dot_cursor_stride = 20;
+
+/* Embedded pointer graphic */
+unsigned char guac_common_dot_cursor[] = {
+
+        _,O,O,O,_,
+        O,X,X,X,O,
+        O,X,X,X,O,
+        O,X,X,X,O,
+        _,O,O,O,_
+
+};
+
+void guac_common_set_dot_cursor(guac_user* user) {
+
+    guac_client* client = user->client;
+    guac_socket* socket = user->socket;
+
+    /* Draw to buffer */
+    guac_layer* cursor = guac_client_alloc_buffer(client);
+
+    cairo_surface_t* graphic = cairo_image_surface_create_for_data(
+            guac_common_dot_cursor,
+            guac_common_dot_cursor_format,
+            guac_common_dot_cursor_width,
+            guac_common_dot_cursor_height,
+            guac_common_dot_cursor_stride);
+
+    guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
+            0, 0, graphic);
+    cairo_surface_destroy(graphic);
+
+    /* Set cursor */
+    guac_protocol_send_cursor(socket, 2, 2, cursor,
+            0, 0,
+            guac_common_dot_cursor_width,
+            guac_common_dot_cursor_height);
+
+    /* Free buffer */
+    guac_client_free_buffer(client, cursor);
+
+    guac_client_log(client, GUAC_LOG_DEBUG,
+            "Client cursor image set to generic built-in dot.");
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_blank_cursor.c
----------------------------------------------------------------------
diff --git a/src/common/guac_blank_cursor.c b/src/common/guac_blank_cursor.c
deleted file mode 100644
index c65db0c..0000000
--- a/src/common/guac_blank_cursor.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/client.h>
-#include <guacamole/layer.h>
-#include <guacamole/protocol.h>
-#include <guacamole/socket.h>
-#include <guacamole/user.h>
-
-/* Dimensions */
-const int guac_common_blank_cursor_width  = 1;
-const int guac_common_blank_cursor_height = 1;
-
-/* Format */
-const cairo_format_t guac_common_blank_cursor_format = CAIRO_FORMAT_ARGB32;
-const int guac_common_blank_cursor_stride = 4;
-
-/* Embedded blank cursor graphic */
-unsigned char guac_common_blank_cursor[] = {
-
-    0x00,0x00,0x00,0x00
-
-};
-
-void guac_common_set_blank_cursor(guac_user* user) {
-
-    guac_client* client = user->client;
-    guac_socket* socket = user->socket;
-
-    /* Draw to buffer */
-    guac_layer* cursor = guac_client_alloc_buffer(client);
-
-    cairo_surface_t* graphic = cairo_image_surface_create_for_data(
-            guac_common_blank_cursor,
-            guac_common_blank_cursor_format,
-            guac_common_blank_cursor_width,
-            guac_common_blank_cursor_height,
-            guac_common_blank_cursor_stride);
-
-    guac_user_stream_png(user, 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_common_blank_cursor_width,
-            guac_common_blank_cursor_height);
-
-    /* Free buffer */
-    guac_client_free_buffer(client, cursor);
-
-    guac_client_log(client, GUAC_LOG_DEBUG,
-            "Client cursor image set to generic transparent (blank) cursor.");
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_blank_cursor.h
----------------------------------------------------------------------
diff --git a/src/common/guac_blank_cursor.h b/src/common/guac_blank_cursor.h
deleted file mode 100644
index 86a4a9f..0000000
--- a/src/common/guac_blank_cursor.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef GUAC_COMMON_BLANK_CURSOR_H
-#define GUAC_COMMON_BLANK_CURSOR_H
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/user.h>
-
-/**
- * Width of the embedded transparent (blank) mouse cursor graphic.
- */
-extern const int guac_common_blank_cursor_width;
-
-/**
- * Height of the embedded transparent (blank) mouse cursor graphic.
- */
-extern const int guac_common_blank_cursor_height;
-
-/**
- * Number of bytes in each row of the embedded transparent (blank) mouse cursor
- * graphic.
- */
-extern const int guac_common_blank_cursor_stride;
-
-/**
- * The Cairo grapic format of the transparent (blank) mouse cursor graphic.
- */
-extern const cairo_format_t guac_common_blank_cursor_format;
-
-/**
- * Embedded transparent (blank) mouse cursor graphic.
- */
-extern unsigned char guac_common_blank_cursor[];
-
-/**
- * Sets the cursor of the remote display to the embedded transparent (blank)
- * cursor graphic.
- *
- * @param user
- *     The guac_user to send the cursor to.
- */
-void guac_common_set_blank_cursor(guac_user* user);
-
-#endif
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_clipboard.c
----------------------------------------------------------------------
diff --git a/src/common/guac_clipboard.c b/src/common/guac_clipboard.c
deleted file mode 100644
index 15cdd84..0000000
--- a/src/common/guac_clipboard.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "config.h"
-#include "guac_clipboard.h"
-
-#include <guacamole/client.h>
-#include <guacamole/protocol.h>
-#include <guacamole/stream.h>
-#include <guacamole/user.h>
-#include <string.h>
-#include <stdlib.h>
-
-guac_common_clipboard* guac_common_clipboard_alloc(int size) {
-
-    guac_common_clipboard* clipboard = malloc(sizeof(guac_common_clipboard));
-
-    /* Init clipboard */
-    clipboard->mimetype[0] = '\0';
-    clipboard->buffer = malloc(size);
-    clipboard->length = 0;
-    clipboard->available = size;
-
-    return clipboard;
-
-}
-
-void guac_common_clipboard_free(guac_common_clipboard* clipboard) {
-    free(clipboard->buffer);
-    free(clipboard);
-}
-
-/**
- * Callback for guac_client_foreach_user() which sends clipboard data to each
- * connected client.
- *
- * @param user
- *     The user to send the clipboard data to.
- *
- * @param
- *     A pointer to the guac_common_clipboard structure containing the
- *     clipboard data that should be sent to the given user.
- *
- * @return
- *     Always NULL.
- */
-static void* __send_user_clipboard(guac_user* user, void* data) {
-
-    guac_common_clipboard* clipboard = (guac_common_clipboard*) data;
-
-    char* current = clipboard->buffer;
-    int remaining = clipboard->length;
-
-    /* Begin stream */
-    guac_stream* stream = guac_user_alloc_stream(user);
-    guac_protocol_send_clipboard(user->socket, stream, clipboard->mimetype);
-
-    guac_user_log(user, GUAC_LOG_DEBUG,
-            "Created stream %i for %s clipboard data.",
-            stream->index, clipboard->mimetype);
-
-    /* Split clipboard into chunks */
-    while (remaining > 0) {
-
-        /* Calculate size of next block */
-        int block_size = GUAC_COMMON_CLIPBOARD_BLOCK_SIZE;
-        if (remaining < block_size)
-            block_size = remaining; 
-
-        /* Send block */
-        guac_protocol_send_blob(user->socket, stream, current, block_size);
-        guac_user_log(user, GUAC_LOG_DEBUG,
-                "Sent %i bytes of clipboard data on stream %i.",
-                block_size, stream->index);
-
-        /* Next block */
-        remaining -= block_size;
-        current += block_size;
-
-    }
-
-    guac_user_log(user, GUAC_LOG_DEBUG,
-            "Clipboard stream %i complete.",
-            stream->index);
-
-    /* End stream */
-    guac_protocol_send_end(user->socket, stream);
-    guac_user_free_stream(user, stream);
-
-    return NULL;
-
-}
-
-void guac_common_clipboard_send(guac_common_clipboard* clipboard, guac_client* client) {
-    guac_client_log(client, GUAC_LOG_DEBUG, "Broadcasting clipboard to all connected users.");
-    guac_client_foreach_user(client, __send_user_clipboard, clipboard);
-    guac_client_log(client, GUAC_LOG_DEBUG, "Broadcast of clipboard complete.");
-}
-
-void guac_common_clipboard_reset(guac_common_clipboard* clipboard, const char* mimetype) {
-    clipboard->length = 0;
-    strncpy(clipboard->mimetype, mimetype, sizeof(clipboard->mimetype)-1);
-}
-
-void guac_common_clipboard_append(guac_common_clipboard* clipboard, const char* data, int length) {
-
-    /* Truncate data to available length */
-    int remaining = clipboard->available - clipboard->length;
-    if (remaining < length)
-        length = remaining;
-
-    /* Append to buffer */
-    memcpy(clipboard->buffer + clipboard->length, data, length);
-
-    /* Update length */
-    clipboard->length += length;
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_clipboard.h
----------------------------------------------------------------------
diff --git a/src/common/guac_clipboard.h b/src/common/guac_clipboard.h
deleted file mode 100644
index 5ebb261..0000000
--- a/src/common/guac_clipboard.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __GUAC_CLIPBOARD_H
-#define __GUAC_CLIPBOARD_H
-
-#include "config.h"
-
-#include <guacamole/client.h>
-
-/**
- * The maximum number of bytes to send in an individual blob when
- * transmitting the clipboard contents to a connected client.
- */
-#define GUAC_COMMON_CLIPBOARD_BLOCK_SIZE 4096
-
-/**
- * Generic clipboard structure.
- */
-typedef struct guac_common_clipboard {
-
-    /**
-     * The mimetype of the contained clipboard data.
-     */
-    char mimetype[256];
-
-    /**
-     * Arbitrary clipboard data.
-     */
-    char* buffer;
-
-    /**
-     * The number of bytes currently stored in the clipboard buffer.
-     */
-    int length;
-
-    /**
-     * The total number of bytes available in the clipboard buffer.
-     */
-    int available;
-
-} guac_common_clipboard;
-
-/**
- * Creates a new clipboard having the given initial size.
- *
- * @param size The maximum number of bytes to allow within the clipboard.
- * @return A newly-allocated clipboard.
- */
-guac_common_clipboard* guac_common_clipboard_alloc(int size);
-
-/**
- * Frees the given clipboard.
- *
- * @param clipboard The clipboard to free.
- */
-void guac_common_clipboard_free(guac_common_clipboard* clipboard);
-
-/**
- * Sends the contents of the clipboard along the given client, splitting
- * the contents as necessary.
- *
- * @param clipboard The clipboard whose contents should be sent.
- * @param client The client to send the clipboard contents on.
- */
-void guac_common_clipboard_send(guac_common_clipboard* clipboard, guac_client* client);
-
-/**
- * Clears the clipboard contents and assigns a new mimetype for future data.
- *
- * @param clipboard The clipboard to reset.
- * @param mimetype The mimetype of future data.
- */
-void guac_common_clipboard_reset(guac_common_clipboard* clipboard, const char* mimetype);
-
-/**
- * Appends the given data to the current clipboard contents. The data must
- * match the mimetype chosen for the clipboard data by
- * guac_common_clipboard_reset().
- *
- * @param clipboard The clipboard to append data to.
- * @param data The data to append.
- * @param length The number of bytes to append from the data given.
- */
-void guac_common_clipboard_append(guac_common_clipboard* clipboard, const char* data, int length);
-
-#endif
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_cursor.c
----------------------------------------------------------------------
diff --git a/src/common/guac_cursor.c b/src/common/guac_cursor.c
deleted file mode 100644
index 4ed66b1..0000000
--- a/src/common/guac_cursor.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "guac_blank_cursor.h"
-#include "guac_dot_cursor.h"
-#include "guac_cursor.h"
-#include "guac_ibar_cursor.h"
-#include "guac_pointer_cursor.h"
-#include "guac_surface.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/client.h>
-#include <guacamole/layer.h>
-#include <guacamole/protocol.h>
-#include <guacamole/socket.h>
-#include <guacamole/user.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-guac_common_cursor* guac_common_cursor_alloc(guac_client* client) {
-
-    guac_common_cursor* cursor = malloc(sizeof(guac_common_cursor));
-    if (cursor == NULL)
-        return NULL;
-
-    /* Associate cursor with client and allocate cursor layer */
-    cursor->client = client;
-    cursor->layer= guac_client_alloc_layer(client);
-
-    /* Allocate initial image buffer */
-    cursor->image_buffer_size = GUAC_COMMON_CURSOR_DEFAULT_SIZE;
-    cursor->image_buffer = malloc(cursor->image_buffer_size);
-
-    /* No cursor image yet */
-    cursor->width = 0;
-    cursor->height = 0;
-    cursor->surface = NULL;
-    cursor->hotspot_x = 0;
-    cursor->hotspot_y = 0;
-
-    /* No user has moved the mouse yet */
-    cursor->user = NULL;
-
-    /* Start cursor in upper-left */
-    cursor->x = 0;
-    cursor->y = 0;
-
-    return cursor;
-
-}
-
-void guac_common_cursor_free(guac_common_cursor* cursor) {
-
-    guac_client* client = cursor->client;
-    guac_layer* layer = cursor->layer;
-    cairo_surface_t* surface = cursor->surface;
-
-    /* Free image buffer and surface */
-    free(cursor->image_buffer);
-    if (surface != NULL)
-        cairo_surface_destroy(surface);
-
-    /* Destroy layer within remotely-connected client */
-    guac_protocol_send_dispose(client->socket, layer);
-
-    /* Return layer to pool */
-    guac_client_free_layer(client, layer);
-
-    free(cursor);
-
-}
-
-void guac_common_cursor_dup(guac_common_cursor* cursor, guac_user* user,
-        guac_socket* socket) {
-
-    /* Synchronize location */
-    guac_protocol_send_move(socket, cursor->layer, GUAC_DEFAULT_LAYER,
-            cursor->x - cursor->hotspot_x,
-            cursor->y - cursor->hotspot_y,
-            0);
-
-    /* Synchronize cursor image */
-    if (cursor->surface != NULL) {
-        guac_protocol_send_size(socket, cursor->layer,
-                cursor->width, cursor->height);
-
-        guac_user_stream_png(user, socket, GUAC_COMP_SRC,
-                cursor->layer, 0, 0, cursor->surface);
-    }
-
-    guac_socket_flush(socket);
-
-}
-
-/**
- * Callback for guac_client_for_user() which shows the cursor layer for the
- * given user (if they exist). The cursor layer is normally hidden when a user
- * is moving the mouse, and will only be shown if a DIFFERENT user is moving
- * the mouse.
- *
- * @param user
- *     The user to show the cursor to, or NULL if that user does not exist.
- *
- * @param data
- *     A pointer to the guac_common_cursor structure describing the cursor to
- *     be shown.
- *
- * @return
- *     Always NULL.
- */
-static void* guac_common_cursor_show(guac_user* user, void* data) {
-
-    guac_common_cursor* cursor = (guac_common_cursor*) data;
-
-    /* Make cursor layer visible to given user */
-    if (user != NULL) {
-        guac_protocol_send_shade(user->socket, cursor->layer, 255);
-        guac_socket_flush(user->socket);
-    }
-
-    return NULL;
-
-}
-
-void guac_common_cursor_move(guac_common_cursor* cursor, guac_user* user,
-        int x, int y) {
-
-    guac_user* last_user = cursor->user;
-
-    /* Update current user of cursor */
-    if (last_user != user) {
-
-        cursor->user = user;
-
-        /* Make cursor layer visible to previous user */
-        guac_client_for_user(cursor->client, last_user,
-                guac_common_cursor_show, cursor);
-
-        /* Show hardware cursor */
-        guac_protocol_send_cursor(user->socket,
-                cursor->hotspot_x, cursor->hotspot_y,
-                cursor->layer, 0, 0, cursor->width, cursor->height);
-
-        /* Hide cursor layer from new user */
-        guac_protocol_send_shade(user->socket, cursor->layer, 0);
-        guac_socket_flush(user->socket);
-
-    }
-
-    /* Update cursor position */
-    cursor->x = x;
-    cursor->y = y;
-
-    guac_protocol_send_move(cursor->client->socket, cursor->layer,
-            GUAC_DEFAULT_LAYER,
-            x - cursor->hotspot_x,
-            y - cursor->hotspot_y,
-            0);
-
-    guac_socket_flush(cursor->client->socket);
-
-}
-
-/**
- * Ensures the cursor image buffer has enough room to fit an image with the 
- * given characteristics. Existing image buffer data may be destroyed.
- *
- * @param cursor
- *     The cursor whose buffer size should be checked. If this cursor lacks
- *     sufficient space to contain a cursor image of the specified width,
- *     height, and stride, the current contents of this cursor will be
- *     destroyed and replaced with an new buffer having sufficient space.
- *
- * @param width
- *     The required cursor width, in pixels.
- *
- * @param height
- *     The required cursor height, in pixels.
- *
- * @param stride
- *     The number of bytes in each row of image data.
- */
-static void guac_common_cursor_resize(guac_common_cursor* cursor,
-        int width, int height, int stride) {
-
-    int minimum_size = height * stride;
-
-    /* Grow image buffer if necessary */
-    if (cursor->image_buffer_size < minimum_size) {
-
-        /* Calculate new size */
-        cursor->image_buffer_size = minimum_size*2;
-
-        /* Destructively reallocate image buffer */
-        free(cursor->image_buffer);
-        cursor->image_buffer = malloc(cursor->image_buffer_size);
-
-    }
-
-}
-
-/**
- * Callback for guac_client_foreach_user() which sends the current cursor image
- * as PNG data to each connected client.
- *
- * @param user
- *     The user to send the cursor image to.
- *
- * @param data
- *     A pointer to the guac_common_cursor structure containing the cursor
- *     image that should be sent to the given user.
- *
- * @return
- *     Always NULL.
- */
-static void* __send_user_cursor_image(guac_user* user, void* data) {
-
-    guac_common_cursor* cursor = (guac_common_cursor*) data;
-
-    guac_user_stream_png(user, user->socket, GUAC_COMP_SRC,
-            cursor->layer, 0, 0, cursor->surface);
-
-    return NULL;
-
-}
-
-/**
- * Callback for guac_client_for_user() which updates the hardware cursor and
- * hotspot for the given user (if they exist). The hardware cursor image is
- * normally hidden when a user is not moving the mouse, and will only be shown
- * if that user begins moving the mouse.
- *
- * @param user
- *     The user whose hardware cursor should be updated, or NULL if that user
- *     does not exist.
- *
- * @param data
- *     A pointer to the guac_common_cursor structure describing the cursor to
- *     be sent as the hardware cursor.
- *
- * @return
- *     Always NULL.
- */
-static void* guac_common_cursor_update(guac_user* user, void* data) {
-
-    guac_common_cursor* cursor = (guac_common_cursor*) data;
-
-    /* Update hardware cursor of current user */
-    if (user != NULL) {
-        guac_protocol_send_cursor(user->socket,
-                cursor->hotspot_x, cursor->hotspot_y,
-                cursor->layer, 0, 0, cursor->width, cursor->height);
-
-        guac_socket_flush(user->socket);
-    }
-
-    return NULL;
-
-}
-
-void guac_common_cursor_set_argb(guac_common_cursor* cursor, int hx, int hy,
-    unsigned const char* data, int width, int height, int stride) {
-
-    /* Copy image data */
-    guac_common_cursor_resize(cursor, width, height, stride);
-    memcpy(cursor->image_buffer, data, height * stride);
-
-    if (cursor->surface != NULL)
-        cairo_surface_destroy(cursor->surface);
-
-    cursor->surface = cairo_image_surface_create_for_data(cursor->image_buffer,
-            CAIRO_FORMAT_ARGB32, width, height, stride);
-
-    /* Set new cursor parameters */
-    cursor->width = width;
-    cursor->height = height;
-    cursor->hotspot_x = hx;
-    cursor->hotspot_y = hy;
-
-    /* Update location based on new hotspot */
-    guac_protocol_send_move(cursor->client->socket, cursor->layer,
-            GUAC_DEFAULT_LAYER,
-            cursor->x - hx,
-            cursor->y - hy,
-            0);
-
-    /* Broadcast new cursor image to all users */
-    guac_protocol_send_size(cursor->client->socket, cursor->layer,
-            width, height);
-
-    guac_client_foreach_user(cursor->client, __send_user_cursor_image, cursor);
-
-    guac_socket_flush(cursor->client->socket);
-
-    /* Update hardware cursor of current user (if they are indeed valid) */
-    if (cursor->user != NULL)
-        guac_client_for_user(cursor->client, cursor->user,
-                guac_common_cursor_update, cursor);
-
-}
-
-void guac_common_cursor_set_surface(guac_common_cursor* cursor, int hx, int hy,
-    guac_common_surface* surface) {
-
-    /* Set cursor to surface contents */
-    guac_common_cursor_set_argb(cursor, hx, hy, surface->buffer,
-            surface->width, surface->height, surface->stride);
-
-}
-
-void guac_common_cursor_set_pointer(guac_common_cursor* cursor) {
-
-    guac_common_cursor_set_argb(cursor, 0, 0,
-            guac_common_pointer_cursor,
-            guac_common_pointer_cursor_width,
-            guac_common_pointer_cursor_height,
-            guac_common_pointer_cursor_stride);
-
-}
-
-void guac_common_cursor_set_dot(guac_common_cursor* cursor) {
-
-     guac_common_cursor_set_argb(cursor, 2, 2,
-            guac_common_dot_cursor,
-            guac_common_dot_cursor_width,
-            guac_common_dot_cursor_height,
-            guac_common_dot_cursor_stride);
-
-}
-
-void guac_common_cursor_set_ibar(guac_common_cursor* cursor) {
-
-     guac_common_cursor_set_argb(cursor,
-            guac_common_ibar_cursor_width / 2,
-            guac_common_ibar_cursor_height / 2,
-            guac_common_ibar_cursor,
-            guac_common_ibar_cursor_width,
-            guac_common_ibar_cursor_height,
-            guac_common_ibar_cursor_stride);
-
-}
-
-void guac_common_cursor_set_blank(guac_common_cursor* cursor) {
-
-     guac_common_cursor_set_argb(cursor, 0, 0,
-            guac_common_blank_cursor,
-            guac_common_blank_cursor_width,
-            guac_common_blank_cursor_height,
-            guac_common_blank_cursor_stride);
-
-}
-
-void guac_common_cursor_remove_user(guac_common_cursor* cursor,
-        guac_user* user) {
-
-    /* Disassociate from given user */
-    if (cursor->user == user)
-        cursor->user = NULL;
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_cursor.h
----------------------------------------------------------------------
diff --git a/src/common/guac_cursor.h b/src/common/guac_cursor.h
deleted file mode 100644
index a6d9681..0000000
--- a/src/common/guac_cursor.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#ifndef GUAC_COMMON_CURSOR_H
-#define GUAC_COMMON_CURSOR_H
-
-#include "guac_surface.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/client.h>
-#include <guacamole/socket.h>
-#include <guacamole/user.h>
-
-/**
- * The default size of the cursor image buffer.
- */
-#define GUAC_COMMON_CURSOR_DEFAULT_SIZE 64*64*4
-
-/**
- * Cursor object which maintains and synchronizes the current mouse cursor
- * state across all users of a specific client.
- */
-typedef struct guac_common_cursor {
-
-    /**
-     * The client to maintain the mouse cursor for.
-     */
-    guac_client* client;
-
-    /**
-     * The cursor layer. This layer will be available to all connected users,
-     * but will be visible only to those users who are not moving the mouse.
-     */
-    guac_layer* layer;
-
-    /**
-     * The width of the cursor image, in pixels.
-     */
-    int width;
-
-    /**
-     * The height of the cursor image, in pixels.
-     */
-    int height;
-
-    /**
-     * Arbitrary image data buffer, backing the Cairo surface used to store
-     * the cursor image.
-     */
-    unsigned char* image_buffer;
-
-    /**
-     * The size of the image data buffer, in bytes.
-     */
-    int image_buffer_size;
-
-    /**
-     * The current cursor image, if any. If the mouse cursor has not yet been
-     * set, this will be NULL.
-     */
-    cairo_surface_t* surface;
-
-    /**
-     * The X coordinate of the hotspot of the mouse cursor.
-     */
-    int hotspot_x;
-
-    /**
-     * The Y coordinate of the hotspot of the mouse cursor.
-     */
-    int hotspot_y;
-
-    /**
-     * The last user to move the mouse, or NULL if no user has moved the
-     * mouse yet.
-     */
-    guac_user* user;
-
-    /**
-     * The X coordinate of the current mouse cursor location.
-     */
-    int x;
-
-    /**
-     * The Y coordinate of the current mouse cursor location.
-     */
-    int y;
-
-} guac_common_cursor;
-
-/**
- * Allocates a new cursor object which maintains and synchronizes the current
- * mouse cursor state across all users of the given client.
- *
- * @param client
- *     The client for which this object shall maintain the mouse cursor.
- *
- * @return
- *     The newly-allocated mouse cursor.
- */
-guac_common_cursor* guac_common_cursor_alloc(guac_client* client);
-
-/**
- * Frees the given cursor.
- *
- * @param cursor
- *     The cursor to free.
- */
-void guac_common_cursor_free(guac_common_cursor* cursor);
-
-/**
- * Sends the current state of this cursor across the given socket, including
- * the current cursor image. The resulting cursor on the remote display will
- * be visible.
- *
- * @param cursor
- *     The cursor to send.
- *
- * @param user
- *     The user receiving the updated cursor.
- *
- * @param socket
- *     The socket over which the updated cursor should be sent.
- */
-void guac_common_cursor_dup(guac_common_cursor* cursor, guac_user* user,
-        guac_socket* socket);
-
-/**
- * Moves the mouse cursor, marking the given user as the most recent user of
- * the mouse. The remote mouse cursor will be hidden for this user and shown
- * for all others.
- *
- * @param cursor
- *     The cursor being moved.
- *
- * @param user
- *     The user that moved the cursor.
- *
- * @param x
- *     The new X coordinate of the cursor.
- *
- * @param y
- *     The new Y coordinate of the cursor.
- */
-void guac_common_cursor_move(guac_common_cursor* cursor, guac_user* user,
-        int x, int y);
-
-/**
- * Sets the cursor image to the given raw image data. This raw image data must
- * be in 32-bit ARGB format, having 8 bits per color component, where the
- * alpha component is stored in the high-order 8 bits, and blue is stored
- * in the low-order 8 bits.
- *
- * @param cursor
- *     The cursor to set the image of.
- *
- * @param hx
- *     The X coordinate of the hotspot of the new cursor image.
- *
- * @param hy
- *     The Y coordinate of the hotspot of the new cursor image.
- *
- * @param data
- *     A pointer to raw 32-bit ARGB image data.
- *
- * @param width
- *     The width of the given image data, in pixels.
- *
- * @param height
- *     The height of the given image data, in pixels.
- *
- * @param stride
- *     The number of bytes in a single row of image data.
- */
-void guac_common_cursor_set_argb(guac_common_cursor* cursor, int hx, int hy,
-    unsigned const char* data, int width, int height, int stride);
-
-/**
- * Sets the cursor image to the contents of the given surface. The entire
- * contents of the surface are used, and the dimensions of the resulting
- * cursor will be the dimensions of the given surface.
- *
- * @param cursor
- *     The cursor to set the image of.
- *
- * @param hx
- *     The X coordinate of the hotspot of the new cursor image.
- *
- * @param hy
- *     The Y coordinate of the hotspot of the new cursor image.
- *
- * @param surface
- *     The surface containing the cursor image.
- */
-void guac_common_cursor_set_surface(guac_common_cursor* cursor, int hx, int hy,
-    guac_common_surface* surface);
-
-/**
- * Set the cursor of the remote display to the embedded "pointer" graphic. The
- * pointer graphic is a black arrow with white border.
- *
- * @param cursor
- *     The cursor to set the image of.
- */
-void guac_common_cursor_set_pointer(guac_common_cursor* cursor);
-
-/**
- * Set the cursor of the remote display to the embedded "dot" graphic. The dot
- * graphic is a small black square with white border.
- *
- * @param cursor
- *     The cursor to set the image of.
- */
-void guac_common_cursor_set_dot(guac_common_cursor* cursor);
-
-/**
- * Sets the cursor of the remote display to the embedded "I-bar" graphic. The
- * I-bar graphic is a small black "I" shape with white border, used to indicate
- * the presence of selectable or editable text.
- *
- * @param cursor
- *     The cursor to set the image of.
- */
-void guac_common_cursor_set_ibar(guac_common_cursor* cursor);
-
-/**
- * Sets the cursor of the remote display to the embedded transparent (blank)
- * graphic, effectively hiding the mouse cursor.
- *
- * @param cursor
- *     The cursor to set the image of.
- */
-void guac_common_cursor_set_blank(guac_common_cursor* cursor);
-
-/**
- * Removes the given user, such that future synchronization will not occur.
- * This is necessary when a user leaves the connection. If a user leaves the
- * connection and this is not called, the mouse cursor state may not update
- * correctly in response to mouse events.
- *
- * @param cursor
- *     The cursor to remove the user from.
- *
- * @param user
- *     The user to remove.
- */
-void guac_common_cursor_remove_user(guac_common_cursor* cursor,
-        guac_user* user);
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_display.c
----------------------------------------------------------------------
diff --git a/src/common/guac_display.c b/src/common/guac_display.c
deleted file mode 100644
index a81ff24..0000000
--- a/src/common/guac_display.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "guac_cursor.h"
-#include "guac_display.h"
-#include "guac_surface.h"
-
-#include <guacamole/client.h>
-#include <guacamole/socket.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-/**
- * Synchronizes all surfaces within the given linked list to the given socket.
- * If the provided pointer to the linked list is NULL, this function has no
- * effect.
- *
- * @param layers
- *     The head element of the linked list of layers to synchronize, which may
- *     be NULL if the list is currently empty.
- *
- * @param user
- *     The user receiving the layers.
- *
- * @param socket
- *     The socket over which each layer should be sent.
- */
-static void guac_common_display_dup_layers(guac_common_display_layer* layers,
-        guac_user* user, guac_socket* socket) {
-
-    guac_common_display_layer* current = layers;
-
-    /* Synchronize all surfaces in given list */
-    while (current != NULL) {
-        guac_common_surface_dup(current->surface, user, socket);
-        current = current->next;
-    }
-
-}
-
-/**
- * Frees all layers and associated surfaces within the given list, as well as
- * their corresponding list elements. If the provided pointer to the linked
- * list is NULL, this function has no effect.
- *
- * @param layers
- *     The head element of the linked list of layers to free, which may be NULL
- *     if the list is currently empty.
- *
- * @param client
- *     The client owning the layers wrapped by each of the layers in the list.
- */
-static void guac_common_display_free_layers(guac_common_display_layer* layers,
-        guac_client* client) {
-
-    guac_common_display_layer* current = layers;
-
-    /* Free each surface in given list */
-    while (current != NULL) {
-
-        guac_common_display_layer* next = current->next;
-        guac_layer* layer = current->layer;
-
-        /* Free surface */
-        guac_common_surface_free(current->surface);
-
-        /* Destroy layer within remotely-connected client */
-        guac_protocol_send_dispose(client->socket, layer);
-
-        /* Free layer or buffer depending on index */
-        if (layer->index < 0)
-            guac_client_free_buffer(client, layer);
-        else if (layer->index > 0)
-            guac_client_free_layer(client, layer);
-
-        /* Free current element and advance to next */
-        free(current);
-        current = next;
-
-    }
-
-}
-
-guac_common_display* guac_common_display_alloc(guac_client* client,
-        int width, int height) {
-
-    /* Allocate display */
-    guac_common_display* display = malloc(sizeof(guac_common_display));
-    if (display == NULL)
-        return NULL;
-
-    /* Associate display with given client */
-    display->client = client;
-
-    /* Allocate shared cursor */
-    display->cursor = guac_common_cursor_alloc(client);
-
-    display->default_surface = guac_common_surface_alloc(client,
-            client->socket, GUAC_DEFAULT_LAYER, width, height);
-
-    /* No initial layers or buffers */
-    display->layers = NULL;
-    display->buffers = NULL;
-
-    return display;
-
-}
-
-void guac_common_display_free(guac_common_display* display) {
-
-    /* Free shared cursor */
-    guac_common_cursor_free(display->cursor);
-
-    /* Free default surface */
-    guac_common_surface_free(display->default_surface);
-
-    /* Free all layers and buffers */
-    guac_common_display_free_layers(display->buffers, display->client);
-    guac_common_display_free_layers(display->layers, display->client);
-
-    free(display);
-
-}
-
-void guac_common_display_dup(guac_common_display* display, guac_user* user,
-        guac_socket* socket) {
-
-    /* Sunchronize shared cursor */
-    guac_common_cursor_dup(display->cursor, user, socket);
-
-    /* Synchronize default surface */
-    guac_common_surface_dup(display->default_surface, user, socket);
-
-    /* Synchronize all layers and buffers */
-    guac_common_display_dup_layers(display->layers, user, socket);
-    guac_common_display_dup_layers(display->buffers, user, socket);
-
-}
-
-void guac_common_display_flush(guac_common_display* display) {
-    guac_common_surface_flush(display->default_surface);
-}
-
-/**
- * Allocates and inserts a new element into the given linked list of display
- * layers, associating it with the given layer and surface.
- *
- * @param head
- *     A pointer to the head pointer of the list of layers. The head pointer
- *     will be updated by this function to point to the newly-allocated
- *     display layer.
- *
- * @param layer
- *     The Guacamole layer to associated with the new display layer.
- *
- * @param surface
- *     The surface associated with the given Guacamole layer and which should
- *     be associated with the new display layer.
- *
- * @return
- *     The newly-allocated display layer, which has been associated with the
- *     provided layer and surface.
- */
-static guac_common_display_layer* guac_common_display_add_layer(
-        guac_common_display_layer** head, guac_layer* layer,
-        guac_common_surface* surface) {
-
-    guac_common_display_layer* old_head = *head;
-
-    guac_common_display_layer* display_layer =
-        malloc(sizeof(guac_common_display_layer));
-
-    /* Init layer/surface pair */
-    display_layer->layer = layer;
-    display_layer->surface = surface;
-
-    /* Insert list element as the new head */
-    display_layer->prev = NULL;
-    display_layer->next = old_head;
-    *head = display_layer;
-
-    /* Update old head to point to new element, if it existed */
-    if (old_head != NULL)
-        old_head->prev = display_layer;
-
-    return display_layer;
-
-}
-
-/**
- * Removes the given display layer from the linked list whose head pointer is
- * provided.
- *
- * @param head
- *     A pointer to the head pointer of the list of layers. The head pointer
- *     will be updated by this function if necessary, and will be set to NULL
- *     if the display layer being removed is the only layer in the list.
- *
- * @param display_layer
- *     The display layer to remove from the given list.
- */
-static void guac_common_display_remove_layer(guac_common_display_layer** head,
-        guac_common_display_layer* display_layer) {
-
-    /* Update previous element, if it exists */
-    if (display_layer->prev != NULL)
-        display_layer->prev->next = display_layer->next;
-
-    /* If there is no previous element, update the list head */
-    else
-        *head = display_layer->next;
-
-    /* Update next element, if it exists */
-    if (display_layer->next != NULL)
-        display_layer->next->prev = display_layer->prev;
-
-}
-
-guac_common_display_layer* guac_common_display_alloc_layer(
-        guac_common_display* display, int width, int height) {
-
-    guac_layer* layer;
-    guac_common_surface* surface;
-
-    /* Allocate Guacamole layer */
-    layer = guac_client_alloc_layer(display->client);
-
-    /* Allocate corresponding surface */
-    surface = guac_common_surface_alloc(display->client,
-            display->client->socket, layer, width, height);
-
-    /* Add layer and surface to list */
-    return guac_common_display_add_layer(&display->layers, layer, surface);
-
-}
-
-guac_common_display_layer* guac_common_display_alloc_buffer(
-        guac_common_display* display, int width, int height) {
-
-    guac_layer* buffer;
-    guac_common_surface* surface;
-
-    /* Allocate Guacamole buffer */
-    buffer = guac_client_alloc_buffer(display->client);
-
-    /* Allocate corresponding surface */
-    surface = guac_common_surface_alloc(display->client,
-            display->client->socket, buffer, width, height);
-
-    /* Add buffer and surface to list */
-    return guac_common_display_add_layer(&display->buffers, buffer, surface);
-
-}
-
-void guac_common_display_free_layer(guac_common_display* display,
-        guac_common_display_layer* display_layer) {
-
-    /* Remove list element from list */
-    guac_common_display_remove_layer(&display->layers, display_layer);
-
-    /* Free associated layer and surface */
-    guac_common_surface_free(display_layer->surface);
-    guac_client_free_layer(display->client, display_layer->layer);
-
-    /* Free list element */
-    free(display_layer);
-
-}
-
-void guac_common_display_free_buffer(guac_common_display* display,
-        guac_common_display_layer* display_buffer) {
-
-    /* Remove list element from list */
-    guac_common_display_remove_layer(&display->buffers, display_buffer);
-
-    /* Free associated layer and surface */
-    guac_common_surface_free(display_buffer->surface);
-    guac_client_free_buffer(display->client, display_buffer->layer);
-
-    /* Free list element */
-    free(display_buffer);
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_display.h
----------------------------------------------------------------------
diff --git a/src/common/guac_display.h b/src/common/guac_display.h
deleted file mode 100644
index 4bac8ea..0000000
--- a/src/common/guac_display.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef GUAC_COMMON_DISPLAY_H
-#define GUAC_COMMON_DISPLAY_H
-
-#include "guac_cursor.h"
-#include "guac_surface.h"
-
-#include <guacamole/client.h>
-#include <guacamole/socket.h>
-
-/**
- * A list element representing a pairing of a Guacamole layer with a
- * corresponding guac_common_surface which wraps that layer. Adjacent layers
- * within the same list are pointed to with traditional prev/next pointers. The
- * order of layers in lists need not correspond in any way to the natural
- * ordering of those layers' indexes nor their stacking order (Z-order) within
- * the display.
- */
-typedef struct guac_common_display_layer guac_common_display_layer;
-
-struct guac_common_display_layer {
-
-    /**
-     * A Guacamole layer.
-     */
-    guac_layer* layer;
-
-    /**
-     * The surface which wraps the associated layer.
-     */
-    guac_common_surface* surface;
-
-    /**
-     * The layer immediately prior to this layer within the list containing
-     * this layer, or NULL if this is the first layer/buffer in the list.
-     */
-    guac_common_display_layer* prev;
-
-    /**
-     * The layer immediately following this layer within the list containing
-     * this layer, or NULL if this is the last layer/buffer in the list.
-     */
-    guac_common_display_layer* next;
-
-};
-
-/**
- * Abstracts a remote Guacamole display, having an associated client,
- * default surface, mouse cursor, and various allocated buffers and layers.
- */
-typedef struct guac_common_display {
-
-    /**
-     * The client associate with this display.
-     */
-    guac_client* client;
-
-    /**
-     * The default surface of the client display.
-     */
-    guac_common_surface* default_surface;
-
-    /**
-     * Client-wide cursor, synchronized across all users.
-     */
-    guac_common_cursor* cursor;
-
-    /**
-     * The first element within a linked list of all currently-allocated
-     * layers, or NULL if no layers are currently allocated. The default layer,
-     * layer #0, is stored within default_surface and will not have a
-     * corresponding element within this list.
-     */
-    guac_common_display_layer* layers;
-
-    /**
-     * The first element within a linked list of all currently-allocated
-     * buffers, or NULL if no buffers are currently allocated.
-     */
-    guac_common_display_layer* buffers;
-
-} guac_common_display;
-
-/**
- * Allocates a new display, abstracting the cursor and buffer/layer allocation
- * operations of the given guac_client such that client state can be easily
- * synchronized to joining users.
- *
- * @param client
- *     The guac_client to associate with this display.
- *
- * @param width
- *     The initial width of the display, in pixels.
- *
- * @param height
- *     The initial height of the display, in pixels.
- *
- * @return
- *     The newly-allocated display.
- */
-guac_common_display* guac_common_display_alloc(guac_client* client,
-        int width, int height);
-
-/**
- * Frees the given display, and any associated resources, including any
- * allocated buffers/layers.
- *
- * @param display
- *     The display to free.
- */
-void guac_common_display_free(guac_common_display* display);
-
-/**
- * Duplicates the state of the given display to the given socket. Any pending
- * changes to buffers, layers, or the default layer are not flushed.
- *
- * @param display
- *     The display whose state should be sent along the given socket.
- *
- * @param user
- *     The user receiving the display state.
- *
- * @param socket
- *     The socket over which the display state should be sent.
- */
-void guac_common_display_dup(guac_common_display* display, guac_user* user,
-        guac_socket* socket);
-
-/**
- * Flushes pending changes to the given display. All pending operations will
- * become visible to any connected users.
- *
- * @param display
- *     The display to flush.
- */
-void guac_common_display_flush(guac_common_display* display);
-
-/**
- * Allocates a new layer, returning a new wrapped layer and corresponding
- * surface. The layer may be reused from a previous allocation, if that layer
- * has since been freed.
- *
- * @param display
- *     The display to allocate a new layer from.
- *
- * @param width
- *     The width of the layer to allocate, in pixels.
- *
- * @param height
- *     The height of the layer to allocate, in pixels.
- *
- * @return
- *     A newly-allocated layer.
- */
-guac_common_display_layer* guac_common_display_alloc_layer(
-        guac_common_display* display, int width, int height);
-
-/**
- * Allocates a new buffer, returning a new wrapped buffer and corresponding
- * surface. The buffer may be reused from a previous allocation, if that buffer
- * has since been freed.
- *
- * @param display
- *     The display to allocate a new buffer from.
- *
- * @param width
- *     The width of the buffer to allocate, in pixels.
- *
- * @param height
- *     The height of the buffer to allocate, in pixels.
- *
- * @return
- *     A newly-allocated buffer.
- */
-guac_common_display_layer* guac_common_display_alloc_buffer(
-        guac_common_display* display, int width, int height);
-
-/**
- * Frees the given surface and associated layer, returning the layer to the
- * given display for future use.
- *
- * @param display
- *     The display originally allocating the layer.
- *
- * @param display_layer
- *     The layer to free.
- */
-void guac_common_display_free_layer(guac_common_display* display,
-        guac_common_display_layer* display_layer);
-
-/**
- * Frees the given surface and associated buffer, returning the buffer to the
- * given display for future use.
- *
- * @param display
- *     The display originally allocating the buffer.
- *
- * @param display_buffer
- *     The buffer to free.
- */
-void guac_common_display_free_buffer(guac_common_display* display,
-        guac_common_display_layer* display_buffer);
-
-#endif
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_dot_cursor.c
----------------------------------------------------------------------
diff --git a/src/common/guac_dot_cursor.c b/src/common/guac_dot_cursor.c
deleted file mode 100644
index fde79b0..0000000
--- a/src/common/guac_dot_cursor.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/client.h>
-#include <guacamole/layer.h>
-#include <guacamole/protocol.h>
-#include <guacamole/socket.h>
-#include <guacamole/user.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_common_dot_cursor_width  = 5;
-const int guac_common_dot_cursor_height = 5;
-
-/* Format */
-const cairo_format_t guac_common_dot_cursor_format = CAIRO_FORMAT_ARGB32;
-const int guac_common_dot_cursor_stride = 20;
-
-/* Embedded pointer graphic */
-unsigned char guac_common_dot_cursor[] = {
-
-        _,O,O,O,_,
-        O,X,X,X,O,
-        O,X,X,X,O,
-        O,X,X,X,O,
-        _,O,O,O,_
-
-};
-
-void guac_common_set_dot_cursor(guac_user* user) {
-
-    guac_client* client = user->client;
-    guac_socket* socket = user->socket;
-
-    /* Draw to buffer */
-    guac_layer* cursor = guac_client_alloc_buffer(client);
-
-    cairo_surface_t* graphic = cairo_image_surface_create_for_data(
-            guac_common_dot_cursor,
-            guac_common_dot_cursor_format,
-            guac_common_dot_cursor_width,
-            guac_common_dot_cursor_height,
-            guac_common_dot_cursor_stride);
-
-    guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
-            0, 0, graphic);
-    cairo_surface_destroy(graphic);
-
-    /* Set cursor */
-    guac_protocol_send_cursor(socket, 2, 2, cursor,
-            0, 0,
-            guac_common_dot_cursor_width,
-            guac_common_dot_cursor_height);
-
-    /* Free buffer */
-    guac_client_free_buffer(client, cursor);
-
-    guac_client_log(client, GUAC_LOG_DEBUG,
-            "Client cursor image set to generic built-in dot.");
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_dot_cursor.h
----------------------------------------------------------------------
diff --git a/src/common/guac_dot_cursor.h b/src/common/guac_dot_cursor.h
deleted file mode 100644
index 034d044..0000000
--- a/src/common/guac_dot_cursor.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#ifndef _GUAC_COMMON_DOT_CURSOR_H
-#define _GUAC_COMMON_DOT_CURSOR_H
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/user.h>
-
-/**
- * Width of the embedded mouse cursor graphic.
- */
-extern const int guac_common_dot_cursor_width;
-
-/**
- * Height of the embedded mouse cursor graphic.
- */
-extern const int guac_common_dot_cursor_height;
-
-/**
- * Number of bytes in each row of the embedded mouse cursor graphic.
- */
-extern const int guac_common_dot_cursor_stride;
-
-/**
- * The Cairo grapic format of the mouse cursor graphic.
- */
-extern const cairo_format_t guac_common_dot_cursor_format;
-
-/**
- * Embedded mouse cursor graphic.
- */
-extern unsigned char guac_common_dot_cursor[];
-
-/**
- * Set the cursor of the remote display to the embedded cursor graphic.
- *
- * @param user The guac_user to send the cursor to.
- */
-void guac_common_set_dot_cursor(guac_user* user);
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_ibar_cursor.c
----------------------------------------------------------------------
diff --git a/src/common/guac_ibar_cursor.c b/src/common/guac_ibar_cursor.c
deleted file mode 100644
index 6494591..0000000
--- a/src/common/guac_ibar_cursor.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/client.h>
-#include <guacamole/layer.h>
-#include <guacamole/protocol.h>
-#include <guacamole/socket.h>
-#include <guacamole/user.h>
-
-/* Macros for prettying up the embedded image. */
-#define X 0x00,0x00,0x00,0xFF
-#define U 0x80,0x80,0x80,0xFF
-#define O 0xFF,0xFF,0xFF,0xFF
-#define _ 0x00,0x00,0x00,0x00
-
-/* Dimensions */
-const int guac_common_ibar_cursor_width  = 7;
-const int guac_common_ibar_cursor_height = 16;
-
-/* Format */
-const cairo_format_t guac_common_ibar_cursor_format = CAIRO_FORMAT_ARGB32;
-const int guac_common_ibar_cursor_stride = 28;
-
-/* Embedded I-bar graphic */
-unsigned char guac_common_ibar_cursor[] = {
-
-        X,X,X,X,X,X,X,
-        X,O,O,U,O,O,X,
-        X,X,X,O,X,X,X,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        _,_,X,O,X,_,_,
-        X,X,X,O,X,X,X,
-        X,O,O,U,O,O,X,
-        X,X,X,X,X,X,X
-
-};
-
-void guac_common_set_ibar_cursor(guac_user* user) {
-
-    guac_client* client = user->client;
-    guac_socket* socket = user->socket;
-
-    /* Draw to buffer */
-    guac_layer* cursor = guac_client_alloc_buffer(client);
-
-    cairo_surface_t* graphic = cairo_image_surface_create_for_data(
-            guac_common_ibar_cursor,
-            guac_common_ibar_cursor_format,
-            guac_common_ibar_cursor_width,
-            guac_common_ibar_cursor_height,
-            guac_common_ibar_cursor_stride);
-
-    guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
-            0, 0, graphic);
-    cairo_surface_destroy(graphic);
-
-    /* Set cursor */
-    guac_protocol_send_cursor(socket, 0, 0, cursor,
-            guac_common_ibar_cursor_width / 2,
-            guac_common_ibar_cursor_height / 2,
-            guac_common_ibar_cursor_width,
-            guac_common_ibar_cursor_height);
-
-    /* Free buffer */
-    guac_client_free_buffer(client, cursor);
-
-    guac_client_log(client, GUAC_LOG_DEBUG,
-            "Client cursor image set to generic built-in I-bar.");
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/eee92854/src/common/guac_ibar_cursor.h
----------------------------------------------------------------------
diff --git a/src/common/guac_ibar_cursor.h b/src/common/guac_ibar_cursor.h
deleted file mode 100644
index ae11fff..0000000
--- a/src/common/guac_ibar_cursor.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef GUAC_COMMON_IBAR_CURSOR_H
-#define GUAC_COMMON_IBAR_CURSOR_H
-
-#include "config.h"
-
-#include <cairo/cairo.h>
-#include <guacamole/user.h>
-
-/**
- * Width of the embedded I-bar mouse cursor graphic.
- */
-extern const int guac_common_ibar_cursor_width;
-
-/**
- * Height of the embedded I-bar mouse cursor graphic.
- */
-extern const int guac_common_ibar_cursor_height;
-
-/**
- * Number of bytes in each row of the embedded I-bar mouse cursor graphic.
- */
-extern const int guac_common_ibar_cursor_stride;
-
-/**
- * The Cairo grapic format of the I-bar mouse cursor graphic.
- */
-extern const cairo_format_t guac_common_ibar_cursor_format;
-
-/**
- * Embedded I-bar mouse cursor graphic.
- */
-extern unsigned char guac_common_ibar_cursor[];
-
-/**
- * Sets the cursor of the remote display to the embedded I-bar cursor graphic.
- *
- * @param user
- *     The guac_user to send the cursor to.
- */
-void guac_common_set_ibar_cursor(guac_user* user);
-
-#endif
-


Mime
View raw message