summaryrefslogtreecommitdiff
path: root/gtk/gtktextbuffer.h
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2006-03-07 13:46:11 +0000
committerMichael Natterer <mitch@src.gnome.org>2006-03-07 13:46:11 +0000
commit6c1d990adc5eea803b4cb28956befb83e89468ee (patch)
treeca25230f26a27da2bde3f6cf1c3e9910c0e7487d /gtk/gtktextbuffer.h
parent1f5c294851a009295c9d331110512e47324d09c0 (diff)
downloadgtk+-6c1d990adc5eea803b4cb28956befb83e89468ee.tar.gz
Add infrastructure for copy/paste and DND of rich text for GtkTextBuffer.
2006-03-07 Michael Natterer <mitch@imendio.com> Add infrastructure for copy/paste and DND of rich text for GtkTextBuffer. Fixes bug #324177. * gtk/gtktextbufferrichtext.[ch]: new files implementing a per-buffer registry of rich text formats. * gtk/gtk.h: #include gtktextbufferrichtext.h * gtk/gtktextbufferserialize.[ch]: new files implementing an internal serialization format that can handle all of a text buffer's tags and pixbufs. It's not useful for anything except tranfer between instances of GtkTextBuffer (Anders Carlsson). * gtk/Makefile.am: build the new files. * gtk/gtkclipboard.[ch]: added convenience APIs for rich text, just as they exist for plain text and pixbufs. * gtk/gtkselection.[ch]: added rich text convenience APIs here too. Return the target list from gtk_target_list_ref(). Register GtkTargetList as boxed type. Added gtk_target_table_new_from_list() and gtk_target_table_free(), which make converting between GtkTargetList and arrays of GtkTargetEntry considerably easier. * gtk/gtktextutil.[ch]: added _gtk_text_util_create_rich_drag_icon() which creates a fancy rich text icon (Matthias Clasen). * gtk/gtktextbuffer.[ch]: use all the new stuff above and implement copy and paste of rich text. Added APIs for getting the target lists used for copy and paste. Added public enum GtkTextBufferTargetInfo which contains the "info" IDs associated with the entries of the target lists. * gtk/gtktextview.c: use the new rich text APIs and GtkTextBuffer's new target list API to enable DND of rich text chunks. * gtk/gtk.symbols: export all the new symbols added. * tests/testtext.c: added rich text testing stuff.
Diffstat (limited to 'gtk/gtktextbuffer.h')
-rw-r--r--gtk/gtktextbuffer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h
index 04aac94f0a..7d69a600d5 100644
--- a/gtk/gtktextbuffer.h
+++ b/gtk/gtktextbuffer.h
@@ -41,6 +41,16 @@ G_BEGIN_DECLS
* GtkTextBTree is the PRIVATE internal representation of it.
*/
+/* these values are used as "info" for the targets contained in the
+ * lists returned by gtk_text_buffer_get_copy,paste_target_list()
+ */
+typedef enum
+{
+ GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS,
+ GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT,
+ GTK_TEXT_BUFFER_TARGET_INFO_TEXT
+} GtkTextBufferTargetInfo;
+
typedef struct _GtkTextBTree GtkTextBTree;
typedef struct _GtkTextLogAttrCache GtkTextLogAttrCache;
@@ -367,6 +377,9 @@ gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer,
void gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer);
void gtk_text_buffer_end_user_action (GtkTextBuffer *buffer);
+GtkTargetList * gtk_text_buffer_get_copy_target_list (GtkTextBuffer *buffer);
+GtkTargetList * gtk_text_buffer_get_paste_target_list (GtkTextBuffer *buffer);
+
/* INTERNAL private stuff */
void _gtk_text_buffer_spew (GtkTextBuffer *buffer);