Details
struct VteTerminalPrivate
struct VteTerminalPrivate; |
enum VteTerminalEraseBinding
typedef enum {
VTE_ERASE_AUTO,
VTE_ERASE_ASCII_BACKSPACE,
VTE_ERASE_ASCII_DELETE,
VTE_ERASE_DELETE_SEQUENCE
} VteTerminalEraseBinding; |
struct VteTerminal
struct VteTerminal {
/* Widget implementation stuffs. */
GtkWidget widget;
GtkAdjustment *adjustment; /* Scrolling adjustment. */
/* Metric and sizing data. */
glong char_width, char_height; /* dimensions of character cells */
glong char_ascent, char_descent; /* important font metrics */
glong row_count, column_count; /* dimensions of the window */
/* Titles. */
char *window_title;
char *icon_title;
}; |
vte_terminal_new ()
Create a new terminal widget.
vte_terminal_im_append_menuitems ()
Appends menu items for various input methods to the given menu. The
user can select one of these items to modify the input method used by
the terminal.
vte_terminal_fork_command ()
pid_t vte_terminal_fork_command (VteTerminal *terminal,
const char *command,
char **argv,
char **envv); |
Starts the specified command under a newly-alllocated control
pseudo-terminal. TERM is automatically set to reflect the terminal widget's
emulation setting.
vte_terminal_feed ()
Interprets data as if it were data received from a child process. This
can either be used to drive the terminal without a child process, or just
to mess with your users.
vte_terminal_feed_child ()
void vte_terminal_feed_child (VteTerminal *terminal,
const char *data,
glong length); |
Sends a block of UTF-8 text to the child as if it were entered by the user
at the keyboard.
vte_terminal_paste_clipboard ()
void vte_terminal_paste_clipboard (VteTerminal *terminal); |
Sends the contents of the GDK_SELECTION_CLIPBOARD selection to the
terminal's child. If necessary, the data is converted from UTF-8 to the
terminal's current encoding.
vte_terminal_copy_primary ()
void vte_terminal_copy_primary (VteTerminal *terminal); |
Places the selected text in the terminal in the GDK_SELECTION_PRIMARY
selection.
vte_terminal_paste_primary ()
void vte_terminal_paste_primary (VteTerminal *terminal); |
Sends the contents of the GDK_SELECTION_PRIMARY selection to the terminal's
child. If necessary, the data is converted from UTF-8 to the terminal's
current encoding. The terminal will call also paste the
GDK_SELECTION_PRIMARY selection when the user clicks with the the second
mouse button.
vte_terminal_set_size ()
Attempts to change the terminal's size in terms of rows and columns. If
the attempt succeeds, the widget will resize itself to the proper size.
vte_terminal_set_audible_bell ()
Controls whether or not the terminal will beep when the child outputs the
"bl" sequence.
vte_terminal_get_audible_bell ()
Checks whether or not the terminal will beep when the child outputs the
"bl" sequence.
vte_terminal_set_visible_bell ()
Controls whether or not the terminal will present a visible bell to the
user when the child outputs the "bl" sequence. The terminal
will clear itself to the default foreground color and then repaint itself.
vte_terminal_get_visible_bell ()
Checks whether or not the terminal will present a visible bell to the
user when the child outputs the "bl" sequence. The terminal
will clear itself to the default foreground color and then repaint itself.
vte_terminal_set_scroll_on_output ()
Controls whether or not the terminal will forcibly scroll to the bottom of
the viewable history when the new data is received from the child.
vte_terminal_set_scroll_on_keystroke ()
Controls whether or not the terminal will forcibly scroll to the bottom of
the viewable history when the user presses a key. Modifier keys do not
trigger this behavior.
vte_terminal_set_color_bold ()
Sets the color used to draw bold text in the default foreground color.
vte_terminal_set_color_foreground ()
Sets the foreground color used to draw normal text
vte_terminal_set_color_background ()
Sets the background color for text which does not have a specific background
color assigned. Only has effect when no background image is set and when
the terminal is not transparent.
vte_terminal_set_colors ()
The terminal widget uses a 19-color model comprised of the default foreground
and background colors, the bold foreground color, an eight color palette, and
bold versions of the eight color palette.
palette_size must be either 0, 8, or 16. If foreground is NULL and
palette_size is greater than 0, the new foreground color is taken from
palette[7]. If background is NULL and palette_size is greater than 0,
the new background color is taken from palette[0]. If palette_size is
8, the second 8-color palette is extrapolated from the new background
color and the items in palette.
vte_terminal_set_default_colors ()
void vte_terminal_set_default_colors (VteTerminal *terminal); |
Reset the terminal palette to reasonable compiled-in defaults.
vte_terminal_set_background_image ()
Sets a background image for the widget. Text which would otherwise be
drawn using the default background color will instead be drawn over the
specified image. If necessary, the image will be tiled to cover the
widget's entire visible area.
vte_terminal_set_background_image_file ()
void vte_terminal_set_background_image_file
(VteTerminal *terminal,
const char *path); |
Sets a background image for the widget. If specified by
vte_terminal_set_background_saturation, the terminal will make its
in-memory copy of the image darker for its own use.
This is a convenience function for vte_terminal_set_background_image().
If your application intends to create multiple terminal widgets using the
same background, performing this step yourself and just using
vte_terminal_set_background_image() will reduce memory consumption.
vte_terminal_set_background_transparent ()
Sets the terminal's background image to the pixmap stored in the root
window, adjusted so that if there are no windows below your application,
the widget will appear to be transparent.
vte_terminal_set_cursor_blinks ()
Sets whether or not the cursor will blink. The length of the blinking cycle
is controlled by the "gtk-cursor-blink-time" GTK+ setting.
vte_terminal_set_scrollback_lines ()
Sets the length of the scrollback buffer used by the terminal. The size of
the scrollback buffer will be set to the larger of this value and the number
of visible rows the widget can display, so 0 can safely be used to disable
scrollback. Note that this setting only affects the normal screen buffer.
For terminal types which have an alternate screen buffer, no scrollback is
allowed.
vte_terminal_set_font ()
void vte_terminal_set_font (VteTerminal *terminal,
const PangoFontDescription *font_desc); |
Sets the font used for rendering all text displayed by the terminal,
overriding any fonts set using gtk_widget_modify_font(). The terminal
will immediately attempt to load the desired font, retrieve its
metrics, and attempts to resize itself to keep the same number of rows
and columns.
vte_terminal_set_font_from_string ()
void vte_terminal_set_font_from_string
(VteTerminal *terminal,
const char *name); |
A convenience function which converts name into a PangoFontDescription and
passes it to vte_terminal_set_font().
vte_terminal_get_font ()
const PangoFontDescription* vte_terminal_get_font
(VteTerminal *terminal); |
vte_terminal_get_using_xft ()
A VteTerminal can use Xft, Pango, or Xlib to draw text. This function
allows an application to determine which mode the widget is in. This
setting cannot be changed by the caller, but in practice usually matches
the behavior of GTK+ itself.
vte_terminal_get_has_selection ()
vte_terminal_set_word_chars ()
void vte_terminal_set_word_chars (VteTerminal *terminal,
const char *spec); |
When the user double-clicks to start selection, the terminal will extend
the selection on word boundaries. It will treat characters included in spec
as parts of words, and all other characters as word separators. Ranges of
characters can be specified by separating them with a hyphen.
vte_terminal_is_word_char ()
Checks if a particular character is considered to be part of a word or not,
based on the values last passed to vte_terminal_set_word_chars().
vte_terminal_set_backspace_binding ()
Modifies the terminal's backspace key binding, which controls what
string or control sequence the terminal sends to its child when the user
presses the backspace key.
vte_terminal_set_delete_binding ()
Modifies the terminal's delete key binding, which controls what
string or control sequence the terminal sends to its child when the user
presses the delete key.
vte_terminal_set_mouse_autohide ()
Changes the value of the terminal's mouse autohide setting. When autohiding
is enabled, the mouse cursor will be hidden when the user presses a key and
shown when the user moves the mouse. This setting can be read using
vte_terminal_get_mouse_autohide().
vte_terminal_get_mouse_autohide ()
Determines the value of the terminal's mouse autohide setting. When
autohiding is enabled, the mouse cursor will be hidden when the user presses
a key and shown when the user moves the mouse. This setting can be changed
using vte_terminal_set_mouse_autohide().
vte_terminal_reset ()
Resets as much of the terminal's internal state as possible, discarding any
unprocessed input data, resetting character attributes, cursor state,
national character set state, status line, terminal modes (insert/delete),
selection state, and encoding.
vte_terminal_get_text ()
char* vte_terminal_get_text (VteTerminal *terminal,
gboolean (*is_selected) (VteTerminal *terminal,glong column,glong row),
GArray *attributes); |
Extracts a view of the visible part of the string. If is_selected is not
NULL, characters will only be read if is_selected returns TRUE after being
passed the column and row, respectively. A vte_char_attributes structure
is added to attributes for each byte added to the returned string detailing
the character's position, colors, and other characteristics.
vte_terminal_get_text_range ()
Extracts a view of the visible part of the string. If is_selected is not
NULL, characters will only be read if is_selected returns TRUE after being
passed the column and row, respectively. A vte_char_attributes structure
is added to attributes for each byte added to the returned string detailing
the character's position, colors, and other characteristics. The
entire scrollback buffer is scanned, so it is possible to read the entire
contents of the buffer using this function.
vte_terminal_get_cursor_position ()
Reads the location of the insertion cursor and returns it. The row
coordinate is absolute.
vte_terminal_match_clear_all ()
void vte_terminal_match_clear_all (VteTerminal *terminal); |
Clears the list of regular expressions the terminal uses to highlight text
when the user moves the mouse cursor.
vte_terminal_match_add ()
int vte_terminal_match_add (VteTerminal *terminal,
const char *match); |
Adds a regular expression to the list of matching expressions. When the
user moves the mouse cursor over a section of displayed text which matches
this expression, the text will be highlighted.
vte_terminal_match_check ()
Checks if the text in and around the specified position matches any of the
regular expressions previously set using vte_terminal_match_add(). If a
match exists, the text string is returned and if tag is not NULL, the number
associated with the matched regular expression will be stored in tag.
If more than one regular expression has been set with
vte_terminal_match_add(), then expressions are checked in the order in
which they were added.
vte_terminal_set_emulation ()
void vte_terminal_set_emulation (VteTerminal *terminal,
const char *emulation); |
Sets what type of terminal the widget attempts to emulate by scanning for
control sequences defined in the system's termcap file. Unless you
are interested in this feature, always use "xterm".
vte_terminal_get_emulation ()
const char* vte_terminal_get_emulation (VteTerminal *terminal); |
vte_terminal_set_encoding ()
void vte_terminal_set_encoding (VteTerminal *terminal,
const char *codeset); |
Changes the encoding the terminal will expect data from the child to
be encoded with. For certain terminal types, applications executing in the
terminal can change the encoding. The default encoding is defined by the
application's locale settings.
vte_terminal_get_encoding ()
const char* vte_terminal_get_encoding (VteTerminal *terminal); |
Determines the name of the encoding in which the terminal expects data to be
encoded.
vte_terminal_get_status_line ()
const char* vte_terminal_get_status_line (VteTerminal *terminal); |
Some terminal emulations specify a status line which is separate from the
main display area, and define a means for applications to move the cursor
to the status line and back.
vte_terminal_get_padding ()
void vte_terminal_get_padding (VteTerminal *terminal,
int *xpad,
int *ypad); |
Determines the amount of additional space the widget is using to pad the
edges of its visible area. This is necessary for cases where characters
in the selected font don't themselves include a padding area and the
text itself would be contiguous with the window border. Applications
which use the widget's row_count, column_count, char_height, and
char_width fields to set geometry hints using
gtk_window_set_geometry_hints() will need to add this value to the base
size. The values returned in xpad and ypad are the total padding used
in each direction, and do not need to be doubled.
Signals
The "char-size-changed" signal
Emitted whenever selection of a new font causes the values of the
char_width or char_height fields to change.
The "child-exited" signal
This signal is emitted when the terminal detects that a child started using
vte_terminal_fork_command() has exited.
The "contents-changed" signal
Emitted whenever the visible appearance of the terminal has changed. Used
primarily by VteTerminalAccessible.
The "cursor-moved" signal
Emitted whenever the cursor moves to a new character cell. Used primarily
by VteTerminalAccessible.
The "deiconify-window" signal
Emitted at the child application's request.
The "emulation-changed" signal
The "encoding-changed" signal
The "icon-title-changed" signal
Emitted when the terminal's icon_title field is modified.
The "iconify-window" signal
Emitted at the child application's request.
The "lower-window" signal
Emitted at the child application's request.
The "maximize-window" signal
Emitted at the child application's request.
The "move-window" signal
Emitted at the child application's request.
The "raise-window" signal
Emitted at the child application's request.
The "refresh-window" signal
Emitted at the child application's request.
The "resize-window" signal
Emitted at the child application's request.
The "restore-window" signal
Emitted at the child application's request.
The "selection-changed" signal
Emitted whenever the contents of terminal's selection changes.
The "status-line-changed" signal
Emitted whenever the contents of the status line are modified or cleared.
The "window-title-changed" signal
Emitted when the terminal's window_title field is modified.