talkatu/talkatu
Clone
Summary
Browse
Changes
Graph
Add TalkatuInput to the glade catalog
2020-01-28, Gary Kramlich
c523a909b8ac
Add TalkatuInput to the glade catalog
/*
* talkatu
* 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"
struct
_TalkatuInput
{
TalkatuView
parent
;
GspellTextView
*
gspell_view
;
};
/******************************************************************************
* Callbacks
*****************************************************************************/
static
void
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
)
static
void
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_signal_connect
(
G_OBJECT
(
input
),
"notify::buffer"
,
G_CALLBACK
(
talkatu_input_buffer_set_cb
),
NULL
);
/* setup GSpell */
input
->
gspell_view
=
gspell_text_view_get_from_gtk_text_view
(
GTK_TEXT_VIEW
(
input
));
}
static
void
talkatu_input_class_init
(
TalkatuInputClass
*
klass
)
{
}
/******************************************************************************
* Public API
*****************************************************************************/
GtkWidget
*
talkatu_input_new
(
void
)
{
return
NULL
;
}