[vte] widget: Move VteTerminal widget to its own file
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Move VteTerminal widget to its own file
- Date: Wed, 18 Nov 2015 20:19:36 +0000 (UTC)
commit 09a4be833e159de520df013f7ba12dbca6bd74d7
Author: Christian Persch <chpe gnome org>
Date: Wed Nov 18 21:15:42 2015 +0100
widget: Move VteTerminal widget to its own file
src/Makefile.am | 3 +
src/vte-private.h | 4 -
src/vte.cc | 1528 ++--------------------------------------------------
src/vtegtk.cc | 1405 +++++++++++++++++++++++++++++++++++++++++++++++
src/vtegtk.hh | 69 +++
src/vteinternal.hh | 13 +
6 files changed, 1537 insertions(+), 1485 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 33acb65..95ca117 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,6 +70,8 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
vtedefines.hh \
vtedraw.cc \
vtedraw.h \
+ vtegtk.cc \
+ vtegtk.hh \
vteint.h \
vteinternal.hh \
vtepcre2.h \
@@ -199,6 +201,7 @@ Vte_ VTE_API_VERSION_U@_gir_FILES = \
$(header_HEADERS) \
$(nodist_header_HEADERS) \
vte.cc \
+ vtegtk.cc \
vtetypebuiltins.cc \
pty.cc \
$(NULL)
diff --git a/src/vte-private.h b/src/vte-private.h
index 5e25f50..096f659 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -53,10 +53,6 @@
G_BEGIN_DECLS
-struct _VteTerminalClassPrivate {
- GtkStyleProvider *style_provider;
-};
-
VteRowData *_vte_terminal_ensure_row(VteTerminal *terminal);
void _vte_invalidate_all(VteTerminal *terminal);
void _vte_invalidate_cells(VteTerminal *terminal,
diff --git a/src/vte.cc b/src/vte.cc
index 695eba4..90ba280 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -57,10 +57,7 @@
#include "vteint.h"
#include "vtepty.h"
#include "vtepty-private.h"
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
+#include "vtegtk.hh"
#include <new> /* placement new */
@@ -78,10 +75,6 @@ static inline double round(double x) {
typedef gunichar wint_t;
#endif
-#if !GLIB_CHECK_VERSION(2, 42, 0)
-#define G_PARAM_EXPLICIT_NOTIFY 0
-#endif
-
#ifndef howmany
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
@@ -91,9 +84,6 @@ typedef gunichar wint_t;
#define I_(string) (g_intern_static_string(string))
static int _vte_unichar_width(gunichar c, int utf8_ambiguous_width);
-static void vte_terminal_paste(VteTerminal *terminal, GdkAtom board);
-static void vte_terminal_real_copy_clipboard(VteTerminal *terminal);
-static void vte_terminal_real_paste_clipboard(VteTerminal *terminal);
static gboolean vte_terminal_io_read(GIOChannel *channel,
GIOCondition condition,
VteTerminal *terminal);
@@ -155,52 +145,12 @@ static void vte_terminal_determine_colors_internal(VteTerminal *terminal,
gboolean cursor,
guint *pfore, guint *pback);
-enum {
- COPY_CLIPBOARD,
- PASTE_CLIPBOARD,
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL];
-
-enum {
- PROP_0,
- PROP_HADJUSTMENT,
- PROP_VADJUSTMENT,
- PROP_HSCROLL_POLICY,
- PROP_VSCROLL_POLICY,
- PROP_ALLOW_BOLD,
- PROP_AUDIBLE_BELL,
- PROP_BACKSPACE_BINDING,
- PROP_CJK_AMBIGUOUS_WIDTH,
- PROP_CURSOR_BLINK_MODE,
- PROP_CURSOR_SHAPE,
- PROP_CURRENT_DIRECTORY_URI,
- PROP_CURRENT_FILE_URI,
- PROP_DELETE_BINDING,
- PROP_ENCODING,
- PROP_FONT_DESC,
- PROP_FONT_SCALE,
- PROP_ICON_TITLE,
- PROP_INPUT_ENABLED,
- PROP_MOUSE_POINTER_AUTOHIDE,
- PROP_PTY,
- PROP_REWRAP_ON_RESIZE,
- PROP_SCROLLBACK_LINES,
- PROP_SCROLL_ON_KEYSTROKE,
- PROP_SCROLL_ON_OUTPUT,
- PROP_WINDOW_TITLE,
- PROP_WORD_CHAR_EXCEPTIONS
-};
-
/* these static variables are guarded by the GDK mutex */
static guint process_timeout_tag = 0;
static gboolean in_process_timeout;
static guint update_timeout_tag = 0;
static gboolean in_update_timeout;
static GList *active_terminals;
-static GTimer *process_timer;
-
-static const GtkBorder default_padding = { 1, 1, 1, 1 };
static int
_vte_unichar_width(gunichar c, int utf8_ambiguous_width)
@@ -308,19 +258,6 @@ _vte_incoming_chunks_reverse(struct _vte_incoming_chunk *chunk)
return prev;
}
-#ifdef VTE_DEBUG
-G_DEFINE_TYPE_WITH_CODE(VteTerminal, vte_terminal, GTK_TYPE_WIDGET,
- g_type_add_class_private (g_define_type_id, sizeof (VteTerminalClassPrivate));
- G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL)
- if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
- g_printerr("vte_terminal_get_type()\n");
- })
-#else
-G_DEFINE_TYPE_WITH_CODE(VteTerminal, vte_terminal, GTK_TYPE_WIDGET,
- g_type_add_class_private (g_define_type_id, sizeof (VteTerminalClassPrivate));
- G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL))
-#endif
-
static void
vte_g_array_fill(GArray *array, gconstpointer item, guint final_size)
{
@@ -5376,16 +5313,6 @@ vte_terminal_set_padding(VteTerminal *terminal)
gtk_widget_queue_resize(widget);
}
-static void
-vte_terminal_style_updated (GtkWidget *widget)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
-
- GTK_WIDGET_CLASS (vte_terminal_parent_class)->style_updated (widget);
-
- terminal->pvt->widget_style_updated();
-}
-
void
VteTerminalPrivate::widget_style_updated()
{
@@ -5506,31 +5433,6 @@ VteTerminalPrivate::read_modifiers(GdkEvent *event)
m_modifiers = mask;
}
-/* Read and handle a keypress event. */
-static gboolean
-vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
-
- /* We do NOT want chain up to GtkWidget::key-press-event, since that would
- * cause GtkWidget's keybindings to be handled and consumed. However we'll
- * have to handle the one sane binding (Shift-F10 or MenuKey, to pop up the
- * context menu) ourself, so for now we simply skip the offending keybinding
- * in class_init.
- */
-
- /* First, check if GtkWidget's behavior already does something with
- * this key. */
- if (GTK_WIDGET_CLASS(vte_terminal_parent_class)->key_press_event) {
- if ((GTK_WIDGET_CLASS(vte_terminal_parent_class))->key_press_event(widget,
- event)) {
- return TRUE;
- }
- }
-
- return terminal->pvt->widget_key_press(event);
-}
-
bool
VteTerminalPrivate::widget_key_press(GdkEventKey *event)
{
@@ -5962,13 +5864,6 @@ VteTerminalPrivate::widget_key_press(GdkEventKey *event)
return false;
}
-static gboolean
-vte_terminal_key_release(GtkWidget *widget, GdkEventKey *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- return terminal->pvt->widget_key_release(event);
-}
-
bool
VteTerminalPrivate::widget_key_release(GdkEventKey *event)
{
@@ -7245,44 +7140,41 @@ vte_terminal_get_cursor_position(VteTerminal *terminal,
/* Place the selected text onto the clipboard. Do this asynchronously so that
* we get notified when the selection we placed on the clipboard is replaced. */
-static void
-vte_terminal_copy(VteTerminal *terminal, VteSelection sel)
+void
+VteTerminalPrivate::widget_copy(VteSelection sel)
{
- GtkClipboard *clipboard;
static GtkTargetEntry *targets = NULL;
static gint n_targets = 0;
GArray *attributes;
- clipboard = terminal->pvt->clipboard[sel];
-
attributes = g_array_new(FALSE, TRUE, sizeof(struct _VteCharAttributes));
/* Chuck old selected text and retrieve the newly-selected text. */
- g_free(terminal->pvt->selection_text[sel]);
- terminal->pvt->selection_text[sel] =
- vte_terminal_get_text_range(terminal,
- terminal->pvt->selection_start.row,
+ g_free(m_selection_text[sel]);
+ m_selection_text[sel] =
+ vte_terminal_get_text_range(m_terminal,
+ m_selection_start.row,
0,
- terminal->pvt->selection_end.row,
- terminal->pvt->column_count,
+ m_selection_end.row,
+ m_column_count,
vte_cell_is_selected,
NULL,
attributes);
#ifdef HTML_SELECTION
- g_free(terminal->pvt->selection_html[sel]);
- terminal->pvt->selection_html[sel] =
- _vte_terminal_attributes_to_html(terminal,
- terminal->pvt->selection_text[sel],
+ g_free(m_selection_html[sel]);
+ m_selection_html[sel] =
+ _vte_terminal_attributes_to_html(m_terminal,
+ m_selection_text[sel],
attributes);
#endif
g_array_free (attributes, TRUE);
if (sel == VTE_SELECTION_PRIMARY)
- terminal->pvt->has_selection = TRUE;
+ m_has_selection = TRUE;
/* Place the text on the clipboard. */
- if (terminal->pvt->selection_text[sel] != NULL) {
+ if (m_selection_text[sel] != NULL) {
_vte_debug_print(VTE_DEBUG_SELECTION,
"Assuming ownership of selection.\n");
if (!targets) {
@@ -7302,32 +7194,30 @@ vte_terminal_copy(VteTerminal *terminal, VteSelection sel)
gtk_target_list_unref (list);
}
- gtk_clipboard_set_with_owner(clipboard,
+ gtk_clipboard_set_with_owner(m_clipboard[sel],
targets,
n_targets,
vte_terminal_copy_cb,
vte_terminal_clear_cb,
- G_OBJECT(terminal));
- gtk_clipboard_set_can_store(clipboard, NULL, 0);
+ G_OBJECT(m_terminal));
+ gtk_clipboard_set_can_store(m_clipboard[sel], NULL, 0);
}
}
/* Paste from the given clipboard. */
-static void
-vte_terminal_paste(VteTerminal *terminal, GdkAtom board)
+void
+VteTerminalPrivate::widget_paste(GdkAtom board)
{
- GtkClipboard *clipboard;
-
- if (!terminal->pvt->input_enabled)
+ if (!m_input_enabled)
return;
- clipboard = vte_terminal_clipboard_get(terminal, board);
- if (clipboard != NULL) {
+ auto clip = vte_terminal_clipboard_get(m_terminal, board);
+ if (clip != nullptr) {
_vte_debug_print(VTE_DEBUG_SELECTION,
"Requesting clipboard contents.\n");
- gtk_clipboard_request_text(clipboard,
+ gtk_clipboard_request_text(clip,
vte_terminal_paste_cb,
- terminal);
+ m_terminal);
}
}
@@ -8011,14 +7901,6 @@ vte_terminal_stop_autoscroll(VteTerminal *terminal)
}
}
-/* Read and handle a motion event. */
-static gboolean
-vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- return terminal->pvt->widget_motion_notify(event);
-}
-
bool
VteTerminalPrivate::widget_motion_notify(GdkEventMotion *event)
{
@@ -8103,14 +7985,6 @@ VteTerminalPrivate::widget_motion_notify(GdkEventMotion *event)
return handled;
}
-/* Read and handle a pointing device buttonpress event. */
-static gboolean
-vte_terminal_button_press(GtkWidget *widget, GdkEventButton *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- return terminal->pvt->widget_button_press(event);
-}
-
bool
VteTerminalPrivate::widget_button_press(GdkEventButton *event)
{
@@ -8279,14 +8153,6 @@ VteTerminalPrivate::widget_button_press(GdkEventButton *event)
return handled;
}
-/* Read and handle a pointing device buttonrelease event. */
-static gint
-vte_terminal_button_release(GtkWidget *widget, GdkEventButton *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- return terminal->pvt->widget_button_release(event);
-}
-
bool
VteTerminalPrivate::widget_button_release(GdkEventButton *event)
{
@@ -8344,15 +8210,6 @@ VteTerminalPrivate::widget_button_release(GdkEventButton *event)
return handled;
}
-/* Handle receiving or losing focus. */
-static gboolean
-vte_terminal_focus_in(GtkWidget *widget, GdkEventFocus *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_focus_in(event);
- return FALSE;
-}
-
void
VteTerminalPrivate::widget_focus_in(GdkEventFocus *event)
{
@@ -8378,14 +8235,6 @@ VteTerminalPrivate::widget_focus_in(GdkEventFocus *event)
}
}
-static gboolean
-vte_terminal_focus_out(GtkWidget *widget, GdkEventFocus *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_focus_out(event);
- return FALSE;
-}
-
void
VteTerminalPrivate::widget_focus_out(GdkEventFocus *event)
{
@@ -8418,21 +8267,6 @@ VteTerminalPrivate::widget_focus_out(GdkEventFocus *event)
check_cursor_blink();
}
-static gboolean
-vte_terminal_enter(GtkWidget *widget, GdkEventCrossing *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- gboolean ret = FALSE;
-
- if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event) {
- ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event (widget, event);
- }
-
- terminal->pvt->widget_enter(event);
-
- return ret;
-}
-
void
VteTerminalPrivate::widget_enter(GdkEventCrossing *event)
{
@@ -8446,21 +8280,6 @@ VteTerminalPrivate::widget_enter(GdkEventCrossing *event)
}
}
-static gboolean
-vte_terminal_leave(GtkWidget *widget, GdkEventCrossing *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- gboolean ret = FALSE;
-
- if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event) {
- ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event (widget, event);
- }
-
- terminal->pvt->widget_leave(event);
-
- return ret;
-}
-
void
VteTerminalPrivate::widget_leave(GdkEventCrossing *event)
{
@@ -8526,14 +8345,6 @@ VteTerminalPrivate::widget_visibility_notify(GdkEventVisibility *event)
}
}
-static gboolean
-vte_terminal_visibility_notify(GtkWidget *widget, GdkEventVisibility *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_visibility_notify(event);
- return FALSE;
-}
-
/* Apply the changed metrics, and queue a resize if need be. */
static void
vte_terminal_apply_metrics(VteTerminal *terminal,
@@ -9019,54 +8830,48 @@ vte_terminal_handle_scroll(VteTerminal *terminal)
}
}
-static void
-vte_terminal_set_hadjustment(VteTerminal *terminal,
- GtkAdjustment *adjustment)
+void
+VteTerminalPrivate::widget_set_hadjustment(GtkAdjustment *adjustment)
{
- VteTerminalPrivate *pvt = terminal->pvt;
-
- if (adjustment == pvt->hadjustment)
+ if (adjustment == m_hadjustment)
return;
- if (pvt->hadjustment)
- g_object_unref (pvt->hadjustment);
+ if (m_hadjustment)
+ g_object_unref (m_hadjustment);
- pvt->hadjustment = adjustment ? (GtkAdjustment *)g_object_ref_sink (adjustment) : NULL;
+ m_hadjustment = adjustment ? (GtkAdjustment *)g_object_ref_sink(adjustment) : nullptr;
}
-static void
-vte_terminal_set_vadjustment(VteTerminal *terminal,
- GtkAdjustment *adjustment)
+void
+VteTerminalPrivate::widget_set_vadjustment(GtkAdjustment *adjustment)
{
- if (adjustment != NULL && adjustment == terminal->pvt->vadjustment)
+ if (adjustment != nullptr && adjustment == m_vadjustment)
return;
- if (adjustment == NULL && terminal->pvt->vadjustment != NULL)
+ if (adjustment == nullptr && m_vadjustment != nullptr)
return;
- if (adjustment == NULL)
+ if (adjustment == nullptr)
adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 0, 0, 0, 0));
- else
- g_return_if_fail(GTK_IS_ADJUSTMENT(adjustment));
/* Add a reference to the new adjustment object. */
g_object_ref_sink(adjustment);
/* Get rid of the old adjustment object. */
- if (terminal->pvt->vadjustment != NULL) {
+ if (m_vadjustment != nullptr) {
/* Disconnect our signal handlers from this object. */
- g_signal_handlers_disconnect_by_func(terminal->pvt->vadjustment,
+ g_signal_handlers_disconnect_by_func(m_vadjustment,
(void*)vte_terminal_handle_scroll,
- terminal);
- g_object_unref(terminal->pvt->vadjustment);
+ m_terminal);
+ g_object_unref(m_vadjustment);
}
/* Set the new adjustment object. */
- terminal->pvt->vadjustment = adjustment;
+ m_vadjustment = adjustment;
/* We care about the offset, not the top or bottom. */
- g_signal_connect_swapped(terminal->pvt->vadjustment,
+ g_signal_connect_swapped(m_vadjustment,
"value-changed",
G_CALLBACK(vte_terminal_handle_scroll),
- terminal);
+ m_terminal);
}
void
@@ -9085,27 +8890,6 @@ _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ..
g_free (str);
}
-/* Initialize the terminal widget after the base widget stuff is initialized.
- * We need to create a new psuedo-terminal pair, and set ourselves up to do
- * the interpretation of sequences. */
-static void
-vte_terminal_init(VteTerminal *terminal)
-{
- void *place;
- GtkStyleContext *context;
-
- _vte_debug_print(VTE_DEBUG_LIFECYCLE, "vte_terminal_init()\n");
-
- context = gtk_widget_get_style_context(&terminal->widget);
- gtk_style_context_add_provider (context,
- VTE_TERMINAL_GET_CLASS (terminal)->priv->style_provider,
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- /* Initialize private data. NOTE: place is zeroed */
- place = G_TYPE_INSTANCE_GET_PRIVATE (terminal, VTE_TYPE_TERMINAL, VteTerminalPrivate);
- terminal->pvt = new (place) VteTerminalPrivate(terminal);
-}
-
VteTerminalPrivate::VteTerminalPrivate(VteTerminal *t) :
m_terminal(t),
m_widget(&t->widget)
@@ -9135,8 +8919,8 @@ VteTerminalPrivate::VteTerminalPrivate(VteTerminal *t) :
m_hscroll_policy = GTK_SCROLL_NATURAL;
m_vscroll_policy = GTK_SCROLL_NATURAL;
- vte_terminal_set_hadjustment(m_terminal, NULL);
- vte_terminal_set_vadjustment(m_terminal, NULL);
+ widget_set_hadjustment(nullptr);
+ widget_set_vadjustment(nullptr);
/* Set up dummy metrics, value != 0 to avoid division by 0 */
m_char_width = 1;
@@ -9273,16 +9057,6 @@ VteTerminalPrivate::VteTerminalPrivate(VteTerminal *t) :
m_padding = default_padding;
}
-/* Tell GTK+ how much space we need. */
-static void
-vte_terminal_get_preferred_width(GtkWidget *widget,
- int *minimum_width,
- int *natural_width)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_get_preferred_width(minimum_width, natural_width);
-}
-
void
VteTerminalPrivate::widget_get_preferred_width(int *minimum_width,
int *natural_width)
@@ -9308,15 +9082,6 @@ VteTerminalPrivate::widget_get_preferred_width(int *minimum_width,
m_row_count);
}
-static void
-vte_terminal_get_preferred_height(GtkWidget *widget,
- int *minimum_height,
- int *natural_height)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_get_preferred_height(minimum_height, natural_height);
-}
-
void
VteTerminalPrivate::widget_get_preferred_height(int *minimum_height,
int *natural_height)
@@ -9342,14 +9107,6 @@ VteTerminalPrivate::widget_get_preferred_height(int *minimum_height,
m_row_count);
}
-/* Accept a given size from GTK+. */
-static void
-vte_terminal_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_size_allocate(allocation);
-}
-
void
VteTerminalPrivate::widget_size_allocate(GtkAllocation *allocation)
{
@@ -9408,14 +9165,6 @@ VteTerminalPrivate::widget_size_allocate(GtkAllocation *allocation)
}
}
-/* The window is being destroyed. */
-static void
-vte_terminal_unrealize(GtkWidget *widget)
-{
- VteTerminal *terminal = VTE_TERMINAL (widget);
- terminal->pvt->widget_unrealize();
-}
-
void
VteTerminalPrivate::widget_unrealize()
{
@@ -9523,19 +9272,6 @@ vte_terminal_sync_settings (GtkSettings *settings,
vte_terminal_update_cursor_blinks_internal(terminal);
}
-static void
-vte_terminal_screen_changed (GtkWidget *widget,
- GdkScreen *previous_screen)
-{
- VteTerminal *terminal = VTE_TERMINAL (widget);
-
- if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->screen_changed) {
- GTK_WIDGET_CLASS (vte_terminal_parent_class)->screen_changed (widget, previous_screen);
- }
-
- terminal->pvt->widget_screen_changed(previous_screen);
-}
-
void
VteTerminalPrivate::widget_screen_changed (GdkScreen *previous_screen)
{
@@ -9563,19 +9299,6 @@ VteTerminalPrivate::widget_screen_changed (GdkScreen *previous_screen)
G_CALLBACK (vte_terminal_sync_settings), m_widget);
}
-/* Perform final cleanups for the widget before it's freed. */
-static void
-vte_terminal_finalize(GObject *object)
-{
- VteTerminal *terminal = VTE_TERMINAL (object);
-
- terminal->pvt->~VteTerminalPrivate();
- terminal->pvt = nullptr;
-
- /* Call the inherited finalize() method. */
- G_OBJECT_CLASS(vte_terminal_parent_class)->finalize(object);
-}
-
VteTerminalPrivate::~VteTerminalPrivate()
{
GtkSettings *settings;
@@ -9739,14 +9462,6 @@ VteTerminalPrivate::~VteTerminalPrivate()
m_terminal);
}
-/* Handle realizing the widget. Most of this is copy-paste from GGAD. */
-static void
-vte_terminal_realize(GtkWidget *widget)
-{
- VteTerminal *terminal= VTE_TERMINAL(widget);
- terminal->pvt->widget_realize();
-}
-
void
VteTerminalPrivate::widget_realize()
{
@@ -10953,15 +10668,6 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal)
}
}
-static gboolean
-vte_terminal_draw(GtkWidget *widget,
- cairo_t *cr)
-{
- VteTerminal *terminal = VTE_TERMINAL (widget);
- terminal->pvt->widget_draw(cr);
- return FALSE;
-}
-
void
VteTerminalPrivate::widget_draw(cairo_t *cr)
{
@@ -11098,15 +10804,6 @@ vte_cairo_get_clip_region (cairo_t *cr)
return region;
}
-/* Handle a scroll event. */
-static gboolean
-vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- terminal->pvt->widget_scroll(event);
- return TRUE;
-}
-
void
VteTerminalPrivate::widget_scroll(GdkEventScroll *event)
{
@@ -11204,1122 +10901,6 @@ VteTerminalPrivate::widget_scroll(GdkEventScroll *event)
}
}
-static void
-vte_terminal_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- VteTerminal *terminal = VTE_TERMINAL (object);
- VteTerminalPrivate *pvt = terminal->pvt;
-
- switch (prop_id)
- {
- case PROP_HADJUSTMENT:
- g_value_set_object (value, pvt->hadjustment);
- break;
- case PROP_VADJUSTMENT:
- g_value_set_object (value, terminal->pvt->vadjustment);
- break;
- case PROP_HSCROLL_POLICY:
- g_value_set_enum (value, pvt->hscroll_policy);
- break;
- case PROP_VSCROLL_POLICY:
- g_value_set_enum (value, pvt->vscroll_policy);
- break;
- case PROP_ALLOW_BOLD:
- g_value_set_boolean (value, vte_terminal_get_allow_bold (terminal));
- break;
- case PROP_AUDIBLE_BELL:
- g_value_set_boolean (value, vte_terminal_get_audible_bell (terminal));
- break;
- case PROP_BACKSPACE_BINDING:
- g_value_set_enum (value, pvt->backspace_binding);
- break;
- case PROP_CJK_AMBIGUOUS_WIDTH:
- g_value_set_int (value, vte_terminal_get_cjk_ambiguous_width (terminal));
- break;
- case PROP_CURSOR_BLINK_MODE:
- g_value_set_enum (value, vte_terminal_get_cursor_blink_mode (terminal));
- break;
- case PROP_CURRENT_DIRECTORY_URI:
- g_value_set_string (value, vte_terminal_get_current_directory_uri (terminal));
- break;
- case PROP_CURRENT_FILE_URI:
- g_value_set_string (value, vte_terminal_get_current_file_uri (terminal));
- break;
- case PROP_CURSOR_SHAPE:
- g_value_set_enum (value, vte_terminal_get_cursor_shape (terminal));
- break;
- case PROP_DELETE_BINDING:
- g_value_set_enum (value, pvt->delete_binding);
- break;
- case PROP_ENCODING:
- g_value_set_string (value, vte_terminal_get_encoding (terminal));
- break;
- case PROP_FONT_DESC:
- g_value_set_boxed (value, vte_terminal_get_font (terminal));
- break;
- case PROP_FONT_SCALE:
- g_value_set_double (value, vte_terminal_get_font_scale (terminal));
- break;
- case PROP_ICON_TITLE:
- g_value_set_string (value, vte_terminal_get_icon_title (terminal));
- break;
- case PROP_INPUT_ENABLED:
- g_value_set_boolean (value, vte_terminal_get_input_enabled (terminal));
- break;
- case PROP_MOUSE_POINTER_AUTOHIDE:
- g_value_set_boolean (value, vte_terminal_get_mouse_autohide (terminal));
- break;
- case PROP_PTY:
- g_value_set_object (value, vte_terminal_get_pty(terminal));
- break;
- case PROP_REWRAP_ON_RESIZE:
- g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
- break;
- case PROP_SCROLLBACK_LINES:
- g_value_set_uint (value, pvt->scrollback_lines);
- break;
- case PROP_SCROLL_ON_KEYSTROKE:
- g_value_set_boolean (value, pvt->scroll_on_keystroke);
- break;
- case PROP_SCROLL_ON_OUTPUT:
- g_value_set_boolean (value, pvt->scroll_on_output);
- break;
- case PROP_WINDOW_TITLE:
- g_value_set_string (value, vte_terminal_get_window_title (terminal));
- break;
- case PROP_WORD_CHAR_EXCEPTIONS:
- g_value_set_string (value, vte_terminal_get_word_char_exceptions (terminal));
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- return;
- }
-}
-
-static void
-vte_terminal_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- VteTerminal *terminal = VTE_TERMINAL (object);
- VteTerminalPrivate *pvt = terminal->pvt;
-
- switch (prop_id)
- {
- case PROP_HADJUSTMENT:
- vte_terminal_set_hadjustment (terminal, (GtkAdjustment *)g_value_get_object (value));
- break;
- case PROP_VADJUSTMENT:
- vte_terminal_set_vadjustment (terminal, (GtkAdjustment *)g_value_get_object (value));
- break;
- case PROP_HSCROLL_POLICY:
- pvt->hscroll_policy = g_value_get_enum (value);
- gtk_widget_queue_resize_no_redraw (GTK_WIDGET (terminal));
- break;
- case PROP_VSCROLL_POLICY:
- pvt->vscroll_policy = g_value_get_enum (value);
- gtk_widget_queue_resize_no_redraw (GTK_WIDGET (terminal));
- break;
- case PROP_ALLOW_BOLD:
- vte_terminal_set_allow_bold (terminal, g_value_get_boolean (value));
- break;
- case PROP_AUDIBLE_BELL:
- vte_terminal_set_audible_bell (terminal, g_value_get_boolean (value));
- break;
- case PROP_BACKSPACE_BINDING:
- vte_terminal_set_backspace_binding (terminal, (VteEraseBinding)g_value_get_enum
(value));
- break;
- case PROP_CJK_AMBIGUOUS_WIDTH:
- vte_terminal_set_cjk_ambiguous_width (terminal, g_value_get_int (value));
- break;
- case PROP_CURSOR_BLINK_MODE:
- vte_terminal_set_cursor_blink_mode (terminal, (VteCursorBlinkMode)g_value_get_enum
(value));
- break;
- case PROP_CURSOR_SHAPE:
- vte_terminal_set_cursor_shape (terminal, (VteCursorShape)g_value_get_enum (value));
- break;
- case PROP_DELETE_BINDING:
- vte_terminal_set_delete_binding (terminal, (VteEraseBinding)g_value_get_enum
(value));
- break;
- case PROP_ENCODING:
- vte_terminal_set_encoding (terminal, g_value_get_string (value), NULL);
- break;
- case PROP_FONT_DESC:
- vte_terminal_set_font (terminal, (PangoFontDescription *)g_value_get_boxed (value));
- break;
- case PROP_FONT_SCALE:
- vte_terminal_set_font_scale (terminal, g_value_get_double (value));
- break;
- case PROP_INPUT_ENABLED:
- vte_terminal_set_input_enabled (terminal, g_value_get_boolean (value));
- break;
- case PROP_MOUSE_POINTER_AUTOHIDE:
- vte_terminal_set_mouse_autohide (terminal, g_value_get_boolean (value));
- break;
- case PROP_PTY:
- vte_terminal_set_pty (terminal, (VtePty *)g_value_get_object (value));
- break;
- case PROP_REWRAP_ON_RESIZE:
- vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value));
- break;
- case PROP_SCROLLBACK_LINES:
- vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value));
- break;
- case PROP_SCROLL_ON_KEYSTROKE:
- vte_terminal_set_scroll_on_keystroke(terminal, g_value_get_boolean (value));
- break;
- case PROP_SCROLL_ON_OUTPUT:
- vte_terminal_set_scroll_on_output (terminal, g_value_get_boolean (value));
- break;
- case PROP_WORD_CHAR_EXCEPTIONS:
- vte_terminal_set_word_char_exceptions (terminal, g_value_get_string (value));
- break;
-
- /* Not writable */
- case PROP_CURRENT_DIRECTORY_URI:
- case PROP_CURRENT_FILE_URI:
- case PROP_ICON_TITLE:
- case PROP_WINDOW_TITLE:
- g_assert_not_reached ();
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- return;
- }
-}
-
-/* Initialize methods. */
-static void
-vte_terminal_class_init(VteTerminalClass *klass)
-{
- GObjectClass *gobject_class;
- GtkWidgetClass *widget_class;
- GtkBindingSet *binding_set;
-
-#ifdef VTE_DEBUG
- {
- _vte_debug_init();
- _vte_debug_print(VTE_DEBUG_LIFECYCLE,
- "vte_terminal_class_init()\n");
- /* print out the legend */
- _vte_debug_print(VTE_DEBUG_WORK,
- "Debugging work flow (top input to bottom output):\n"
- " . _vte_terminal_process_incoming\n"
- " < start process_timeout\n"
- " {[ start update_timeout [ => rate limited\n"
- " T start of terminal in update_timeout\n"
- " ( start _vte_terminal_process_incoming\n"
- " ? _vte_invalidate_cells (call)\n"
- " ! _vte_invalidate_cells (dirty)\n"
- " * _vte_invalidate_all\n"
- " ) end _vte_terminal_process_incoming\n"
- " - gdk_window_process_updates\n"
- " = vte_terminal_paint\n"
- " ]} end update_timeout\n"
- " > end process_timeout\n");
- }
-#endif
-
- bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
-#ifdef HAVE_DECL_BIND_TEXTDOMAIN_CODESET
- bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
-#endif
-
- g_type_class_add_private(klass, sizeof (VteTerminalPrivate));
-
- gobject_class = G_OBJECT_CLASS(klass);
- widget_class = GTK_WIDGET_CLASS(klass);
-
- /* Override some of the default handlers. */
- gobject_class->finalize = vte_terminal_finalize;
- gobject_class->get_property = vte_terminal_get_property;
- gobject_class->set_property = vte_terminal_set_property;
- widget_class->realize = vte_terminal_realize;
- widget_class->scroll_event = vte_terminal_scroll;
- widget_class->draw = vte_terminal_draw;
- widget_class->key_press_event = vte_terminal_key_press;
- widget_class->key_release_event = vte_terminal_key_release;
- widget_class->button_press_event = vte_terminal_button_press;
- widget_class->button_release_event = vte_terminal_button_release;
- widget_class->motion_notify_event = vte_terminal_motion_notify;
- widget_class->enter_notify_event = vte_terminal_enter;
- widget_class->leave_notify_event = vte_terminal_leave;
- widget_class->focus_in_event = vte_terminal_focus_in;
- widget_class->focus_out_event = vte_terminal_focus_out;
- widget_class->visibility_notify_event = vte_terminal_visibility_notify;
- widget_class->unrealize = vte_terminal_unrealize;
- widget_class->style_updated = vte_terminal_style_updated;
- widget_class->get_preferred_width = vte_terminal_get_preferred_width;
- widget_class->get_preferred_height = vte_terminal_get_preferred_height;
- widget_class->size_allocate = vte_terminal_size_allocate;
- widget_class->screen_changed = vte_terminal_screen_changed;
-
- /* Initialize default handlers. */
- klass->eof = NULL;
- klass->child_exited = NULL;
- klass->encoding_changed = NULL;
- klass->char_size_changed = NULL;
- klass->window_title_changed = NULL;
- klass->icon_title_changed = NULL;
- klass->selection_changed = NULL;
- klass->contents_changed = NULL;
- klass->cursor_moved = NULL;
- klass->commit = NULL;
-
- klass->deiconify_window = NULL;
- klass->iconify_window = NULL;
- klass->raise_window = NULL;
- klass->lower_window = NULL;
- klass->refresh_window = NULL;
- klass->restore_window = NULL;
- klass->maximize_window = NULL;
- klass->resize_window = NULL;
- klass->move_window = NULL;
-
- klass->increase_font_size = NULL;
- klass->decrease_font_size = NULL;
-
- klass->text_modified = NULL;
- klass->text_inserted = NULL;
- klass->text_deleted = NULL;
- klass->text_scrolled = NULL;
-
- klass->copy_clipboard = vte_terminal_real_copy_clipboard;
- klass->paste_clipboard = vte_terminal_real_paste_clipboard;
-
- klass->bell = NULL;
-
- /* GtkScrollable interface properties */
- g_object_class_override_property (gobject_class, PROP_HADJUSTMENT, "hadjustment");
- g_object_class_override_property (gobject_class, PROP_VADJUSTMENT, "vadjustment");
- g_object_class_override_property (gobject_class, PROP_HSCROLL_POLICY, "hscroll-policy");
- g_object_class_override_property (gobject_class, PROP_VSCROLL_POLICY, "vscroll-policy");
-
- /* Register some signals of our own. */
-
- /**
- * VteTerminal::eof:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the terminal receives an end-of-file from a child which
- * is running in the terminal. This signal is frequently (but not
- * always) emitted with a #VteTerminal::child-exited signal.
- */
- g_signal_new(I_("eof"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, eof),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::child-exited:
- * @vteterminal: the object which received the signal
- * @status: the child's exit status
- *
- * This signal is emitted when the terminal detects that a child
- * watched using vte_terminal_watch_child() has exited.
- */
- g_signal_new(I_("child-exited"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, child_exited),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE,
- 1, G_TYPE_INT);
-
- /**
- * VteTerminal::window-title-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the terminal's %window_title field is modified.
- */
- g_signal_new(I_("window-title-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, window_title_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::icon-title-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the terminal's %icon_title field is modified.
- */
- g_signal_new(I_("icon-title-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, icon_title_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::current-directory-uri-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the current directory URI is modified.
- */
- g_signal_new(I_("current-directory-uri-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::current-file-uri-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the current file URI is modified.
- */
- g_signal_new(I_("current-file-uri-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::encoding-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever the terminal's current encoding has changed, either
- * as a result of receiving a control sequence which toggled between the
- * local and UTF-8 encodings, or at the parent application's request.
- */
- g_signal_new(I_("encoding-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, encoding_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::commit:
- * @vteterminal: the object which received the signal
- * @text: a string of text
- * @size: the length of that string of text
- *
- * Emitted whenever the terminal receives input from the user and
- * prepares to send it to the child process. The signal is emitted even
- * when there is no child process.
- */
- g_signal_new(I_("commit"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, commit),
- NULL,
- NULL,
- _vte_marshal_VOID__STRING_UINT,
- G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
-
- /**
- * VteTerminal::char-size-changed:
- * @vteterminal: the object which received the signal
- * @width: the new character cell width
- * @height: the new character cell height
- *
- * Emitted whenever selection of a new font causes the values of the
- * %char_width or %char_height fields to change.
- */
- g_signal_new(I_("char-size-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, char_size_changed),
- NULL,
- NULL,
- _vte_marshal_VOID__UINT_UINT,
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
-
- /**
- * VteTerminal::selection-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever the contents of terminal's selection changes.
- */
- g_signal_new (I_("selection-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, selection_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::contents-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever the visible appearance of the terminal has changed.
- * Used primarily by #VteTerminalAccessible.
- */
- g_signal_new(I_("contents-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, contents_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::cursor-moved:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever the cursor moves to a new character cell. Used
- * primarily by #VteTerminalAccessible.
- */
- g_signal_new(I_("cursor-moved"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, cursor_moved),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::deiconify-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("deiconify-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, deiconify_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::iconify-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("iconify-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, iconify_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::raise-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("raise-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, raise_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::lower-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("lower-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, lower_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::refresh-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("refresh-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, refresh_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::restore-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("restore-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, restore_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::maximize-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("maximize-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, maximize_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::resize-window:
- * @vteterminal: the object which received the signal
- * @width: the desired number of columns
- * @height: the desired number of rows
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("resize-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, resize_window),
- NULL,
- NULL,
- _vte_marshal_VOID__UINT_UINT,
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
-
- /**
- * VteTerminal::move-window:
- * @vteterminal: the object which received the signal
- * @x: the terminal's desired location, X coordinate
- * @y: the terminal's desired location, Y coordinate
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("move-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, move_window),
- NULL,
- NULL,
- _vte_marshal_VOID__UINT_UINT,
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
-
- /**
- * VteTerminal::increase-font-size:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the user hits the '+' key while holding the Control key.
- */
- g_signal_new(I_("increase-font-size"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, increase_font_size),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::decrease-font-size:
- * @vteterminal: the object which received the signal
- *
- * Emitted when the user hits the '-' key while holding the Control key.
- */
- g_signal_new(I_("decrease-font-size"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, decrease_font_size),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::text-modified:
- * @vteterminal: the object which received the signal
- *
- * An internal signal used for communication between the terminal and
- * its accessibility peer. May not be emitted under certain
- * circumstances.
- */
- g_signal_new(I_("text-modified"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, text_modified),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::text-inserted:
- * @vteterminal: the object which received the signal
- *
- * An internal signal used for communication between the terminal and
- * its accessibility peer. May not be emitted under certain
- * circumstances.
- */
- g_signal_new(I_("text-inserted"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, text_inserted),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::text-deleted:
- * @vteterminal: the object which received the signal
- *
- * An internal signal used for communication between the terminal and
- * its accessibility peer. May not be emitted under certain
- * circumstances.
- */
- g_signal_new(I_("text-deleted"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, text_deleted),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::text-scrolled:
- * @vteterminal: the object which received the signal
- * @delta: the number of lines scrolled
- *
- * An internal signal used for communication between the terminal and
- * its accessibility peer. May not be emitted under certain
- * circumstances.
- */
- g_signal_new(I_("text-scrolled"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, text_scrolled),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- /**
- * VteTerminal::copy-clipboard:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever vte_terminal_copy_clipboard() is called.
- */
- signals[COPY_CLIPBOARD] =
- g_signal_new(I_("copy-clipboard"),
- G_OBJECT_CLASS_TYPE(klass),
- (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
- G_STRUCT_OFFSET(VteTerminalClass, copy_clipboard),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::paste-clipboard:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever vte_terminal_paste_clipboard() is called.
- */
- signals[PASTE_CLIPBOARD] =
- g_signal_new(I_("paste-clipboard"),
- G_OBJECT_CLASS_TYPE(klass),
- (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
- G_STRUCT_OFFSET(VteTerminalClass, paste_clipboard),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::bell:
- * @vteterminal: the object which received the signal
- *
- * This signal is emitted when the a child sends a bell request to the
- * terminal.
- */
- g_signal_new(I_("bell"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, bell),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal:allow-bold:
- *
- * Controls whether or not the terminal will attempt to draw bold text.
- * This may happen either by using a bold font variant, or by
- * repainting text with a different offset.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_ALLOW_BOLD,
- g_param_spec_boolean ("allow-bold", NULL, NULL,
- TRUE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:audible-bell:
- *
- * Controls whether or not the terminal will beep when the child outputs the
- * "bl" sequence.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_AUDIBLE_BELL,
- g_param_spec_boolean ("audible-bell", NULL, NULL,
- TRUE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:backspace-binding:
- *
- * *Controls what string or control sequence the terminal sends to its child
- * when the user presses the backspace key.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_BACKSPACE_BINDING,
- g_param_spec_enum ("backspace-binding", NULL, NULL,
- VTE_TYPE_ERASE_BINDING,
- VTE_ERASE_AUTO,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:cjk-ambiguous-width:
- *
- * This setting controls whether ambiguous-width characters are narrow or wide
- * when using the UTF-8 encoding (vte_terminal_set_encoding()). In all other encodings,
- * the width of ambiguous-width characters is fixed.
- *
- * This setting only takes effect the next time the terminal is reset, either
- * via escape sequence or with vte_terminal_reset().
- */
- g_object_class_install_property
- (gobject_class,
- PROP_CJK_AMBIGUOUS_WIDTH,
- g_param_spec_int ("cjk-ambiguous-width", NULL, NULL,
- 1, 2, VTE_DEFAULT_UTF8_AMBIGUOUS_WIDTH,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:cursor-blink-mode:
- *
- * Sets whether or not the cursor will blink. Using %VTE_CURSOR_BLINK_SYSTEM
- * will use the #GtkSettings::gtk-cursor-blink setting.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_CURSOR_BLINK_MODE,
- g_param_spec_enum ("cursor-blink-mode", NULL, NULL,
- VTE_TYPE_CURSOR_BLINK_MODE,
- VTE_CURSOR_BLINK_SYSTEM,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:cursor-shape:
- *
- * Controls the shape of the cursor.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_CURSOR_SHAPE,
- g_param_spec_enum ("cursor-shape", NULL, NULL,
- VTE_TYPE_CURSOR_SHAPE,
- VTE_CURSOR_SHAPE_BLOCK,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:delete-binding:
- *
- * Controls what string or control sequence the terminal sends to its child
- * when the user presses the delete key.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_DELETE_BINDING,
- g_param_spec_enum ("delete-binding", NULL, NULL,
- VTE_TYPE_ERASE_BINDING,
- VTE_ERASE_AUTO,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:font-scale:
- *
- * The terminal's font scale.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_FONT_SCALE,
- g_param_spec_double ("font-scale", NULL, NULL,
- VTE_FONT_SCALE_MIN,
- VTE_FONT_SCALE_MAX,
- 1.,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:encoding:
- *
- * Controls 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 is defined by the
- * application's locale settings.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_ENCODING,
- g_param_spec_string ("encoding", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:font-desc:
- *
- * Specifies 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 attempt to resize itself to keep the same number of rows
- * and columns.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_FONT_DESC,
- g_param_spec_boxed ("font-desc", NULL, NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:icon-title:
- *
- * The terminal's so-called icon title, or %NULL if no icon title has been set.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_ICON_TITLE,
- g_param_spec_string ("icon-title", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:input-enabled:
- *
- * Controls whether the terminal allows user input. When user input is disabled,
- * key press and mouse button press and motion events are not sent to the
- * terminal's child.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_INPUT_ENABLED,
- g_param_spec_boolean ("input-enabled", NULL, NULL,
- TRUE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:pointer-autohide:
- *
- * Controls 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.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_MOUSE_POINTER_AUTOHIDE,
- g_param_spec_boolean ("pointer-autohide", NULL, NULL,
- FALSE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:pty:
- *
- * The PTY object for the terminal.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_PTY,
- g_param_spec_object ("pty", NULL, NULL,
- VTE_TYPE_PTY,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:rewrap-on-resize:
- *
- * Controls whether or not the terminal will rewrap its contents, including
- * the scrollback buffer, whenever the terminal's width changes.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_REWRAP_ON_RESIZE,
- g_param_spec_boolean ("rewrap-on-resize", NULL, NULL,
- TRUE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:scrollback-lines:
- *
- * 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 on the alternate screen buffer.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_SCROLLBACK_LINES,
- g_param_spec_uint ("scrollback-lines", NULL, NULL,
- 0, G_MAXUINT,
- VTE_SCROLLBACK_INIT,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal: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.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_SCROLL_ON_KEYSTROKE,
- g_param_spec_boolean ("scroll-on-keystroke", NULL, NULL,
- FALSE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal: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.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_SCROLL_ON_OUTPUT,
- g_param_spec_boolean ("scroll-on-output", NULL, NULL,
- TRUE,
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:window-title:
- *
- * The terminal's title.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_WINDOW_TITLE,
- g_param_spec_string ("window-title", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:current-directory-uri:
- *
- * The current directory URI, or %NULL if unset.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_CURRENT_DIRECTORY_URI,
- g_param_spec_string ("current-directory-uri", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:current-file-uri:
- *
- * The current file URI, or %NULL if unset.
- */
- g_object_class_install_property
- (gobject_class,
- PROP_CURRENT_FILE_URI,
- g_param_spec_string ("current-file-uri", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /**
- * VteTerminal:word-char-exceptions:
- *
- * The set of characters which will be considered parts of a word
- * when doing word-wise selection, in addition to the default which only
- * considers alphanumeric characters part of a word.
- *
- * If %NULL, a built-in set is used.
- *
- * Since: 0.40
- */
- g_object_class_install_property
- (gobject_class,
- PROP_WORD_CHAR_EXCEPTIONS,
- g_param_spec_string ("word-char-exceptions", NULL, NULL,
- NULL,
- (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY)));
-
- /* Disable GtkWidget's keybindings except for Shift-F10 and MenuKey
- * which pop up the context menu.
- */
- binding_set = gtk_binding_set_by_class(vte_terminal_parent_class);
- gtk_binding_entry_skip(binding_set, GDK_KEY_F1, GDK_CONTROL_MASK);
- gtk_binding_entry_skip(binding_set, GDK_KEY_F1, GDK_SHIFT_MASK);
- gtk_binding_entry_skip(binding_set, GDK_KEY_KP_F1, GDK_CONTROL_MASK);
- gtk_binding_entry_skip(binding_set, GDK_KEY_KP_F1, GDK_SHIFT_MASK);
-
-
- process_timer = g_timer_new ();
-
- klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, VTE_TYPE_TERMINAL, VteTerminalClassPrivate);
-
- klass->priv->style_provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
- gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (klass->priv->style_provider),
- "VteTerminal {\n"
- "padding: 1px 1px 1px 1px;\n"
- "background-color: @theme_base_color;\n"
- "color: @theme_fg_color;\n"
- "}\n",
- -1, NULL);
-
- /* a11y */
- gtk_widget_class_set_accessible_type(widget_class, VTE_TYPE_TERMINAL_ACCESSIBLE);
-}
-
/**
* vte_terminal_set_audible_bell:
* @terminal: a #VteTerminal
@@ -12488,14 +11069,6 @@ vte_terminal_get_rewrap_on_resize(VteTerminal *terminal)
return terminal->pvt->rewrap_on_resize;
}
-/* Place the selected text onto the CLIPBOARD clipboard. Do this
- * asynchronously, so that we can support the html target as well */
-static void
-vte_terminal_real_copy_clipboard(VteTerminal *terminal)
-{
- vte_terminal_copy(terminal, VTE_SELECTION_CLIPBOARD);
-}
-
/**
* vte_terminal_copy_clipboard:
* @terminal: a #VteTerminal
@@ -12510,13 +11083,6 @@ vte_terminal_copy_clipboard(VteTerminal *terminal)
g_signal_emit (terminal, signals[COPY_CLIPBOARD], 0);
}
-static void
-vte_terminal_real_paste_clipboard(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SELECTION, "Pasting CLIPBOARD.\n");
- vte_terminal_paste(terminal, GDK_SELECTION_CLIPBOARD);
-}
-
/**
* vte_terminal_paste_clipboard:
* @terminal: a #VteTerminal
@@ -12545,7 +11111,7 @@ vte_terminal_copy_primary(VteTerminal *terminal)
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
_vte_debug_print(VTE_DEBUG_SELECTION, "Copying to PRIMARY.\n");
- vte_terminal_copy(terminal, VTE_SELECTION_PRIMARY);
+ terminal->pvt->widget_copy(VTE_SELECTION_PRIMARY);
}
/**
@@ -12563,7 +11129,7 @@ vte_terminal_paste_primary(VteTerminal *terminal)
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
_vte_debug_print(VTE_DEBUG_SELECTION, "Pasting PRIMARY.\n");
- vte_terminal_paste(terminal, GDK_SELECTION_PRIMARY);
+ terminal->pvt->widget_paste(GDK_SELECTION_PRIMARY);
}
/* Set up whatever background we wanted. */
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
new file mode 100644
index 0000000..375ae25
--- /dev/null
+++ b/src/vtegtk.cc
@@ -0,0 +1,1405 @@
+/*
+ * Copyright (C) 2001-2004,2009,2010 Red Hat, Inc.
+ * Copyright © 2008, 2009, 2010, 2015 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION: vte-terminal
+ * @short_description: A terminal widget implementation
+ *
+ * A VteTerminal is a terminal emulator implemented as a GTK3 widget.
+ */
+
+#include "config.h"
+
+#include <new> /* placement new */
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include "vte/vteenums.h"
+#include "vte/vtepty.h"
+#include "vte/vteterminal.h"
+#include "vte/vtetypebuiltins.h"
+
+#include "debug.h"
+#include "marshal.h"
+#include "vtedefines.hh"
+#include "vteinternal.hh"
+#include "vteaccess.h"
+
+#include "vtegtk.hh"
+
+#if !GLIB_CHECK_VERSION(2, 42, 0)
+#define G_PARAM_EXPLICIT_NOTIFY 0
+#endif
+
+#define I_(string) (g_intern_static_string(string))
+
+guint signals[LAST_SIGNAL];
+GParamSpec *pspecs[LAST_PROP];
+GTimer *process_timer;
+
+struct _VteTerminalClassPrivate {
+ GtkStyleProvider *style_provider;
+};
+
+static void
+vte_terminal_set_hadjustment(VteTerminal *terminal,
+ GtkAdjustment *adjustment)
+{
+ g_return_if_fail(adjustment == nullptr || GTK_IS_ADJUSTMENT(adjustment));
+ terminal->pvt->widget_set_hadjustment(adjustment);
+}
+
+static void
+vte_terminal_set_vadjustment(VteTerminal *terminal,
+ GtkAdjustment *adjustment)
+{
+ g_return_if_fail(adjustment == nullptr || GTK_IS_ADJUSTMENT(adjustment));
+ terminal->pvt->widget_set_vadjustment(adjustment);
+}
+
+static void
+vte_terminal_set_hscroll_policy(VteTerminal *terminal,
+ GtkScrollablePolicy policy)
+{
+ terminal->pvt->hscroll_policy = policy;
+ gtk_widget_queue_resize_no_redraw (GTK_WIDGET (terminal));
+}
+
+
+static void
+vte_terminal_set_vscroll_policy(VteTerminal *terminal,
+ GtkScrollablePolicy policy)
+{
+ terminal->pvt->vscroll_policy = policy;
+ gtk_widget_queue_resize_no_redraw (GTK_WIDGET (terminal));
+}
+
+#ifdef VTE_DEBUG
+G_DEFINE_TYPE_WITH_CODE(VteTerminal, vte_terminal, GTK_TYPE_WIDGET,
+ g_type_add_class_private (g_define_type_id, sizeof (VteTerminalClassPrivate));
+ G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL)
+ if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+ g_printerr("vte_terminal_get_type()\n");
+ })
+#else
+G_DEFINE_TYPE_WITH_CODE(VteTerminal, vte_terminal, GTK_TYPE_WIDGET,
+ g_type_add_class_private (g_define_type_id, sizeof (VteTerminalClassPrivate));
+ G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL))
+#endif
+
+static void
+vte_terminal_real_copy_clipboard(VteTerminal *terminal)
+{
+ terminal->pvt->widget_copy(VTE_SELECTION_CLIPBOARD);
+}
+
+static void
+vte_terminal_real_paste_clipboard(VteTerminal *terminal)
+{
+ terminal->pvt->widget_paste(GDK_SELECTION_CLIPBOARD);
+}
+
+static void
+vte_terminal_style_updated (GtkWidget *widget)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+
+ GTK_WIDGET_CLASS (vte_terminal_parent_class)->style_updated (widget);
+
+ terminal->pvt->widget_style_updated();
+}
+
+static gboolean
+vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+
+ /* We do NOT want chain up to GtkWidget::key-press-event, since that would
+ * cause GtkWidget's keybindings to be handled and consumed. However we'll
+ * have to handle the one sane binding (Shift-F10 or MenuKey, to pop up the
+ * context menu) ourself, so for now we simply skip the offending keybinding
+ * in class_init.
+ */
+
+ /* First, check if GtkWidget's behavior already does something with
+ * this key. */
+ if (GTK_WIDGET_CLASS(vte_terminal_parent_class)->key_press_event) {
+ if ((GTK_WIDGET_CLASS(vte_terminal_parent_class))->key_press_event(widget,
+ event)) {
+ return TRUE;
+ }
+ }
+
+ return terminal->pvt->widget_key_press(event);
+}
+
+static gboolean
+vte_terminal_key_release(GtkWidget *widget, GdkEventKey *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ return terminal->pvt->widget_key_release(event);
+}
+
+static gboolean
+vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ return terminal->pvt->widget_motion_notify(event);
+}
+
+static gboolean
+vte_terminal_button_press(GtkWidget *widget, GdkEventButton *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ return terminal->pvt->widget_button_press(event);
+}
+
+static gboolean
+vte_terminal_button_release(GtkWidget *widget, GdkEventButton *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ return terminal->pvt->widget_button_release(event);
+}
+
+static gboolean
+vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_scroll(event);
+ return TRUE;
+}
+
+static gboolean
+vte_terminal_focus_in(GtkWidget *widget, GdkEventFocus *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_focus_in(event);
+ return FALSE;
+}
+
+static gboolean
+vte_terminal_focus_out(GtkWidget *widget, GdkEventFocus *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_focus_out(event);
+ return FALSE;
+}
+
+static gboolean
+vte_terminal_enter(GtkWidget *widget, GdkEventCrossing *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ gboolean ret = FALSE;
+
+ if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event) {
+ ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event (widget, event);
+ }
+
+ terminal->pvt->widget_enter(event);
+
+ return ret;
+}
+
+static gboolean
+vte_terminal_leave(GtkWidget *widget, GdkEventCrossing *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ gboolean ret = FALSE;
+
+ if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event) {
+ ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event (widget, event);
+ }
+
+ terminal->pvt->widget_leave(event);
+
+ return ret;
+}
+
+static gboolean
+vte_terminal_visibility_notify(GtkWidget *widget, GdkEventVisibility *event)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_visibility_notify(event);
+ return FALSE;
+}
+
+static void
+vte_terminal_get_preferred_width(GtkWidget *widget,
+ int *minimum_width,
+ int *natural_width)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_get_preferred_width(minimum_width, natural_width);
+}
+
+static void
+vte_terminal_get_preferred_height(GtkWidget *widget,
+ int *minimum_height,
+ int *natural_height)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_get_preferred_height(minimum_height, natural_height);
+}
+
+static void
+vte_terminal_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
+{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ terminal->pvt->widget_size_allocate(allocation);
+}
+
+static gboolean
+vte_terminal_draw(GtkWidget *widget,
+ cairo_t *cr)
+{
+ VteTerminal *terminal = VTE_TERMINAL (widget);
+ terminal->pvt->widget_draw(cr);
+ return FALSE;
+}
+
+static void
+vte_terminal_realize(GtkWidget *widget)
+{
+ VteTerminal *terminal= VTE_TERMINAL(widget);
+ terminal->pvt->widget_realize();
+}
+
+static void
+vte_terminal_unrealize(GtkWidget *widget)
+{
+ VteTerminal *terminal = VTE_TERMINAL (widget);
+ terminal->pvt->widget_unrealize();
+}
+
+
+static void
+vte_terminal_screen_changed (GtkWidget *widget,
+ GdkScreen *previous_screen)
+{
+ VteTerminal *terminal = VTE_TERMINAL (widget);
+
+ if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->screen_changed) {
+ GTK_WIDGET_CLASS (vte_terminal_parent_class)->screen_changed (widget, previous_screen);
+ }
+
+ terminal->pvt->widget_screen_changed(previous_screen);
+}
+
+static void
+vte_terminal_init(VteTerminal *terminal)
+{
+ void *place;
+ GtkStyleContext *context;
+
+ _vte_debug_print(VTE_DEBUG_LIFECYCLE, "vte_terminal_init()\n");
+
+ context = gtk_widget_get_style_context(&terminal->widget);
+ gtk_style_context_add_provider (context,
+ VTE_TERMINAL_GET_CLASS (terminal)->priv->style_provider,
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ /* Initialize private data. NOTE: place is zeroed */
+ place = G_TYPE_INSTANCE_GET_PRIVATE (terminal, VTE_TYPE_TERMINAL, VteTerminalPrivate);
+ terminal->pvt = new (place) VteTerminalPrivate(terminal);
+}
+
+static void
+vte_terminal_finalize(GObject *object)
+{
+ VteTerminal *terminal = VTE_TERMINAL (object);
+
+ terminal->pvt->~VteTerminalPrivate();
+ terminal->pvt = nullptr;
+
+ /* Call the inherited finalize() method. */
+ G_OBJECT_CLASS(vte_terminal_parent_class)->finalize(object);
+}
+
+static void
+vte_terminal_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ VteTerminal *terminal = VTE_TERMINAL (object);
+ VteTerminalPrivate *pvt = terminal->pvt;
+
+ switch (prop_id)
+ {
+ case PROP_HADJUSTMENT:
+ g_value_set_object (value, pvt->hadjustment);
+ break;
+ case PROP_VADJUSTMENT:
+ g_value_set_object (value, terminal->pvt->vadjustment);
+ break;
+ case PROP_HSCROLL_POLICY:
+ g_value_set_enum (value, pvt->hscroll_policy);
+ break;
+ case PROP_VSCROLL_POLICY:
+ g_value_set_enum (value, pvt->vscroll_policy);
+ break;
+ case PROP_ALLOW_BOLD:
+ g_value_set_boolean (value, vte_terminal_get_allow_bold (terminal));
+ break;
+ case PROP_AUDIBLE_BELL:
+ g_value_set_boolean (value, vte_terminal_get_audible_bell (terminal));
+ break;
+ case PROP_BACKSPACE_BINDING:
+ g_value_set_enum (value, pvt->backspace_binding);
+ break;
+ case PROP_CJK_AMBIGUOUS_WIDTH:
+ g_value_set_int (value, vte_terminal_get_cjk_ambiguous_width (terminal));
+ break;
+ case PROP_CURSOR_BLINK_MODE:
+ g_value_set_enum (value, vte_terminal_get_cursor_blink_mode (terminal));
+ break;
+ case PROP_CURRENT_DIRECTORY_URI:
+ g_value_set_string (value, vte_terminal_get_current_directory_uri (terminal));
+ break;
+ case PROP_CURRENT_FILE_URI:
+ g_value_set_string (value, vte_terminal_get_current_file_uri (terminal));
+ break;
+ case PROP_CURSOR_SHAPE:
+ g_value_set_enum (value, vte_terminal_get_cursor_shape (terminal));
+ break;
+ case PROP_DELETE_BINDING:
+ g_value_set_enum (value, pvt->delete_binding);
+ break;
+ case PROP_ENCODING:
+ g_value_set_string (value, vte_terminal_get_encoding (terminal));
+ break;
+ case PROP_FONT_DESC:
+ g_value_set_boxed (value, vte_terminal_get_font (terminal));
+ break;
+ case PROP_FONT_SCALE:
+ g_value_set_double (value, vte_terminal_get_font_scale (terminal));
+ break;
+ case PROP_ICON_TITLE:
+ g_value_set_string (value, vte_terminal_get_icon_title (terminal));
+ break;
+ case PROP_INPUT_ENABLED:
+ g_value_set_boolean (value, vte_terminal_get_input_enabled (terminal));
+ break;
+ case PROP_MOUSE_POINTER_AUTOHIDE:
+ g_value_set_boolean (value, vte_terminal_get_mouse_autohide (terminal));
+ break;
+ case PROP_PTY:
+ g_value_set_object (value, vte_terminal_get_pty(terminal));
+ break;
+ case PROP_REWRAP_ON_RESIZE:
+ g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
+ break;
+ case PROP_SCROLLBACK_LINES:
+ g_value_set_uint (value, pvt->scrollback_lines);
+ break;
+ case PROP_SCROLL_ON_KEYSTROKE:
+ g_value_set_boolean (value, pvt->scroll_on_keystroke);
+ break;
+ case PROP_SCROLL_ON_OUTPUT:
+ g_value_set_boolean (value, pvt->scroll_on_output);
+ break;
+ case PROP_WINDOW_TITLE:
+ g_value_set_string (value, vte_terminal_get_window_title (terminal));
+ break;
+ case PROP_WORD_CHAR_EXCEPTIONS:
+ g_value_set_string (value, vte_terminal_get_word_char_exceptions (terminal));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ }
+}
+
+static void
+vte_terminal_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ VteTerminal *terminal = VTE_TERMINAL (object);
+
+ switch (prop_id)
+ {
+ case PROP_HADJUSTMENT:
+ vte_terminal_set_hadjustment (terminal, (GtkAdjustment *)g_value_get_object (value));
+ break;
+ case PROP_VADJUSTMENT:
+ vte_terminal_set_vadjustment (terminal, (GtkAdjustment *)g_value_get_object (value));
+ break;
+ case PROP_HSCROLL_POLICY:
+ vte_terminal_set_hscroll_policy(terminal,
(GtkScrollablePolicy)g_value_get_enum(value));
+ break;
+ case PROP_VSCROLL_POLICY:
+ vte_terminal_set_vscroll_policy(terminal,
(GtkScrollablePolicy)g_value_get_enum(value));
+ break;
+ case PROP_ALLOW_BOLD:
+ vte_terminal_set_allow_bold (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_AUDIBLE_BELL:
+ vte_terminal_set_audible_bell (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_BACKSPACE_BINDING:
+ vte_terminal_set_backspace_binding (terminal, (VteEraseBinding)g_value_get_enum
(value));
+ break;
+ case PROP_CJK_AMBIGUOUS_WIDTH:
+ vte_terminal_set_cjk_ambiguous_width (terminal, g_value_get_int (value));
+ break;
+ case PROP_CURSOR_BLINK_MODE:
+ vte_terminal_set_cursor_blink_mode (terminal, (VteCursorBlinkMode)g_value_get_enum
(value));
+ break;
+ case PROP_CURSOR_SHAPE:
+ vte_terminal_set_cursor_shape (terminal, (VteCursorShape)g_value_get_enum (value));
+ break;
+ case PROP_DELETE_BINDING:
+ vte_terminal_set_delete_binding (terminal, (VteEraseBinding)g_value_get_enum
(value));
+ break;
+ case PROP_ENCODING:
+ vte_terminal_set_encoding (terminal, g_value_get_string (value), NULL);
+ break;
+ case PROP_FONT_DESC:
+ vte_terminal_set_font (terminal, (PangoFontDescription *)g_value_get_boxed (value));
+ break;
+ case PROP_FONT_SCALE:
+ vte_terminal_set_font_scale (terminal, g_value_get_double (value));
+ break;
+ case PROP_INPUT_ENABLED:
+ vte_terminal_set_input_enabled (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_MOUSE_POINTER_AUTOHIDE:
+ vte_terminal_set_mouse_autohide (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_PTY:
+ vte_terminal_set_pty (terminal, (VtePty *)g_value_get_object (value));
+ break;
+ case PROP_REWRAP_ON_RESIZE:
+ vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_SCROLLBACK_LINES:
+ vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value));
+ break;
+ case PROP_SCROLL_ON_KEYSTROKE:
+ vte_terminal_set_scroll_on_keystroke(terminal, g_value_get_boolean (value));
+ break;
+ case PROP_SCROLL_ON_OUTPUT:
+ vte_terminal_set_scroll_on_output (terminal, g_value_get_boolean (value));
+ break;
+ case PROP_WORD_CHAR_EXCEPTIONS:
+ vte_terminal_set_word_char_exceptions (terminal, g_value_get_string (value));
+ break;
+
+ /* Not writable */
+ case PROP_CURRENT_DIRECTORY_URI:
+ case PROP_CURRENT_FILE_URI:
+ case PROP_ICON_TITLE:
+ case PROP_WINDOW_TITLE:
+ g_assert_not_reached ();
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ }
+}
+
+static void
+vte_terminal_class_init(VteTerminalClass *klass)
+{
+ GObjectClass *gobject_class;
+ GtkWidgetClass *widget_class;
+ GtkBindingSet *binding_set;
+
+#ifdef VTE_DEBUG
+ {
+ _vte_debug_init();
+ _vte_debug_print(VTE_DEBUG_LIFECYCLE,
+ "vte_terminal_class_init()\n");
+ /* print out the legend */
+ _vte_debug_print(VTE_DEBUG_WORK,
+ "Debugging work flow (top input to bottom output):\n"
+ " . _vte_terminal_process_incoming\n"
+ " < start process_timeout\n"
+ " {[ start update_timeout [ => rate limited\n"
+ " T start of terminal in update_timeout\n"
+ " ( start _vte_terminal_process_incoming\n"
+ " ? _vte_invalidate_cells (call)\n"
+ " ! _vte_invalidate_cells (dirty)\n"
+ " * _vte_invalidate_all\n"
+ " ) end _vte_terminal_process_incoming\n"
+ " - gdk_window_process_updates\n"
+ " = vte_terminal_paint\n"
+ " ]} end update_timeout\n"
+ " > end process_timeout\n");
+ }
+#endif
+
+ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+#ifdef HAVE_DECL_BIND_TEXTDOMAIN_CODESET
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+#endif
+
+ g_type_class_add_private(klass, sizeof (VteTerminalPrivate));
+
+ gobject_class = G_OBJECT_CLASS(klass);
+ widget_class = GTK_WIDGET_CLASS(klass);
+
+ /* Override some of the default handlers. */
+ gobject_class->finalize = vte_terminal_finalize;
+ gobject_class->get_property = vte_terminal_get_property;
+ gobject_class->set_property = vte_terminal_set_property;
+ widget_class->realize = vte_terminal_realize;
+ widget_class->scroll_event = vte_terminal_scroll;
+ widget_class->draw = vte_terminal_draw;
+ widget_class->key_press_event = vte_terminal_key_press;
+ widget_class->key_release_event = vte_terminal_key_release;
+ widget_class->button_press_event = vte_terminal_button_press;
+ widget_class->button_release_event = vte_terminal_button_release;
+ widget_class->motion_notify_event = vte_terminal_motion_notify;
+ widget_class->enter_notify_event = vte_terminal_enter;
+ widget_class->leave_notify_event = vte_terminal_leave;
+ widget_class->focus_in_event = vte_terminal_focus_in;
+ widget_class->focus_out_event = vte_terminal_focus_out;
+ widget_class->visibility_notify_event = vte_terminal_visibility_notify;
+ widget_class->unrealize = vte_terminal_unrealize;
+ widget_class->style_updated = vte_terminal_style_updated;
+ widget_class->get_preferred_width = vte_terminal_get_preferred_width;
+ widget_class->get_preferred_height = vte_terminal_get_preferred_height;
+ widget_class->size_allocate = vte_terminal_size_allocate;
+ widget_class->screen_changed = vte_terminal_screen_changed;
+
+ /* Initialize default handlers. */
+ klass->eof = NULL;
+ klass->child_exited = NULL;
+ klass->encoding_changed = NULL;
+ klass->char_size_changed = NULL;
+ klass->window_title_changed = NULL;
+ klass->icon_title_changed = NULL;
+ klass->selection_changed = NULL;
+ klass->contents_changed = NULL;
+ klass->cursor_moved = NULL;
+ klass->commit = NULL;
+
+ klass->deiconify_window = NULL;
+ klass->iconify_window = NULL;
+ klass->raise_window = NULL;
+ klass->lower_window = NULL;
+ klass->refresh_window = NULL;
+ klass->restore_window = NULL;
+ klass->maximize_window = NULL;
+ klass->resize_window = NULL;
+ klass->move_window = NULL;
+
+ klass->increase_font_size = NULL;
+ klass->decrease_font_size = NULL;
+
+ klass->text_modified = NULL;
+ klass->text_inserted = NULL;
+ klass->text_deleted = NULL;
+ klass->text_scrolled = NULL;
+
+ klass->copy_clipboard = vte_terminal_real_copy_clipboard;
+ klass->paste_clipboard = vte_terminal_real_paste_clipboard;
+
+ klass->bell = NULL;
+
+ /* GtkScrollable interface properties */
+ g_object_class_override_property (gobject_class, PROP_HADJUSTMENT, "hadjustment");
+ g_object_class_override_property (gobject_class, PROP_VADJUSTMENT, "vadjustment");
+ g_object_class_override_property (gobject_class, PROP_HSCROLL_POLICY, "hscroll-policy");
+ g_object_class_override_property (gobject_class, PROP_VSCROLL_POLICY, "vscroll-policy");
+
+ /* Register some signals of our own. */
+
+ /**
+ * VteTerminal::eof:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the terminal receives an end-of-file from a child which
+ * is running in the terminal. This signal is frequently (but not
+ * always) emitted with a #VteTerminal::child-exited signal.
+ */
+ g_signal_new(I_("eof"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, eof),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::child-exited:
+ * @vteterminal: the object which received the signal
+ * @status: the child's exit status
+ *
+ * This signal is emitted when the terminal detects that a child
+ * watched using vte_terminal_watch_child() has exited.
+ */
+ g_signal_new(I_("child-exited"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, child_exited),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE,
+ 1, G_TYPE_INT);
+
+ /**
+ * VteTerminal::window-title-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the terminal's %window_title field is modified.
+ */
+ g_signal_new(I_("window-title-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, window_title_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::icon-title-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the terminal's %icon_title field is modified.
+ */
+ g_signal_new(I_("icon-title-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, icon_title_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::current-directory-uri-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the current directory URI is modified.
+ */
+ g_signal_new(I_("current-directory-uri-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::current-file-uri-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the current file URI is modified.
+ */
+ g_signal_new(I_("current-file-uri-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::encoding-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever the terminal's current encoding has changed, either
+ * as a result of receiving a control sequence which toggled between the
+ * local and UTF-8 encodings, or at the parent application's request.
+ */
+ g_signal_new(I_("encoding-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, encoding_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::commit:
+ * @vteterminal: the object which received the signal
+ * @text: a string of text
+ * @size: the length of that string of text
+ *
+ * Emitted whenever the terminal receives input from the user and
+ * prepares to send it to the child process. The signal is emitted even
+ * when there is no child process.
+ */
+ g_signal_new(I_("commit"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, commit),
+ NULL,
+ NULL,
+ _vte_marshal_VOID__STRING_UINT,
+ G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
+
+ /**
+ * VteTerminal::char-size-changed:
+ * @vteterminal: the object which received the signal
+ * @width: the new character cell width
+ * @height: the new character cell height
+ *
+ * Emitted whenever selection of a new font causes the values of the
+ * %char_width or %char_height fields to change.
+ */
+ g_signal_new(I_("char-size-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, char_size_changed),
+ NULL,
+ NULL,
+ _vte_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+
+ /**
+ * VteTerminal::selection-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever the contents of terminal's selection changes.
+ */
+ g_signal_new (I_("selection-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, selection_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::contents-changed:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever the visible appearance of the terminal has changed.
+ * Used primarily by #VteTerminalAccessible.
+ */
+ g_signal_new(I_("contents-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, contents_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::cursor-moved:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever the cursor moves to a new character cell. Used
+ * primarily by #VteTerminalAccessible.
+ */
+ g_signal_new(I_("cursor-moved"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, cursor_moved),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::deiconify-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("deiconify-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, deiconify_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::iconify-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("iconify-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, iconify_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::raise-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("raise-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, raise_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::lower-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("lower-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, lower_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::refresh-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("refresh-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, refresh_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::restore-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("restore-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, restore_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::maximize-window:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("maximize-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, maximize_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::resize-window:
+ * @vteterminal: the object which received the signal
+ * @width: the desired number of columns
+ * @height: the desired number of rows
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("resize-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, resize_window),
+ NULL,
+ NULL,
+ _vte_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+
+ /**
+ * VteTerminal::move-window:
+ * @vteterminal: the object which received the signal
+ * @x: the terminal's desired location, X coordinate
+ * @y: the terminal's desired location, Y coordinate
+ *
+ * Emitted at the child application's request.
+ */
+ g_signal_new(I_("move-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, move_window),
+ NULL,
+ NULL,
+ _vte_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+
+ /**
+ * VteTerminal::increase-font-size:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the user hits the '+' key while holding the Control key.
+ */
+ g_signal_new(I_("increase-font-size"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, increase_font_size),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::decrease-font-size:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted when the user hits the '-' key while holding the Control key.
+ */
+ g_signal_new(I_("decrease-font-size"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, decrease_font_size),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::text-modified:
+ * @vteterminal: the object which received the signal
+ *
+ * An internal signal used for communication between the terminal and
+ * its accessibility peer. May not be emitted under certain
+ * circumstances.
+ */
+ g_signal_new(I_("text-modified"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, text_modified),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::text-inserted:
+ * @vteterminal: the object which received the signal
+ *
+ * An internal signal used for communication between the terminal and
+ * its accessibility peer. May not be emitted under certain
+ * circumstances.
+ */
+ g_signal_new(I_("text-inserted"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, text_inserted),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::text-deleted:
+ * @vteterminal: the object which received the signal
+ *
+ * An internal signal used for communication between the terminal and
+ * its accessibility peer. May not be emitted under certain
+ * circumstances.
+ */
+ g_signal_new(I_("text-deleted"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, text_deleted),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::text-scrolled:
+ * @vteterminal: the object which received the signal
+ * @delta: the number of lines scrolled
+ *
+ * An internal signal used for communication between the terminal and
+ * its accessibility peer. May not be emitted under certain
+ * circumstances.
+ */
+ g_signal_new(I_("text-scrolled"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, text_scrolled),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
+
+ /**
+ * VteTerminal::copy-clipboard:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever vte_terminal_copy_clipboard() is called.
+ */
+ signals[COPY_CLIPBOARD] =
+ g_signal_new(I_("copy-clipboard"),
+ G_OBJECT_CLASS_TYPE(klass),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET(VteTerminalClass, copy_clipboard),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::paste-clipboard:
+ * @vteterminal: the object which received the signal
+ *
+ * Emitted whenever vte_terminal_paste_clipboard() is called.
+ */
+ signals[PASTE_CLIPBOARD] =
+ g_signal_new(I_("paste-clipboard"),
+ G_OBJECT_CLASS_TYPE(klass),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET(VteTerminalClass, paste_clipboard),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal::bell:
+ * @vteterminal: the object which received the signal
+ *
+ * This signal is emitted when the a child sends a bell request to the
+ * terminal.
+ */
+ g_signal_new(I_("bell"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, bell),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteTerminal:allow-bold:
+ *
+ * Controls whether or not the terminal will attempt to draw bold text.
+ * This may happen either by using a bold font variant, or by
+ * repainting text with a different offset.
+ */
+ pspecs[PROP_ALLOW_BOLD] =
+ g_param_spec_boolean ("allow-bold", NULL, NULL,
+ TRUE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:audible-bell:
+ *
+ * Controls whether or not the terminal will beep when the child outputs the
+ * "bl" sequence.
+ */
+ pspecs[PROP_AUDIBLE_BELL] =
+ g_param_spec_boolean ("audible-bell", NULL, NULL,
+ TRUE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:backspace-binding:
+ *
+ * *Controls what string or control sequence the terminal sends to its child
+ * when the user presses the backspace key.
+ */
+ pspecs[PROP_BACKSPACE_BINDING] =
+ g_param_spec_enum ("backspace-binding", NULL, NULL,
+ VTE_TYPE_ERASE_BINDING,
+ VTE_ERASE_AUTO,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:cjk-ambiguous-width:
+ *
+ * This setting controls whether ambiguous-width characters are narrow or wide
+ * when using the UTF-8 encoding (vte_terminal_set_encoding()). In all other encodings,
+ * the width of ambiguous-width characters is fixed.
+ *
+ * This setting only takes effect the next time the terminal is reset, either
+ * via escape sequence or with vte_terminal_reset().
+ */
+ pspecs[PROP_CJK_AMBIGUOUS_WIDTH] =
+ g_param_spec_int ("cjk-ambiguous-width", NULL, NULL,
+ 1, 2, VTE_DEFAULT_UTF8_AMBIGUOUS_WIDTH,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:cursor-blink-mode:
+ *
+ * Sets whether or not the cursor will blink. Using %VTE_CURSOR_BLINK_SYSTEM
+ * will use the #GtkSettings::gtk-cursor-blink setting.
+ */
+ pspecs[PROP_CURSOR_BLINK_MODE] =
+ g_param_spec_enum ("cursor-blink-mode", NULL, NULL,
+ VTE_TYPE_CURSOR_BLINK_MODE,
+ VTE_CURSOR_BLINK_SYSTEM,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:cursor-shape:
+ *
+ * Controls the shape of the cursor.
+ */
+ pspecs[PROP_CURSOR_SHAPE] =
+ g_param_spec_enum ("cursor-shape", NULL, NULL,
+ VTE_TYPE_CURSOR_SHAPE,
+ VTE_CURSOR_SHAPE_BLOCK,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:delete-binding:
+ *
+ * Controls what string or control sequence the terminal sends to its child
+ * when the user presses the delete key.
+ */
+ pspecs[PROP_DELETE_BINDING] =
+ g_param_spec_enum ("delete-binding", NULL, NULL,
+ VTE_TYPE_ERASE_BINDING,
+ VTE_ERASE_AUTO,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:font-scale:
+ *
+ * The terminal's font scale.
+ */
+ pspecs[PROP_FONT_SCALE] =
+ g_param_spec_double ("font-scale", NULL, NULL,
+ VTE_FONT_SCALE_MIN,
+ VTE_FONT_SCALE_MAX,
+ 1.,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:encoding:
+ *
+ * Controls 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 is defined by the
+ * application's locale settings.
+ */
+ pspecs[PROP_ENCODING] =
+ g_param_spec_string ("encoding", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:font-desc:
+ *
+ * Specifies 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 attempt to resize itself to keep the same number of rows
+ * and columns.
+ */
+ pspecs[PROP_FONT_DESC] =
+ g_param_spec_boxed ("font-desc", NULL, NULL,
+ PANGO_TYPE_FONT_DESCRIPTION,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:icon-title:
+ *
+ * The terminal's so-called icon title, or %NULL if no icon title has been set.
+ */
+ pspecs[PROP_ICON_TITLE] =
+ g_param_spec_string ("icon-title", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:input-enabled:
+ *
+ * Controls whether the terminal allows user input. When user input is disabled,
+ * key press and mouse button press and motion events are not sent to the
+ * terminal's child.
+ */
+ pspecs[PROP_INPUT_ENABLED] =
+ g_param_spec_boolean ("input-enabled", NULL, NULL,
+ TRUE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:pointer-autohide:
+ *
+ * Controls 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.
+ */
+ pspecs[PROP_MOUSE_POINTER_AUTOHIDE] =
+ g_param_spec_boolean ("pointer-autohide", NULL, NULL,
+ FALSE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:pty:
+ *
+ * The PTY object for the terminal.
+ */
+ pspecs[PROP_PTY] =
+ g_param_spec_object ("pty", NULL, NULL,
+ VTE_TYPE_PTY,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:rewrap-on-resize:
+ *
+ * Controls whether or not the terminal will rewrap its contents, including
+ * the scrollback buffer, whenever the terminal's width changes.
+ */
+ pspecs[PROP_REWRAP_ON_RESIZE] =
+ g_param_spec_boolean ("rewrap-on-resize", NULL, NULL,
+ TRUE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:scrollback-lines:
+ *
+ * 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 on the alternate screen buffer.
+ */
+ pspecs[PROP_SCROLLBACK_LINES] =
+ g_param_spec_uint ("scrollback-lines", NULL, NULL,
+ 0, G_MAXUINT,
+ VTE_SCROLLBACK_INIT,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal: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.
+ */
+ pspecs[PROP_SCROLL_ON_KEYSTROKE] =
+ g_param_spec_boolean ("scroll-on-keystroke", NULL, NULL,
+ FALSE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal: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.
+ */
+ pspecs[PROP_SCROLL_ON_OUTPUT] =
+ g_param_spec_boolean ("scroll-on-output", NULL, NULL,
+ TRUE,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:window-title:
+ *
+ * The terminal's title.
+ */
+ pspecs[PROP_WINDOW_TITLE] =
+ g_param_spec_string ("window-title", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:current-directory-uri:
+ *
+ * The current directory URI, or %NULL if unset.
+ */
+ pspecs[PROP_CURRENT_DIRECTORY_URI] =
+ g_param_spec_string ("current-directory-uri", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:current-file-uri:
+ *
+ * The current file URI, or %NULL if unset.
+ */
+ pspecs[PROP_CURRENT_FILE_URI] =
+ g_param_spec_string ("current-file-uri", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
+ * VteTerminal:word-char-exceptions:
+ *
+ * The set of characters which will be considered parts of a word
+ * when doing word-wise selection, in addition to the default which only
+ * considers alphanumeric characters part of a word.
+ *
+ * If %NULL, a built-in set is used.
+ *
+ * Since: 0.40
+ */
+ pspecs[PROP_WORD_CHAR_EXCEPTIONS] =
+ g_param_spec_string ("word-char-exceptions", NULL, NULL,
+ NULL,
+ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+ g_object_class_install_properties(gobject_class, LAST_PROP, pspecs);
+
+ /* Disable GtkWidget's keybindings except for Shift-F10 and MenuKey
+ * which pop up the context menu.
+ */
+ binding_set = gtk_binding_set_by_class(vte_terminal_parent_class);
+ gtk_binding_entry_skip(binding_set, GDK_KEY_F1, GDK_CONTROL_MASK);
+ gtk_binding_entry_skip(binding_set, GDK_KEY_F1, GDK_SHIFT_MASK);
+ gtk_binding_entry_skip(binding_set, GDK_KEY_KP_F1, GDK_CONTROL_MASK);
+ gtk_binding_entry_skip(binding_set, GDK_KEY_KP_F1, GDK_SHIFT_MASK);
+
+ process_timer = g_timer_new();
+
+ klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, VTE_TYPE_TERMINAL, VteTerminalClassPrivate);
+
+ klass->priv->style_provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
+ gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (klass->priv->style_provider),
+ "VteTerminal {\n"
+ "padding: 1px 1px 1px 1px;\n"
+ "background-color: @theme_base_color;\n"
+ "color: @theme_fg_color;\n"
+ "}\n",
+ -1, NULL);
+
+ /* a11y */
+ gtk_widget_class_set_accessible_type(widget_class, VTE_TYPE_TERMINAL_ACCESSIBLE);
+}
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
new file mode 100644
index 0000000..2e34935
--- /dev/null
+++ b/src/vtegtk.hh
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2001-2004,2009,2010 Red Hat, Inc.
+ * Copyright © 2008, 2009, 2010, 2015 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION: vte-terminal
+ * @short_description: A terminal widget implementation
+ *
+ * A VteTerminal is a terminal emulator implemented as a GTK3 widget.
+ */
+
+#pragma once
+
+enum {
+ COPY_CLIPBOARD,
+ PASTE_CLIPBOARD,
+ LAST_SIGNAL
+};
+extern guint signals[LAST_SIGNAL];
+
+enum {
+ PROP_0,
+ PROP_ALLOW_BOLD,
+ PROP_AUDIBLE_BELL,
+ PROP_BACKSPACE_BINDING,
+ PROP_CJK_AMBIGUOUS_WIDTH,
+ PROP_CURSOR_BLINK_MODE,
+ PROP_CURSOR_SHAPE,
+ PROP_CURRENT_DIRECTORY_URI,
+ PROP_CURRENT_FILE_URI,
+ PROP_DELETE_BINDING,
+ PROP_ENCODING,
+ PROP_FONT_DESC,
+ PROP_FONT_SCALE,
+ PROP_ICON_TITLE,
+ PROP_INPUT_ENABLED,
+ PROP_MOUSE_POINTER_AUTOHIDE,
+ PROP_PTY,
+ PROP_REWRAP_ON_RESIZE,
+ PROP_SCROLLBACK_LINES,
+ PROP_SCROLL_ON_KEYSTROKE,
+ PROP_SCROLL_ON_OUTPUT,
+ PROP_WINDOW_TITLE,
+ PROP_WORD_CHAR_EXCEPTIONS,
+ LAST_PROP,
+
+ /* override properties */
+ PROP_HADJUSTMENT,
+ PROP_VADJUSTMENT,
+ PROP_HSCROLL_POLICY,
+ PROP_VSCROLL_POLICY
+};
+extern GParamSpec *pspecs[LAST_PROP];
+
+const GtkBorder default_padding = { 1, 1, 1, 1 };
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index ca14349..d3ddcbe 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -21,6 +21,9 @@
#include <glib.h>
#include "vtetypes.hh"
+#include "ring.h"
+#include "vteconv.h"
+#include "buffer.h"
#ifdef WITH_PCRE2
#include "vtepcre2.h"
@@ -452,6 +455,12 @@ public:
void add_cursor_timeout();
void remove_cursor_timeout();
+ void widget_paste(GdkAtom board);
+ void widget_copy(VteSelection sel);
+
+ void widget_set_hadjustment(GtkAdjustment *adjustment);
+ void widget_set_vadjustment(GtkAdjustment *adjustment);
+
void widget_realize();
void widget_unrealize();
void widget_style_updated();
@@ -707,3 +716,7 @@ public:
#define m_word_char_exceptions_string word_char_exceptions_string
#define m_word_char_exceptions word_char_exceptions
#define m_icon_title icon_title
+#define m_selection_start selection_start
+#define m_selection_end selection_end
+
+extern GTimer *process_timer;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]