X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtktextbuffer.h;h=79f969ccfaa6236b3c4c3e4b0e389e8a46761206;hb=5ead07e1b2b959e5309d7f17409c3d4d9b01cf96;hp=6d9d3b8774c93fee4c3eb7891c9be29d67b5da53;hpb=e0ad07e0b4e7257fc95f8ce0f988b977c6b8e2b9;p=~andy%2Fgtk diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h index 6d9d3b877..79f969ccf 100644 --- a/gtk/gtktextbuffer.h +++ b/gtk/gtktextbuffer.h @@ -24,8 +24,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef GTK_TEXT_BUFFER_H -#define GTK_TEXT_BUFFER_H +#ifndef __GTK_TEXT_BUFFER_H__ +#define __GTK_TEXT_BUFFER_H__ #include #include @@ -34,15 +34,26 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* * This is the PUBLIC representation of a text buffer. * 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() + * + * the enum counts down from G_MAXUINT to avoid clashes with application + * added drag destinations which usually start at 0. + */ +typedef enum +{ + GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS = G_MAXUINT - 0, + GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT = G_MAXUINT - 1, + GTK_TEXT_BUFFER_TARGET_INFO_TEXT = G_MAXUINT - 2 +} GtkTextBufferTargetInfo; + typedef struct _GtkTextBTree GtkTextBTree; typedef struct _GtkTextLogAttrCache GtkTextLogAttrCache; @@ -72,6 +83,8 @@ struct _GtkTextBuffer /* Whether the buffer has been modified since last save */ guint modified : 1; + + guint has_selection : 1; }; struct _GtkTextBufferClass @@ -186,14 +199,14 @@ void gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer, const gchar *text, gint len, GtkTextTag *first_tag, - ...); + ...) G_GNUC_NULL_TERMINATED; void gtk_text_buffer_insert_with_tags_by_name (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, const gchar *first_tag_name, - ...); + ...) G_GNUC_NULL_TERMINATED; /* Delete from the buffer */ void gtk_text_buffer_delete (GtkTextBuffer *buffer, @@ -339,6 +352,8 @@ gboolean gtk_text_buffer_get_modified (GtkTextBuffer *buffer); void gtk_text_buffer_set_modified (GtkTextBuffer *buffer, gboolean setting); +gboolean gtk_text_buffer_get_has_selection (GtkTextBuffer *buffer); + void gtk_text_buffer_add_selection_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard); void gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer *buffer, @@ -365,6 +380,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); @@ -377,8 +395,6 @@ const PangoLogAttr* _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buff void _gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer, GtkTextTag *tag); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif