[vte] lib: Make VteTerminalPrivate a C++ class



commit 6ee7dd640c9124f016ae2ce351439af37b530936
Author: Christian Persch <chpe gnome org>
Date:   Wed Apr 1 22:10:24 2015 +0200

    lib: Make VteTerminalPrivate a C++ class

 src/vte-private.h     |  353 +----------------------------------------------
 src/vte.cc            |    8 +-
 src/vte/vteterminal.h |    6 +
 src/vteinternal.hh    |  375 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 389 insertions(+), 353 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 8ecea8e..2fbad44 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -50,361 +50,10 @@
 #include "caps.h"
 
 #include "vtedefines.hh"
+#include "vteinternal.hh"
 
 G_BEGIN_DECLS
 
-typedef enum {
-  VTE_REGEX_CURSOR_GDKCURSOR,
-  VTE_REGEX_CURSOR_GDKCURSORTYPE,
-  VTE_REGEX_CURSOR_NAME
-} VteRegexCursorMode;
-
-/* The order is important */
-typedef enum {
-       MOUSE_TRACKING_NONE,
-       MOUSE_TRACKING_SEND_XY_ON_CLICK,
-       MOUSE_TRACKING_SEND_XY_ON_BUTTON,
-       MOUSE_TRACKING_HILITE_TRACKING,
-       MOUSE_TRACKING_CELL_MOTION_TRACKING,
-       MOUSE_TRACKING_ALL_MOTION_TRACKING
-} MouseTrackingMode;
-
-/* A match regex, with a tag. */
-struct vte_match_regex {
-       gint tag;
-        GRegex *regex;
-        GRegexMatchFlags match_flags;
-        VteRegexCursorMode cursor_mode;
-        union {
-              GdkCursor *cursor;
-               char *cursor_name;
-               GdkCursorType cursor_type;
-        } cursor;
-};
-
-typedef enum _VteCharacterReplacement {
-        VTE_CHARACTER_REPLACEMENT_NONE,
-        VTE_CHARACTER_REPLACEMENT_LINE_DRAWING,
-        VTE_CHARACTER_REPLACEMENT_BRITISH
-} VteCharacterReplacement;
-
-/* The terminal's keypad/cursor state.  A terminal can either be using the
- * normal keypad, or the "application" keypad. */
-typedef enum _VteKeymode {
-       VTE_KEYMODE_NORMAL,
-       VTE_KEYMODE_APPLICATION
-} VteKeymode;
-
-typedef struct _VteScreen VteScreen;
-
-typedef struct _VtePaletteColor {
-       struct {
-               PangoColor color;
-               gboolean is_set;
-       } sources[2];
-} VtePaletteColor;
-
-/* These correspond to the parameters for DECSCUSR (Set cursor style). */
-typedef enum _VteCursorStyle {
-        /* We treat 0 and 1 differently, assuming that the VT510 does so too.
-         *
-         * See, according to the "VT510 Video Terminal Programmer Information",
-         * from vt100.net, paragraph "2.5.7 Cursor Display", there was a menu
-         * item in the "Terminal Set-Up" to set the cursor's style. It looks
-         * like that defaulted to blinking block. So it makes sense for 0 to
-         * mean "set cursor style to default (set by Set-Up)" and 1 to mean
-         * "set cursor style to blinking block", since that default need not be
-         * blinking block. Access to a VT510 is needed to test this theory,
-         * but it seems plausible. And, anyhow, we can even decide we know
-         * better than the VT510 designers! */
-        VTE_CURSOR_STYLE_TERMINAL_DEFAULT = 0,
-        VTE_CURSOR_STYLE_BLINK_BLOCK      = 1,
-        VTE_CURSOR_STYLE_STEADY_BLOCK     = 2,
-        VTE_CURSOR_STYLE_BLINK_UNDERLINE  = 3,
-        VTE_CURSOR_STYLE_STEADY_UNDERLINE = 4,
-        /* *_IBEAM are xterm extensions */
-        VTE_CURSOR_STYLE_BLINK_IBEAM      = 5,
-        VTE_CURSOR_STYLE_STEADY_IBEAM     = 6
-} VteCursorStyle;
-
-typedef struct _vte_incoming_chunk _vte_incoming_chunk_t;
-struct _vte_incoming_chunk{
-        _vte_incoming_chunk_t *next;
-        guint len;
-        guchar data[VTE_INPUT_CHUNK_SIZE - 2 * sizeof(void *)];
-};
-
-struct _VteScreen {
-        VteRing row_data[1];   /* buffer contents */
-        long scroll_delta;     /* scroll offset */
-        long insert_delta;     /* insertion offset */
-
-        /* Stuff saved along with the cursor */
-        struct {
-                VteVisualPosition cursor;
-                gboolean reverse_mode;
-                gboolean origin_mode;
-                gboolean sendrecv_mode;
-                gboolean insert_mode;
-                gboolean linefeed_mode;
-                VteCell defaults;
-                VteCell color_defaults;
-                VteCell fill_defaults;
-                VteCharacterReplacement character_replacements[2];
-                VteCharacterReplacement *character_replacement;
-        } saved;
-};
-
-enum vte_selection_type {
-        selection_type_char,
-        selection_type_word,
-        selection_type_line
-};
-
-struct selection_event_coords {
-        long x, y;
-};
-
-struct vte_scrolling_region {
-        int start, end;
-};
-
-/* Terminal private data. */
-struct _VteTerminalPrivate {
-        /* Metric and sizing data: dimensions of the window */
-        glong row_count;
-        glong column_count;
-
-       /* Emulation setup data. */
-       struct _vte_matcher *matcher;   /* control sequence matcher */
-       const char *emulation;          /* terminal type to emulate */
-        gboolean autowrap;              /* auto wraparound at right margin */
-       int keypad_mode, cursor_mode;   /* these would be VteKeymodes, but we
-                                          need to guarantee its type */
-       GHashTable *dec_saved;
-
-       /* PTY handling data. */
-       VtePty *pty;
-       GIOChannel *pty_channel;        /* master channel */
-       guint pty_input_source;
-       guint pty_output_source;
-       gboolean pty_input_active;
-       GPid pty_pid;                   /* pid of child using pty slave */
-       guint child_watch_source;
-
-       /* Input data queues. */
-       const char *encoding;           /* the pty's encoding */
-        int utf8_ambiguous_width;
-       struct _vte_iso2022_state *iso2022;
-       _vte_incoming_chunk_t *incoming;/* pending bytestream */
-       GArray *pending;                /* pending characters */
-       GSList *update_regions;
-       gboolean invalidated_all;       /* pending refresh of entire terminal */
-       GList *active;                  /* is the terminal processing data */
-       glong input_bytes;
-       glong max_input_bytes;
-
-       /* Output data queue. */
-       VteByteArray *outgoing; /* pending input characters */
-       VteConv outgoing_conv;
-
-       /* IConv buffer. */
-       VteByteArray *conv_buffer;
-
-       /* Screen data.  We support the normal screen, and an alternate
-        * screen, which seems to be a DEC-specific feature. */
-       struct _VteScreen normal_screen, alternate_screen, *screen;
-
-        /* Values we save along with the cursor */
-        VteVisualPosition cursor;      /* relative to the insertion delta */
-        gboolean reverse_mode; /* reverse mode */
-        gboolean origin_mode;  /* origin mode */
-        gboolean sendrecv_mode;        /* sendrecv mode */
-        gboolean insert_mode;  /* insert mode */
-        gboolean linefeed_mode;        /* linefeed mode */
-        VteCell defaults;      /* default characteristics
-                                   for insertion of any new
-                                   characters */
-        VteCell color_defaults;        /* original defaults
-                                   plus the current
-                                   fore/back */
-        VteCell fill_defaults; /* original defaults
-                                   plus the current
-                                   fore/back with no
-                                   character data */
-        VteCharacterReplacement character_replacements[2];  /* charsets in the G0 and G1 slots */
-        VteCharacterReplacement *character_replacement;     /* pointer to the active one */
-
-
-        /* Word chars */
-        char *word_char_exceptions_string;
-        gunichar *word_char_exceptions;
-        gsize word_char_exceptions_len;
-
-       /* Selection information. */
-       gboolean has_selection;
-       gboolean selecting;
-       gboolean selecting_after_threshold;
-       gboolean selecting_restart;
-       gboolean selecting_had_delta;
-       gboolean selection_block_mode;
-       char *selection;
-       enum vte_selection_type selection_type;
-       struct selection_event_coords selection_origin, selection_last;
-       VteVisualPosition selection_start, selection_end;
-
-       /* Miscellaneous options. */
-       VteEraseBinding backspace_binding, delete_binding;
-       gboolean meta_sends_escape;
-       gboolean audible_bell;
-       gboolean margin_bell;
-       guint bell_margin;
-       gboolean allow_bold;
-        gboolean deccolm_mode; /* DECCOLM allowed */
-       GHashTable *tabstops;
-       gboolean text_modified_flag;
-       gboolean text_inserted_flag;
-       gboolean text_deleted_flag;
-       gboolean rewrap_on_resize;
-       gboolean bracketed_paste_mode;
-
-       /* Scrolling options. */
-       gboolean scroll_background;
-       gboolean scroll_on_output;
-       gboolean scroll_on_keystroke;
-       gboolean alternate_screen_scroll;
-       long scrollback_lines;
-
-        /* Restricted scrolling */
-        struct vte_scrolling_region scrolling_region;     /* the region we scroll in */
-        gboolean scrolling_restricted;
-
-       /* Cursor shape, as set via API */
-       VteCursorShape cursor_shape;
-        float cursor_aspect_ratio;
-
-       /* Cursor blinking, as set in dconf. */
-        VteCursorBlinkMode cursor_blink_mode;
-       gboolean cursor_blink_state;
-       guint cursor_blink_tag;           /* cursor blinking timeout ID */
-        gint cursor_blink_cycle;          /* gtk-cursor-blink-time / 2 */
-       gint cursor_blink_timeout;        /* gtk-cursor-blink-timeout */
-        gboolean cursor_blinks;           /* whether the cursor is actually blinking */
-       gint64 cursor_blink_time;         /* how long the cursor has been blinking yet */
-       gboolean cursor_visible;
-       gboolean has_focus;               /* is the terminal window focused */
-
-        /* DECSCUSR cursor style (shape and blinking possibly overridden
-         * via escape sequence) */
-        VteCursorStyle cursor_style;
-
-       /* Input device options. */
-        gboolean input_enabled;
-       time_t last_keypress_time;
-
-       int mouse_tracking_mode; /* this is of type MouseTrackingMode,
-                                   but we need to guarantee its type. */
-        guint mouse_pressed_buttons;      /* bits 0, 1, 2 resp. for buttons 1, 2, 3 */
-        guint mouse_handled_buttons;      /* similar bitmap for buttons we handled ourselves */
-       long mouse_last_x, mouse_last_y;
-       gboolean mouse_autohide;
-       guint mouse_autoscroll_tag;
-       gboolean mouse_xterm_extension;
-       gboolean mouse_urxvt_extension;
-       double mouse_smooth_scroll_delta;
-
-       /* State variables for handling match checks. */
-       char *match_contents;
-       GArray *match_attributes;
-       GArray *match_regexes;
-       char *match;
-       int match_tag;
-       VteVisualPosition match_start, match_end;
-       gboolean show_match;
-
-       /* Search data. */
-       GRegex *search_regex;
-        GRegexMatchFlags search_match_flags;
-       gboolean search_wrap_around;
-       GArray *search_attrs; /* Cache attrs */
-
-       /* Data used when rendering the text which does not require server
-        * resources and which can be kept after unrealizing. */
-        PangoFontDescription *unscaled_font_desc;
-       PangoFontDescription *fontdesc;
-        gdouble font_scale;
-       gboolean fontdirty;
-        glong char_ascent;
-        glong char_descent;
-        /* dimensions of character cells */
-        glong char_width;
-        glong char_height;
-
-       /* Data used when rendering the text which reflects server resources
-        * and data, which should be dropped when unrealizing and (re)created
-        * when realizing. */
-       struct _vte_draw *draw;
-
-       VtePaletteColor palette[VTE_PALETTE_SIZE];
-
-       /* Mouse cursors. */
-       gboolean mouse_cursor_visible;
-       GdkCursor *mouse_default_cursor,
-                 *mouse_mousing_cursor,
-                 *mouse_inviso_cursor;
-
-       /* Input method support. */
-       GtkIMContext *im_context;
-       gboolean im_preedit_active;
-       char *im_preedit;
-       PangoAttrList *im_preedit_attrs;
-       int im_preedit_cursor;
-
-       gboolean accessible_emit;
-
-       /* Adjustment updates pending. */
-       gboolean adjustment_changed_pending;
-       gboolean adjustment_value_changed_pending;
-
-       gboolean cursor_moved_pending;
-       gboolean contents_changed_pending;
-
-       /* window name changes */
-        gchar *window_title;
-       gchar *window_title_changed;
-        gchar *icon_title;
-       gchar *icon_title_changed;
-        gchar *current_directory_uri;
-        gchar *current_directory_uri_changed;
-        gchar *current_file_uri;
-        gchar *current_file_uri_changed;
-
-       /* Background */
-        gdouble background_alpha;
-
-       /* Key modifiers. */
-       guint modifiers;
-
-       /* Obscured? state. */
-       GdkVisibilityState visibility_state;
-
-       /* Font stuff. */
-       gboolean has_fonts;
-       glong line_thickness;
-       glong underline_position;
-       glong strikethrough_position;
-
-        /* Style stuff */
-        GtkBorder padding;
-
-        /* GtkScrollable impl */
-        GtkAdjustment *hadjustment; /* unused */
-        GtkAdjustment *vadjustment;
-        guint hscroll_policy : 1; /* unused */
-
-        guint vscroll_policy : 1;
-};
-
 struct _VteTerminalClassPrivate {
         GtkStyleProvider *style_provider;
 };
