GUACAMOLE-1538: Make it clear which functions are getters by adding _get_ to the name of each.
This commit is contained in:
parent
0856e94ece
commit
ad0155b5f5
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
)) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
@ -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 &&
|
||||
@ -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;
|
||||
|
||||
@ -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 */
|
||||
@ -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 */
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
@ -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
|
||||
@ -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.
|
||||
@ -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.
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user