#include "empathy-input-text-view.h"
#include "empathy-request-util.h"
#include "empathy-search-bar.h"
-#include "empathy-smiley-manager.h"
#include "empathy-spell.h"
#include "empathy-string-parser.h"
#include "empathy-theme-manager.h"
empathy_theme_adium_focus_toggled (chat->view, gtk_widget_has_focus (widget));
}
+void
+empathy_chat_insert_smiley (GtkTextBuffer *buffer,
+ EmpathySmiley *smiley)
+{
+ gtk_text_buffer_insert_at_cursor (buffer, smiley->str, -1);
+}
+
static void
chat_insert_smiley_activate_cb (EmpathySmileyManager *manager,
EmpathySmiley *smiley,
{
EmpathyChat *chat = EMPATHY_CHAT (user_data);
GtkTextBuffer *buffer;
- GtkTextIter iter;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
- gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_buffer_insert (buffer, &iter, smiley->str, -1);
-
- gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_buffer_insert (buffer, &iter, " ", -1);
+ empathy_chat_insert_smiley (buffer, smiley);
}
typedef struct {
#include "empathy-contact.h"
#include "empathy-theme-adium.h"
#include "empathy-tp-chat.h"
+#include "empathy-smiley-manager.h"
G_BEGIN_DECLS
gchar * empathy_chat_dup_text (EmpathyChat *self);
void empathy_chat_set_text (EmpathyChat *self,
const gchar *text);
+void empathy_chat_insert_smiley (GtkTextBuffer *buffer,
+ EmpathySmiley *smiley);
G_END_DECLS
#include "empathy-invite-participant-dialog.h"
#include "empathy-notify-manager.h"
#include "empathy-request-util.h"
-#include "empathy-smiley-manager.h"
#include "empathy-sound-manager.h"
#include "empathy-ui-utils.h"
#include "empathy-utils.h"
EmpathyChatWindow *self = user_data;
EmpathyChat *chat;
GtkTextBuffer *buffer;
- GtkTextIter iter;
chat = self->priv->current_chat;
-
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
- gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_buffer_insert (buffer, &iter, smiley->str, -1);
+
+ empathy_chat_insert_smiley (buffer, smiley);
}
static void