Hello community,
here is the log from the commit of package gtkspell
checked in at Fri Feb 1 22:12:58 CET 2008.
--------
--- GNOME/gtkspell/gtkspell.changes 2007-08-08 00:21:00.000000000 +0200
+++ gtkspell/gtkspell.changes 2008-02-01 14:45:42.000000000 +0100
@@ -1,0 +2,5 @@
+Fri Feb 1 14:44:38 CET 2008 - lmichnovic@suse.cz
+
+- enabled enchant support in gtkspell (*-enchant.patch)
+
+-------------------------------------------------------------------
Old:
----
gtkspell-gcc-err-fix.diff
New:
----
gtkspell-2.0.11-enchant.patch
gtkspell-gcc-err-fix.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gtkspell.spec ++++++
--- /var/tmp/diff_new_pack.n15592/_old 2008-02-01 22:12:10.000000000 +0100
+++ /var/tmp/diff_new_pack.n15592/_new 2008-02-01 22:12:10.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package gtkspell (Version 2.0.11)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -11,15 +11,16 @@
# norootforbuild
Name: gtkspell
-BuildRequires: aspell-devel fdupes gnome-doc-utils gtk-doc gtk2-devel libstdc++-devel
+BuildRequires: aspell-devel enchant-devel fdupes gnome-doc-utils gtk-doc gtk2-devel libstdc++-devel
Summary: GTK2 Spell Checker Interface Library
Version: 2.0.11
-Release: 107
+Release: 176
License: GPL v2 or later
Group: System/Libraries
Source: gtkspell-%{version}.tar.bz2
-Patch: %{name}-gcc-err-fix.diff
-URL: http://gtkspell.sf.net/
+Patch1: %{name}-gcc-err-fix.patch
+Patch2: %{name}-2.0.11-enchant.patch
+Url: http://gtkspell.sf.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-lang = %{version}
@@ -39,6 +40,7 @@
Group: Development/Libraries/X11
Requires: %{name} = %{version}
Requires: gtk2-devel glib2-devel pango-devel atk-devel aspell-devel
+Requires: enchant-devel
%description devel
Static libraries and header files from gtkspell.
@@ -69,7 +71,8 @@
%lang_package
%prep
%setup -q %{name}-%{version}
-%patch
+%patch1
+%patch2 -p1
%build
autoreconf -f -i
@@ -109,41 +112,43 @@
%{_datadir}/gtk-doc/html/*
%changelog
-* Wed Aug 08 2007 - maw@suse.de
+* Fri Feb 01 2008 lmichnovic@suse.cz
+- enabled enchant support in gtkspell (*-enchant.patch)
+* Wed Aug 08 2007 maw@suse.de
- Use %%fdupes
- Split off a -lang subpackage
- s#%%run_ldconfig#/sbin/ldconfig/ in %%post and %%postun.
-* Wed Feb 07 2007 - sbrabec@suse.cz
+* Wed Feb 07 2007 sbrabec@suse.cz
- Do not build unusable static libraries (#238552).
-* Fri Jan 12 2007 - sbrabec@suse.cz
+* Fri Jan 12 2007 sbrabec@suse.cz
- More spec file cleanups.
-* Mon Jan 08 2007 - lmichnovic@suse.cz
+* Mon Jan 08 2007 lmichnovic@suse.cz
- changed prefix because GNOME moved to /usr
-* Wed Dec 13 2006 - maw@suse.de
+* Thu Dec 14 2006 maw@suse.de
- Do some specfile cleanup.
-* Wed Jan 25 2006 - mls@suse.de
+* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
-* Mon Sep 19 2005 - pnemec@suse.cz
+* Mon Sep 19 2005 pnemec@suse.cz
- fix gcc 4.1 warning
-* Tue Aug 02 2005 - ro@suse.de
+* Tue Aug 02 2005 ro@suse.de
- use gtk2-devel-packages in nfb
-* Tue May 31 2005 - ltinkl@suse.cz
+* Tue May 31 2005 ltinkl@suse.cz
- update to 2.0.11
-* Tue Apr 12 2005 - ltinkl@suse.cz
+* Tue Apr 12 2005 ltinkl@suse.cz
- update to 2.0.10
-* Wed Oct 27 2004 - ltinkl@suse.cz
+* Wed Oct 27 2004 ltinkl@suse.cz
- update to version 2.0.8
-* Sat Apr 24 2004 - sndirsch@suse.de
+* Sat Apr 24 2004 sndirsch@suse.de
- fixed neededforbuild (using x-devel-packages now)
-* Wed Jan 28 2004 - ltinkl@suse.cz
+* Wed Jan 28 2004 ltinkl@suse.cz
- update to 2.0.5
-* Sun Jan 11 2004 - adrian@suse.de
+* Sun Jan 11 2004 adrian@suse.de
- build as user
-* Fri Dec 05 2003 - ro@suse.de
+* Fri Dec 05 2003 ro@suse.de
- fix typo in specfile (run_ldconfig on own line)
-* Tue Jul 22 2003 - hhetter@suse.de
+* Tue Jul 22 2003 hhetter@suse.de
- really prefix to /opt/gnome
-* Mon Jul 14 2003 - sbrabec@suse.cz
+* Mon Jul 14 2003 sbrabec@suse.cz
- GNOME prefix change to /opt/gnome.
-* Fri Jun 06 2003 - ltinkl@suse.cz
+* Fri Jun 06 2003 ltinkl@suse.cz
- initial version (2.0.4)
++++++ gtkspell-2.0.11-enchant.patch ++++++
diff -x '*orig' -uNr gtkspell-2.0.11/configure.ac gtkspell-2.0.11.patched/configure.ac
--- gtkspell-2.0.11/configure.ac 2005-05-27 23:38:33.000000000 +0200
+++ gtkspell-2.0.11.patched/configure.ac 2006-04-05 15:51:17.000000000 +0200
@@ -4,18 +4,12 @@
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_CONFIG_HEADERS([config.h])
-AC_CHECK_HEADER(aspell.h, [AC_DEFINE(HAVE_ASPELL_H,1,
- [Define to 1 if you have the header file.] )] )
-AC_CHECK_HEADER(pspell/pspell.h, [AC_DEFINE(HAVE_PSPELL_H,1,
- [Define to 1 if you have the header file.] )] )
-AC_CHECK_LIB(aspell, new_aspell_speller, SPELLER_LIB="-laspell",
- [AC_CHECK_LIB(pspell, new_pspell_manager, SPELLER_LIB="-lpspell",
- [AC_MSG_ERROR([You must have the aspell or pspell dev libraries to build gtkspell.]) ] ) ] )
+SPELLER_LIB=-lenchant
AC_SUBST(SPELLER_LIB)
GTKSPELL_PACKAGES=gtk+-2.0
AC_SUBST(GTKSPELL_PACKAGES)
-PKG_CHECK_MODULES(GTKSPELL, $GTKSPELL_PACKAGES)
+PKG_CHECK_MODULES(GTKSPELL, $GTKSPELL_PACKAGES enchant >= 0.4.0 )
AC_SUBST(GTKSPELL_CFLAGS)
AC_SUBST(GTKSPELL_LIBS)
diff -x '*orig' -uNr gtkspell-2.0.11/gtkspell/gtkspell.c gtkspell-2.0.11.patched/gtkspell/gtkspell.c
--- gtkspell-2.0.11/gtkspell/gtkspell.c 2005-05-27 23:09:10.000000000 +0200
+++ gtkspell-2.0.11.patched/gtkspell/gtkspell.c 2006-04-05 15:52:08.000000000 +0200
@@ -14,37 +14,7 @@
#define GTKSPELL_MISSPELLED_TAG "gtkspell-misspelled"
-#ifdef HAVE_ASPELL_H
- #define USING_ASPELL
- #include
-#elif defined HAVE_PSPELL_H
- #define USING_PSPELL
- #include
- #define AspellSpeller PspellManager
- #define speller manager
- #define aspell_speller_check pspell_manager_check
- #define aspell_speller_add_to_session pspell_manager_add_to_session
- #define aspell_speller_add_to_personal pspell_manager_add_to_personal
- #define aspell_speller_save_all_word_lists pspell_manager_save_all_word_lists
- #define aspell_speller_store_replacement pspell_manager_store_replacement
- #define AspellWordList PspellWordList
- #define AspellStringEnumeration PspellStringEmulation
- #define aspell_speller_suggest pspell_manager_suggest
- #define aspell_word_list_elements pspell_word_list_elements
- #define aspell_string_enumeration_next pspell_string_emulation_next
- #define delete_aspell_string_enumeration delete_pspell_string_emulation
- #define AspellConfig PspellConfig
- #define AspellCanHaveError PspellCanHaveError
- #define new_aspell_config new_pspell_config
- #define aspell_config_replace pspell_config_replace
- #define new_aspell_speller new_pspell_manager
- #define delete_aspell_config delete_pspell_config
- #define aspell_error_message pspell_error_message
- #define delete_aspell_speller delete_pspell_manager
- #define to_aspell_speller to_pspell_manager
- #define aspell_error_number pspell_error_number
- #define aspell pspell
-#endif
+#include
const int debug = 0;
const int quiet = 0;
@@ -55,7 +25,8 @@
GtkTextMark *mark_insert_start;
GtkTextMark *mark_insert_end;
gboolean deferred_check;
- AspellSpeller *speller;
+ EnchantBroker *broker;
+ EnchantDict *speller;
GtkTextMark *mark_click;
};
@@ -124,10 +95,12 @@
check_word(GtkSpell *spell, GtkTextBuffer *buffer,
GtkTextIter *start, GtkTextIter *end) {
char *text;
+ if (!spell->speller)
+ return;
text = gtk_text_buffer_get_text(buffer, start, end, FALSE);
if (debug) g_print("checking: %s\n", text);
if (g_unichar_isdigit(*text) == FALSE) /* don't check numbers */
- if (aspell_speller_check(spell->speller, text, -1) == FALSE)
+ if (enchant_dict_check(spell->speller, text, strlen(text)) != 0)
gtk_text_buffer_apply_tag(buffer, spell->tag_highlight, start, end);
g_free(text);
}
@@ -302,8 +275,7 @@
get_word_extents_from_mark(buffer, &start, &end, spell->mark_click);
word = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
- aspell_speller_add_to_personal(spell->speller, word, strlen(word));
- aspell_speller_save_all_word_lists(spell->speller);
+ enchant_dict_add_to_pwl( spell->speller, word, strlen(word));
gtkspell_recheck_all(spell);
@@ -321,7 +293,7 @@
get_word_extents_from_mark(buffer, &start, &end, spell->mark_click);
word = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
- aspell_speller_add_to_session(spell->speller, word, strlen(word));
+ enchant_dict_add_to_session(spell->speller, word, strlen(word));
gtkspell_recheck_all(spell);
@@ -335,6 +307,9 @@
GtkTextIter start, end;
GtkTextBuffer *buffer;
+ if (!spell->speller)
+ return;
+
buffer = gtk_text_view_get_buffer(spell->view);
get_word_extents_from_mark(buffer, &start, &end, spell->mark_click);
@@ -350,33 +325,33 @@
gtk_text_buffer_delete(buffer, &start, &end);
gtk_text_buffer_insert(buffer, &start, newword, -1);
- aspell_speller_store_replacement(spell->speller,
+ enchant_dict_store_replacement(spell->speller,
oldword, strlen(oldword),
newword, strlen(newword));
g_free(oldword);
}
-GtkWidget*
+static GtkWidget*
build_suggestion_menu(GtkSpell *spell, GtkTextBuffer *buffer,
const char *word) {
const char *suggestion;
GtkWidget *topmenu, *menu;
GtkWidget *mi;
GtkWidget *hbox;
- int count = 0;
void *spelldata;
- const AspellWordList *suggestions;
- AspellStringEnumeration *elements;
+ char **suggestions;
+ size_t n_suggs, i;
char *label;
topmenu = menu = gtk_menu_new();
- suggestions = aspell_speller_suggest(spell->speller, word, -1);
- elements = aspell_word_list_elements(suggestions);
+ if (!spell->speller)
+ return topmenu;
- suggestion = aspell_string_enumeration_next(elements);
- if (suggestion == NULL) {
+ suggestions = enchant_dict_suggest(spell->speller, word, strlen(word), &n_suggs);
+
+ if (suggestions == NULL || !n_suggs) {
/* no suggestions. put something in the menu anyway... */
GtkWidget *label;
label = gtk_label_new("");
@@ -388,8 +363,8 @@
gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), mi);
} else {
/* build a set of menus with suggestions. */
- while (suggestion != NULL) {
- if (count == 10) {
+ for (i = 0; i < n_suggs; i++ ) {
+ if (i > 0 && i % 10 == 0) {
mi = gtk_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
@@ -400,19 +375,16 @@
menu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), menu);
- count = 0;
}
- mi = gtk_menu_item_new_with_label(suggestion);
+ mi = gtk_menu_item_new_with_label(suggestions[i]);
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(replace_word), spell);
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
- count++;
- suggestion = aspell_string_enumeration_next(elements);
}
}
- delete_aspell_string_enumeration(elements);
+ enchant_dict_free_suggestions(spell->speller, suggestions);
/* Separator */
mi = gtk_menu_item_new();
@@ -517,9 +489,6 @@
static gboolean
gtkspell_set_language_internal(GtkSpell *spell, const gchar *lang, GError **error) {
- AspellConfig *config;
- AspellCanHaveError *err;
- AspellSpeller *speller;
if (lang == NULL) {
lang = g_getenv("LANG");
@@ -531,26 +500,25 @@
}
}
- config = new_aspell_config();
- if (lang)
- aspell_config_replace(config, "language-tag", lang);
- aspell_config_replace(config, "encoding", "utf-8");
- err = new_aspell_speller(config);
- delete_aspell_config(config);
+ if (!spell->broker)
+ spell->broker = enchant_broker_init();
- if (aspell_error_number(err) != 0) {
-#ifdef USING_ASPELL
- g_set_error(error, GTKSPELL_ERROR, GTKSPELL_ERROR_BACKEND,
- "aspell: %s", aspell_error_message(err));
-#elif defined USING_PSPELL
+ if (spell->speller) {
+ enchant_broker_free_dict(spell->broker, spell->speller);
+ spell->speller = NULL;
+ }
+
+ if (!lang) {
+ lang = "en";
+ }
+
+ spell->speller = enchant_broker_request_dict(spell->broker, lang );
+
+ if (!spell->speller) {
g_set_error(error, GTKSPELL_ERROR, GTKSPELL_ERROR_BACKEND,
- "pspell: %s", aspell_error_message(err));
-#endif
+ _("enchant error for language: %s"),lang);
return FALSE;
}
- if (spell->speller)
- delete_aspell_speller(spell->speller);
- spell->speller = to_aspell_speller(err);
return TRUE;
}
@@ -713,8 +681,13 @@
gtk_text_buffer_delete_mark(buffer, spell->mark_insert_end);
gtk_text_buffer_delete_mark(buffer, spell->mark_click);
- delete_aspell_speller(spell->speller);
+ if (spell->broker) {
+ if (spell->speller) {
+ enchant_broker_free_dict(spell->broker, spell->speller);
+ }
+ enchant_broker_free(spell->broker);
+ }
g_signal_handlers_disconnect_matched(spell->view,
G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL,
++++++ gtkspell-gcc-err-fix.patch ++++++
-- gtkspell/gtkspell.c
+++ gtkspell/gtkspell.c
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include "../config.h"
#include "gtkspell.h"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org