qulogic/talkatu

Parents a9d9f03d1c64
Children be2b4d3019d4
Implement GtkTextViewClass->create_buffer for TalkatuView and TalkatuHistory to return our default buffers for both.
--- a/talkatu/talkatuhistory.c Fri Jul 19 02:31:11 2019 -0500
+++ b/talkatu/talkatuhistory.c Fri Jul 19 07:46:03 2019 -0500
@@ -18,6 +18,7 @@
#include <gtk/gtk.h>
#include <talkatu/talkatuhistory.h>
+#include <talkatu/talkatuhistorybuffer.h>
#include <talkatu/talkatumessage.h>
/**
@@ -36,6 +37,14 @@
G_DEFINE_TYPE(TalkatuHistory, talkatu_history, TALKATU_TYPE_VIEW)
/******************************************************************************
+ * GtkTextViewClass overrides
+ *****************************************************************************/
+static GtkTextBuffer *
+talkatu_history_create_buffer(GtkTextView *view) {
+ return talkatu_history_buffer_new();
+}
+
+/******************************************************************************
* GObject Stuff
*****************************************************************************/
static void
@@ -46,6 +55,9 @@
static void
talkatu_history_class_init(TalkatuHistoryClass *klass) {
+ GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS(klass);
+
+ text_view_class->create_buffer = talkatu_history_create_buffer;
}
/******************************************************************************
--- a/talkatu/talkatuview.c Fri Jul 19 02:31:11 2019 -0500
+++ b/talkatu/talkatuview.c Fri Jul 19 07:46:03 2019 -0500
@@ -414,6 +414,14 @@
}
/******************************************************************************
+ * GtkTextViewClass overrides
+ *****************************************************************************/
+static GtkTextBuffer *
+talkatu_view_create_buffer(GtkTextView *view) {
+ return talkatu_buffer_new(NULL);
+}
+
+/******************************************************************************
* GObject Stuff
*****************************************************************************/
static void
@@ -498,6 +506,7 @@
talkatu_view_class_init(TalkatuViewClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS(klass);
GtkBindingSet *binding_set = NULL;
obj_class->get_property = talkatu_view_get_property;
@@ -508,6 +517,8 @@
widget_class->popup_menu = talkatu_view_popup_menu;
widget_class->query_tooltip = talkatu_view_query_tooltip;
+ text_view_class->create_buffer = talkatu_view_create_buffer;
+
/* add our default signal handlers */
klass->format_activate = talkatu_view_format_activate;
klass->should_send_message = talkatu_view_should_send_message;