Skip to content

Commit

Permalink
New configure option:
Browse files Browse the repository at this point in the history
  --enable-spell=type     enable spelling type: none static libsexy gtkspell


git-svn-id: https://xchat.svn.sourceforge.net/svnroot/xchat@1038 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1
  • Loading branch information
zed committed Jul 15, 2006
1 parent 1842bcd commit d428035
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
29 changes: 23 additions & 6 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ AH_VERBATIM([USE_DEBUG],[#undef USE_DEBUG])
dnl AH_VERBATIM([USE_GNOME],[#undef USE_GNOME])
AH_VERBATIM([USE_SHM],[#undef USE_SHM])
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
AH_VERBATIM([USE_MMX],[#undef USE_MMX])
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
Expand Down Expand Up @@ -143,8 +144,8 @@ AC_ARG_ENABLE(shm,
shm=$enableval, shm=no)

AC_ARG_ENABLE(spell,
[ --disable-spell disable use of GtkSpell],
spell=$enableval, spell=yes)
[ --enable-spell=type enable spelling type: none static libsexy gtkspell],
spell=$enableval, spell=libsexy)

dnl *********************************************************************
dnl ** DEBUG ************************************************************
Expand Down Expand Up @@ -483,24 +484,40 @@ dnl *********************************************************************
dnl ** SPELL ************************************************************
dnl *********************************************************************

if test "$spell" = yes ; then
if test "$spell" = "gtkspell" ; then
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
AC_MSG_RESULT(no)
spell=no
])
if test "$spell" = "yes" ; then
LIBS="$LIBS $GTKSPELL_LIBS"
CFLAGS="$CFLAGS $GTKSPELL_CFLAGS"
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, AC_MSG_RESULT(no))
if test "$libsexy" = "yes" ; then
GUI_LIBS="$GUI_LIBS $LIBSEXY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBSEXY_CFLAGS"
AC_DEFINE(USE_LIBSEXY)
else
dnl use builtin static one
spell="static"
fi
fi

if test "$spell" = "static" ; then
AC_DEFINE(USE_LIBSEXY)
fi

dnl *********************************************************************
dnl ** CONDITIONALS *****************************************************
dnl *********************************************************************

AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic")
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
Expand Down
6 changes: 5 additions & 1 deletion src/fe-gtk/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ if DO_PLUGIN
plugingui_c = plugingui.c
endif

if USE_LIBSEXY
sexy_spell_entry_c = sexy-spell-entry.c
endif

xchat_SOURCES = about.c ascii.c banlist.c chanlist.c chanview.c dccgui.c \
editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c maingui.c \
$(mmx_cmod_S) notifygui.c palette.c pixmaps.c $(plugingui_c) rawlog.c \
search.c servlistgui.c setup.c textgui.c urlgrab.c userlistgui.c xtext.c
search.c servlistgui.c setup.c $(sexy_spell_entry_c) textgui.c urlgrab.c userlistgui.c xtext.c
10 changes: 9 additions & 1 deletion src/fe-gtk/maingui.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
#include <gtkspell/gtkspell.h>
#endif

#ifdef USE_LIBSEXY
#include "sexy-spell-entry.h"
#endif

#define GUI_SPACING (3)
#define GUI_BORDER (1)
#define SCROLLBAR_SPACING (2)
Expand Down Expand Up @@ -2559,8 +2563,12 @@ mg_create_entry (session *sess, GtkWidget *box)
GTK_POLICY_NEVER);
gtk_container_add (GTK_CONTAINER (sw), entry);
gtk_container_add (GTK_CONTAINER (hbox), sw);
#else
#else
#ifdef USE_LIBSEXY
gui->input_box = entry = sexy_spell_entry_new ();
#else
gui->input_box = entry = gtk_entry_new ();
#endif
gtk_entry_set_max_length (GTK_ENTRY (gui->input_box), 2048);
g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (mg_inputbox_cb), gui);
Expand Down
4 changes: 4 additions & 0 deletions src/fe-gtk/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,10 @@ setup_apply_to_sess (session_gui *gui)
gtkspell_detach (spell);
}
#endif

#ifdef USE_LIBSEXY
sexy_spell_entry_is_checked (gui->input_box, prefs.gui_input_spell);
#endif
}

static void
Expand Down

0 comments on commit d428035

Please sign in to comment.