[gtk/dnd-gestures: 10/29] textbuffer: Add a content provider api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures: 10/29] textbuffer: Add a content provider api
- Date: Wed, 1 Jan 2020 19:25:46 +0000 (UTC)
commit cfb35e9a2af2c08a13368c808237a62a4fb43e70
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 31 09:23:25 2019 -0500
textbuffer: Add a content provider api
We need a content provider for the selection,
to implement DND, and the text buffer already
has one. Just add an api to get it.
gtk/gtktextbuffer.c | 7 +++++++
gtk/gtktextbuffer.h | 4 ++++
2 files changed, 11 insertions(+)
---
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index f764c96331..3e50c4fb20 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4078,6 +4078,13 @@ cut_or_copy (GtkTextBuffer *buffer,
}
}
+GdkContentProvider *
+gtk_text_buffer_get_selection_content (GtkTextBuffer *buffer)
+{
+ return gtk_text_buffer_content_new (buffer);
+}
+
+
/**
* gtk_text_buffer_cut_clipboard:
* @buffer: a #GtkTextBuffer
diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h
index 9517077fe6..969db7f3d8 100644
--- a/gtk/gtktextbuffer.h
+++ b/gtk/gtktextbuffer.h
@@ -453,6 +453,10 @@ gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer,
gboolean interactive,
gboolean default_editable);
+GDK_AVAILABLE_IN_ALL
+GdkContentProvider *
+ gtk_text_buffer_get_selection_content (GtkTextBuffer *buffer);
+
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_buffer_get_can_undo (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]