Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
GUACAMOLE-1538: Make it clear which functions are getters by adding _…
Browse files Browse the repository at this point in the history
…get_ to the name of each.
  • Loading branch information
jmuehlner committed Feb 24, 2022
1 parent 0856e94 commit ad0155b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/protocols/kubernetes/argv.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ void* guac_kubernetes_send_current_argv(guac_user* user, void* data) {
/* Send current color scheme */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_KUBERNETES_ARGV_COLOR_SCHEME,
guac_terminal_color_scheme(terminal));
guac_terminal_get_color_scheme(terminal));

/* Send current font name */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_KUBERNETES_ARGV_FONT_NAME,
guac_terminal_font_name(terminal));
guac_terminal_get_font_name(terminal));

/* Send current font size */
char font_size[64];
sprintf(font_size, "%i", guac_terminal_font_size(terminal));
sprintf(font_size, "%i", guac_terminal_get_font_size(terminal));
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_KUBERNETES_ARGV_FONT_SIZE, font_size);

Expand Down
6 changes: 3 additions & 3 deletions src/protocols/ssh/argv.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ void* guac_ssh_send_current_argv(guac_user* user, void* data) {
/* Send current color scheme */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_SSH_ARGV_COLOR_SCHEME,
guac_terminal_color_scheme(terminal));
guac_terminal_get_color_scheme(terminal));

/* Send current font name */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_SSH_ARGV_FONT_NAME,
guac_terminal_font_name(terminal));
guac_terminal_get_font_name(terminal));

/* Send current font size */
char font_size[64];
sprintf(font_size, "%i", guac_terminal_font_size(terminal));
sprintf(font_size, "%i", guac_terminal_get_font_size(terminal));
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_SSH_ARGV_FONT_SIZE, font_size);

Expand Down
6 changes: 3 additions & 3 deletions src/protocols/telnet/argv.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ void* guac_telnet_send_current_argv(guac_user* user, void* data) {
/* Send current color scheme */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_TELNET_ARGV_COLOR_SCHEME,
guac_terminal_color_scheme(terminal));
guac_terminal_get_color_scheme(terminal));

/* Send current font name */
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_TELNET_ARGV_FONT_NAME,
guac_terminal_font_name(terminal));
guac_terminal_get_font_name(terminal));

/* Send current font size */
char font_size[64];
sprintf(font_size, "%i", guac_terminal_font_size(terminal));
sprintf(font_size, "%i", guac_terminal_get_font_size(terminal));
guac_user_stream_argv(user, user->socket, "text/plain",
GUAC_TELNET_ARGV_FONT_SIZE, font_size);

