summaryrefslogtreecommitdiff
path: root/gtk/gtktextview.h
diff options
context:
space:
mode:
authorSébastien Wilmet <swilmet@gnome.org>2014-12-15 14:53:29 +0100
committerSébastien Wilmet <swilmet@gnome.org>2014-12-17 12:20:02 +0100
commit020258f85a4add53e9f04fce39f1ba3e89f9abae (patch)
tree9131a2651c344ce40fbbc51e628b80d2c6e95c97 /gtk/gtktextview.h
parent7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 (diff)
downloadgtk+-020258f85a4add53e9f04fce39f1ba3e89f9abae.tar.gz
textview: add extend-selection signal
To be able to customize the double-click and triple-click behaviors, to provide custom selection boundaries. https://bugzilla.gnome.org/show_bug.cgi?id=111503
Diffstat (limited to 'gtk/gtktextview.h')
-rw-r--r--gtk/gtktextview.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h
index df1f5d9483..91396ba85d 100644
--- a/gtk/gtktextview.h
+++ b/gtk/gtktextview.h
@@ -82,6 +82,24 @@ typedef enum
} GtkTextViewLayer;
/**
+ * GtkTextExtendSelection:
+ * @GTK_TEXT_EXTEND_SELECTION_WORD: Selects the current word. It is triggered by
+ * a double-click for example.
+ * @GTK_TEXT_EXTEND_SELECTION_LINE: Selects the current line. It is triggered by
+ * a triple-click for example.
+ *
+ * Granularity types that extend the text selection. Use the
+ * #GtkTextView::extend-selection signal to customize the selection.
+ *
+ * Since: 3.16
+ */
+typedef enum
+{
+ GTK_TEXT_EXTEND_SELECTION_WORD,
+ GTK_TEXT_EXTEND_SELECTION_LINE
+} GtkTextExtendSelection;
+
+/**
* GTK_TEXT_VIEW_PRIORITY_VALIDATE:
*
* The priority at which the text view validates onscreen lines
@@ -160,6 +178,11 @@ struct _GtkTextViewClass
void (* draw_layer) (GtkTextView *text_view,
GtkTextViewLayer layer,
cairo_t *cr);
+ gboolean (* extend_selection) (GtkTextView *text_view,
+ GtkTextExtendSelection granularity,
+ const GtkTextIter *location,
+ GtkTextIter *start,
+ GtkTextIter *end);
/*< private >*/
@@ -169,7 +192,6 @@ struct _GtkTextViewClass
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
- void (*_gtk_reserved6) (void);
};
GDK_AVAILABLE_IN_ALL