[gtk/dnd-gestures-2: 16/69] textbuffer: Add a content provider api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures-2: 16/69] textbuffer: Add a content provider api
- Date: Sat, 4 Jan 2020 17:53:28 +0000 (UTC)
commit 7a45520f852a780f806386095321f5fa5cf7eb64
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]