21#ifndef _GUAC_TERMINAL_H
22#define _GUAC_TERMINAL_H
34#include <guacamole/client.h>
35#include <guacamole/stream.h>
40#define GUAC_TERMINAL_DEFAULT_FONT_NAME "monospace"
46#define GUAC_TERMINAL_DEFAULT_FONT_SIZE 12
51#define GUAC_TERMINAL_DEFAULT_MAX_SCROLLBACK 1000
56#define GUAC_TERMINAL_DEFAULT_BACKSPACE 127
61#define GUAC_TERMINAL_DEFAULT_COLOR_SCHEME ""
66#define GUAC_TERMINAL_DEFAULT_DISABLE_COPY false
71#define GUAC_TERMINAL_MAX_ROWS 1024
77#define GUAC_TERMINAL_MAX_COLUMNS 1024
82#define GUAC_TERMINAL_FRAME_DURATION 40
88#define GUAC_TERMINAL_FRAME_TIMEOUT 10
93#define GUAC_TERMINAL_MAX_TABS 16
98#define GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT 3
105#define GUAC_TERMINAL_PIPE_INTERPRET_OUTPUT 1
113#define GUAC_TERMINAL_PIPE_AUTOFLUSH 2
291 int width,
int height,
int dpi);
503 int x,
int y,
int mask);
592 guac_stream* stream);
636 guac_socket* socket);
654 guac_terminal* term, guac_client* client, guac_socket* socket);
721 const char* mimetype);
736 const char* data,
int length);
780 const char* name,
int create_path);
794 const char* color_scheme);
829 int font_size,
int dpi);
Configuration options that may be passed when creating a new guac_terminal.
Definition terminal.h:182
int dpi
The DPI of the display.
Definition terminal.h:218
int height
The height of the terminal, in pixels.
Definition terminal.h:228
char * color_scheme
The name of the color scheme to use.
Definition terminal.h:234
int backspace
The integer ASCII code to send when backspace is pressed in the terminal.
Definition terminal.h:240
int width
The width of the terminal, in pixels.
Definition terminal.h:223
int font_size
The size of each glyph, in points.
Definition terminal.h:212
int max_scrollback
The maximum number of rows to allow within the scrollback buffer.
Definition terminal.h:202
bool disable_copy
Whether copying from the terminal clipboard should be blocked.
Definition terminal.h:190
char * font_name
The name of the font to use when rendering glyphs.
Definition terminal.h:207
char * guac_terminal_prompt(guac_terminal *terminal, const char *title, bool echo)
Reads a single line from this terminal's STDIN, storing the result in a newly-allocated string.
void guac_terminal_clipboard_reset(guac_terminal *terminal, const char *mimetype)
Clears the clipboard contents for a given terminal, and assigns a new mimetype for future data.
void guac_terminal_notify(guac_terminal *terminal)
Notifies the terminal that an event has occurred and the terminal should flush itself when reasonable...
int guac_terminal_create_typescript(guac_terminal *term, const char *path, const char *name, int create_path)
Requests that the terminal write all output to a new pair of typescript files within the given path a...
guac_terminal_options * guac_terminal_options_create(int width, int height, int dpi)
Create a new guac_terminal_options struct.
int guac_terminal_send_stream(guac_terminal *term, guac_user *user, guac_stream *stream)
Initializes the handlers of the given guac_stream such that it serves as the source of input to the t...
guac_stream * guac_terminal_file_download_handler(guac_client *client, char *filename)
Handler that is invoked whenever the necessary terminal codes are sent to initiate a download of a gi...
Definition terminal.h:174
void guac_terminal_sync_users(guac_terminal *term, guac_client *client, guac_socket *socket)
Replicates the current display state to one or more users that are joining the connection.
void guac_terminal_upload_path_handler(guac_client *client, char *path)
Handler that is invoked whenever the necessary terminal codes are sent to to the given terminal to ch...
Definition terminal.h:154
void guac_terminal_set_upload_path_handler(guac_terminal *terminal, guac_terminal_upload_path_handler *upload_path_handler)
Sets the upload path handler for the given terminal.
void guac_terminal_apply_color_scheme(guac_terminal *terminal, const char *color_scheme)
Immediately applies the given color scheme to the given terminal, overriding the color scheme provide...
struct guac_terminal guac_terminal
Represents a terminal emulator which uses a given Guacamole client to render itself.
Definition terminal.h:119
void guac_terminal_stop(guac_terminal *term)
Manually stop the terminal to forcibly unblock any pending reads/writes, e.g.
void guac_terminal_start(guac_terminal *term)
Notifies the terminal that rendering should begin and that user input should now be accepted.
int guac_terminal_write(guac_terminal *term, const char *buffer, int length)
Writes the given buffer to the given terminal's STDOUT.
int guac_terminal_printf(guac_terminal *terminal, const char *format,...)
Writes the given format string and arguments to this terminal's STDOUT in the same manner as printf()...
guac_terminal_cursor_type
All possible mouse cursors used by the terminal emulator.
Definition terminal.h:124
@ GUAC_TERMINAL_CURSOR_IBAR
A standard I-bar cursor for selecting text, etc.
Definition terminal.h:134
@ GUAC_TERMINAL_CURSOR_BLANK
A transparent (blank) cursor.
Definition terminal.h:129
@ GUAC_TERMINAL_CURSOR_POINTER
A standard triangular mouse pointer for manipulating non-text objects.
Definition terminal.h:139
int guac_terminal_sendf(guac_terminal *term, const char *format,...)
Sends data through STDIN as if typed by the user, using the format string given and any args (similar...
void guac_terminal_clipboard_append(guac_terminal *terminal, const char *data, int length)
Appends the given data to the contents of the clipboard for the given terminal.
int guac_terminal_get_mod_ctrl(guac_terminal *terminal)
Returns the current state of the mod_ctrl flag in the given terminal.
int guac_terminal_get_font_size(guac_terminal *terminal)
Returns the font size currently in use by the given terminal.
const char * guac_terminal_get_color_scheme(guac_terminal *terminal)
Returns name of the color scheme currently in use by the given terminal.
int guac_terminal_send_data(guac_terminal *term, const char *data, int length)
Sends the given string as if typed by the user.
const char * guac_terminal_get_font_name(guac_terminal *terminal)
Returns the font name currently in use by the given terminal.
void guac_terminal_dup(guac_terminal *term, guac_user *user, guac_socket *socket)
Replicates the current display state to a user that has just joined the connection.
int guac_terminal_resize(guac_terminal *term, int width, int height)
Resize the client display and terminal to the given pixel dimensions.
int guac_terminal_render_frame(guac_terminal *terminal)
Renders a single frame of terminal data.
int guac_terminal_get_rows(guac_terminal *term)
Returns the height of the given terminal, in characters.
guac_terminal * guac_terminal_create(guac_client *client, guac_terminal_options *terminal_options)
Creates a new guac_terminal, having the given width and height, and rendering to the given client.
void guac_terminal_set_file_download_handler(guac_terminal *terminal, guac_terminal_file_download_handler *file_download_handler)
Sets the file download handler for the given terminal.
int guac_terminal_send_key(guac_terminal *term, int keysym, int pressed)
Handles the given key event, sending data, scrolling, pasting clipboard data, etc.
int guac_terminal_send_mouse(guac_terminal *term, guac_user *user, int x, int y, int mask)
Handles the given mouse event, sending data, scrolling, pasting clipboard data, etc.
void guac_terminal_free(guac_terminal *term)
Frees all resources associated with the given terminal.
int guac_terminal_read_stdin(guac_terminal *terminal, char *c, int size)
Reads from this terminal's STDIN.
void guac_terminal_remove_user(guac_terminal *terminal, guac_user *user)
Removes the given user from any user-specific resources internal to the given terminal.
void guac_terminal_apply_font(guac_terminal *terminal, const char *font_name, int font_size, int dpi)
Alters the font of the terminal.
int guac_terminal_get_columns(guac_terminal *term)
Returns the width of the given terminal, in characters.
int guac_terminal_get_available_scroll(guac_terminal *term)
Returns the number of rows within the buffer of the given terminal which are not currently displayed ...
int guac_terminal_send_string(guac_terminal *term, const char *data)
Sends the given string as if typed by the user.