summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarinus Schraal <foser@gentoo.org>2003-10-26 19:57:02 +0000
committerMarinus Schraal <foser@gentoo.org>2003-10-26 19:57:02 +0000
commit8f7643f65be88f40965079531c64bb8fd6d64948 (patch)
tree33053d89608a55ef098ea77372eb22e5a3044f79 /app-text/gtkspell/files
parentfix metadata, mark 2.0.4 x86 and add patch to -r1 (diff)
downloadgentoo-2-8f7643f65be88f40965079531c64bb8fd6d64948.tar.gz
gentoo-2-8f7643f65be88f40965079531c64bb8fd6d64948.tar.bz2
gentoo-2-8f7643f65be88f40965079531c64bb8fd6d64948.zip
fix metadata, mark 2.0.4 x86 and add patch to -r1
Diffstat (limited to 'app-text/gtkspell/files')
-rw-r--r--app-text/gtkspell/files/digest-gtkspell-2.0.0-r11
-rw-r--r--app-text/gtkspell/files/digest-gtkspell-2.0.4-r11
-rw-r--r--app-text/gtkspell/files/gtkspell-2.0.4-enchant.patch387
3 files changed, 388 insertions, 1 deletions
diff --git a/app-text/gtkspell/files/digest-gtkspell-2.0.0-r1 b/app-text/gtkspell/files/digest-gtkspell-2.0.0-r1
deleted file mode 100644
index 541cb25ff696..000000000000
--- a/app-text/gtkspell/files/digest-gtkspell-2.0.0-r1
+++ /dev/null
@@ -1 +0,0 @@
-MD5 a1ae5eb2bf7d176da5fab1c9f349dd04 gtkspell-2.0.0.tar.gz 182782
diff --git a/app-text/gtkspell/files/digest-gtkspell-2.0.4-r1 b/app-text/gtkspell/files/digest-gtkspell-2.0.4-r1
new file mode 100644
index 000000000000..d708aca87daf
--- /dev/null
+++ b/app-text/gtkspell/files/digest-gtkspell-2.0.4-r1
@@ -0,0 +1 @@
+MD5 4ded985b8eefdf9ac6fbf79cad69ccbd gtkspell-2.0.4.tar.gz 197288
diff --git a/app-text/gtkspell/files/gtkspell-2.0.4-enchant.patch b/app-text/gtkspell/files/gtkspell-2.0.4-enchant.patch
new file mode 100644
index 000000000000..4ee978023093
--- /dev/null
+++ b/app-text/gtkspell/files/gtkspell-2.0.4-enchant.patch
@@ -0,0 +1,387 @@
+? Makefile
+? Makefile.in
+? aclocal.m4
+? autom4te-2.53.cache
+? config.h
+? config.h.in
+? config.log
+? config.status
+? configure
+? gtkspell-2.0.pc
+? gtkspell-enchant.diff
+? gtkspell-enchant.diff.gz
+? gtkspell.spec
+? libtool
+? stamp-h
+? stamp-h.in
+? docs/Makefile
+? docs/Makefile.in
+? docs/gtkspell-decl-list.txt
+? docs/gtkspell-decl.txt
+? docs/gtkspell-undocumented.txt
+? docs/gtkspell-unused.txt
+? docs/gtkspell.args
+? docs/gtkspell.hierarchy
+? docs/gtkspell.interfaces
+? docs/gtkspell.prerequisites
+? docs/gtkspell.signals
+? docs/html
+? docs/html-build.stamp
+? docs/html.stamp
+? docs/scan-build.stamp
+? docs/sgml-build.stamp
+? docs/sgml.stamp
+? docs/tmpl-build.stamp
+? docs/tmpl.stamp
+? docs/xml
+? docs/tmpl/gtkspell-unused.sgml
+? examples/.deps
+? examples/.libs
+? examples/Makefile
+? examples/Makefile.in
+? examples/advanced
+? examples/simple
+? gtkspell/.deps
+? gtkspell/.libs
+? gtkspell/Makefile
+? gtkspell/Makefile.in
+? gtkspell/deprecated.lo
+? gtkspell/gtkspell.lo
+? gtkspell/libgtkspell.la
+Index: ChangeLog
+===================================================================
+RCS file: /cvsroot/gtkspell/gtkspell2/ChangeLog,v
+retrieving revision 1.8
+diff -u -r1.8 ChangeLog
+--- ChangeLog 2 Jan 2003 02:20:29 -0000 1.8
++++ ChangeLog 30 Aug 2003 21:23:33 -0000
+@@ -1,3 +1,9 @@
++Mon Aug 25 21:13:55 EDT 2003 Dom Lachowicz <cinamod@hotmail.com>
++
++ * configure.ac: Drop Pspell/Aspell checks, add Enchant one
++ * src/gtkspell.c: Replace Pspell/Aspell backend in favor of an Enchant
++ one
++
+ Wed, 01 Jan 2003 18:20:07 -0800 Evan Martin <martine@cs.washington.edu>
+
+ * 2.0.4.
+Index: configure.ac
+===================================================================
+RCS file: /cvsroot/gtkspell/gtkspell2/configure.ac,v
+retrieving revision 1.6
+diff -u -r1.6 configure.ac
+--- configure.ac 2 Jan 2003 02:20:29 -0000 1.6
++++ configure.ac 30 Aug 2003 21:23:33 -0000
+@@ -4,18 +4,12 @@
+ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+ AM_CONFIG_HEADER(config.h)
+
+-AC_CHECK_HEADER(aspell.h, [AC_DEFINE(HAVE_ASPELL_H,1,
+- [Define to 1 if you have the <aspell.h> header file.] )] )
+-AC_CHECK_HEADER(pspell/pspell.h, [AC_DEFINE(HAVE_PSPELL_H,1,
+- [Define to 1 if you have the <pspell/pspell.h> 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)
+
+Index: gtkspell/gtkspell.c
+===================================================================
+RCS file: /cvsroot/gtkspell/gtkspell2/gtkspell/gtkspell.c,v
+retrieving revision 1.3
+diff -u -r1.3 gtkspell.c
+--- gtkspell/gtkspell.c 12 Dec 2002 05:18:49 -0000 1.3
++++ gtkspell/gtkspell.c 30 Aug 2003 21:25:34 -0000
+@@ -8,44 +8,21 @@
+ #include "../config.h"
+ #include "gtkspell.h"
+
+-#ifdef HAVE_ASPELL_H
+- #define USING_ASPELL
+- #include <aspell.h>
+-#elif defined HAVE_PSPELL_H
+- #define USING_PSPELL
+- #include <pspell/pspell.h>
+- #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_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 <enchant.h>
++
++/* prepare for gettext internationalization */
++#undef _
++#define _(x) x
+
+ const int debug = 0;
+ const int quiet = 0;
+
+ struct _GtkSpell {
+- GtkTextView *view;
+- GtkTextTag *tag_highlight;
+- GtkTextMark *mark_insert;
+- AspellSpeller *speller;
++ GtkTextView *view;
++ GtkTextTag *tag_highlight;
++ GtkTextMark *mark_insert;
++ EnchantBroker *broker;
++ EnchantDict *speller;
+ };
+
+ static void gtkspell_free(GtkSpell *spell);
+@@ -113,9 +90,13 @@
+ 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 (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);
+ }
+@@ -233,12 +214,15 @@
+ GtkTextIter start, end;
+ GtkTextBuffer *buffer;
+
++ if (!spell->speller)
++ return;
++
+ buffer = gtk_text_view_get_buffer(spell->view);
+
+ get_cur_word_extents(buffer, &start, &end);
+ 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));
+
+ gtk_text_buffer_remove_tag(buffer, spell->tag_highlight, &start, &end);
+
+@@ -251,6 +235,9 @@
+ const char *newword;
+ GtkTextIter start, end;
+ GtkTextBuffer *buffer;
++
++ if (!spell->speller)
++ return;
+
+ buffer = gtk_text_view_get_buffer(spell->view);
+
+@@ -267,30 +254,32 @@
+ gtk_text_buffer_delete(buffer, &start, &end);
+ gtk_text_buffer_insert(buffer, &start, newword, -1);
+
+- aspell_speller_store_replacement(spell->speller,
+- oldword, strlen(oldword),
+- newword, strlen(newword));
++ 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();
+
++ if (!spell->speller)
++ return topmenu;
++
+ /* + Add to Dictionary */
+- label = g_strdup_printf("Add \"%s\" to Dictionary", word);
++ label = g_strdup_printf(_("Add \"%s\" to Dictionary"), word);
+ mi = gtk_image_menu_item_new_with_label(label);
+ g_free(label);
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi),
+@@ -305,15 +294,13 @@
+ gtk_widget_show(mi);
+ gtk_menu_shell_append(GTK_MENU_SHELL(topmenu), mi);
+
+- suggestions = aspell_speller_suggest(spell->speller, word, -1);
+- elements = aspell_word_list_elements(suggestions);
++ suggestions = enchant_dict_suggest(spell->speller, word, strlen(word), &n_suggs);
+
+- suggestion = aspell_string_enumeration_next(elements);
+- if (suggestion == NULL) {
++ if (suggestions == NULL || !n_suggs) {
+ /* no suggestions. put something in the menu anyway... */
+ GtkWidget *label;
+ label = gtk_label_new("");
+- gtk_label_set_markup(GTK_LABEL(label), "<i>(no suggestions)</i>");
++ gtk_label_set_markup(GTK_LABEL(label), _("<i>(no suggestions)</i>"));
+
+ mi = gtk_menu_item_new();
+ gtk_container_add(GTK_CONTAINER(mi), label);
+@@ -321,31 +308,29 @@
+ gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), mi);
+ } else {
+ /* build a set of menus with suggestions. */
+- while (suggestion != NULL) {
+- if (count == 10) {
+- mi = gtk_menu_item_new();
+- gtk_widget_show(mi);
+- gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
+-
+- mi = gtk_menu_item_new_with_label("More...");
+- gtk_widget_show(mi);
+- gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
+-
+- menu = gtk_menu_new();
+- gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), menu);
+- count = 0;
+- }
+- mi = gtk_menu_item_new_with_label(suggestion);
+- 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);
+- }
++ for (i = 0; i < n_suggs; i++) {
++ if (i % 10 == 0 && i != 0) {
++ mi = gtk_menu_item_new();
++ gtk_widget_show(mi);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
++
++ mi = gtk_menu_item_new_with_label(_("More..."));
++ gtk_widget_show(mi);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
++
++ menu = gtk_menu_new();
++ gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), menu);
++ }
++
++ 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);
++ }
+ }
+
+- delete_aspell_string_enumeration(elements);
++ enchant_dict_free_suggestions (spell->speller, suggestions);
+
+ return topmenu;
+ }
+@@ -372,7 +357,7 @@
+
+ /* then, on top of it, the suggestions menu. */
+ img = gtk_image_new_from_stock(GTK_STOCK_SPELL_CHECK, GTK_ICON_SIZE_MENU);
+- mi = gtk_image_menu_item_new_with_label("Spelling Suggestions");
++ mi = gtk_image_menu_item_new_with_label(_("Spelling Suggestions"));
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi), img);
+
+ word = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+@@ -408,9 +393,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");
+@@ -422,26 +404,23 @@
+ }
+ }
+
+- 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;
+ }
+@@ -575,8 +554,12 @@
+
+ gtk_text_buffer_delete_mark(buffer, spell->mark_insert);
+
+- 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,