Merge lp:~timo-jyrinki/ubuntu/wily/mozvoikko/new_upstream_signed_release into lp:ubuntu/wily/mozvoikko
- Wily (15.10)
- new_upstream_signed_release
- Merge into wily
Proposed by
Timo Jyrinki
Status: | Work in progress |
---|---|
Proposed branch: | lp:~timo-jyrinki/ubuntu/wily/mozvoikko/new_upstream_signed_release |
Merge into: | lp:ubuntu/wily/mozvoikko |
Diff against target: |
600 lines (+240/-79) 11 files modified
ChangeLog (+19/-0) Makefile (+3/-2) README (+18/-8) README.user (+24/-0) chrome.manifest (+1/-0) components/MozVoikko2.js (+146/-49) debian/changelog (+9/-0) debian/control (+0/-13) debian/rules (+1/-1) debian/source/include-binaries (+1/-0) install.rdf (+18/-6) |
To merge this branch: | bzr merge lp:~timo-jyrinki/ubuntu/wily/mozvoikko/new_upstream_signed_release |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu branches | Pending | ||
Review via email: mp+271643@code.launchpad.net |
Commit message
* New upstream release.
* Include the signed upstream version of the XPI (otherwise identical), so
that it continues to work with Firefox 41 and newer. (LP: #1482219)
* Drop transitional package, not needed anymore for 14.04 -> 16.04 upgrades.
Description of the change
New upstream release from http://
To post a comment you must log in.
- 31. By Timo Jyrinki
-
Use a more proper install method and only use the signatures from the upstream xpi
Unmerged revisions
- 31. By Timo Jyrinki
-
Use a more proper install method and only use the signatures from the upstream xpi
- 30. By Timo Jyrinki
-
* New upstream release.
* Include the signed upstream version of the XPI (otherwise identical), so
that it continues to work with Firefox 41 and newer. (LP: #1482219)
* Drop transitional package, not needed anymore for 14.04 -> 16.04 upgrades. - 29. By Timo Jyrinki
-
Import upstream version 2.2
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2014-05-13 07:57:55 +0000 | |||
3 | +++ ChangeLog 2015-09-18 13:59:48 +0000 | |||
4 | @@ -1,3 +1,22 @@ | |||
5 | 1 | 2015-08-16 Harri Pitkänen <hatapitk@iki.fi> | ||
6 | 2 | * Add a separate user oriented README.user and include it in the extension | ||
7 | 3 | instead of README. | ||
8 | 4 | |||
9 | 5 | 2015-07-27 Harri Pitkänen <hatapitk@iki.fi> | ||
10 | 6 | * Support loading optional dependent libraries. | ||
11 | 7 | |||
12 | 8 | 2015-04-18 Harri Pitkänen <hatapitk@iki.fi> | ||
13 | 9 | * Support languages other than Finnish. | ||
14 | 10 | |||
15 | 11 | 2014-08-23 Harri Pitkänen <hatapitk@iki.fi> | ||
16 | 12 | * Add icon. | ||
17 | 13 | |||
18 | 14 | 2012-03-20 Marko Wallin <marko.wallin@iki.fi> | ||
19 | 15 | * Support for 64-bit Windows | ||
20 | 16 | |||
21 | 17 | 2012-01-22 Marko Wallin <marko.wallin@iki.fi> | ||
22 | 18 | * Support TenFourFox on PPC Mac OS X. | ||
23 | 19 | |||
24 | 1 | 2011-12-29 Andris Pavenis <andris.pavenis@iki.fi> | 20 | 2011-12-29 Andris Pavenis <andris.pavenis@iki.fi> |
25 | 2 | * Throw an exception when specified dictionary is not 'fi_FI' | 21 | * Throw an exception when specified dictionary is not 'fi_FI' |
26 | 3 | 22 | ||
27 | 4 | 23 | ||
28 | === modified file 'Makefile' | |||
29 | --- Makefile 2014-05-13 07:57:55 +0000 | |||
30 | +++ Makefile 2015-09-18 13:59:48 +0000 | |||
31 | @@ -1,8 +1,8 @@ | |||
32 | 1 | 1 | ||
33 | 2 | VERSION=$(shell grep -E -o '<em.version>(.*)</em.version>' install.rdf | sed -e 's/<[a-z:/]*>//g') | 2 | VERSION=$(shell grep -E -o '<em.version>(.*)</em.version>' install.rdf | sed -e 's/<[a-z:/]*>//g') |
34 | 3 | 3 | ||
37 | 4 | XPI_FILES=README COPYING ChangeLog install.rdf chrome.manifest components/MozVoikko2.js | 4 | XPI_FILES=README.user COPYING ChangeLog install.rdf chrome.manifest components/MozVoikko2.js skin/icon.png |
38 | 5 | SOURCE_FILES=$(XPI_FILES) Makefile | 5 | SOURCE_FILES=$(XPI_FILES) Makefile README |
39 | 6 | 6 | ||
40 | 7 | .PHONY: dist-gzip mozvoikko2 clean all | 7 | .PHONY: dist-gzip mozvoikko2 clean all |
41 | 8 | 8 | ||
42 | @@ -24,4 +24,5 @@ | |||
43 | 24 | rm -f mozvoikko-$(VERSION).tar.gz mozvoikko2.xpi | 24 | rm -f mozvoikko-$(VERSION).tar.gz mozvoikko2.xpi |
44 | 25 | rm -f $(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES))) | 25 | rm -f $(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES))) |
45 | 26 | test ! -d mozvoikko-$(VERSION)/components || rmdir mozvoikko-$(VERSION)/components | 26 | test ! -d mozvoikko-$(VERSION)/components || rmdir mozvoikko-$(VERSION)/components |
46 | 27 | test ! -d mozvoikko-$(VERSION)/skin || rmdir mozvoikko-$(VERSION)/skin | ||
47 | 27 | test ! -d mozvoikko-$(VERSION) || rmdir mozvoikko-$(VERSION) | 28 | test ! -d mozvoikko-$(VERSION) || rmdir mozvoikko-$(VERSION) |
48 | 28 | 29 | ||
49 | === modified file 'README' | |||
50 | --- README 2014-05-13 07:57:55 +0000 | |||
51 | +++ README 2015-09-18 13:59:48 +0000 | |||
52 | @@ -1,5 +1,4 @@ | |||
55 | 1 | This is test version of mozvoikko2, an extension for Mozilla programs | 1 | This is Mozvoikko, an extension for Mozilla programs for using Voikko spell checker. |
54 | 2 | for using Finnish Language spell-checker Voikko | ||
56 | 3 | 2 | ||
57 | 4 | Supported versions are: | 3 | Supported versions are: |
58 | 5 | ======================= | 4 | ======================= |
59 | @@ -11,23 +10,26 @@ | |||
60 | 11 | Supported targets: | 10 | Supported targets: |
61 | 12 | ================== | 11 | ================== |
62 | 13 | - 32-bit Windows (WINNT_x86-msvc) | 12 | - 32-bit Windows (WINNT_x86-msvc) |
63 | 13 | - 64-bit Windows (WINNT_x86_64-msvc) | ||
64 | 14 | - 32-bit Linux (Linux_ix86-gcc3) | 14 | - 32-bit Linux (Linux_ix86-gcc3) |
65 | 15 | - 64-bit Linux (Linux_x86_64-gcc3) | 15 | - 64-bit Linux (Linux_x86_64-gcc3) |
67 | 16 | - 32- and 64-bit OS X 10.5 and 10.6 (Darwin_x86-gcc3) | 16 | - 32-bit Mac OS X (Darwin_x86-gcc3) |
68 | 17 | - 64-bit Mac OS X (Darwin_x86_64-gcc3) | ||
69 | 18 | - 32-bit Mac OS X (Darwin_ppc-gcc3) | ||
70 | 17 | 19 | ||
71 | 18 | Binary packages for targets mentioned above are included in the extension package. | 20 | Binary packages for targets mentioned above are included in the extension package. |
72 | 19 | Also suomi-malaga data are included. Extension works however with system installations | 21 | Also suomi-malaga data are included. Extension works however with system installations |
73 | 20 | of these packages (libvoikko and suomi-malaga) if the files are not found inside | 22 | of these packages (libvoikko and suomi-malaga) if the files are not found inside |
74 | 21 | the extension package. | 23 | the extension package. |
75 | 22 | 24 | ||
77 | 23 | movoikko2 itself is written completely in JavaScript and does not contain | 25 | Version 2 of Mozvoikko is written completely in JavaScript and does not contain |
78 | 24 | any binary components. | 26 | any binary components. |
79 | 25 | 27 | ||
83 | 26 | One can include libvoikko shared libraries and suomi-malaga files into an extension. | 28 | One can include libvoikko shared libraries and suomi-malaga (or other dictionaries) |
84 | 27 | For that one must put these files in the subdirectories of directory voikko as | 29 | into an extension. For that one must put these files in the subdirectories of |
85 | 28 | shown below: | 30 | directory voikko as shown below: |
86 | 29 | 31 | ||
88 | 30 | [andris@ap mozvoikko2]$ find voikko -type f | sort | 32 | $ find voikko -type f | sort |
89 | 31 | voikko/2/mor-standard/voikko-fi_FI.all_l | 33 | voikko/2/mor-standard/voikko-fi_FI.all_l |
90 | 32 | voikko/2/mor-standard/voikko-fi_FI.lex_l | 34 | voikko/2/mor-standard/voikko-fi_FI.lex_l |
91 | 33 | voikko/2/mor-standard/voikko-fi_FI.mor_l | 35 | voikko/2/mor-standard/voikko-fi_FI.mor_l |
92 | @@ -39,6 +41,14 @@ | |||
93 | 39 | voikko/Linux_x86-gcc3/libvoikko.so.1 | 41 | voikko/Linux_x86-gcc3/libvoikko.so.1 |
94 | 40 | voikko/README | 42 | voikko/README |
95 | 41 | voikko/WINNT_x86-msvc/libvoikko-1.dll | 43 | voikko/WINNT_x86-msvc/libvoikko-1.dll |
96 | 44 | voikko/WINNT_x86_64-msvc/libvoikko-1.dll | ||
97 | 42 | 45 | ||
98 | 46 | On PPC Mac OS X: | ||
99 | 47 | $ find voikko -type f | sort | ||
100 | 48 | voikko/2/mor-standard/voikko-fi_FI.lex_b | ||
101 | 49 | voikko/2/mor-standard/voikko-fi_FI.mor_b | ||
102 | 50 | voikko/2/mor-standard/voikko-fi_FI.pro | ||
103 | 51 | voikko/2/mor-standard/voikko-fi_FI.sym_b | ||
104 | 52 | voikko/Darwin_ppc-gcc3/libvoikko.1.dylib | ||
105 | 43 | 53 | ||
106 | 44 | Andris Pavenis <andris.pavenis@iki.fi> | 54 | Andris Pavenis <andris.pavenis@iki.fi> |
107 | 45 | 55 | ||
108 | === added file 'README.user' | |||
109 | --- README.user 1970-01-01 00:00:00 +0000 | |||
110 | +++ README.user 2015-09-18 13:59:48 +0000 | |||
111 | @@ -0,0 +1,24 @@ | |||
112 | 1 | This is Mozvoikko, an extension for Mozilla programs for using Voikko spell checker. | ||
113 | 2 | |||
114 | 3 | Adding new languages | ||
115 | 4 | ==================== | ||
116 | 5 | |||
117 | 6 | This extension may include spelling dictionaries for one or more languages. It is not | ||
118 | 7 | possible to install multiple Mozvoikko extensions simultaneously but you can add | ||
119 | 8 | dictionaries into an already installed extension by placing the dictionaries in any | ||
120 | 9 | of the following locations and restarting Firefox: | ||
121 | 10 | |||
122 | 11 | - Under the Firefox profile folder: | ||
123 | 12 | Firefox profile folder can be located by following these instructions: | ||
124 | 13 | https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data | ||
125 | 14 | Additional ZHFST speller dictionaries can be placed in the sub-folder | ||
126 | 15 | extensions\{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}\voikko\3 | ||
127 | 16 | Note that if you remove or re-install your Mozvoikko extension these | ||
128 | 17 | additional dictionaries may need to be installed again. | ||
129 | 18 | - On Windows: | ||
130 | 19 | ZHFST speller dictionaries can be placed under c:\voikko\3 | ||
131 | 20 | - On OS X: | ||
132 | 21 | ZHFST speller dictionaries can be placed under /Library/Spelling/voikko/3 | ||
133 | 22 | or similarly named folder under user's home folder. | ||
134 | 23 | - On Linux: | ||
135 | 24 | ZHFST speller dictionaries can be placed under /etc/voikko/3 | ||
136 | 0 | 25 | ||
137 | === modified file 'chrome.manifest' | |||
138 | --- chrome.manifest 2014-05-13 07:57:55 +0000 | |||
139 | +++ chrome.manifest 2015-09-18 13:59:48 +0000 | |||
140 | @@ -1,3 +1,4 @@ | |||
141 | 1 | component {89630d4c-c64d-11e0-83d8-00508d9f364f} components/MozVoikko2.js | 1 | component {89630d4c-c64d-11e0-83d8-00508d9f364f} components/MozVoikko2.js |
142 | 2 | contract @mozilla.fi/mozvoikko2;1 {89630d4c-c64d-11e0-83d8-00508d9f364f} | 2 | contract @mozilla.fi/mozvoikko2;1 {89630d4c-c64d-11e0-83d8-00508d9f364f} |
143 | 3 | category spell-check-engine @mozilla.fi/mozvoikko2;1 mozvoikko2 | 3 | category spell-check-engine @mozilla.fi/mozvoikko2;1 mozvoikko2 |
144 | 4 | skin voikko classic/1.0 skin/ | ||
145 | 4 | 5 | ||
146 | === modified file 'components/MozVoikko2.js' | |||
147 | --- components/MozVoikko2.js 2014-05-13 07:57:55 +0000 | |||
148 | +++ components/MozVoikko2.js 2015-09-18 13:59:48 +0000 | |||
149 | @@ -21,7 +21,7 @@ | |||
150 | 21 | 21 | ||
151 | 22 | const mozISpellCheckingEngine = Components.interfaces.mozISpellCheckingEngine; | 22 | const mozISpellCheckingEngine = Components.interfaces.mozISpellCheckingEngine; |
152 | 23 | const CLASS_ID = Components.ID("89630d4c-c64d-11e0-83d8-00508d9f364f"); | 23 | const CLASS_ID = Components.ID("89630d4c-c64d-11e0-83d8-00508d9f364f"); |
154 | 24 | const CLASS_NAME = "Finnish language spell-check"; | 24 | const CLASS_NAME = "Spell checker based on Voikko"; |
155 | 25 | const CONTRACT_ID = "@mozilla.org/mozvoikko2;1"; | 25 | const CONTRACT_ID = "@mozilla.org/mozvoikko2;1"; |
156 | 26 | 26 | ||
157 | 27 | const VOIKKO_OPT_IGNORE_DOT = 0; | 27 | const VOIKKO_OPT_IGNORE_DOT = 0; |
158 | @@ -29,12 +29,42 @@ | |||
159 | 29 | const VOIKKO_OPT_IGNORE_UPPERCASE = 3; | 29 | const VOIKKO_OPT_IGNORE_UPPERCASE = 3; |
160 | 30 | const VOIKKO_OPT_ACCEPT_MISSING_HYPHENS = 12; | 30 | const VOIKKO_OPT_ACCEPT_MISSING_HYPHENS = 12; |
161 | 31 | 31 | ||
162 | 32 | const OPTIONAL_DEPENDENCIES = { | ||
163 | 33 | "WINNT_x86-msvc" : ["libgcc_s_sjlj-1.dll", "libstdc++-6.dll", "zlib1.dll", "libarchive-13.dll", "libhfstospell-4.dll"], | ||
164 | 34 | "WINNT_x86_64-msvc" : ["libgcc_s_seh-1.dll", "libstdc++-6.dll", "zlib1.dll", "libarchive-13.dll", "libhfstospell-4.dll"], | ||
165 | 35 | "Darwin_x86_64-gcc3" : ["libtinyxml2.3.dylib", "libarchive.13.dylib", "libhfstospell.4.dylib"], | ||
166 | 36 | "Darwin_x86-gcc3" : ["libtinyxml2.3.dylib", "libarchive.13.dylib", "libhfstospell.4.dylib"] | ||
167 | 37 | }; | ||
168 | 38 | |||
169 | 39 | function tryLoadLibrary(abi, lib_name) { | ||
170 | 40 | // Try to locate the library inside extension directory and | ||
171 | 41 | // replace value | ||
172 | 42 | var extension_dir = __LOCATION__.parent.parent; | ||
173 | 43 | var library_loc = extension_dir.clone(); | ||
174 | 44 | library_loc.append("voikko"); | ||
175 | 45 | library_loc.append(abi); | ||
176 | 46 | library_loc.append(lib_name); | ||
177 | 47 | if (library_loc.exists() && library_loc.isFile()) | ||
178 | 48 | { | ||
179 | 49 | var handle = ctypes.open(library_loc.path); | ||
180 | 50 | aConsoleService.logStringMessage("MozVoikko2: loaded bundled library " + library_loc.path); | ||
181 | 51 | return handle; | ||
182 | 52 | } | ||
183 | 53 | else | ||
184 | 54 | { | ||
185 | 55 | var handle = ctypes.open(lib_name); | ||
186 | 56 | aConsoleService.logStringMessage("MozVoikko2: loaded system library " + library_loc.path); | ||
187 | 57 | return handle; | ||
188 | 58 | } | ||
189 | 59 | } | ||
190 | 60 | |||
191 | 32 | function LibVoikko() | 61 | function LibVoikko() |
192 | 33 | { | 62 | { |
193 | 34 | } | 63 | } |
194 | 35 | 64 | ||
195 | 36 | LibVoikko.prototype = { | 65 | LibVoikko.prototype = { |
196 | 37 | libvoikko: null, | 66 | libvoikko: null, |
197 | 67 | optional_deps: [], | ||
198 | 38 | 68 | ||
199 | 39 | data_loc: "", | 69 | data_loc: "", |
200 | 40 | 70 | ||
201 | @@ -46,6 +76,7 @@ | |||
202 | 46 | fn_voikko_suggest_cstr: null, | 76 | fn_voikko_suggest_cstr: null, |
203 | 47 | fn_voikko_free_cstr_array: null, | 77 | fn_voikko_free_cstr_array: null, |
204 | 48 | fn_voikko_set_boolean_option: null, | 78 | fn_voikko_set_boolean_option: null, |
205 | 79 | fn_voikkoListSupportedSpellingLanguages: null, | ||
206 | 49 | 80 | ||
207 | 50 | init : function() | 81 | init : function() |
208 | 51 | { | 82 | { |
209 | @@ -59,16 +90,16 @@ | |||
210 | 59 | //================================================================== | 90 | //================================================================== |
211 | 60 | // Detect shared library name to load | 91 | // Detect shared library name to load |
212 | 61 | //================================================================== | 92 | //================================================================== |
214 | 62 | if (abi == "Linux_x86-gcc3" || abi == "Linux_x86_64-gcc3") | 93 | if (abi.indexOf("Linux_") == 0) |
215 | 63 | { | 94 | { |
216 | 64 | lib_name = "libvoikko.so.1"; | 95 | lib_name = "libvoikko.so.1"; |
217 | 65 | } | 96 | } |
219 | 66 | else if (abi == "WINNT_x86-msvc") | 97 | else if (abi == "WINNT_x86-msvc" || abi == "WINNT_x86_64-msvc") |
220 | 67 | { | 98 | { |
221 | 68 | lib_name = "libvoikko-1.dll"; | 99 | lib_name = "libvoikko-1.dll"; |
222 | 69 | this.call_abi = ctypes.winapi_abi; | 100 | this.call_abi = ctypes.winapi_abi; |
223 | 70 | } | 101 | } |
225 | 71 | else if (abi == "Darwin_x86_64-gcc3" || abi == "Darwin_x86-gcc3") | 102 | else if (abi == "Darwin_x86_64-gcc3" || abi == "Darwin_x86-gcc3" || abi == "Darwin_ppc-gcc3") |
226 | 72 | { | 103 | { |
227 | 73 | lib_name = "libvoikko.1.dylib"; | 104 | lib_name = "libvoikko.1.dylib"; |
228 | 74 | } | 105 | } |
229 | @@ -77,36 +108,32 @@ | |||
230 | 77 | throw "Unsupported ABI " + abi; | 108 | throw "Unsupported ABI " + abi; |
231 | 78 | } | 109 | } |
232 | 79 | 110 | ||
244 | 80 | // Try to locate libvoikko inside extension directory and | 111 | try { |
245 | 81 | // replace value | 112 | this.libvoikko = tryLoadLibrary(abi, lib_name); |
235 | 82 | var extension_dir = __LOCATION__.parent.parent; | ||
236 | 83 | var libvoikko_loc = extension_dir.clone(); | ||
237 | 84 | libvoikko_loc.append("voikko"); | ||
238 | 85 | libvoikko_loc.append(abi); | ||
239 | 86 | libvoikko_loc.append(lib_name); | ||
240 | 87 | if (libvoikko_loc.exists() && libvoikko_loc.isFile()) | ||
241 | 88 | { | ||
242 | 89 | this.libvoikko = ctypes.open(libvoikko_loc.path); | ||
243 | 90 | aConsoleService.logStringMessage("MozVoikko2: loaded " + libvoikko_loc.path); | ||
246 | 91 | } | 113 | } |
252 | 92 | else | 114 | catch (err) { |
253 | 93 | { | 115 | aConsoleService.logStringMessage("MozVoikko2: Failed to load libvoikko (" + lib_name + "), maybe we need optional dependencies"); |
254 | 94 | this.libvoikko = ctypes.open(lib_name); | 116 | if (abi in OPTIONAL_DEPENDENCIES) { |
255 | 95 | aConsoleService.logStringMessage("MozVoikko2: loaded system libvoikko"); | 117 | for (var i = 0; i < OPTIONAL_DEPENDENCIES[abi].length; i++) { |
256 | 96 | aConsoleService.logStringMessage("MozVoikko2: libvoikko_loc = " + libvoikko_loc.path); | 118 | var dep = OPTIONAL_DEPENDENCIES[abi][i]; |
257 | 119 | try { | ||
258 | 120 | var h = tryLoadLibrary(abi, dep); | ||
259 | 121 | this.optional_deps.push(h); | ||
260 | 122 | } | ||
261 | 123 | catch (e2) { | ||
262 | 124 | aConsoleService.logStringMessage("MozVoikko2: Failed to load optional dependency " + dep); | ||
263 | 125 | } | ||
264 | 126 | } | ||
265 | 127 | this.libvoikko = tryLoadLibrary(abi, lib_name); | ||
266 | 128 | } | ||
267 | 129 | else { | ||
268 | 130 | throw err; | ||
269 | 131 | } | ||
270 | 97 | } | 132 | } |
271 | 98 | 133 | ||
273 | 99 | var data_loc = extension_dir.clone(); | 134 | var data_loc = __LOCATION__.parent.parent.clone(); |
274 | 100 | data_loc.append("voikko"); | 135 | data_loc.append("voikko"); |
284 | 101 | var data_loc_test = data_loc.clone(); | 136 | this.data_loc = data_loc.path; |
276 | 102 | data_loc_test.append("2"); | ||
277 | 103 | data_loc_test.append("mor-standard"); | ||
278 | 104 | data_loc_test.append("voikko-fi_FI.pro"); | ||
279 | 105 | if (data_loc_test.exists() && data_loc_test.isFile()) | ||
280 | 106 | { | ||
281 | 107 | this.data_loc = data_loc.path; | ||
282 | 108 | aConsoleService.logStringMessage("MozVoikko2: Found suomi-malaga data at " + this.data_loc); | ||
283 | 109 | } | ||
285 | 110 | 137 | ||
286 | 111 | /* Detect used libvoikko version and output a message to Javascript console. */ | 138 | /* Detect used libvoikko version and output a message to Javascript console. */ |
287 | 112 | var fn_voikkoGetVersion = this.libvoikko.declare( | 139 | var fn_voikkoGetVersion = this.libvoikko.declare( |
288 | @@ -178,6 +205,16 @@ | |||
289 | 178 | ctypes.voidptr_t, | 205 | ctypes.voidptr_t, |
290 | 179 | ctypes.int, | 206 | ctypes.int, |
291 | 180 | ctypes.int); | 207 | ctypes.int); |
292 | 208 | |||
293 | 209 | // | ||
294 | 210 | // char ** voikkoListSupportedSpellingLanguages(const char * path) | ||
295 | 211 | // | ||
296 | 212 | this.fn_voikkoListSupportedSpellingLanguages = this.libvoikko.declare( | ||
297 | 213 | "voikkoListSupportedSpellingLanguages", | ||
298 | 214 | this.call_abi, | ||
299 | 215 | ctypes.char.ptr.array(50).ptr, | ||
300 | 216 | ctypes.char.ptr); | ||
301 | 217 | |||
302 | 181 | }, | 218 | }, |
303 | 182 | 219 | ||
304 | 183 | finalize : function() | 220 | finalize : function() |
305 | @@ -185,6 +222,9 @@ | |||
306 | 185 | this.fn_voikko_init = null; | 222 | this.fn_voikko_init = null; |
307 | 186 | this.fn_voikko_terminate = null; | 223 | this.fn_voikko_terminate = null; |
308 | 187 | this.libvoikko.close(); | 224 | this.libvoikko.close(); |
309 | 225 | while (this.optional_deps.length > 0) { | ||
310 | 226 | this.optional_deps.pop().close(); | ||
311 | 227 | } | ||
312 | 188 | } | 228 | } |
313 | 189 | }; | 229 | }; |
314 | 190 | 230 | ||
315 | @@ -211,7 +251,6 @@ | |||
316 | 211 | VoikkoHandle.prototype = { | 251 | VoikkoHandle.prototype = { |
317 | 212 | handle: null, | 252 | handle: null, |
318 | 213 | libvoikko: null, | 253 | libvoikko: null, |
319 | 214 | lang_code: null, | ||
320 | 215 | 254 | ||
321 | 216 | open : function(libvoikko, lang_code) | 255 | open : function(libvoikko, lang_code) |
322 | 217 | { | 256 | { |
323 | @@ -228,8 +267,12 @@ | |||
324 | 228 | 267 | ||
325 | 229 | this.handle = this.libvoikko.fn_voikko_init( | 268 | this.handle = this.libvoikko.fn_voikko_init( |
326 | 230 | message_ptr, | 269 | message_ptr, |
328 | 231 | "fi_FI", | 270 | lang_code, |
329 | 232 | data_loc); | 271 | data_loc); |
330 | 272 | if (this.handle.isNull()) { | ||
331 | 273 | this.handle = null; | ||
332 | 274 | throw "Could not load dictionary that should exists: " + lang_code; | ||
333 | 275 | } | ||
334 | 233 | 276 | ||
335 | 234 | this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_DOT, 1); | 277 | this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_DOT, 1); |
336 | 235 | this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_NUMBERS, 1); | 278 | this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_NUMBERS, 1); |
337 | @@ -239,7 +282,7 @@ | |||
338 | 239 | 282 | ||
339 | 240 | finalize : function() | 283 | finalize : function() |
340 | 241 | { | 284 | { |
342 | 242 | if (handle) | 285 | if (this.handle) |
343 | 243 | { | 286 | { |
344 | 244 | this.libvoikko.fn_voikko_terminate(this.handle); | 287 | this.libvoikko.fn_voikko_terminate(this.handle); |
345 | 245 | this.handle = null; | 288 | this.handle = null; |
346 | @@ -250,16 +293,6 @@ | |||
347 | 250 | 293 | ||
348 | 251 | function MozVoikko2() | 294 | function MozVoikko2() |
349 | 252 | { | 295 | { |
350 | 253 | try | ||
351 | 254 | { | ||
352 | 255 | this.voikko_handle = new VoikkoHandle; | ||
353 | 256 | this.voikko_handle.open(libvoikko); | ||
354 | 257 | } | ||
355 | 258 | catch (err) | ||
356 | 259 | { | ||
357 | 260 | Components.utils.reportError(err); | ||
358 | 261 | throw err; | ||
359 | 262 | } | ||
360 | 263 | } | 296 | } |
361 | 264 | 297 | ||
362 | 265 | MozVoikko2.prototype = { | 298 | MozVoikko2.prototype = { |
363 | @@ -267,23 +300,44 @@ | |||
364 | 267 | classID: CLASS_ID, | 300 | classID: CLASS_ID, |
365 | 268 | contractID: CONTRACT_ID, | 301 | contractID: CONTRACT_ID, |
366 | 269 | 302 | ||
367 | 270 | data_loc : null, | ||
368 | 271 | voikko_handle : null, | 303 | voikko_handle : null, |
369 | 304 | supportedDicts : null, | ||
370 | 305 | currentDict: null, | ||
371 | 272 | mPersonalDictionary : null, | 306 | mPersonalDictionary : null, |
372 | 273 | 307 | ||
373 | 274 | QueryInterface: XPCOMUtils.generateQI([mozISpellCheckingEngine, Components.interfaces.nsISupport]), | 308 | QueryInterface: XPCOMUtils.generateQI([mozISpellCheckingEngine, Components.interfaces.nsISupport]), |
374 | 275 | 309 | ||
375 | 276 | get dictionary() | 310 | get dictionary() |
376 | 277 | { | 311 | { |
378 | 278 | return "fi_FI"; | 312 | return this.currentDict; |
379 | 279 | }, | 313 | }, |
380 | 280 | 314 | ||
381 | 281 | set dictionary(dict) | 315 | set dictionary(dict) |
382 | 282 | { | 316 | { |
384 | 283 | if (dict != "fi_FI") | 317 | if (dict == this.currentDict) |
385 | 318 | { | ||
386 | 319 | return; | ||
387 | 320 | } | ||
388 | 321 | var availableDict = this.getSupportedDictionaryCodeInternal(dict); | ||
389 | 322 | if (availableDict == null) | ||
390 | 284 | { | 323 | { |
391 | 285 | throw "mozvoikko2: dictionary '" + dict + "' is not supported by this component (but may be supported by others)"; | 324 | throw "mozvoikko2: dictionary '" + dict + "' is not supported by this component (but may be supported by others)"; |
392 | 286 | } | 325 | } |
393 | 326 | try | ||
394 | 327 | { | ||
395 | 328 | if (this.voikko_handle) | ||
396 | 329 | { | ||
397 | 330 | this.voikko_handle.finalize(); | ||
398 | 331 | } | ||
399 | 332 | this.voikko_handle = new VoikkoHandle; | ||
400 | 333 | this.voikko_handle.open(libvoikko, availableDict); | ||
401 | 334 | this.currentDict = dict; | ||
402 | 335 | } | ||
403 | 336 | catch (err) | ||
404 | 337 | { | ||
405 | 338 | Components.utils.reportError(err); | ||
406 | 339 | throw err; | ||
407 | 340 | } | ||
408 | 287 | }, | 341 | }, |
409 | 288 | 342 | ||
410 | 289 | get providesPersonalDictionary() | 343 | get providesPersonalDictionary() |
411 | @@ -316,10 +370,53 @@ | |||
412 | 316 | this.mPersonalDictionary = mPersonalDictionary; | 370 | this.mPersonalDictionary = mPersonalDictionary; |
413 | 317 | }, | 371 | }, |
414 | 318 | 372 | ||
415 | 373 | getSupportedDictionariesInternal : function() | ||
416 | 374 | { | ||
417 | 375 | if (this.supportedDicts == null) { | ||
418 | 376 | var data_loc = null; | ||
419 | 377 | if (libvoikko.data_loc) { | ||
420 | 378 | data_loc = libvoikko.data_loc; | ||
421 | 379 | } | ||
422 | 380 | var cSpellingLangs = libvoikko.fn_voikkoListSupportedSpellingLanguages(data_loc); | ||
423 | 381 | if (!cSpellingLangs.isNull()) | ||
424 | 382 | { | ||
425 | 383 | var spellingLangs = []; | ||
426 | 384 | for (i = 0; i < 200 && !cSpellingLangs.contents[i].isNull(); i++) | ||
427 | 385 | { | ||
428 | 386 | spellingLangs.push(cSpellingLangs.contents[i].readString()); | ||
429 | 387 | } | ||
430 | 388 | libvoikko.fn_voikko_free_cstr_array(cSpellingLangs); | ||
431 | 389 | this.supportedDicts = spellingLangs; | ||
432 | 390 | } | ||
433 | 391 | } | ||
434 | 392 | }, | ||
435 | 393 | |||
436 | 394 | getSupportedDictionaryCodeInternal : function(dict) | ||
437 | 395 | { | ||
438 | 396 | this.getSupportedDictionariesInternal(); | ||
439 | 397 | if (this.supportedDicts == null) | ||
440 | 398 | { | ||
441 | 399 | return; | ||
442 | 400 | } | ||
443 | 401 | if (this.supportedDicts.indexOf(dict) != -1) | ||
444 | 402 | { | ||
445 | 403 | return dict; | ||
446 | 404 | } | ||
447 | 405 | if (dict.indexOf("_") > -1) | ||
448 | 406 | { | ||
449 | 407 | var d = dict.substr(0, dict.indexOf("_")); | ||
450 | 408 | if (this.supportedDicts.indexOf(d) != -1) | ||
451 | 409 | { | ||
452 | 410 | return d; | ||
453 | 411 | } | ||
454 | 412 | } | ||
455 | 413 | }, | ||
456 | 414 | |||
457 | 319 | getDictionaryList : function(dicts, count) | 415 | getDictionaryList : function(dicts, count) |
458 | 320 | { | 416 | { |
461 | 321 | dicts.value = ["fi_FI"]; | 417 | this.getSupportedDictionariesInternal(); |
462 | 322 | count.value = 1; | 418 | dicts.value = this.supportedDicts; |
463 | 419 | count.value = this.supportedDicts.length; | ||
464 | 323 | }, | 420 | }, |
465 | 324 | 421 | ||
466 | 325 | check : function(word) | 422 | check : function(word) |
467 | @@ -332,7 +429,7 @@ | |||
468 | 332 | 429 | ||
469 | 333 | if (result == 0 && this.mPersonalDictionary) | 430 | if (result == 0 && this.mPersonalDictionary) |
470 | 334 | { | 431 | { |
472 | 335 | return this.mPersonalDictionary.check(word, "fi_FI"); | 432 | return this.mPersonalDictionary.check(word, this.currentDict); |
473 | 336 | } | 433 | } |
474 | 337 | else | 434 | else |
475 | 338 | { | 435 | { |
476 | 339 | 436 | ||
477 | === modified file 'debian/changelog' | |||
478 | --- debian/changelog 2015-08-12 05:25:58 +0000 | |||
479 | +++ debian/changelog 2015-09-18 13:59:48 +0000 | |||
480 | @@ -1,3 +1,12 @@ | |||
481 | 1 | mozvoikko (2.2-0ubuntu1) wily; urgency=medium | ||
482 | 2 | |||
483 | 3 | * New upstream release. | ||
484 | 4 | * Include the signed upstream version of the XPI (otherwise identical), so | ||
485 | 5 | that it continues to work with Firefox 41 and newer. (LP: #1482219) | ||
486 | 6 | * Drop transitional package, not needed anymore for 14.04 -> 16.04 upgrades. | ||
487 | 7 | |||
488 | 8 | -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Tue, 15 Sep 2015 08:30:35 +0000 | ||
489 | 9 | |||
490 | 1 | mozvoikko (2.0.1-1ubuntu3) wily; urgency=medium | 10 | mozvoikko (2.0.1-1ubuntu3) wily; urgency=medium |
491 | 2 | 11 | ||
492 | 3 | * Update mozvoikko's hard-coded dep on libvoikko1 to use either of | 12 | * Update mozvoikko's hard-coded dep on libvoikko1 to use either of |
493 | 4 | 13 | ||
494 | === modified file 'debian/control' | |||
495 | --- debian/control 2015-08-12 05:25:58 +0000 | |||
496 | +++ debian/control 2015-09-18 13:59:48 +0000 | |||
497 | @@ -15,16 +15,3 @@ | |||
498 | 15 | Finnish spell-checker extension for Firefox. Spell-checking | 15 | Finnish spell-checker extension for Firefox. Spell-checking |
499 | 16 | functionality is provided by Voikko - a free spelling checker | 16 | functionality is provided by Voikko - a free spelling checker |
500 | 17 | for Finnish language. | 17 | for Finnish language. |
501 | 18 | |||
502 | 19 | Package: mozvoikko | ||
503 | 20 | Priority: extra | ||
504 | 21 | Section: oldlibs | ||
505 | 22 | Architecture: all | ||
506 | 23 | Depends: ${misc:Depends}, ${shlibs:Depends}, xul-ext-mozvoikko | ||
507 | 24 | Description: Finnish spell-checker extension for Firefox (transitional package) | ||
508 | 25 | Finnish spell-checker extension for Firefox. Spell-checking | ||
509 | 26 | functionality is provided by Voikko - a free spelling checker | ||
510 | 27 | for Finnish language. | ||
511 | 28 | . | ||
512 | 29 | This is just a transitional package to pull in xul-ext-mozvoikko | ||
513 | 30 | on upgrades. It may be safely removed | ||
514 | 31 | 18 | ||
515 | === modified file 'debian/rules' | |||
516 | --- debian/rules 2014-05-13 07:57:55 +0000 | |||
517 | +++ debian/rules 2015-09-18 13:59:48 +0000 | |||
518 | @@ -5,4 +5,4 @@ | |||
519 | 5 | 5 | ||
520 | 6 | override_dh_auto_install: | 6 | override_dh_auto_install: |
521 | 7 | install-xpi mozvoikko2.xpi | 7 | install-xpi mozvoikko2.xpi |
523 | 8 | 8 | unzip -d $(CURDIR)/debian/xul-ext-mozvoikko/usr/share/xul-ext/mozvoikko/ mozvoikko-2.2.xpi META-INF/* | |
524 | 9 | 9 | ||
525 | === added file 'debian/source/include-binaries' | |||
526 | --- debian/source/include-binaries 1970-01-01 00:00:00 +0000 | |||
527 | +++ debian/source/include-binaries 2015-09-18 13:59:48 +0000 | |||
528 | @@ -0,0 +1,1 @@ | |||
529 | 1 | mozvoikko-2.2.xpi | ||
530 | 0 | 2 | ||
531 | === modified file 'install.rdf' | |||
532 | --- install.rdf 2014-05-13 07:57:55 +0000 | |||
533 | +++ install.rdf 2015-09-18 13:59:48 +0000 | |||
534 | @@ -6,26 +6,38 @@ | |||
535 | 6 | <Description about="urn:mozilla:install-manifest"> | 6 | <Description about="urn:mozilla:install-manifest"> |
536 | 7 | <em:id>{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}</em:id> | 7 | <em:id>{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}</em:id> |
537 | 8 | <em:name>Mozilla-laajennus Voikon käyttöön</em:name> | 8 | <em:name>Mozilla-laajennus Voikon käyttöön</em:name> |
539 | 9 | <em:version>2.0.1</em:version> | 9 | <em:version>2.2</em:version> |
540 | 10 | <em:description>Mozilla-laajennus Voikko-oikoluvun käyttöön</em:description> | 10 | <em:description>Mozilla-laajennus Voikko-oikoluvun käyttöön</em:description> |
541 | 11 | <em:localized> | ||
542 | 12 | <Description> | ||
543 | 13 | <em:locale>en-US</em:locale> | ||
544 | 14 | <em:name>Spell checker based on Voikko</em:name> | ||
545 | 15 | <em:description>Open source spell checker Voikko for Mozilla and needed libraries.</em:description> | ||
546 | 16 | </Description> | ||
547 | 17 | </em:localized> | ||
548 | 11 | <em:creator>Andris.Pavenis <andris.pavenis@iki.fi></em:creator> | 18 | <em:creator>Andris.Pavenis <andris.pavenis@iki.fi></em:creator> |
549 | 12 | <em:contributor>Marko Wallin <marko.wallin@iki.fi></em:contributor> | 19 | <em:contributor>Marko Wallin <marko.wallin@iki.fi></em:contributor> |
551 | 13 | <em:contributor>http://voikko.sourceforge.net - Voikon kehitys</em:contributor> | 20 | <em:contributor>Harri Pitkänen <hatapitk@iki.fi></em:contributor> |
552 | 21 | <em:contributor>http://voikko.puimula.org - Voikon kehitys</em:contributor> | ||
553 | 22 | <em:iconURL>chrome://voikko/skin/icon.png</em:iconURL> | ||
554 | 14 | 23 | ||
555 | 15 | <em:unpack>true</em:unpack> | 24 | <em:unpack>true</em:unpack> |
557 | 16 | <em:homepageURL>https://sourceforge.net/apps/trac/voikko/wiki/mozvoikko</em:homepageURL> | 25 | <em:type>2</em:type> |
558 | 26 | <em:homepageURL>https://github.com/voikko/mozvoikko/wiki</em:homepageURL> | ||
559 | 17 | <em:targetPlatform>Linux_x86-gcc3</em:targetPlatform> | 27 | <em:targetPlatform>Linux_x86-gcc3</em:targetPlatform> |
560 | 18 | <em:targetPlatform>Linux_x86_64-gcc3</em:targetPlatform> | 28 | <em:targetPlatform>Linux_x86_64-gcc3</em:targetPlatform> |
561 | 19 | <em:targetPlatform>Darwin_x86-gcc3</em:targetPlatform> | 29 | <em:targetPlatform>Darwin_x86-gcc3</em:targetPlatform> |
562 | 20 | <em:targetPlatform>Darwin_x86_64-gcc3</em:targetPlatform> | 30 | <em:targetPlatform>Darwin_x86_64-gcc3</em:targetPlatform> |
563 | 31 | <em:targetPlatform>Darwin_ppc-gcc3</em:targetPlatform> | ||
564 | 21 | <em:targetPlatform>WINNT_x86-msvc</em:targetPlatform> | 32 | <em:targetPlatform>WINNT_x86-msvc</em:targetPlatform> |
565 | 33 | <em:targetPlatform>WINNT_x86_64-msvc</em:targetPlatform> | ||
566 | 22 | 34 | ||
567 | 23 | <em:targetApplication> | 35 | <em:targetApplication> |
568 | 24 | <!-- Mozilla Firefox --> | 36 | <!-- Mozilla Firefox --> |
569 | 25 | <Description> | 37 | <Description> |
570 | 26 | <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> | 38 | <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> |
571 | 27 | <em:minVersion>4.0</em:minVersion> | 39 | <em:minVersion>4.0</em:minVersion> |
573 | 28 | <em:maxVersion>12.0a1</em:maxVersion> | 40 | <em:maxVersion>33.0</em:maxVersion> |
574 | 29 | </Description> | 41 | </Description> |
575 | 30 | </em:targetApplication> | 42 | </em:targetApplication> |
576 | 31 | 43 | ||
577 | @@ -34,7 +46,7 @@ | |||
578 | 34 | <Description> | 46 | <Description> |
579 | 35 | <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> | 47 | <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> |
580 | 36 | <em:minVersion>5.0</em:minVersion> | 48 | <em:minVersion>5.0</em:minVersion> |
582 | 37 | <em:maxVersion>12.0a1</em:maxVersion> | 49 | <em:maxVersion>33.0</em:maxVersion> |
583 | 38 | </Description> | 50 | </Description> |
584 | 39 | </em:targetApplication> | 51 | </em:targetApplication> |
585 | 40 | 52 | ||
586 | @@ -43,7 +55,7 @@ | |||
587 | 43 | <Description> | 55 | <Description> |
588 | 44 | <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> | 56 | <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> |
589 | 45 | <em:minVersion>2.2</em:minVersion> | 57 | <em:minVersion>2.2</em:minVersion> |
591 | 46 | <em:maxVersion>2.9a1</em:maxVersion> | 58 | <em:maxVersion>2.30</em:maxVersion> |
592 | 47 | </Description> | 59 | </Description> |
593 | 48 | </em:targetApplication> | 60 | </em:targetApplication> |
594 | 49 | 61 | ||
595 | 50 | 62 | ||
596 | === added file 'mozvoikko-2.2.xpi' | |||
597 | 51 | Binary files mozvoikko-2.2.xpi 1970-01-01 00:00:00 +0000 and mozvoikko-2.2.xpi 2015-09-18 13:59:48 +0000 differ | 63 | Binary files mozvoikko-2.2.xpi 1970-01-01 00:00:00 +0000 and mozvoikko-2.2.xpi 2015-09-18 13:59:48 +0000 differ |
598 | === added directory 'skin' | |||
599 | === added file 'skin/icon.png' | |||
600 | 52 | Binary files skin/icon.png 1970-01-01 00:00:00 +0000 and skin/icon.png 2015-09-18 13:59:48 +0000 differ | 64 | Binary files skin/icon.png 1970-01-01 00:00:00 +0000 and skin/icon.png 2015-09-18 13:59:48 +0000 differ |