aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2011-05-16 17:35:56 +0800
committerJonny Lamb <jonnylamb@gnome.org>2011-05-16 17:35:56 +0800
commitadd05052afddb11b158dd08075ffbe2c0404692a (patch)
tree31a19fb71b05e256efacabca07f40039d0903887 /libempathy-gtk/empathy-chat.c
parente22e3fd06caa9486b9641636c2bbe13cf954cab5 (diff)
downloadgsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar.gz
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar.bz2
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar.lz
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar.xz
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.tar.zst
gsoc2013-empathy-add05052afddb11b158dd08075ffbe2c0404692a.zip
chat: add {get,set}_text methods
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 183b49bf9..59f2b3c09 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -3921,3 +3921,26 @@ empathy_chat_get_n_messages_sending (EmpathyChat *self)
return n_messages;
}
}
+
+gchar *
+empathy_chat_get_text (EmpathyChat *self)
+{
+ GtkTextBuffer *buffer;
+ GtkTextIter start, end;
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self->input_text_view));
+
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
+ return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+}
+
+void
+empathy_chat_set_text (EmpathyChat *self,
+ const gchar *text)
+{
+ GtkTextBuffer *buffer;
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self->input_text_view));
+
+ gtk_text_buffer_set_text (buffer, text, -1);
+}