* 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 <gtk/gtkwidget.h>
#include <gtk/gtkclipboard.h>
#include <gtk/gtktextmark.h>
#include <gtk/gtktextchild.h>
-#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;
/* Whether the buffer has been modified since last save */
guint modified : 1;
+
+ guint has_selection : 1;
};
struct _GtkTextBufferClass
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,
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,
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);
void _gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer,
GtkTextTag *tag);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif