Remove gtkspell support

This commit is contained in:
TingPing 2013-10-01 11:21:28 -04:00
parent d643056ca0
commit eb93130cd3
8 changed files with 12 additions and 182 deletions

View File

@ -3,7 +3,7 @@
#define USE_GMODULE #define USE_GMODULE
#define USE_PLUGIN #define USE_PLUGIN
#define USE_OPENSSL #define USE_OPENSSL
#define USE_LIBSEXY #define USE_SPELL
#define USE_IPV6 #define USE_IPV6
#define HAVE_ISO_CODES #define HAVE_ISO_CODES
#define PACKAGE_NAME "hexchat" #define PACKAGE_NAME "hexchat"

View File

@ -41,8 +41,7 @@ AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
AH_VERBATIM([SOCKS],[#undef SOCKS]) AH_VERBATIM([SOCKS],[#undef SOCKS])
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY]) AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY]) AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL]) AH_VERBATIM([USE_SPELL],[#undef USE_SPELL])
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES]) AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY]) AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA]) AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
@ -145,8 +144,8 @@ AC_ARG_ENABLE(libcanberra,
libcanberra=$enableval, libcanberra=yes) libcanberra=$enableval, libcanberra=yes)
AC_ARG_ENABLE(spell, AC_ARG_ENABLE(spell,
[AS_HELP_STRING([--enable-spell=type],[enable spelling type: none static libsexy gtkspell])], [AS_HELP_STRING([--enable-spell],[enable spellcheck, (default: yes)])],
spell=$enableval, spell=libsexy) spell=$enableval, spell=yes)
AC_ARG_ENABLE(ntlm, AC_ARG_ENABLE(ntlm,
[AS_HELP_STRING([--enable-ntlm],[enable Microsoft\'s NTLM auth (libntlm) library support (default: no)])], [AS_HELP_STRING([--enable-ntlm],[enable Microsoft\'s NTLM auth (libntlm) library support (default: no)])],
@ -540,33 +539,10 @@ dnl *********************************************************************
dnl ** SPELL ************************************************************ dnl ** SPELL ************************************************************
dnl ********************************************************************* dnl *********************************************************************
if test "$spell" = "gtkspell" ; then if test "$spell" = "xyes" ; then
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
spell=no
])
if test "$spell" != "no" ; then
GUI_LIBS="$GUI_LIBS $GTKSPELL_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTKSPELL_CFLAGS"
AC_DEFINE(USE_GTKSPELL)
fi
fi
if test "$spell" = "libsexy" ; then
PKG_CHECK_MODULES([LIBSEXY], [libsexy >= 0.1.8], [
libsexy=yes
GUI_LIBS="$GUI_LIBS $LIBSEXY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBSEXY_CFLAGS"
AC_DEFINE(USE_LIBSEXY)
], [
dnl use builtin static one
spell="static"
])
fi
if test "$spell" = "static" ; then
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.0.0, [ PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.0.0, [
AC_DEFINE(HAVE_ISO_CODES) AC_DEFINE(HAVE_ISO_CODES)
AC_DEFINE(USE_LIBSEXY) AC_DEFINE(USE_SPELL)
GUI_CFLAGS="$GUI_CFLAGS $LIBXML2_CFLAGS" GUI_CFLAGS="$GUI_CFLAGS $LIBXML2_CFLAGS"
LIBS="$LIBS -lxml2" LIBS="$LIBS -lxml2"
], [ ], [
@ -579,7 +555,7 @@ dnl ** CONDITIONALS *****************************************************
dnl ********************************************************************* dnl *********************************************************************
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes") AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic") AM_CONDITIONAL(USE_SPELL, test "x$spell" = "xyes")
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes") AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes") AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes") AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
@ -865,10 +841,5 @@ if test "$gtkfe" = no; then
echo echo
fi fi
if test "$spell" = "gtkspell"; then
echo Warning: GTK SPELL is not the recommended spelling library.
echo
fi
echo configure complete, now type \'make\' and pray. echo configure complete, now type \'make\' and pray.
echo echo

View File

@ -18,16 +18,11 @@ if DO_PLUGIN
plugingui_c = plugingui.c plugingui_c = plugingui.c
endif endif
if USE_LIBSEXY
sexy_spell = \
sexy-iso-codes.c sexy-marshal.c sexy-spell-entry.c
endif
hexchat_SOURCES = ascii.c banlist.c chanlist.c chanview.c custom-list.c \ hexchat_SOURCES = ascii.c banlist.c chanlist.c chanview.c custom-list.c \
dccgui.c editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c \ dccgui.c editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c \
maingui.c notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \ maingui.c notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
rawlog.c resources.c servlistgui.c setup.c $(sexy_spell) textgui.c \ rawlog.c resources.c servlistgui.c setup.c sexy-iso-codes.c sexy-marshal.c \
urlgrab.c userlistgui.c xtext.c sexy-spell-entry.c textgui.c urlgrab.c userlistgui.c xtext.c
resources.c: ../../data/hexchat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=../../data --generate-dependencies ../../data/hexchat.gresource.xml) resources.c: ../../data/hexchat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=../../data --generate-dependencies ../../data/hexchat.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../../data --generate-source $< $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../../data --generate-source $<

View File

@ -240,11 +240,7 @@ fe_args (int argc, char *argv[])
const char cursor_color_rc[] = const char cursor_color_rc[] =
"style \"xc-ib-st\"" "style \"xc-ib-st\""
"{" "{"
#ifdef USE_GTKSPELL
"GtkTextView::cursor-color=\"#%02x%02x%02x\""
#else
"GtkEntry::cursor-color=\"#%02x%02x%02x\"" "GtkEntry::cursor-color=\"#%02x%02x%02x\""
#endif
"}" "}"
"widget \"*.hexchat-inputbox\" style : application \"xc-ib-st\""; "widget \"*.hexchat-inputbox\" style : application \"xc-ib-st\"";

View File

@ -197,21 +197,11 @@ typedef struct session_gui
extern GdkPixmap *channelwin_pix; extern GdkPixmap *channelwin_pix;
extern GdkPixmap *dialogwin_pix; extern GdkPixmap *dialogwin_pix;
#ifdef USE_GTKSPELL
char *SPELL_ENTRY_GET_TEXT (GtkWidget *entry);
#define SPELL_ENTRY_SET_TEXT(e,txt) gtk_text_buffer_set_text (gtk_text_view_get_buffer(GTK_TEXT_VIEW(e)),txt,-1);
#define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_text_view_set_editable(GTK_TEXT_VIEW(e), v)
int SPELL_ENTRY_GET_POS (GtkWidget *entry);
void SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos);
void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos);
#else
#define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e)))) #define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e))))
#define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt) #define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt)
#define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v) #define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v)
#define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e)) #define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e))
#define SPELL_ENTRY_SET_POS(e,p) gtk_editable_set_position(GTK_EDITABLE(e),p); #define SPELL_ENTRY_SET_POS(e,p) gtk_editable_set_position(GTK_EDITABLE(e),p);
#define SPELL_ENTRY_INSERT(e,t,l,p) gtk_editable_insert_text(GTK_EDITABLE(e),t,l,p) #define SPELL_ENTRY_INSERT(e,t,l,p) gtk_editable_insert_text(GTK_EDITABLE(e),t,l,p)
#endif
#endif #endif

View File

@ -300,17 +300,6 @@ key_handle_key_press (GtkWidget *wid, GdkEventKey *evt, session *sess)
case GDK_KEY_space: case GDK_KEY_space:
key_action_tab_clean (); key_action_tab_clean ();
break; break;
#if defined(USE_GTKSPELL)/* && !defined(WIN32) */
/* gtktextview has no 'activate' event, so we trap ENTER here */
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (!(evt->state & STATE_CTRL))
{
g_signal_stop_emission_by_name (G_OBJECT (wid), "key_press_event");
mg_inputbox_cb (wid, sess->gui);
}
#endif
} }
return 0; return 0;

View File

@ -50,14 +50,7 @@
#include "pixmaps.h" #include "pixmaps.h"
#include "plugin-tray.h" #include "plugin-tray.h"
#include "xtext.h" #include "xtext.h"
#ifdef USE_GTKSPELL
#include <gtkspell/gtkspell.h>
#endif
#ifdef USE_LIBSEXY
#include "sexy-spell-entry.h" #include "sexy-spell-entry.h"
#endif
#define GUI_SPACING (3) #define GUI_SPACING (3)
#define GUI_BORDER (0) #define GUI_BORDER (0)
@ -99,59 +92,6 @@ static PangoAttrList *nickseen_list;
static PangoAttrList *newmsg_list; static PangoAttrList *newmsg_list;
static PangoAttrList *plain_list = NULL; static PangoAttrList *plain_list = NULL;
#ifdef USE_GTKSPELL
/* use these when it's a GtkTextView instead of GtkEntry */
char *
SPELL_ENTRY_GET_TEXT (GtkWidget *entry)
{
static char *last = NULL; /* warning: don't overlap 2 GET_TEXT calls! */
GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
GtkTextIter start_iter, end_iter;
gtk_text_buffer_get_iter_at_offset (buf, &start_iter, 0);
gtk_text_buffer_get_end_iter (buf, &end_iter);
g_free (last);
last = gtk_text_buffer_get_text (buf, &start_iter, &end_iter, FALSE);
return last;
}
void
SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos)
{
GtkTextIter iter;
GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
gtk_text_buffer_get_iter_at_offset (buf, &iter, pos);
gtk_text_buffer_place_cursor (buf, &iter);
}
int
SPELL_ENTRY_GET_POS (GtkWidget *entry)
{
GtkTextIter cursor;
GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
gtk_text_buffer_get_iter_at_mark (buf, &cursor, gtk_text_buffer_get_insert (buf));
return gtk_text_iter_get_offset (&cursor);
}
void
SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos)
{
GtkTextIter iter;
GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
/* len is bytes. pos is chars. */
gtk_text_buffer_get_iter_at_offset (buf, &iter, *pos);
gtk_text_buffer_insert (buf, &iter, text, len);
*pos += g_utf8_strlen (text, len);
}
#endif
static PangoAttrList * static PangoAttrList *
mg_attr_list_create (GdkColor *col, int size) mg_attr_list_create (GdkColor *col, int size)
{ {
@ -2999,9 +2939,6 @@ static void
mg_create_entry (session *sess, GtkWidget *box) mg_create_entry (session *sess, GtkWidget *box)
{ {
GtkWidget *hbox, *but, *entry; GtkWidget *hbox, *but, *entry;
#ifdef USE_GTKSPELL
GtkWidget *sw;
#endif
session_gui *gui = sess->gui; session_gui *gui = sess->gui;
hbox = gtk_hbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 0);
@ -3017,34 +2954,13 @@ mg_create_entry (session *sess, GtkWidget *box)
g_signal_connect (G_OBJECT (but), "clicked", g_signal_connect (G_OBJECT (but), "clicked",
G_CALLBACK (mg_nickclick_cb), NULL); G_CALLBACK (mg_nickclick_cb), NULL);
#ifdef USE_GTKSPELL
gui->input_box = entry = gtk_text_view_new ();
gtk_widget_set_size_request (entry, 0, 1);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_NONE);
gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE);
if (prefs.hex_gui_input_spell)
gtkspell_new_attach (GTK_TEXT_VIEW (entry), NULL, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), entry);
gtk_container_add (GTK_CONTAINER (hbox), sw);
#else
#ifdef USE_LIBSEXY
gui->input_box = entry = sexy_spell_entry_new (); gui->input_box = entry = sexy_spell_entry_new ();
sexy_spell_entry_set_checked ((SexySpellEntry *)entry, prefs.hex_gui_input_spell); sexy_spell_entry_set_checked ((SexySpellEntry *)entry, prefs.hex_gui_input_spell);
#else
gui->input_box = entry = gtk_entry_new ();
#endif
gtk_entry_set_max_length (GTK_ENTRY (gui->input_box), 0); gtk_entry_set_max_length (GTK_ENTRY (gui->input_box), 0);
g_signal_connect (G_OBJECT (entry), "activate", g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (mg_inputbox_cb), gui); G_CALLBACK (mg_inputbox_cb), gui);
gtk_container_add (GTK_CONTAINER (hbox), entry); gtk_container_add (GTK_CONTAINER (hbox), entry);
#endif
gtk_widget_set_name (entry, "hexchat-inputbox"); gtk_widget_set_name (entry, "hexchat-inputbox");
g_signal_connect (G_OBJECT (entry), "key_press_event", g_signal_connect (G_OBJECT (entry), "key_press_event",

View File

@ -40,12 +40,7 @@
#ifdef WIN32 #ifdef WIN32
#include "../common/fe.h" #include "../common/fe.h"
#endif #endif
#ifdef USE_GTKSPELL
#include <gtkspell/gtkspell.h>
#endif
#ifdef USE_LIBSEXY
#include "sexy-spell-entry.h" #include "sexy-spell-entry.h"
#endif
GtkStyle *create_input_style (GtkStyle *); GtkStyle *create_input_style (GtkStyle *);
@ -194,7 +189,7 @@ static const setting inputbox_settings[] =
{ST_TOGGLE, N_("Use the Text box font and colors"), P_OFFINTNL(hex_gui_input_style),0,0,0}, {ST_TOGGLE, N_("Use the Text box font and colors"), P_OFFINTNL(hex_gui_input_style),0,0,0},
{ST_TOGGLE, N_("Show nick box"), P_OFFINTNL(hex_gui_input_nick),0,0,1}, {ST_TOGGLE, N_("Show nick box"), P_OFFINTNL(hex_gui_input_nick),0,0,1},
{ST_TOGGLE, N_("Show user mode icon in nick box"), P_OFFINTNL(hex_gui_input_icon),0,0,0}, {ST_TOGGLE, N_("Show user mode icon in nick box"), P_OFFINTNL(hex_gui_input_icon),0,0,0},
#ifdef HAVE_ISO_CODES /* Defined with static spelling */ #ifdef USE_SPELL
{ST_TOGGLE, N_("Spell checking"), P_OFFINTNL(hex_gui_input_spell),0,0,1}, {ST_TOGGLE, N_("Spell checking"), P_OFFINTNL(hex_gui_input_spell),0,0,1},
{ST_ENTRY, N_("Dictionaries to use:"), P_OFFSETNL(hex_text_spell_langs),0,0,sizeof prefs.hex_text_spell_langs}, {ST_ENTRY, N_("Dictionaries to use:"), P_OFFSETNL(hex_text_spell_langs),0,0,sizeof prefs.hex_text_spell_langs},
#ifdef WIN32 #ifdef WIN32
@ -202,10 +197,6 @@ static const setting inputbox_settings[] =
#else #else
{ST_LABEL, N_("Use language codes. Separate multiple entries with commas.")}, {ST_LABEL, N_("Use language codes. Separate multiple entries with commas.")},
#endif #endif
#else
#if defined(USE_GTKSPELL) || defined(USE_LIBSEXY)
{ST_TOGGLE, N_("Spell checking"), P_OFFINTNL(hex_gui_input_spell),0,0,0},
#endif
#endif #endif
{ST_HEADER, N_("Nick Completion"),0,0,0}, {ST_HEADER, N_("Nick Completion"),0,0,0},
@ -2004,10 +1995,6 @@ setup_apply_entry_style (GtkWidget *entry)
static void static void
setup_apply_to_sess (session_gui *gui) setup_apply_to_sess (session_gui *gui)
{ {
#ifdef USE_GTKSPELL
GtkSpell *spell;
#endif
mg_update_xtext (gui->xtext); mg_update_xtext (gui->xtext);
if (prefs.hex_gui_ulist_style) if (prefs.hex_gui_ulist_style)
@ -2034,21 +2021,7 @@ setup_apply_to_sess (session_gui *gui)
else else
gtk_widget_hide (gui->button_box); gtk_widget_hide (gui->button_box);
#ifdef USE_GTKSPELL #ifdef USE_SPELL
spell = gtkspell_get_from_text_view (GTK_TEXT_VIEW (gui->input_box));
if (prefs.hex_gui_input_spell)
{
if (!spell)
gtkspell_new_attach (GTK_TEXT_VIEW (gui->input_box), NULL, NULL);
}
else
{
if (spell)
gtkspell_detach (spell);
}
#endif
#ifdef USE_LIBSEXY
/* update active languages */ /* update active languages */
sexy_spell_entry_deactivate_language((SexySpellEntry *)gui->input_box,NULL); sexy_spell_entry_deactivate_language((SexySpellEntry *)gui->input_box,NULL);
sexy_spell_entry_activate_default_languages((SexySpellEntry *)gui->input_box); sexy_spell_entry_activate_default_languages((SexySpellEntry *)gui->input_box);