Commit 6c556698 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: add gimp_text_buffer_insert() and use it

Does nothing special yet, but will soon apply the currently active
tags to the inserted text.
parent ebfbc5a0
......@@ -821,8 +821,7 @@ gimp_text_tool_insert_at_cursor (GimpTextTool *text_tool,
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (text_tool->buffer),
str, -1);
gimp_text_buffer_insert (text_tool->buffer, str);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (text_tool));
}
......@@ -1120,7 +1119,7 @@ gimp_text_tool_enter_text (GimpTextTool *text_tool,
gimp_text_tool_delete_from_cursor (text_tool, GTK_DELETE_CHARS, 1);
}
gtk_text_buffer_insert_at_cursor (buffer, str, -1);
gimp_text_buffer_insert (text_tool->buffer, str);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (text_tool));
}
......
......@@ -275,6 +275,15 @@ gimp_text_buffer_name_to_tag (GimpTextBuffer *buffer,
return NULL;
}
void
gimp_text_buffer_insert (GimpTextBuffer *buffer,
const gchar *text)
{
g_return_if_fail (GIMP_IS_TEXT_BUFFER (buffer));
gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (buffer), text, -1);
}
gint
gimp_text_buffer_get_iter_index (GimpTextBuffer *buffer,
GtkTextIter *iter)
......
......@@ -66,6 +66,9 @@ const gchar * gimp_text_buffer_tag_to_name (GimpTextBuffer *buffer,
GtkTextTag * gimp_text_buffer_name_to_tag (GimpTextBuffer *buffer,
const gchar *name);
void gimp_text_buffer_insert (GimpTextBuffer *buffer,
const gchar *text);
gint gimp_text_buffer_get_iter_index (GimpTextBuffer *buffer,
GtkTextIter *iter);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment