diff --git a/src/protocols/ssh/client.c b/src/protocols/ssh/client.c index 0b5a14f6..676a5f74 100644 --- a/src/protocols/ssh/client.c +++ b/src/protocols/ssh/client.c @@ -187,17 +187,17 @@ int guac_client_init(guac_client* client, int argc, char** argv) { } /* Set up I-bar pointer */ - client_data->ibar_cursor = guac_ssh_create_ibar(client); + client_data->ibar_cursor = guac_terminal_create_ibar(client); /* Set up blank pointer */ - client_data->blank_cursor = guac_ssh_create_blank(client); + client_data->blank_cursor = guac_terminal_create_blank(client); /* Send initial name */ guac_protocol_send_name(socket, client_data->hostname); /* Initialize pointer */ client_data->current_cursor = client_data->blank_cursor; - guac_ssh_set_cursor(client, client_data->current_cursor); + guac_terminal_set_cursor(client, client_data->current_cursor); guac_socket_flush(socket); diff --git a/src/protocols/ssh/client.h b/src/protocols/ssh/client.h index 11598e73..18b326f2 100644 --- a/src/protocols/ssh/client.h +++ b/src/protocols/ssh/client.h @@ -176,17 +176,17 @@ typedef struct ssh_guac_client_data { /** * The cached I-bar cursor. */ - guac_ssh_cursor* ibar_cursor; + guac_terminal_cursor* ibar_cursor; /** * The cached invisible (blank) cursor. */ - guac_ssh_cursor* blank_cursor; + guac_terminal_cursor* blank_cursor; /** * The current cursor, used to avoid re-setting the cursor. */ - guac_ssh_cursor* current_cursor; + guac_terminal_cursor* current_cursor; } ssh_guac_client_data; diff --git a/src/protocols/ssh/guac_handlers.c b/src/protocols/ssh/guac_handlers.c index 579569e4..4ee12f01 100644 --- a/src/protocols/ssh/guac_handlers.c +++ b/src/protocols/ssh/guac_handlers.c @@ -119,7 +119,7 @@ int ssh_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { pthread_mutex_lock(&(term->lock)); client_data->current_cursor = client_data->ibar_cursor; - guac_ssh_set_cursor(client, client_data->ibar_cursor); + guac_terminal_set_cursor(client, client_data->ibar_cursor); guac_socket_flush(client->socket); pthread_mutex_unlock(&(term->lock)); @@ -180,14 +180,14 @@ int ssh_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { /* Scroll up if wheel moved up */ if (released_mask & GUAC_CLIENT_MOUSE_SCROLL_UP) { pthread_mutex_lock(&(term->lock)); - guac_terminal_scroll_display_up(term, GUAC_SSH_WHEEL_SCROLL_AMOUNT); + guac_terminal_scroll_display_up(term, GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT); pthread_mutex_unlock(&(term->lock)); } /* Scroll down if wheel moved down */ if (released_mask & GUAC_CLIENT_MOUSE_SCROLL_DOWN) { pthread_mutex_lock(&(term->lock)); - guac_terminal_scroll_display_down(term, GUAC_SSH_WHEEL_SCROLL_AMOUNT); + guac_terminal_scroll_display_down(term, GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT); pthread_mutex_unlock(&(term->lock)); } @@ -205,7 +205,7 @@ int ssh_guac_client_key_handler(guac_client* client, int keysym, int pressed) { pthread_mutex_lock(&(term->lock)); client_data->current_cursor = client_data->blank_cursor; - guac_ssh_set_cursor(client, client_data->blank_cursor); + guac_terminal_set_cursor(client, client_data->blank_cursor); guac_socket_flush(client->socket); pthread_mutex_unlock(&(term->lock)); @@ -421,8 +421,8 @@ int ssh_guac_client_free_handler(guac_client* client) { guac_common_clipboard_free(guac_client_data->clipboard); /* Free cursors */ - guac_ssh_cursor_free(client, guac_client_data->ibar_cursor); - guac_ssh_cursor_free(client, guac_client_data->blank_cursor); + guac_terminal_cursor_free(client, guac_client_data->ibar_cursor); + guac_terminal_cursor_free(client, guac_client_data->blank_cursor); /* Free generic data struct */ free(client->data); diff --git a/src/terminal/blank.c b/src/terminal/blank.c index f2253d59..f2165275 100644 --- a/src/terminal/blank.c +++ b/src/terminal/blank.c @@ -29,10 +29,10 @@ #include #include -guac_ssh_cursor* guac_ssh_create_blank(guac_client* client) { +guac_terminal_cursor* guac_terminal_create_blank(guac_client* client) { guac_socket* socket = client->socket; - guac_ssh_cursor* cursor = guac_ssh_cursor_alloc(client); + guac_terminal_cursor* cursor = guac_terminal_cursor_alloc(client); /* Set buffer to a single 1x1 transparent rectangle */ guac_protocol_send_rect(socket, cursor->buffer, 0, 0, 1, 1); diff --git a/src/terminal/blank.h b/src/terminal/blank.h index def9f1e2..0d22797b 100644 --- a/src/terminal/blank.h +++ b/src/terminal/blank.h @@ -21,8 +21,8 @@ */ -#ifndef _GUAC_SSH_BLANK_H -#define _GUAC_SSH_BLANK_H +#ifndef _GUAC_TERMINAL_BLANK_H +#define _GUAC_TERMINAL_BLANK_H #include "config.h" @@ -35,8 +35,8 @@ * Creates a new blank cursor, returning the corresponding cursor object. * * @param client The guac_client to send the cursor to. - * @return A new cursor which must be free'd via guac_ssh_cursor_free()/ + * @return A new cursor which must be free'd via guac_terminal_cursor_free()/ */ -guac_ssh_cursor* guac_ssh_create_blank(guac_client* client); +guac_terminal_cursor* guac_terminal_create_blank(guac_client* client); #endif diff --git a/src/terminal/buffer.h b/src/terminal/buffer.h index 9362d53c..1ae7a4d5 100644 --- a/src/terminal/buffer.h +++ b/src/terminal/buffer.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_BUFFER_H -#define _SSH_GUAC_BUFFER_H +#ifndef _GUAC_TERMINAL_BUFFER_H +#define _GUAC_TERMINAL_BUFFER_H #include "config.h" diff --git a/src/terminal/char_mappings.h b/src/terminal/char_mappings.h index fe823844..f59ae71f 100644 --- a/src/terminal/char_mappings.h +++ b/src/terminal/char_mappings.h @@ -21,8 +21,8 @@ */ -#ifndef _GUAC_SSH_CHAR_MAPPINGS_H -#define _GUAC_SSH_CHAR_MAPPINGS_H +#ifndef _GUAC_TERMINAL_CHAR_MAPPINGS_H +#define _GUAC_TERMINAL_CHAR_MAPPINGS_H #include "config.h" diff --git a/src/terminal/common.h b/src/terminal/common.h index 358943ee..dbff68d1 100644 --- a/src/terminal/common.h +++ b/src/terminal/common.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_COMMON_H -#define _SSH_GUAC_COMMON_H +#ifndef _GUAC_TERMINAL_COMMON_H +#define _GUAC_TERMINAL_COMMON_H #include "config.h" diff --git a/src/terminal/cursor.c b/src/terminal/cursor.c index 1dc800d5..9bd00264 100644 --- a/src/terminal/cursor.c +++ b/src/terminal/cursor.c @@ -29,17 +29,17 @@ #include #include -guac_ssh_cursor* guac_ssh_cursor_alloc(guac_client* client) { +guac_terminal_cursor* guac_terminal_cursor_alloc(guac_client* client) { /* Alloc new cursor, initialize buffer */ - guac_ssh_cursor* cursor = malloc(sizeof(guac_ssh_cursor)); + guac_terminal_cursor* cursor = malloc(sizeof(guac_terminal_cursor)); cursor->buffer = guac_client_alloc_buffer(client); return cursor; } -void guac_ssh_cursor_free(guac_client* client, guac_ssh_cursor* cursor) { +void guac_terminal_cursor_free(guac_client* client, guac_terminal_cursor* cursor) { /* Free buffer */ guac_client_free_buffer(client, cursor->buffer); @@ -49,7 +49,7 @@ void guac_ssh_cursor_free(guac_client* client, guac_ssh_cursor* cursor) { } -void guac_ssh_set_cursor(guac_client* client, guac_ssh_cursor* cursor) { +void guac_terminal_set_cursor(guac_client* client, guac_terminal_cursor* cursor) { /* Set cursor */ guac_protocol_send_cursor(client->socket, diff --git a/src/terminal/cursor.h b/src/terminal/cursor.h index 1aff8b47..cfe5c036 100644 --- a/src/terminal/cursor.h +++ b/src/terminal/cursor.h @@ -21,14 +21,14 @@ */ -#ifndef _GUAC_SSH_CURSOR_H -#define _GUAC_SSH_CURSOR_H +#ifndef _GUAC_TERMINAL_CURSOR_H +#define _GUAC_TERMINAL_CURSOR_H #include "config.h" #include -typedef struct guac_ssh_cursor { +typedef struct guac_terminal_cursor { /** * A buffer allocated with guac_client_alloc_buffer() that contains the @@ -56,22 +56,22 @@ typedef struct guac_ssh_cursor { */ int hotspot_y; -} guac_ssh_cursor; +} guac_terminal_cursor; /** * Allocates a new cursor, pre-populating the cursor with a newly-allocated * buffer. */ -guac_ssh_cursor* guac_ssh_cursor_alloc(guac_client* client); +guac_terminal_cursor* guac_terminal_cursor_alloc(guac_client* client); /** * Frees the buffer associated with this cursor as well as the cursor itself. */ -void guac_ssh_cursor_free(guac_client* client, guac_ssh_cursor* cursor); +void guac_terminal_cursor_free(guac_client* client, guac_terminal_cursor* cursor); /** * Set the remote cursor. */ -void guac_ssh_set_cursor(guac_client* client, guac_ssh_cursor* cursor); +void guac_terminal_set_cursor(guac_client* client, guac_terminal_cursor* cursor); #endif diff --git a/src/terminal/display.h b/src/terminal/display.h index e6cf8599..54723a51 100644 --- a/src/terminal/display.h +++ b/src/terminal/display.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_DISPLAY_H -#define _SSH_GUAC_DISPLAY_H +#ifndef _GUAC_TERMINAL_DISPLAY_H +#define _GUAC_TERMINAL_DISPLAY_H #include "config.h" diff --git a/src/terminal/ibar.c b/src/terminal/ibar.c index 405b7879..ecdcc5cb 100644 --- a/src/terminal/ibar.c +++ b/src/terminal/ibar.c @@ -36,15 +36,15 @@ #define _ 0x00,0x00,0x00,0x00 /* Dimensions */ -const int guac_ssh_ibar_width = 7; -const int guac_ssh_ibar_height = 16; +const int guac_terminal_ibar_width = 7; +const int guac_terminal_ibar_height = 16; /* Format */ -const cairo_format_t guac_ssh_ibar_format = CAIRO_FORMAT_ARGB32; -const int guac_ssh_ibar_stride = 28; +const cairo_format_t guac_terminal_ibar_format = CAIRO_FORMAT_ARGB32; +const int guac_terminal_ibar_stride = 28; /* Embedded pointer graphic */ -unsigned char guac_ssh_ibar[] = { +unsigned char guac_terminal_ibar[] = { X,X,X,X,X,X,X, X,O,O,U,O,O,X, @@ -65,28 +65,28 @@ unsigned char guac_ssh_ibar[] = { }; -guac_ssh_cursor* guac_ssh_create_ibar(guac_client* client) { +guac_terminal_cursor* guac_terminal_create_ibar(guac_client* client) { guac_socket* socket = client->socket; - guac_ssh_cursor* cursor = guac_ssh_cursor_alloc(client); + guac_terminal_cursor* cursor = guac_terminal_cursor_alloc(client); /* Draw to buffer */ cairo_surface_t* graphic = cairo_image_surface_create_for_data( - guac_ssh_ibar, - guac_ssh_ibar_format, - guac_ssh_ibar_width, - guac_ssh_ibar_height, - guac_ssh_ibar_stride); + guac_terminal_ibar, + guac_terminal_ibar_format, + guac_terminal_ibar_width, + guac_terminal_ibar_height, + guac_terminal_ibar_stride); guac_protocol_send_png(socket, GUAC_COMP_SRC, cursor->buffer, 0, 0, graphic); cairo_surface_destroy(graphic); /* Initialize cursor properties */ - cursor->width = guac_ssh_ibar_width; - cursor->height = guac_ssh_ibar_height; - cursor->hotspot_x = guac_ssh_ibar_width / 2; - cursor->hotspot_y = guac_ssh_ibar_height / 2; + cursor->width = guac_terminal_ibar_width; + cursor->height = guac_terminal_ibar_height; + cursor->hotspot_x = guac_terminal_ibar_width / 2; + cursor->hotspot_y = guac_terminal_ibar_height / 2; return cursor; diff --git a/src/terminal/ibar.h b/src/terminal/ibar.h index 376a0d0a..bbbc6578 100644 --- a/src/terminal/ibar.h +++ b/src/terminal/ibar.h @@ -21,8 +21,8 @@ */ -#ifndef _GUAC_SSH_IBAR_H -#define _GUAC_SSH_IBAR_H +#ifndef _GUAC_TERMINAL_IBAR_H +#define _GUAC_TERMINAL_IBAR_H #include "config.h" @@ -32,34 +32,34 @@ /** * Width of the embedded mouse cursor graphic. */ -extern const int guac_ssh_ibar_width; +extern const int guac_terminal_ibar_width; /** * Height of the embedded mouse cursor graphic. */ -extern const int guac_ssh_ibar_height; +extern const int guac_terminal_ibar_height; /** * Number of bytes in each row of the embedded mouse cursor graphic. */ -extern const int guac_ssh_ibar_stride; +extern const int guac_terminal_ibar_stride; /** * The Cairo grapic format of the mouse cursor graphic. */ -extern const cairo_format_t guac_ssh_ibar_format; +extern const cairo_format_t guac_terminal_ibar_format; /** * Embedded mouse cursor graphic. */ -extern unsigned char guac_ssh_ibar[]; +extern unsigned char guac_terminal_ibar[]; /** * Creates a new I-bar cursor, returning the corresponding cursor object. * * @param client The guac_client to send the cursor to. - * @return A new cursor which must be free'd via guac_ssh_cursor_free()/ + * @return A new cursor which must be free'd via guac_terminal_cursor_free()/ */ -guac_ssh_cursor* guac_ssh_create_ibar(guac_client* client); +guac_terminal_cursor* guac_terminal_create_ibar(guac_client* client); #endif diff --git a/src/terminal/terminal.h b/src/terminal/terminal.h index c48ae7dc..dab6630c 100644 --- a/src/terminal/terminal.h +++ b/src/terminal/terminal.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_TERMINAL_H -#define _SSH_GUAC_TERMINAL_H +#ifndef _GUAC_TERMINAL_H +#define _GUAC_TERMINAL_H #include "config.h" @@ -43,7 +43,7 @@ /** * The number of rows to scroll per scroll wheel event. */ -#define GUAC_SSH_WHEEL_SCROLL_AMOUNT 3 +#define GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT 3 typedef struct guac_terminal guac_terminal; diff --git a/src/terminal/terminal_handlers.c b/src/terminal/terminal_handlers.c index be1436bd..5a4a0122 100644 --- a/src/terminal/terminal_handlers.c +++ b/src/terminal/terminal_handlers.c @@ -875,7 +875,7 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) { } -int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c) { +int guac_terminal_set_directory(guac_terminal* term, unsigned char c) { static char filename[2048]; static int length = 0; @@ -896,7 +896,7 @@ int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c) { } -int guac_terminal_guac_download(guac_terminal* term, unsigned char c) { +int guac_terminal_download(guac_terminal* term, unsigned char c) { static char filename[2048]; static int length = 0; @@ -930,11 +930,11 @@ int guac_terminal_osc(guac_terminal* term, unsigned char c) { /* Download OSC */ if (operation == 482200) - term->char_handler = guac_terminal_guac_download; + term->char_handler = guac_terminal_download; /* Set upload directory OSC */ else if (operation == 482201) - term->char_handler = guac_terminal_guac_set_directory; + term->char_handler = guac_terminal_set_directory; /* Reset parameter for next OSC */ operation = 0; diff --git a/src/terminal/terminal_handlers.h b/src/terminal/terminal_handlers.h index bccad21a..a6d8f225 100644 --- a/src/terminal/terminal_handlers.h +++ b/src/terminal/terminal_handlers.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_TERMINAL_HANDLERS -#define _SSH_GUAC_TERMINAL_HANDLERS +#ifndef _GUAC_TERMINAL_HANDLERS +#define _GUAC_TERMINAL_HANDLERS #include "config.h" @@ -33,8 +33,8 @@ int guac_terminal_escape(guac_terminal* term, unsigned char c); int guac_terminal_g0_charset(guac_terminal* term, unsigned char c); int guac_terminal_g1_charset(guac_terminal* term, unsigned char c); int guac_terminal_csi(guac_terminal* term, unsigned char c); -int guac_terminal_guac_download(guac_terminal* term, unsigned char c); -int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c); +int guac_terminal_download(guac_terminal* term, unsigned char c); +int guac_terminal_set_directory(guac_terminal* term, unsigned char c); int guac_terminal_osc(guac_terminal* term, unsigned char c); int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c); diff --git a/src/terminal/types.h b/src/terminal/types.h index 12f3a854..efa1c617 100644 --- a/src/terminal/types.h +++ b/src/terminal/types.h @@ -21,8 +21,8 @@ */ -#ifndef _SSH_GUAC_TYPES_H -#define _SSH_GUAC_TYPES_H +#ifndef _GUAC_TERMINAL_TYPES_H +#define _GUAC_TERMINAL_TYPES_H #include "config.h"