mike-jumper commented on a change in pull request #373:
URL: https://github.com/apache/guacamole-server/pull/373#discussion_r816355356
##########
File path: src/terminal/terminal/terminal.h
##########
@@ -915,261 +536,86 @@ void
guac_terminal_scroll_handler(guac_terminal_scrollbar* scrollbar, int value)
void guac_terminal_dup(guac_terminal* term, guac_user* user,
guac_socket* socket);
-/* INTERNAL FUNCTIONS */
-
-
-/**
- * Acquires exclusive access to the terminal. Note that enforcing this
- * exclusive access requires that ALL users of the terminal call this
- * function before making further calls to the terminal.
- */
-void guac_terminal_lock(guac_terminal* terminal);
-
-/**
- * Releases exclusive access to the terminal.
- */
-void guac_terminal_unlock(guac_terminal* terminal);
-
-/**
- * Resets the state of the given terminal, as if it were just allocated.
- */
-void guac_terminal_reset(guac_terminal* term);
-
-/**
- * Writes the given string of characters to the terminal.
- */
-int guac_terminal_write(guac_terminal* term, const char* c, int size);
-
-/**
- * Sets the character at the given row and column to the specified value.
- */
-int guac_terminal_set(guac_terminal* term, int row, int col, int codepoint);
-
-/**
- * Clears the given region within a single row.
- */
-int guac_terminal_clear_columns(guac_terminal* term,
- int row, int start_col, int end_col);
-
-/**
- * Clears the given region from right-to-left, top-to-bottom, replacing
- * all characters with the current background color and attributes.
- */
-int guac_terminal_clear_range(guac_terminal* term,
- int start_row, int start_col,
- int end_row, int end_col);
-
-/**
- * Scrolls the terminal's current scroll region up by one row.
- */
-int guac_terminal_scroll_up(guac_terminal* term,
- int start_row, int end_row, int amount);
-
-/**
- * Scrolls the terminal's current scroll region down by one row.
- */
-int guac_terminal_scroll_down(guac_terminal* term,
- int start_row, int end_row, int amount);
-
-/**
- * Commits the current cursor location, updating the visible cursor
- * on the screen.
- */
-void guac_terminal_commit_cursor(guac_terminal* term);
-
-/**
- * Scroll down the display by the given amount, replacing the new space with
- * data from the buffer. If not enough data is available, the maximum
- * amount will be scrolled.
- */
-void guac_terminal_scroll_display_down(guac_terminal* terminal, int amount);
-
-/**
- * Scroll up the display by the given amount, replacing the new space with data
- * from either the buffer or the terminal buffer. If not enough data is
- * available, the maximum amount will be scrolled.
- */
-void guac_terminal_scroll_display_up(guac_terminal* terminal, int amount);
-
-/* LOW-LEVEL TERMINAL OPERATIONS */
-
-
-/**
- * Copies the given range of columns to a new location, offset from
- * the original by the given number of columns.
- */
-void guac_terminal_copy_columns(guac_terminal* terminal, int row,
- int start_column, int end_column, int offset);
-
-/**
- * Copies the given range of rows to a new location, offset from the
- * original by the given number of rows.
- */
-void guac_terminal_copy_rows(guac_terminal* terminal,
- int start_row, int end_row, int offset);
-
-/**
- * Sets the given range of columns within the given row to the given
- * character.
- */
-void guac_terminal_set_columns(guac_terminal* terminal, int row,
- int start_column, int end_column, guac_terminal_char* character);
-
/**
* Resize the terminal to the given dimensions.
*/
int guac_terminal_resize(guac_terminal* term, int width, int height);
/**
- * Flushes all pending operations within the given guac_terminal.
- */
-void guac_terminal_flush(guac_terminal* terminal);
-
-/**
- * Sends the given string as if typed by the user. If terminal input is
- * currently coming from a stream due to a prior call to
- * guac_terminal_send_stream(), any input which would normally result from
- * invoking this function is dropped.
+ * Returns the number of rows within the buffer of the given terminal which are
+ * not currently displayed on screen. Adjustments to the desired scrollback
+ * size are taken into account, and rows which are within the buffer but
+ * unavailable due to being outside the desired scrollback range are ignored.
*
* @param term
- * The terminal which should receive the given data on STDIN.
- *
- * @param data
- * The data the terminal should receive on STDIN.
- *
- * @param length
- * The size of the given data, in bytes.
+ * The terminal whose off-screen row count should be determined.
*
* @return
- * The number of bytes written to STDIN, or a negative value if an error
- * occurs preventing the data from being written. This should always be
- * the size of the data given unless data is intentionally dropped.
+ * The number of rows within the buffer which are not currently displayed
+ * on screen.
*/
-int guac_terminal_send_data(guac_terminal* term, const char* data, int length);
+int guac_terminal_get_available_scroll(guac_terminal* term);
/**
- * Sends the given string as if typed by the user. If terminal input is
- * currently coming from a stream due to a prior call to
- * guac_terminal_send_stream(), any input which would normally result from
- * invoking this function is dropped.
+ * Returns the height of the given terminal, in characters.
*
* @param term
- * The terminal which should receive the given data on STDIN.
- *
- * @param data
- * The data the terminal should receive on STDIN.
+ * The terminal whose height should be determined.
*
* @return
- * The number of bytes written to STDIN, or a negative value if an error
- * occurs preventing the data from being written. This should always be
- * the size of the data given unless data is intentionally dropped.
+ * The height of the terminal, in characters.
*/
-int guac_terminal_send_string(guac_terminal* term, const char* data);
+int guac_terminal_get_rows(guac_terminal* term);
/**
- * Sends data through STDIN as if typed by the user, using the format string
- * given and any args (similar to printf). If terminal input is currently
- * coming from a stream due to a prior call to guac_terminal_send_stream(), any
- * input which would normally result from invoking this function is dropped.
+ * Returns the width of the given terminal, in characters.
*
* @param term
- * The terminal which should receive the given data on STDIN.
- *
- * @param format
- * A printf-style format string describing the data to be received on
- * STDIN.
- *
- * @param ...
- * Any srguments to use when filling the format string.
+ * The terminal whose width should be determined.
*
* @return
- * The number of bytes written to STDIN, or a negative value if an error
- * occurs preventing the data from being written. This should always be
- * the size of the data given unless data is intentionally dropped.
- */
-int guac_terminal_sendf(guac_terminal* term, const char* format, ...);
Review comment:
IMHO, this should stay in public as a convenient printf-style way to
invoke `guac_terminal_send_string()`, assuming there isn't anything about this
function that would mean it has to be considered internal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]