--- a/talkatu/meson.build Sat Jan 25 15:35:26 2020 -0600
+++ b/talkatu/meson.build Sat Jan 25 15:54:23 2020 -0600
@@ -14,6 +14,7 @@
'talkatuhistorybuffer.h',
'talkatumarkdownbuffer.h',
@@ -40,6 +41,7 @@
'talkatuhistorybuffer.c',
'talkatumarkdownbuffer.c',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/talkatuinput.c Sat Jan 25 15:54:23 2020 -0600
@@ -0,0 +1,70 @@
+ * Copyright (C) 2017-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include <gspell/gspell.h> +#include "talkatu/talkatuinput.h" + GspellTextView *gspell_view; +/****************************************************************************** + *****************************************************************************/ +talkatu_input_buffer_set_cb(GObject *view, GParamSpec *pspec, gpointer data) { + TalkatuInput *input = TALKATU_INPUT(view); + gspell_text_view_basic_setup(input->gspell_view); +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +G_DEFINE_TYPE(TalkatuInput, talkatu_input, TALKATU_TYPE_VIEW) +talkatu_input_init(TalkatuInput *input) { + /* we need to know when the buffer is changed in our parent so we can + * update our actions and other stuff. + G_CALLBACK(talkatu_input_buffer_set_cb), + input->gspell_view = gspell_text_view_get_from_gtk_text_view(GTK_TEXT_VIEW(input)); +talkatu_input_class_init(TalkatuInputClass *klass) { +/****************************************************************************** + *****************************************************************************/ +talkatu_input_new(void) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/talkatuinput.h Sat Jan 25 15:54:23 2020 -0600
@@ -0,0 +1,42 @@
+ * Copyright (C) 2017-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#if !defined(TALKATU_GLOBAL_HEADER_INSIDE) && !defined(TALKATU_COMPILATION) +#error "only <talkatu.h> may be included directly" +#include <glib-object.h> +#include <talkatu/talkatuview.h> +#define TALKATU_TYPE_INPUT (talkatu_input_get_type()) +G_DECLARE_FINAL_TYPE(TalkatuInput, talkatu_input, TALKATU, INPUT, TalkatuView) +GtkWidget *talkatu_input_new(void); +#endif /* TALKATU_INPUT_H */ --- a/talkatu/talkatuview.c Sat Jan 25 15:35:26 2020 -0600
+++ b/talkatu/talkatuview.c Sat Jan 25 15:54:23 2020 -0600
@@ -18,7 +18,6 @@
#include <glib/gi18n-lib.h>
#include <gdk/gdkkeysyms.h>
-#include <gspell/gspell.h>
@@ -78,7 +77,6 @@
GSimpleActionGroup *action_group;
TalkatuViewSendBinding send_binding;
- GspellTextView *gspell_view;
/* this mark is used to keep track of our context for the context menu. It
* is updated via cursor-moved and button-press callbacks.
@@ -273,8 +271,6 @@
- gspell_text_view_basic_setup(priv->gspell_view);
@@ -589,9 +585,6 @@
- priv->gspell_view = gspell_text_view_get_from_gtk_text_view(GTK_TEXT_VIEW(view));
/* we need to connect this signal *AFTER* everything to make sure our items
* end up in the correct place.