Synopsis
#include <gtk/gtk.h>
GtkTextBuffer;
GtkTextBuffer* gtk_text_buffer_new (GtkTextTagTable *table);
gint gtk_text_buffer_get_line_count (GtkTextBuffer *buffer);
gint gtk_text_buffer_get_char_count (GtkTextBuffer *buffer);
GtkTextTagTable* gtk_text_buffer_get_tag_table (GtkTextBuffer *buffer);
void gtk_text_buffer_insert (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len);
void gtk_text_buffer_insert_at_cursor (GtkTextBuffer *buffer,
const gchar *text,
gint len);
gboolean gtk_text_buffer_insert_interactive (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len,
gboolean default_editable);
gboolean gtk_text_buffer_insert_interactive_at_cursor
(GtkTextBuffer *buffer,
const gchar *text,
gint len,
gboolean default_editable);
void gtk_text_buffer_insert_range (GtkTextBuffer *buffer,
GtkTextIter *iter,
const GtkTextIter *start,
const GtkTextIter *end);
gboolean gtk_text_buffer_insert_range_interactive
(GtkTextBuffer *buffer,
GtkTextIter *iter,
const GtkTextIter *start,
const GtkTextIter *end,
gboolean default_editable);
void gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len,
GtkTextTag *first_tag,
...);
void gtk_text_buffer_insert_with_tags_by_name
(GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len,
const gchar *first_tag_name,
...);
void gtk_text_buffer_delete (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
gboolean gtk_text_buffer_delete_interactive (GtkTextBuffer *buffer,
GtkTextIter *start_iter,
GtkTextIter *end_iter,
gboolean default_editable);
gboolean gtk_text_buffer_backspace (GtkTextBuffer *buffer,
GtkTextIter *iter,
gboolean interactive,
gboolean default_editable);
void gtk_text_buffer_set_text (GtkTextBuffer *buffer,
const gchar *text,
gint len);
gchar* gtk_text_buffer_get_text (GtkTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end,
gboolean include_hidden_chars);
gchar* gtk_text_buffer_get_slice (GtkTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end,
gboolean include_hidden_chars);
void gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixbuf *pixbuf);
void gtk_text_buffer_insert_child_anchor (GtkTextBuffer *buffer,
GtkTextIter *iter,
GtkTextChildAnchor *anchor);
GtkTextChildAnchor* gtk_text_buffer_create_child_anchor (GtkTextBuffer *buffer,
GtkTextIter *iter);
GtkTextMark* gtk_text_buffer_create_mark (GtkTextBuffer *buffer,
const gchar *mark_name,
const GtkTextIter *where,
gboolean left_gravity);
void gtk_text_buffer_move_mark (GtkTextBuffer *buffer,
GtkTextMark *mark,
const GtkTextIter *where);
void gtk_text_buffer_move_mark_by_name (GtkTextBuffer *buffer,
const gchar *name,
const GtkTextIter *where);
void gtk_text_buffer_add_mark (GtkTextBuffer *buffer,
GtkTextMark *mark,
const GtkTextIter *where);
void gtk_text_buffer_delete_mark (GtkTextBuffer *buffer,
GtkTextMark *mark);
void gtk_text_buffer_delete_mark_by_name (GtkTextBuffer *buffer,
const gchar *name);
GtkTextMark* gtk_text_buffer_get_mark (GtkTextBuffer *buffer,
const gchar *name);
GtkTextMark* gtk_text_buffer_get_insert (GtkTextBuffer *buffer);
GtkTextMark* gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer);
gboolean gtk_text_buffer_get_has_selection (GtkTextBuffer *buffer);
void gtk_text_buffer_place_cursor (GtkTextBuffer *buffer,
const GtkTextIter *where);
void gtk_text_buffer_select_range (GtkTextBuffer *buffer,
const GtkTextIter *ins,
const GtkTextIter *bound);
void gtk_text_buffer_apply_tag (GtkTextBuffer *buffer,
GtkTextTag *tag,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_buffer_remove_tag (GtkTextBuffer *buffer,
GtkTextTag *tag,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_buffer_apply_tag_by_name (GtkTextBuffer *buffer,
const gchar *name,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer,
const gchar *name,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_buffer_remove_all_tags (GtkTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end);
GtkTextTag* gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
const gchar *tag_name,
const gchar *first_property_name,
...);
void gtk_text_buffer_get_iter_at_line_offset
(GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number,
gint char_offset);
void gtk_text_buffer_get_iter_at_offset (GtkTextBuffer *buffer,
GtkTextIter *iter,
gint char_offset);
void gtk_text_buffer_get_iter_at_line (GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number);
void gtk_text_buffer_get_iter_at_line_index
(GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number,
gint byte_index);
void gtk_text_buffer_get_iter_at_mark (GtkTextBuffer *buffer,
GtkTextIter *iter,
GtkTextMark *mark);
void gtk_text_buffer_get_iter_at_child_anchor
(GtkTextBuffer *buffer,
GtkTextIter *iter,
GtkTextChildAnchor *anchor);
void gtk_text_buffer_get_start_iter (GtkTextBuffer *buffer,
GtkTextIter *iter);
void gtk_text_buffer_get_end_iter (GtkTextBuffer *buffer,
GtkTextIter *iter);
void gtk_text_buffer_get_bounds (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
gboolean gtk_text_buffer_get_modified (GtkTextBuffer *buffer);
void gtk_text_buffer_set_modified (GtkTextBuffer *buffer,
gboolean setting);
gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer,
gboolean interactive,
gboolean default_editable);
void gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
GtkTextIter *override_location,
gboolean default_editable);
void gtk_text_buffer_copy_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard);
void gtk_text_buffer_cut_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
gboolean default_editable);
gboolean gtk_text_buffer_get_selection_bounds
(GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
void gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer);
void gtk_text_buffer_end_user_action (GtkTextBuffer *buffer);
void gtk_text_buffer_add_selection_clipboard
(GtkTextBuffer *buffer,
GtkClipboard *clipboard);
void gtk_text_buffer_remove_selection_clipboard
(GtkTextBuffer *buffer,
GtkClipboard *clipboard);
enum GtkTextBufferTargetInfo;
gboolean (*GtkTextBufferDeserializeFunc) (GtkTextBuffer *register_buffer,
GtkTextBuffer *content_buffer,
GtkTextIter *iter,
const guint8 *data,
gsize length,
gboolean create_tags,
gpointer user_data,
GError **error);
gboolean gtk_text_buffer_deserialize (GtkTextBuffer *register_buffer,
GtkTextBuffer *content_buffer,
GdkAtom format,
GtkTextIter *iter,
const guint8 *data,
gsize length,
GError **error);
gboolean gtk_text_buffer_deserialize_get_can_create_tags
(GtkTextBuffer *buffer,
GdkAtom format);
void gtk_text_buffer_deserialize_set_can_create_tags
(GtkTextBuffer *buffer,
GdkAtom format,
gboolean can_create_tags);
GtkTargetList* gtk_text_buffer_get_copy_target_list
(GtkTextBuffer *buffer);
GdkAtom* gtk_text_buffer_get_deserialize_formats
(GtkTextBuffer *buffer,
gint *n_formats);
GtkTargetList* gtk_text_buffer_get_paste_target_list
(GtkTextBuffer *buffer);
GdkAtom* gtk_text_buffer_get_serialize_formats
(GtkTextBuffer *buffer,
gint *n_formats);
GdkAtom gtk_text_buffer_register_deserialize_format
(GtkTextBuffer *buffer,
const gchar *mime_type,
GtkTextBufferDeserializeFunc function,
gpointer user_data,
GDestroyNotify user_data_destroy);
GdkAtom gtk_text_buffer_register_deserialize_tagset
(GtkTextBuffer *buffer,
const gchar *tagset_name);
GdkAtom gtk_text_buffer_register_serialize_format
(GtkTextBuffer *buffer,
const gchar *mime_type,
GtkTextBufferSerializeFunc function,
gpointer user_data,
GDestroyNotify user_data_destroy);
GdkAtom gtk_text_buffer_register_serialize_tagset
(GtkTextBuffer *buffer,
const gchar *tagset_name);
guint8* (*GtkTextBufferSerializeFunc) (GtkTextBuffer *register_buffer,
GtkTextBuffer *content_buffer,
const GtkTextIter *start,
const GtkTextIter *end,
gsize *length,
gpointer user_data);
guint8* gtk_text_buffer_serialize (GtkTextBuffer *register_buffer,
GtkTextBuffer *content_buffer,
GdkAtom format,
const GtkTextIter *start,
const GtkTextIter *end,
gsize *length);
void gtk_text_buffer_unregister_deserialize_format
(GtkTextBuffer *buffer,
GdkAtom format);
void gtk_text_buffer_unregister_serialize_format
(GtkTextBuffer *buffer,
GdkAtom format);
Properties"copy-target-list" GtkTargetList* : Read "cursor-position" gint : Read "has-selection" gboolean : Read "paste-target-list" GtkTargetList* : Read "tag-table" GtkTextTagTable* : Read / Write / Construct Only "text" gchar* : Read / Write Signals"apply-tag" : Run Last "begin-user-action" : Run Last "changed" : Run Last "delete-range" : Run Last "end-user-action" : Run Last "insert-child-anchor" : Run Last "insert-pixbuf" : Run Last "insert-text" : Run Last "mark-deleted" : Run Last "mark-set" : Run Last "modified-changed" : Run Last "remove-tag" : Run Last DescriptionYou may wish to begin by reading the text widget conceptual overview which gives an overview of all the objects and data types related to the text widget and how they work together.
Detailsgtk_text_buffer_new ()GtkTextBuffer* gtk_text_buffer_new (GtkTextTagTable *table); Creates a new text buffer.
gtk_text_buffer_get_line_count ()gint gtk_text_buffer_get_line_count (GtkTextBuffer *buffer); Obtains the number of lines in the buffer. This value is cached, so the function is very fast.
gtk_text_buffer_get_char_count ()gint gtk_text_buffer_get_char_count (GtkTextBuffer *buffer); Gets the number of characters in the buffer; note that characters and bytes are not the same, you can't e.g. expect the contents of the buffer in string form to be this many bytes long. The character count is cached, so this function is very fast.
gtk_text_buffer_get_tag_table ()GtkTextTagTable* gtk_text_buffer_get_tag_table (GtkTextBuffer *buffer); Get the GtkTextTagTable associated with this buffer.
gtk_text_buffer_insert ()void gtk_text_buffer_insert (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len);
Inserts
gtk_text_buffer_insert_at_cursor ()void gtk_text_buffer_insert_at_cursor (GtkTextBuffer *buffer, const gchar *text, gint len);
Simply calls
gtk_text_buffer_insert_interactive ()gboolean gtk_text_buffer_insert_interactive (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, gboolean default_editable);
Like
gtk_text_buffer_insert_interactive_at_cursor ()gboolean gtk_text_buffer_insert_interactive_at_cursor
(GtkTextBuffer *buffer,
const gchar *text,
gint len,
gboolean default_editable);
Calls
gtk_text_buffer_insert_range ()void gtk_text_buffer_insert_range (GtkTextBuffer *buffer, GtkTextIter *iter, const GtkTextIter *start, const GtkTextIter *end);
Copies text, tags, and pixbufs between Implemented via emissions of the insert_text and apply_tag signals, so expect those.
gtk_text_buffer_insert_range_interactive ()gboolean gtk_text_buffer_insert_range_interactive
(GtkTextBuffer *buffer,
GtkTextIter *iter,
const GtkTextIter *start,
const GtkTextIter *end,
gboolean default_editable);
Same as
gtk_text_buffer_insert_with_tags ()void gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, GtkTextTag *first_tag, ...);
Inserts
gtk_text_buffer_insert_with_tags_by_name ()void gtk_text_buffer_insert_with_tags_by_name
(GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len,
const gchar *first_tag_name,
...);
Same as
gtk_text_buffer_delete ()void gtk_text_buffer_delete (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end);
Deletes text between
gtk_text_buffer_delete_interactive ()gboolean gtk_text_buffer_delete_interactive (GtkTextBuffer *buffer, GtkTextIter *start_iter, GtkTextIter *end_iter, gboolean default_editable);
Deletes all editable text in the given range.
Calls
gtk_text_buffer_backspace ()gboolean gtk_text_buffer_backspace (GtkTextBuffer *buffer, GtkTextIter *iter, gboolean interactive, gboolean default_editable);
Performs the appropriate action as if the user hit the delete
key with the cursor at the position specified by
Because the buffer is modified, all outstanding iterators become
invalid after calling this function; however, the
Since 2.6 gtk_text_buffer_set_text ()void gtk_text_buffer_set_text (GtkTextBuffer *buffer, const gchar *text, gint len);
Deletes current contents of
gtk_text_buffer_get_text ()gchar* gtk_text_buffer_get_text (GtkTextBuffer *buffer, const GtkTextIter *start, const GtkTextIter *end, gboolean include_hidden_chars);
Returns the text in the range [
gtk_text_buffer_get_slice ()gchar* gtk_text_buffer_get_slice (GtkTextBuffer *buffer, const GtkTextIter *start, const GtkTextIter *end, gboolean include_hidden_chars);
Returns the text in the range [
gtk_text_buffer_insert_pixbuf ()void gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer, GtkTextIter *iter, GdkPixbuf *pixbuf);
Inserts an image into the text buffer at
gtk_text_buffer_insert_child_anchor ()void gtk_text_buffer_insert_child_anchor (GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextChildAnchor *anchor);
Inserts a child widget anchor into the text buffer at
gtk_text_buffer_create_child_anchor ()GtkTextChildAnchor* gtk_text_buffer_create_child_anchor (GtkTextBuffer *buffer, GtkTextIter *iter);
This is a convenience function which simply creates a child anchor
with
gtk_text_buffer_create_mark ()GtkTextMark* gtk_text_buffer_create_mark (GtkTextBuffer *buffer, const gchar *mark_name, const GtkTextIter *where, gboolean left_gravity);
Creates a mark at position The caller of this function does not own a reference to the returned GtkTextMark, so you can ignore the return value if you like. Marks are owned by the buffer and go away when the buffer does. Emits the "mark-set" signal as notification of the mark's initial placement.
gtk_text_buffer_move_mark ()void gtk_text_buffer_move_mark (GtkTextBuffer *buffer, GtkTextMark *mark, const GtkTextIter *where);
Moves
gtk_text_buffer_move_mark_by_name ()void gtk_text_buffer_move_mark_by_name (GtkTextBuffer *buffer, const gchar *name, const GtkTextIter *where);
Moves the mark named
gtk_text_buffer_add_mark ()void gtk_text_buffer_add_mark (GtkTextBuffer *buffer, GtkTextMark *mark, const GtkTextIter *where);
Adds the mark at position Emits the "mark-set" signal as notification of the mark's initial placement.
Since 2.12 gtk_text_buffer_delete_mark ()void gtk_text_buffer_delete_mark (GtkTextBuffer *buffer, GtkTextMark *mark);
Deletes
gtk_text_buffer_delete_mark_by_name ()void gtk_text_buffer_delete_mark_by_name (GtkTextBuffer *buffer, const gchar *name);
Deletes the mark named
gtk_text_buffer_get_mark ()GtkTextMark* gtk_text_buffer_get_mark (GtkTextBuffer *buffer, const gchar *name);
Returns the mark named
gtk_text_buffer_get_insert ()GtkTextMark* gtk_text_buffer_get_insert (GtkTextBuffer *buffer);
Returns the mark that represents the cursor (insertion point).
Equivalent to calling
gtk_text_buffer_get_selection_bound ()GtkTextMark* gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer);
Returns the mark that represents the selection bound. Equivalent
to calling
The currently-selected text in
gtk_text_buffer_get_has_selection ()gboolean gtk_text_buffer_get_has_selection (GtkTextBuffer *buffer); Indicates whether the buffer has some text currently selected.
Since 2.10 gtk_text_buffer_place_cursor ()void gtk_text_buffer_place_cursor (GtkTextBuffer *buffer, const GtkTextIter *where);
This function moves the "insert" and "selection_bound" marks
simultaneously. If you move them to the same place in two steps
with
gtk_text_buffer_select_range ()void gtk_text_buffer_select_range (GtkTextBuffer *buffer, const GtkTextIter *ins, const GtkTextIter *bound);
This function moves the "insert" and "selection_bound" marks
simultaneously. If you move them in two steps
with
Since 2.4 gtk_text_buffer_apply_tag ()void gtk_text_buffer_apply_tag (GtkTextBuffer *buffer, GtkTextTag *tag, const GtkTextIter *start, const GtkTextIter *end);
Emits the "apply-tag" signal on
gtk_text_buffer_remove_tag ()void gtk_text_buffer_remove_tag (GtkTextBuffer *buffer, GtkTextTag *tag, const GtkTextIter *start, const GtkTextIter *end);
Emits the "remove-tag" signal. The default handler for the signal
removes all occurrences of
gtk_text_buffer_apply_tag_by_name ()void gtk_text_buffer_apply_tag_by_name (GtkTextBuffer *buffer, const gchar *name, const GtkTextIter *start, const GtkTextIter *end);
Calls
gtk_text_buffer_remove_tag_by_name ()void gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer, const gchar *name, const GtkTextIter *start, const GtkTextIter *end);
Calls
gtk_text_buffer_remove_all_tags ()void gtk_text_buffer_remove_all_tags (GtkTextBuffer *buffer, const GtkTextIter *start, const GtkTextIter *end);
Removes all tags in the range between
gtk_text_buffer_create_tag ()GtkTextTag* gtk_text_buffer_create_tag (GtkTextBuffer *buffer, const gchar *tag_name, const gchar *first_property_name, ...);
Creates a tag and adds it to the tag table for
If
If
The
gtk_text_buffer_get_iter_at_line_offset ()void gtk_text_buffer_get_iter_at_line_offset
(GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number,
gint char_offset);
Obtains an iterator pointing to
gtk_text_buffer_get_iter_at_offset ()void gtk_text_buffer_get_iter_at_offset (GtkTextBuffer *buffer, GtkTextIter *iter, gint char_offset);
Initializes
gtk_text_buffer_get_iter_at_line ()void gtk_text_buffer_get_iter_at_line (GtkTextBuffer *buffer, GtkTextIter *iter, gint line_number);
Initializes
gtk_text_buffer_get_iter_at_line_index ()void gtk_text_buffer_get_iter_at_line_index
(GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number,
gint byte_index);
Obtains an iterator pointing to
gtk_text_buffer_get_iter_at_mark ()void gtk_text_buffer_get_iter_at_mark (GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextMark *mark);
Initializes
gtk_text_buffer_get_iter_at_child_anchor ()void gtk_text_buffer_get_iter_at_child_anchor
(GtkTextBuffer *buffer,
GtkTextIter *iter,
GtkTextChildAnchor *anchor);
Obtains the location of
gtk_text_buffer_get_start_iter ()void gtk_text_buffer_get_start_iter (GtkTextBuffer *buffer, GtkTextIter *iter);
Initialized
gtk_text_buffer_get_end_iter ()void gtk_text_buffer_get_end_iter (GtkTextBuffer *buffer, GtkTextIter *iter);
Initializes
gtk_text_buffer_get_bounds ()void gtk_text_buffer_get_bounds (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end);
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [
gtk_text_buffer_get_modified ()gboolean gtk_text_buffer_get_modified (GtkTextBuffer *buffer);
Indicates whether the buffer has been modified since the last call
to
gtk_text_buffer_set_modified ()void gtk_text_buffer_set_modified (GtkTextBuffer *buffer, gboolean setting);
Used to keep track of whether the buffer has been modified since the
last time it was saved. Whenever the buffer is saved to disk, call
gtk_text_buffer_set_modified (
gtk_text_buffer_delete_selection ()gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer, gboolean interactive, gboolean default_editable);
Deletes the range between the "insert" and "selection_bound" marks,
that is, the currently-selected text. If
gtk_text_buffer_paste_clipboard ()void gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard, GtkTextIter *override_location, gboolean default_editable);
Pastes the contents of a clipboard at the insertion point, or at
gtk_text_buffer_copy_clipboard ()void gtk_text_buffer_copy_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard); Copies the currently-selected text to a clipboard.
gtk_text_buffer_cut_clipboard ()void gtk_text_buffer_cut_clipboard (GtkTextBuffer *buffer, GtkClipboard *clipboard, gboolean default_editable); Copies the currently-selected text to a clipboard, then deletes said text if it's editable.
gtk_text_buffer_get_selection_bounds ()gboolean gtk_text_buffer_get_selection_bounds
(GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
Returns
gtk_text_buffer_begin_user_action ()void gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer);
Called to indicate that the buffer operations between here and a
call to
The "interactive" buffer mutation functions, such as
gtk_text_buffer_end_user_action ()void gtk_text_buffer_end_user_action (GtkTextBuffer *buffer);
Should be paired with a call to
gtk_text_buffer_add_selection_clipboard ()void gtk_text_buffer_add_selection_clipboard
(GtkTextBuffer *buffer,
GtkClipboard *clipboard);
Adds
gtk_text_buffer_remove_selection_clipboard ()void gtk_text_buffer_remove_selection_clipboard
(GtkTextBuffer *buffer,
GtkClipboard *clipboard);
Removes a GtkClipboard added with
enum GtkTextBufferTargetInfotypedef enum
{
GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS = - 1,
GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT = - 2,
GTK_TEXT_BUFFER_TARGET_INFO_TEXT = - 3
} GtkTextBufferTargetInfo;
GtkTextBufferDeserializeFunc ()gboolean (*GtkTextBufferDeserializeFunc) (GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GtkTextIter *iter, const guint8 *data, gsize length, gboolean create_tags, gpointer user_data, GError **error);
A function that is called to deserialize rich text that has been
serialized with
gtk_text_buffer_deserialize ()gboolean gtk_text_buffer_deserialize (GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GdkAtom format, GtkTextIter *iter, const guint8 *data, gsize length, GError **error);
This function deserializes rich text in format
Since 2.10 gtk_text_buffer_deserialize_get_can_create_tags ()gboolean gtk_text_buffer_deserialize_get_can_create_tags
(GtkTextBuffer *buffer,
GdkAtom format);
This functions returns the value set with
Since 2.10 gtk_text_buffer_deserialize_set_can_create_tags ()void gtk_text_buffer_deserialize_set_can_create_tags
(GtkTextBuffer *buffer,
GdkAtom format,
gboolean can_create_tags);
Use this function to allow a rich text deserialization function to create new tags in the receiving buffer. Note that using this function is almost always a bad idea, because the rich text functions you register should know how to map the rich text format they handler to your text buffers set of tags.
The ability of creating new (arbitrary!) tags in the receiving buffer
is meant for special rich text formats like the internal one that
is registered using You should allow creation of tags only if you know what you are doing, e.g. if you defined a tagset name for your application suite's text buffers and you know that it's fine to receive new tags from these buffers, because you know that your application can handle the newly created tags.
Since 2.10 gtk_text_buffer_get_copy_target_list ()GtkTargetList* gtk_text_buffer_get_copy_target_list (GtkTextBuffer *buffer);
This function returns the list of targets this text buffer can
provide for copying and as DND source. The targets in the list are
added with
Since 2.10 gtk_text_buffer_get_deserialize_formats ()GdkAtom* gtk_text_buffer_get_deserialize_formats
(GtkTextBuffer *buffer,
gint *n_formats);
This function returns the rich text deserialize formats registered
with
Since 2.10 gtk_text_buffer_get_paste_target_list ()GtkTargetList* gtk_text_buffer_get_paste_target_list (GtkTextBuffer *buffer);
This function returns the list of targets this text buffer supports
for pasting and as DND destination. The targets in the list are
added with
Since 2.10 gtk_text_buffer_get_serialize_formats ()GdkAtom* gtk_text_buffer_get_serialize_formats
(GtkTextBuffer *buffer,
gint *n_formats);
This function returns the rich text serialize formats registered
with
Since 2.10 gtk_text_buffer_register_deserialize_format ()GdkAtom gtk_text_buffer_register_deserialize_format
(GtkTextBuffer *buffer,
const gchar *mime_type,
GtkTextBufferDeserializeFunc function,
gpointer user_data,
GDestroyNotify user_data_destroy);
This function registers a rich text deserialization
Since 2.10 gtk_text_buffer_register_deserialize_tagset ()GdkAtom gtk_text_buffer_register_deserialize_tagset
(GtkTextBuffer *buffer,
const gchar *tagset_name);
This function registers GTK+'s internal rich text serialization
format with the passed
Since 2.10 gtk_text_buffer_register_serialize_format ()GdkAtom gtk_text_buffer_register_serialize_format
(GtkTextBuffer *buffer,
const gchar *mime_type,
GtkTextBufferSerializeFunc function,
gpointer user_data,
GDestroyNotify user_data_destroy);
This function registers a rich text serialization
Since 2.10 gtk_text_buffer_register_serialize_tagset ()GdkAtom gtk_text_buffer_register_serialize_tagset
(GtkTextBuffer *buffer,
const gchar *tagset_name);
This function registers GTK+'s internal rich text serialization
format with the passed
This function is just a wrapper around
The
Since 2.10 GtkTextBufferSerializeFunc ()guint8* (*GtkTextBufferSerializeFunc) (GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, const GtkTextIter *start, const GtkTextIter *end, gsize *length, gpointer user_data); A function that is called to serialize the content of a text buffer. It must return the serialized form of the content.
gtk_text_buffer_serialize ()guint8* gtk_text_buffer_serialize (GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GdkAtom format, const GtkTextIter *start, const GtkTextIter *end, gsize *length);
This function serializes the portion of text between
Since 2.10 gtk_text_buffer_unregister_deserialize_format ()void gtk_text_buffer_unregister_deserialize_format
(GtkTextBuffer *buffer,
GdkAtom format);
This function unregisters a rich text format that was previously
registered using
Since 2.10 gtk_text_buffer_unregister_serialize_format ()void gtk_text_buffer_unregister_serialize_format
(GtkTextBuffer *buffer,
GdkAtom format);
This function unregisters a rich text format that was previously
registered using
Since 2.10 Property DetailsThe
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
the object which received the signal |
|
the applied tag |
|
the start of the range the tag is applied to |
|
the end of the range the tag is applied to |
|
user data set when the signal handler was connected. |
"begin-user-action" signalvoid user_function (GtkTextBuffer *textbuffer, gpointer user_data) : Run Last
The ::begin-user-action signal is emitted at the beginning of a single user-visible operation on a GtkTextBuffer.
See also:
gtk_text_buffer_begin_user_action(),
gtk_text_buffer_insert_interactive(),
gtk_text_buffer_insert_range_interactive(),
gtk_text_buffer_delete_interactive(),
gtk_text_buffer_backspace(),
gtk_text_buffer_delete_selection().
|
the object which received the signal |
|
user data set when the signal handler was connected. |
"changed" signalvoid user_function (GtkTextBuffer *textbuffer, gpointer user_data) : Run Last
The ::changed signal is emitted when the content of a GtkTextBuffer has changed.
|
the object which received the signal |
|
user data set when the signal handler was connected. |
"delete-range" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextIter *start, GtkTextIter *end, gpointer user_data) : Run Last
The ::delete-range signal is emitted to delete a range from a GtkTextBuffer.
Note that if your handler runs before the default handler it must not
invalidate the start and end iters (or has to revalidate them).
The default signal handler revalidates the start and end iters to
both point point to the location where text was deleted. Handlers
which run after the default handler (see g_signal_connect_after())
do not have access to the deleted text.
See also: gtk_text_buffer_delete().
|
the object which received the signal |
|
the start of the range to be deleted |
|
the end of the range to be deleted |
|
user data set when the signal handler was connected. |
"end-user-action" signalvoid user_function (GtkTextBuffer *textbuffer, gpointer user_data) : Run Last
The ::end-user-action signal is emitted at the end of a single user-visible operation GtkTextBuffer.
See also:
gtk_text_buffer_end_user_action(),
gtk_text_buffer_insert_interactive(),
gtk_text_buffer_insert_range_interactive(),
gtk_text_buffer_delete_interactive(),
gtk_text_buffer_backspace(),
gtk_text_buffer_delete_selection(),
gtk_text_buffer_backspace().
|
the object which received the signal |
|
user data set when the signal handler was connected. |
"insert-child-anchor" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextIter *location, GtkTextChildAnchor *anchor, gpointer user_data) : Run Last
The ::insert-child-anchor signal is emitted to insert a GtkTextChildAnchor in a GtkTextBuffer. Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must
not invalidate the location iter (or has to revalidate it).
The default signal handler revalidates it to be placed after the
inserted anchor.
See also: gtk_text_buffer_insert_child_anchor().
|
the object which received the signal |
|
position to insert anchor in textbuffer
|
|
the GtkTextChildAnchor to be inserted |
|
user data set when the signal handler was connected. |
"insert-pixbuf" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextIter *location, GdkPixbuf *pixbuf, gpointer user_data) : Run Last
The ::insert-pixbuf signal is emitted to insert a GdkPixbuf in a GtkTextBuffer. Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the location iter (or has to revalidate it).
The default signal handler revalidates it to be placed after the
inserted pixbuf.
See also: gtk_text_buffer_insert_pixbuf().
|
the object which received the signal |
|
position to insert pixbuf in textbuffer
|
|
the GdkPixbuf to be inserted |
|
user data set when the signal handler was connected. |
"insert-text" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextIter *location, gchar *text, gint len, gpointer user_data) : Run Last
The ::insert-text signal is emitted to insert text in a GtkTextBuffer. Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the location iter (or has to revalidate it).
The default signal handler revalidates it to point to the end of the
inserted text.
See also:
gtk_text_buffer_insert(),
gtk_text_buffer_insert_range().
|
the object which received the signal |
|
position to insert text in textbuffer
|
|
the UTF-8 text to be inserted |
|
length of the inserted text in bytes |
|
user data set when the signal handler was connected. |
"mark-deleted" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextMark *mark, gpointer user_data) : Run Last
The ::mark-deleted signal is emitted as notification after a GtkTextMark is deleted.
See also:
gtk_text_buffer_delete_mark().
|
the object which received the signal |
|
The mark that was deleted |
|
user data set when the signal handler was connected. |
"mark-set" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextIter *location, GtkTextMark *mark, gpointer user_data) : Run Last
The ::mark-set signal is emitted as notification after a GtkTextMark is set.
See also:
gtk_text_buffer_create_mark(),
gtk_text_buffer_move_mark().
|
the object which received the signal |
|
The location of mark in textbuffer
|
|
The mark that is set |
|
user data set when the signal handler was connected. |
"modified-changed" signalvoid user_function (GtkTextBuffer *textbuffer, gpointer user_data) : Run Last
The ::modified-changed signal is emitted when the modified bit of a GtkTextBuffer flips.
See also:
gtk_text_buffer_set_modified().
|
the object which received the signal |
|
user data set when the signal handler was connected. |
"remove-tag" signalvoid user_function (GtkTextBuffer *textbuffer, GtkTextTag *tag, GtkTextIter *start, GtkTextIter *end, gpointer user_data) : Run Last
The ::remove-tag signal is emitted to remove all occurrences of tag from
a range of text in a GtkTextBuffer.
Removal actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the start and end iters (or has to revalidate them).
See also:
gtk_text_buffer_remove_tag().
|
the object which received the signal |
|
the tag to be removed |
|
the start of the range the tag is removed from |
|
the end of the range the tag is removed from |
|
user data set when the signal handler was connected. |