diff --git a/src/vte.cc b/src/vte.cc
index 7145630..074ad04 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -60,6 +60,8 @@
 #include <locale.h>
 #endif
 
+#include <new> /* placement new */
+
 #ifndef HAVE_ROUND
 static inline double round(double x) {
        if(x - floor(x) < 0.5) {
@@ -8095,6 +8097,7 @@ _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ..
 static void
 vte_terminal_init(VteTerminal *terminal)
 {
+        void *place;
        VteTerminalPrivate *pvt;
        GtkStyleContext *context;
        int i;
@@ -8102,7 +8105,8 @@ vte_terminal_init(VteTerminal *terminal)
        _vte_debug_print(VTE_DEBUG_LIFECYCLE, "vte_terminal_init()\n");
 
        /* Initialize private data. */
-       pvt = terminal->pvt = G_TYPE_INSTANCE_GET_PRIVATE (terminal, VTE_TYPE_TERMINAL, VteTerminalPrivate);
+       place = G_TYPE_INSTANCE_GET_PRIVATE (terminal, VTE_TYPE_TERMINAL, VteTerminalPrivate);
+        pvt = terminal->pvt = new (place) VteTerminalPrivate();
 
        gtk_widget_set_can_focus(&terminal->widget, TRUE);
 
@@ -8682,6 +8686,8 @@ vte_terminal_finalize(GObject *object)
                                               0, 0, NULL, NULL,
                                               terminal);
 
+        terminal->pvt->~VteTerminalPrivate();
+
        /* Call the inherited finalize() method. */
        G_OBJECT_CLASS(vte_terminal_parent_class)->finalize(object);
 }
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index b7b5277..dbe3ffe 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -32,6 +32,10 @@
 #include "vtemacros.h"
 #include "vtepty.h"
 
+#if defined(VTE_COMPILATION) && defined(__cplusplus)
+class VteTerminalPrivate;
+#endif
+
 G_BEGIN_DECLS
 
 #define VTE_TYPE_TERMINAL            (vte_terminal_get_type())
@@ -42,7 +46,9 @@ G_BEGIN_DECLS
 #define VTE_TERMINAL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  VTE_TYPE_TERMINAL, 
VteTerminalClass))
 
 typedef struct _VteTerminal             VteTerminal;
+#if !defined(VTE_COMPILATION) || !defined(__cplusplus)
 typedef struct _VteTerminalPrivate      VteTerminalPrivate;
+#endif
 typedef struct _VteTerminalClass        VteTerminalClass;
 typedef struct _VteTerminalClassPrivate VteTerminalClassPrivate;
 typedef struct _VteCharAttributes       VteCharAttributes;
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
new file mode 100644
index 0000000..b5edc5d
--- /dev/null
+++ b/src/vteinternal.hh
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat, Inc.
+ *
+ * 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 Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <glib.h>
+
+typedef enum {
+        VTE_REGEX_CURSOR_GDKCURSOR,
+        VTE_REGEX_CURSOR_GDKCURSORTYPE,
+        VTE_REGEX_CURSOR_NAME
+} VteRegexCursorMode;
+
+/* The order is important */
+typedef enum {
+       MOUSE_TRACKING_NONE,
+       MOUSE_TRACKING_SEND_XY_ON_CLICK,
+       MOUSE_TRACKING_SEND_XY_ON_BUTTON,
+       MOUSE_TRACKING_HILITE_TRACKING,
+       MOUSE_TRACKING_CELL_MOTION_TRACKING,
+       MOUSE_TRACKING_ALL_MOTION_TRACKING
+} MouseTrackingMode;
+
+/* A match regex, with a tag. */
+struct vte_match_regex {
+       gint tag;
+        GRegex *regex;
+        GRegexMatchFlags match_flags;
+        VteRegexCursorMode cursor_mode;
+        union {
+              GdkCursor *cursor;
+               char *cursor_name;
+               GdkCursorType cursor_type;
+        } cursor;
+};
+
+typedef enum _VteCharacterReplacement {
+        VTE_CHARACTER_REPLACEMENT_NONE,
+        VTE_CHARACTER_REPLACEMENT_LINE_DRAWING,
+        VTE_CHARACTER_REPLACEMENT_BRITISH
+} VteCharacterReplacement;
+
+/* The terminal's keypad/cursor state.  A terminal can either be using the
+ * normal keypad, or the "application" keypad. */
+typedef enum _VteKeymode {
+       VTE_KEYMODE_NORMAL,
+       VTE_KEYMODE_APPLICATION
+} VteKeymode;
+
+typedef struct _VtePaletteColor {
+       struct {
+               PangoColor color;
+               gboolean is_set;
+       } sources[2];
+} VtePaletteColor;
+
+/* These correspond to the parameters for DECSCUSR (Set cursor style). */
+typedef enum _VteCursorStyle {
+        /* We treat 0 and 1 differently, assuming that the VT510 does so too.
+         *
+         * See, according to the "VT510 Video Terminal Programmer Information",
+         * from vt100.net, paragraph "2.5.7 Cursor Display", there was a menu
+         * item in the "Terminal Set-Up" to set the cursor's style. It looks
+         * like that defaulted to blinking block. So it makes sense for 0 to
+         * mean "set cursor style to default (set by Set-Up)" and 1 to mean
+         * "set cursor style to blinking block", since that default need not be
+         * blinking block. Access to a VT510 is needed to test this theory,
+         * but it seems plausible. And, anyhow, we can even decide we know
+         * better than the VT510 designers! */
+        VTE_CURSOR_STYLE_TERMINAL_DEFAULT = 0,
+        VTE_CURSOR_STYLE_BLINK_BLOCK      = 1,
+        VTE_CURSOR_STYLE_STEADY_BLOCK     = 2,
+        VTE_CURSOR_STYLE_BLINK_UNDERLINE  = 3,
+        VTE_CURSOR_STYLE_STEADY_UNDERLINE = 4,
+        /* *_IBEAM are xterm extensions */
+        VTE_CURSOR_STYLE_BLINK_IBEAM      = 5,
+        VTE_CURSOR_STYLE_STEADY_IBEAM     = 6
+} VteCursorStyle;
+
+typedef struct _vte_incoming_chunk _vte_incoming_chunk_t;
+struct _vte_incoming_chunk{
+        _vte_incoming_chunk_t *next;
+        guint len;
+        guchar data[VTE_INPUT_CHUNK_SIZE - 2 * sizeof(void *)];
+};
+
+typedef struct _VteScreen VteScreen;
+struct _VteScreen {
+        VteRing row_data[1];   /* buffer contents */
+        long scroll_delta;     /* scroll offset */
+        long insert_delta;     /* insertion offset */
+
+        /* Stuff saved along with the cursor */
+        struct {
+                VteVisualPosition cursor;
+                gboolean reverse_mode;
+                gboolean origin_mode;
+                gboolean sendrecv_mode;
+                gboolean insert_mode;
+                gboolean linefeed_mode;
+                VteCell defaults;
+                VteCell color_defaults;
+                VteCell fill_defaults;
+                VteCharacterReplacement character_replacements[2];
+                VteCharacterReplacement *character_replacement;
+        } saved;
+};
+
+enum vte_selection_type {
+        selection_type_char,
+        selection_type_word,
+        selection_type_line
+};
+
+struct selection_event_coords {
+        long x, y;
+};
+
+struct vte_scrolling_region {
+        int start, end;
+};
+
+/* Terminal private data. */
+class VteTerminalPrivate {
+public:
+        VteTerminalPrivate() { }
+        ~VteTerminalPrivate() { }
+public:
+        /* Metric and sizing data: dimensions of the window */
+        glong row_count;
+        glong column_count;
+
+       /* Emulation setup data. */
+       struct _vte_matcher *matcher;   /* control sequence matcher */
+        gboolean autowrap;              /* auto wraparound at right margin */
+       int keypad_mode, cursor_mode;   /* these would be VteKeymodes, but we
+                                          need to guarantee its type */
+       GHashTable *dec_saved;
+
+       /* PTY handling data. */
+       VtePty *pty;
+       GIOChannel *pty_channel;        /* master channel */
+       guint pty_input_source;
+       guint pty_output_source;
+       gboolean pty_input_active;
+       GPid pty_pid;                   /* pid of child using pty slave */
+       guint child_watch_source;
+
+       /* Input data queues. */
+       const char *encoding;           /* the pty's encoding */
+        int utf8_ambiguous_width;
+       struct _vte_iso2022_state *iso2022;
+       _vte_incoming_chunk_t *incoming;/* pending bytestream */
+       GArray *pending;                /* pending characters */
+       GSList *update_regions;
+       gboolean invalidated_all;       /* pending refresh of entire terminal */
+       GList *active;                  /* is the terminal processing data */
+       glong input_bytes;
+       glong max_input_bytes;
+
+       /* Output data queue. */
+       VteByteArray *outgoing; /* pending input characters */
+       VteConv outgoing_conv;
+
+       /* IConv buffer. */
+       VteByteArray *conv_buffer;
+
+       /* Screen data.  We support the normal screen, and an alternate
+        * screen, which seems to be a DEC-specific feature. */
+       struct _VteScreen normal_screen, alternate_screen, *screen;
+
+        /* Values we save along with the cursor */
+        VteVisualPosition cursor;      /* relative to the insertion delta */
+        gboolean reverse_mode; /* reverse mode */
+        gboolean origin_mode;  /* origin mode */
+        gboolean sendrecv_mode;        /* sendrecv mode */
+        gboolean insert_mode;  /* insert mode */
+        gboolean linefeed_mode;        /* linefeed mode */
+        VteCell defaults;      /* default characteristics
+                                   for insertion of any new
+                                   characters */
+        VteCell color_defaults;        /* original defaults
+                                   plus the current
+                                   fore/back */
+        VteCell fill_defaults; /* original defaults
+                                   plus the current
+                                   fore/back with no
+                                   character data */
+        VteCharacterReplacement character_replacements[2];  /* charsets in the G0 and G1 slots */
+        VteCharacterReplacement *character_replacement;     /* pointer to the active one */
+
+
+        /* Word chars */
+        char *word_char_exceptions_string;
+        gunichar *word_char_exceptions;
+        gsize word_char_exceptions_len;
+
+       /* Selection information. */
+       gboolean has_selection;
+       gboolean selecting;
+       gboolean selecting_after_threshold;
+       gboolean selecting_restart;
+       gboolean selecting_had_delta;
+       gboolean selection_block_mode;
+       char *selection;
+       enum vte_selection_type selection_type;
+       struct selection_event_coords selection_origin, selection_last;
+       VteVisualPosition selection_start, selection_end;
+
+       /* Miscellaneous options. */
+       VteEraseBinding backspace_binding, delete_binding;
+       gboolean meta_sends_escape;
+       gboolean audible_bell;
+       gboolean margin_bell;
+       guint bell_margin;
+       gboolean allow_bold;
+        gboolean deccolm_mode; /* DECCOLM allowed */
+       GHashTable *tabstops;
+       gboolean text_modified_flag;
+       gboolean text_inserted_flag;
+       gboolean text_deleted_flag;
+       gboolean rewrap_on_resize;
+       gboolean bracketed_paste_mode;
+
+       /* Scrolling options. */
+       gboolean scroll_background;
+       gboolean scroll_on_output;
+       gboolean scroll_on_keystroke;
+       gboolean alternate_screen_scroll;
+       long scrollback_lines;
+
+        /* Restricted scrolling */
+        struct vte_scrolling_region scrolling_region;     /* the region we scroll in */
+        gboolean scrolling_restricted;
+
+       /* Cursor shape, as set via API */
+       VteCursorShape cursor_shape;
+        float cursor_aspect_ratio;
+
+       /* Cursor blinking, as set in dconf. */
+        VteCursorBlinkMode cursor_blink_mode;
+       gboolean cursor_blink_state;
+       guint cursor_blink_tag;           /* cursor blinking timeout ID */
+        gint cursor_blink_cycle;          /* gtk-cursor-blink-time / 2 */
+       gint cursor_blink_timeout;        /* gtk-cursor-blink-timeout */
+        gboolean cursor_blinks;           /* whether the cursor is actually blinking */
+       gint64 cursor_blink_time;         /* how long the cursor has been blinking yet */
+       gboolean cursor_visible;
+       gboolean has_focus;               /* is the terminal window focused */
+
+        /* DECSCUSR cursor style (shape and blinking possibly overridden
+         * via escape sequence) */
+        VteCursorStyle cursor_style;
+
+       /* Input device options. */
+        gboolean input_enabled;
+       time_t last_keypress_time;
+
+       int mouse_tracking_mode; /* this is of type MouseTrackingMode,
+                                   but we need to guarantee its type. */
+        guint mouse_pressed_buttons;      /* bits 0, 1, 2 resp. for buttons 1, 2, 3 */
+        guint mouse_handled_buttons;      /* similar bitmap for buttons we handled ourselves */
+       long mouse_last_x, mouse_last_y;
+       gboolean mouse_autohide;
+       guint mouse_autoscroll_tag;
+       gboolean mouse_xterm_extension;
+       gboolean mouse_urxvt_extension;
+       double mouse_smooth_scroll_delta;
+
+       /* State variables for handling match checks. */
+       char *match_contents;
+       GArray *match_attributes;
+       GArray *match_regexes;
+       char *match;
+       int match_tag;
+       VteVisualPosition match_start, match_end;
+       gboolean show_match;
+
+       /* Search data. */
+       GRegex *search_regex;
+        GRegexMatchFlags search_match_flags;
+       gboolean search_wrap_around;
+       GArray *search_attrs; /* Cache attrs */
+
+       /* Data used when rendering the text which does not require server
+        * resources and which can be kept after unrealizing. */
+        PangoFontDescription *unscaled_font_desc;
+       PangoFontDescription *fontdesc;
+        gdouble font_scale;
+       gboolean fontdirty;
+        glong char_ascent;
+        glong char_descent;
+        /* dimensions of character cells */
+        glong char_width;
+        glong char_height;
+
+       /* Data used when rendering the text which reflects server resources
+        * and data, which should be dropped when unrealizing and (re)created
+        * when realizing. */
+       struct _vte_draw *draw;
+
+       VtePaletteColor palette[VTE_PALETTE_SIZE];
+
+       /* Mouse cursors. */
+       gboolean mouse_cursor_visible;
+       GdkCursor *mouse_default_cursor,
+                 *mouse_mousing_cursor,
+                 *mouse_inviso_cursor;
+
+       /* Input method support. */
+       GtkIMContext *im_context;
+       gboolean im_preedit_active;
+       char *im_preedit;
+       PangoAttrList *im_preedit_attrs;
+       int im_preedit_cursor;
+
+       gboolean accessible_emit;
+
+       /* Adjustment updates pending. */
+       gboolean adjustment_changed_pending;
+       gboolean adjustment_value_changed_pending;
+
+       gboolean cursor_moved_pending;
+       gboolean contents_changed_pending;
+
+       /* window name changes */
+        gchar *window_title;
+       gchar *window_title_changed;
+        gchar *icon_title;
+       gchar *icon_title_changed;
+        gchar *current_directory_uri;
+        gchar *current_directory_uri_changed;
+        gchar *current_file_uri;
+        gchar *current_file_uri_changed;
+
+       /* Background */
+        gdouble background_alpha;
+
+       /* Key modifiers. */
+       guint modifiers;
+
+       /* Obscured? state. */
+       GdkVisibilityState visibility_state;
+
+       /* Font stuff. */
+       gboolean has_fonts;
+       glong line_thickness;
+       glong underline_position;
+       glong strikethrough_position;
+
+        /* Style stuff */
+        GtkBorder padding;
+
+        /* GtkScrollable impl */
+        GtkAdjustment *hadjustment; /* unused */
+        GtkAdjustment *vadjustment;
+        guint hscroll_policy : 1; /* unused */
+
+        guint vscroll_policy : 1;
+};


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]