Expand Down
2 changes: 1 addition & 1 deletion src/protocols/telnet/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int guac_telnet_user_key_handler(guac_user* user, int keysym, int pressed) {
keysym == 0xFF13 /* Pause */
|| keysym == 0xFF6B /* Break */
|| (
guac_terminal_mod_ctrl(term)
guac_terminal_get_mod_ctrl(term)
&& keysym == '0'
) /* Ctrl + 0 */
)) {
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/terminal-handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ int guac_terminal_set_scrollback(guac_terminal* term, unsigned char c) {

/* Update scrollbar bounds */
guac_terminal_scrollbar_set_bounds(term->scrollbar,
-guac_terminal_available_scroll(term), 0);
-guac_terminal_get_available_scroll(term), 0);

/* Return to echo mode */
term->char_handler = guac_terminal_echo;
Expand Down
18 changes: 9 additions & 9 deletions src/terminal/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static int guac_terminal_effective_buffer_length(guac_terminal* term) {

}

int guac_terminal_available_scroll(guac_terminal* term) {
int guac_terminal_get_available_scroll(guac_terminal* term) {
return guac_terminal_effective_buffer_length(term) - term->term_height;
}

Expand Down Expand Up @@ -897,7 +897,7 @@ int guac_terminal_scroll_up(guac_terminal* term,

/* Reset scrollbar bounds */
guac_terminal_scrollbar_set_bounds(term->scrollbar,
-guac_terminal_available_scroll(term), 0);
-guac_terminal_get_available_scroll(term), 0);

/* Update cursor location if within region */
if (term->visible_cursor_row >= start_row &&
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void guac_terminal_scroll_display_up(guac_terminal* terminal,
int row, column;

/* Limit scroll amount by size of scrollback buffer */
int available_scroll = guac_terminal_available_scroll(terminal);
int available_scroll = guac_terminal_get_available_scroll(terminal);
if (terminal->scroll_offset + scroll_amount > available_scroll)
scroll_amount = available_scroll - terminal->scroll_offset;

Expand Down Expand Up @@ -1308,7 +1308,7 @@ static void __guac_terminal_resize(guac_terminal* term, int width, int height) {
if (height > term->term_height) {

/* If undisplayed rows exist in the buffer, shift them into view */
int available_scroll = guac_terminal_available_scroll(term);
int available_scroll = guac_terminal_get_available_scroll(term);
if (available_scroll > 0) {

/* If the new terminal bottom reveals N rows, shift down N rows */
Expand Down Expand Up @@ -1433,7 +1433,7 @@ int guac_terminal_resize(guac_terminal* terminal, int width, int height) {
/* Notify scrollbar of resize */
guac_terminal_scrollbar_parent_resized(terminal->scrollbar, width, height, rows);
guac_terminal_scrollbar_set_bounds(terminal->scrollbar,
-guac_terminal_available_scroll(terminal), 0);
-guac_terminal_get_available_scroll(terminal), 0);


/* Release terminal */
Expand Down Expand Up @@ -2027,7 +2027,7 @@ void guac_terminal_apply_color_scheme(guac_terminal* terminal,

}

const char* guac_terminal_color_scheme(guac_terminal* terminal) {
const char* guac_terminal_get_color_scheme(guac_terminal* terminal) {
return terminal->color_scheme;
}

Expand Down Expand Up @@ -2079,15 +2079,15 @@ void guac_terminal_set_file_download_handler(guac_terminal* terminal,
terminal->file_download_handler = file_download_handler;
}

const char* guac_terminal_font_name(guac_terminal* terminal) {
const char* guac_terminal_get_font_name(guac_terminal* terminal) {
return terminal->font_name;
}

int guac_terminal_font_size(guac_terminal* terminal) {
int guac_terminal_get_font_size(guac_terminal* terminal) {
return terminal->font_size;
}

int guac_terminal_mod_ctrl(guac_terminal* terminal) {
int guac_terminal_get_mod_ctrl(guac_terminal* terminal) {
return terminal->mod_ctrl;
}

Expand Down
4 changes: 2 additions & 2 deletions src/terminal/terminal/color-scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

#ifndef GUAC_TERMINAL_COLOR_SCHEME_H
#define GUAC_TERMINAL_COLOR_SCHEME_H
#ifndef GUAC_TERMINAL_GET_COLOR_SCHEME_H
#define GUAC_TERMINAL_GET_COLOR_SCHEME_H

/**
* Definitions and functions related to color scheme handling.
Expand Down
10 changes: 5 additions & 5 deletions src/terminal/terminal/terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void guac_terminal_dup(guac_terminal* term, guac_user* user,
* The number of rows within the buffer which are not currently displayed
* on screen.
*/
int guac_terminal_available_scroll(guac_terminal* term);
int guac_terminal_get_available_scroll(guac_terminal* term);

/**
* Returns the height of the given terminal, in characters.
Expand Down Expand Up @@ -899,7 +899,7 @@ void guac_terminal_apply_color_scheme(guac_terminal* terminal,
* @return
* The name of the color scheme currently in use by the given terminal.
*/
const char* guac_terminal_color_scheme(guac_terminal* terminal);
const char* guac_terminal_get_color_scheme(guac_terminal* terminal);

/**
* Alters the font of the terminal. The terminal will automatically be redrawn
Expand Down Expand Up @@ -934,7 +934,7 @@ void guac_terminal_apply_font(guac_terminal* terminal, const char* font_name,
* @return
* The name of the font in use by the given terminal.
*/
const char* guac_terminal_font_name(guac_terminal* terminal);
const char* guac_terminal_get_font_name(guac_terminal* terminal);

/**
* Returns the font size currently in use by the given terminal.
Expand All @@ -945,7 +945,7 @@ const char* guac_terminal_font_name(guac_terminal* terminal);
* @return
* The size of the font in use by the given terminal.
*/
int guac_terminal_font_size(guac_terminal* terminal);
int guac_terminal_get_font_size(guac_terminal* terminal);

/**
* Returns the current state of the mod_ctrl flag in the given terminal.
Expand All @@ -956,6 +956,6 @@ int guac_terminal_font_size(guac_terminal* terminal);
* @return
* The current state of the mod_ctrl flag.
*/
int guac_terminal_mod_ctrl(guac_terminal* terminal);
int guac_terminal_get_mod_ctrl(guac_terminal* terminal);

#endif

0 comments on commit ad0155b

Please sign in to comment.