diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-09 18:17:40 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-09 18:17:40 +0000 |
commit | eb8172c20b02c2acb9d4c92a81275a418640fbd6 (patch) | |
tree | 30b8abb49de88698bdab42a9f5ce28f3f8cc89c0 /plugins/SpellChecker/src | |
parent | 6b38bd980c93eb70ce88641ef8c89ad4839940bd (diff) |
added precompiled header
added version info
git-svn-id: http://svn.miranda-ng.org/main/trunk@3942 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src')
20 files changed, 378 insertions, 496 deletions
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index 0b24ce48f9..cd15c18b04 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -1,12 +1,12 @@ #include "commons.h"
-#define DEFINE_GUIDXXX(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - const GUID CDECL name \ - = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } - -DEFINE_GUIDXXX(IID_ITextDocument,0x8CC497C0,0xA1DF,0x11CE,0x80,0x98, - 0x00,0xAA,0x00,0x47,0xBE,0x5D); - +#define DEFINE_GUIDXXX(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ const GUID CDECL name \
+ = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
+
+DEFINE_GUIDXXX(IID_ITextDocument,0x8CC497C0,0xA1DF,0x11CE,0x80,0x98,
+ 0x00,0xAA,0x00,0x47,0xBE,0x5D);
+
RichEdit::RichEdit(HWND hwnd)
: hwnd(NULL), ole(NULL), textDocument(NULL), stopped(0), undoEnabled(TRUE)
{
diff --git a/plugins/SpellChecker/src/RichEdit.h b/plugins/SpellChecker/src/RichEdit.h index e8b4101be4..8d8b25f6bf 100644 --- a/plugins/SpellChecker/src/RichEdit.h +++ b/plugins/SpellChecker/src/RichEdit.h @@ -1,12 +1,6 @@ #ifndef __RICHEDIT_H__
#define __RICHEDIT_H__
-#include <windows.h>
-#include <richedit.h>
-#include <tom.h>
-#include <richole.h>
-
-
class RichEdit
{
HWND hwnd;
diff --git a/plugins/SpellChecker/src/Version.h b/plugins/SpellChecker/src/Version.h index 220618991c..fa1a2cad0c 100644 --- a/plugins/SpellChecker/src/Version.h +++ b/plugins/SpellChecker/src/Version.h @@ -4,14 +4,8 @@ #define __BUILD_NUM 0
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
-#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
-#define __STRINGIFY_IMPL(x) #x
-#define __STRINGIFY(x) __STRINGIFY_IMPL(x)
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS)
-
-#define __PLUGIN_NAME "Spell Checker"
-#define __INTERNAL_NAME "SpellChecker"
+#define __PLUGIN_NAME "Spell checker"
#define __FILENAME "SpellChecker.dll"
#define __DESCRIPTION "Spell checker for the message windows. Uses Hunspell to do the checking."
#define __AUTHOR "Ricardo Pescuma Domenecci, FREAK_THEMIGHTY"
diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp index a2e1cb05af..cfaacbb770 100644 --- a/plugins/SpellChecker/src/ardialog.cpp +++ b/plugins/SpellChecker/src/ardialog.cpp @@ -17,14 +17,11 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
#include "commons.h"
-
static LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
struct Data
{
Dictionary *dict;
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp index 425bfa010c..11aac5c310 100644 --- a/plugins/SpellChecker/src/autoreplace.cpp +++ b/plugins/SpellChecker/src/autoreplace.cpp @@ -17,10 +17,8 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
#include "commons.h"
-
AutoReplacement::AutoReplacement()
: useVariables(FALSE)
{
diff --git a/plugins/SpellChecker/src/codepages.cpp b/plugins/SpellChecker/src/codepages.cpp deleted file mode 100644 index 6441cda1b0..0000000000 --- a/plugins/SpellChecker/src/codepages.cpp +++ /dev/null @@ -1,307 +0,0 @@ -
-struct {
- char *name;
- UINT codepage;
-} codepages[] = {
- { "ISO8859-1", 28591 },
- { "UTF-7", CP_UTF7 },
- { "UTF-8", CP_UTF8 },
- { "UTF7", CP_UTF7 },
- { "UTF8", CP_UTF8 },
- { "ISO8859-2", 28592 },
- { "ISO8859-3", 28593 },
- { "ISO8859-4", 28594 },
- { "ISO8859-5", 28595 },
- { "ISO8859-6", 28596 },
- { "ISO8859-7", 28597 },
- { "ISO8859-8", 28598 },
- { "ISO8859-9", 28599 },
- { "ASMO-708", 708 },
- { "DOS-720", 720 },
- { "iso-8859-6", 28596 },
- { "arabic", 28596 },
- { "csISOLatinArabic", 28596 },
- { "ECMA-114", 28596 },
- { "ISO_8859-6", 28596 },
- { "ISO_8859-6:1987", 28596 },
- { "iso-ir-127", 28596 },
- { "x-mac-arabic", 10004 },
- { "windows-1256", 1256 },
- { "cp1256", 1256 },
- { "ibm775", 775 },
- { "CP500", 775 },
- { "iso-8859-4", 28594 },
- { "csISOLatin4", 28594 },
- { "ISO_8859-4", 28594 },
- { "ISO_8859-4:1988", 28594 },
- { "iso-ir-110", 28594 },
- { "l4", 28594 },
- { "latin4", 28594 },
- { "windows-1257", 1257 },
- { "ibm852", 852 },
- { "cp852", 852 },
- { "iso-8859-2", 28592 },
- { "csISOLatin2", 28592 },
- { "iso_8859-2", 28592 },
- { "iso_8859-2:1987", 28592 },
- { "iso-ir-101", 28592 },
- { "l2", 28592 },
- { "latin2", 28592 },
- { "x-mac-ce", 10029 },
- { "windows-1250", 1250 },
- { "x-cp1250", 1250 },
- { "EUC-CN", 51936 },
- { "x-euc-cn", 51936 },
- { "gb2312", 936 },
- { "chinese", 936 },
- { "CN-GB", 936 },
- { "csGB2312", 936 },
- { "csGB231280", 936 },
- { "csISO58GB231280", 936 },
- { "GB_2312-80", 936 },
- { "GB231280", 936 },
- { "GB2312-80", 936 },
- { "GBK", 936 },
- { "iso-ir-58", 936 },
- { "hz-gb-2312", 52936 },
- { "x-mac-chinesesimp", 10008 },
- { "big5", 950 },
- { "cn-big5", 950 },
- { "csbig5", 950 },
- { "x-x-big5", 950 },
- { "x-Chinese-CNS", 20000 },
- { "x-Chinese-Eten", 20002 },
- { "x-mac-chinesetrad", 10002 },
- { "cp866", 866 },
- { "ibm866", 866 },
- { "iso-8859-5", 28595 },
- { "csISOLatin5", 28595 },
- { "csISOLatinCyrillic", 28595 },
- { "cyrillic", 28595 },
- { "ISO_8859-5", 28595 },
- { "ISO_8859-5:1988", 28595 },
- { "iso-ir-144", 28595 },
- { "l5", 28595 },
- { "KOI8-R", 20866 },
- { "csKOI8R", 20866 },
- { "koi", 20866 },
- { "koi8", 20866 },
- { "koi8r", 20866 },
- { "KOI8-U", 21866 },
- { "koi8-ru", 21866 },
- { "x-mac-cyrillic", 10007 },
- { "windows-1251", 1251 },
- { "Win1251", 1251 },
- { "x-cp1251", 1251 },
- { "x-Europa", 29001 },
- { "x-IA5-German", 20106 },
- { "ibm737", 737 },
- { "iso-8859-7", 28597 },
- { "csISOLatinGreek", 28597 },
- { "ECMA-118", 28597 },
- { "ELOT_928", 28597 },
- { "greek", 28597 },
- { "greek8", 28597 },
- { "ISO_8859-7", 28597 },
- { "ISO_8859-7:1987", 28597 },
- { "iso-ir-126", 28597 },
- { "x-mac-greek", 10006 },
- { "windows-1253", 1253 },
- { "ibm869", 869 },
- { "DOS-862", 862 },
- { "iso-8859-8-i", 38598 },
- { "logical", 38598 },
- { "iso-8859-8", 28598 },
- { "csISOLatinHebrew", 28598 },
- { "hebrew", 28598 },
- { "ISO_8859-8", 28598 },
- { "ISO_8859-8:1988", 28598 },
- { "ISO-8859-8", 28598 },
- { "iso-ir-138", 28598 },
- { "visual", 28598 },
- { "x-mac-hebrew", 10005 },
- { "windows-1255", 1255 },
- { "ISO_8859-8-I", 1255 },
- { "ISO-8859-8", 1255 },
- { "x-EBCDIC-Arabic", 20420 },
- { "x-EBCDIC-CyrillicRussian", 20880 },
- { "x-EBCDIC-CyrillicSerbianBulgarian", 21025 },
- { "x-EBCDIC-DenmarkNorway", 20277 },
- { "x-ebcdic-denmarknorway-euro", 1142 },
- { "x-EBCDIC-FinlandSweden", 20278 },
- { "x-ebcdic-finlandsweden-euro", 1143 },
- { "X-EBCDIC-France", 1143 },
- { "X-EBCDIC-France", 1143 },
- { "x-ebcdic-france-euro", 1147 },
- { "x-EBCDIC-Germany", 20273 },
- { "x-ebcdic-germany-euro", 1141 },
- { "x-EBCDIC-GreekModern", 875 },
- { "x-EBCDIC-Greek", 20423 },
- { "x-EBCDIC-Hebrew", 20424 },
- { "x-EBCDIC-Icelandic", 20871 },
- { "x-ebcdic-icelandic-euro", 1149 },
- { "x-ebcdic-international-euro", 1148 },
- { "x-EBCDIC-Italy", 20280 },
- { "x-ebcdic-italy-euro", 1144 },
- { "x-EBCDIC-JapaneseAndKana", 50930 },
- { "x-EBCDIC-JapaneseAndJapaneseLatin", 50939 },
- { "x-EBCDIC-JapaneseAndUSCanada", 50931 },
- { "x-EBCDIC-JapaneseKatakana", 20290 },
- { "x-EBCDIC-KoreanAndKoreanExtended", 50933 },
- { "x-EBCDIC-KoreanExtended", 20833 },
- { "CP870", 870 },
- { "x-EBCDIC-SimplifiedChinese", 50935 },
- { "X-EBCDIC-Spain", 20284 },
- { "x-ebcdic-spain-euro", 1145 },
- { "x-EBCDIC-Thai", 20838 },
- { "x-EBCDIC-TraditionalChinese", 50937 },
- { "CP1026", 1026 },
- { "x-EBCDIC-Turkish", 20905 },
- { "x-EBCDIC-UK", 20285 },
- { "x-ebcdic-uk-euro", 1146 },
- { "ebcdic-cp-us", 37 },
- { "x-ebcdic-cp-us-euro", 1140 },
- { "ibm861", 861 },
- { "x-mac-icelandic", 10079 },
- { "x-iscii-as", 57006 },
- { "x-iscii-be", 57003 },
- { "x-iscii-de", 57002 },
- { "x-iscii-gu", 57010 },
- { "x-iscii-ka", 57008 },
- { "x-iscii-ma", 57009 },
- { "x-iscii-or", 57007 },
- { "x-iscii-pa", 57011 },
- { "x-iscii-ta", 57004 },
- { "x-iscii-te", 57005 },
- { "euc-jp", 51932 },
- { "csEUCPkdFmtJapanese", 51932 },
- { "Extended_UNIX_Code_Packed_Format_for_Japanese", 51932 },
- { "x-euc", 51932 },
- { "x-euc-jp", 51932 },
- { "iso-2022-jp", 50220 },
- { "iso-2022-jp", 50222 },
- { "_iso-2022-jp$SIO", 50222 },
- { "csISO2022JP", 50221 },
- { "_iso-2022-jp", 50221 },
- { "x-mac-japanese", 10001 },
- { "shift_jis", 932 },
- { "csShiftJIS", 932 },
- { "csWindows31J", 932 },
- { "ms_Kanji", 932 },
- { "shift-jis", 932 },
- { "x-ms-cp932", 932 },
- { "x-sjis", 932 },
- { "ks_c_5601-1987", 949 },
- { "csKSC56011987", 949 },
- { "euc-kr", 949 },
- { "iso-ir-149", 949 },
- { "korean", 949 },
- { "ks_c_5601", 949 },
- { "ks_c_5601_1987", 949 },
- { "ks_c_5601-1989", 949 },
- { "KSC_5601", 949 },
- { "KSC5601", 949 },
- { "euc-kr", 51949 },
- { "csEUCKR", 51949 },
- { "iso-2022-kr", 50225 },
- { "csISO2022KR", 50225 },
- { "Johab", 1361 },
- { "x-mac-korean", 10003 },
- { "iso-8859-3", 28593 },
- { "csISO", 28593 },
- { "Latin3", 28593 },
- { "ISO_8859-3", 28593 },
- { "ISO_8859-3:1988", 28593 },
- { "iso-ir-109", 28593 },
- { "l3", 28593 },
- { "latin3", 28593 },
- { "iso-8859-15", 28605 },
- { "csISO", 28605 },
- { "Latin9", 28605 },
- { "ISO_8859-15", 28605 },
- { "l9", 28605 },
- { "latin9", 28605 },
- { "x-IA5-Norwegian", 20108 },
- { "IBM437", 437 },
- { "437", 437 },
- { "cp437", 437 },
- { "csPC8", 437 },
- { "CodePage437", 437 },
- { "x-IA5-Swedish", 20107 },
- { "windows-874", 874 },
- { "DOS-874", 874 },
- { "iso-8859-11", 874 },
- { "TIS-620", 874 },
- { "ibm857", 857 },
- { "iso-8859-9", 28599 },
- { "csISO", 28599 },
- { "Latin5", 28599 },
- { "ISO_8859-9", 28599 },
- { "ISO_8859-9:1989", 28599 },
- { "iso-ir-148", 28599 },
- { "l5", 28599 },
- { "latin5", 28599 },
- { "x-mac-turkish", 10081 },
- { "windows-1254", 1254 },
- { "ISO_8859-9", 1254 },
- { "ISO_8859-9:1989", 1254 },
- { "iso-8859-9", 1254 },
- { "iso-ir-148", 1254 },
- { "latin5", 1254 },
- { "unicode", 1200 },
- { "utf-16", 1200 },
- { "unicodeFFFE", 1201 },
- { "utf-7", 65000 },
- { "csUnicode11UTF7", 65000 },
- { "unicode-1-1-utf-7", 65000 },
- { "x-unicode-2-0-utf-7", 65000 },
- { "utf-8", 65001 },
- { "unicode-1-1-utf-8", 65001 },
- { "unicode-2-0-utf-8", 65001 },
- { "x-unicode-2-0-utf-8", 65001 },
- { "us-ascii", 20127 },
- { "ANSI_X3.4-1968", 20127 },
- { "ANSI_X3.4-1986", 20127 },
- { "ascii", 20127 },
- { "cp367", 20127 },
- { "csASCII", 20127 },
- { "IBM367", 20127 },
- { "ISO_646.irv:1991", 20127 },
- { "ISO646-US", 20127 },
- { "iso-ir-6us", 20127 },
- { "windows-1258", 1258 },
- { "ibm850", 850 },
- { "x-IA5", 20105 },
- { "iso-8859-1", 28591 },
- { "cp819", 28591 },
- { "csISO", 28591 },
- { "Latin1", 28591 },
- { "ibm819", 28591 },
- { "iso_8859-1", 28591 },
- { "iso_8859-1:1987", 28591 },
- { "iso-ir-100", 28591 },
- { "l1", 28591 },
- { "latin1", 28591 },
- { "macintosh", 10000 },
- { "Windows-1252", 1252 },
- { "ANSI_X3.4-1968", 1252 },
- { "ANSI_X3.4-1986", 1252 },
- { "ascii", 1252 },
- { "cp367", 1252 },
- { "cp819", 1252 },
- { "csASCII", 1252 },
- { "IBM367", 1252 },
- { "ibm819", 1252 },
- { "ISO_646.irv:1991", 1252 },
- { "iso_8859-1", 1252 },
- { "iso_8859-1:1987", 1252 },
- { "ISO646-US", 1252 },
- { "iso-ir-100", 1252 },
- { "iso-ir-6", 1252 },
- { "latin1", 1252 },
- { "us", 1252 },
- { "us-ascii", 1252 },
- { "x-ansi", 1252 },
- { "microsoft-cp1251", 1251 }
-};
-
diff --git a/plugins/SpellChecker/src/commons.h b/plugins/SpellChecker/src/commons.h index 9038fe26c4..a71d850bc9 100644 --- a/plugins/SpellChecker/src/commons.h +++ b/plugins/SpellChecker/src/commons.h @@ -20,57 +20,59 @@ Boston, MA 02111-1307, USA. #ifndef __COMMONS_H__
# define __COMMONS_H__
+#define _CRT_SECURE_NO_WARNINGS
#define OEMRESOURCE
+
#include <windows.h>
-#include <tchar.h>
-#include <stdio.h>
-#include <time.h>
#include <richedit.h>
#include <tom.h>
#include <richole.h>
#include <commctrl.h>
-
#include <map>
#include <vector>
-#include <string>
using namespace std;
-
-// Miranda headers
-#define MIRANDA_VER 0x0A00
#include <newpluginapi.h>
-#include <m_system.h>
-#include <m_system_cpp.h>
-#include <m_protocols.h>
#include <m_protosvc.h>
-#include <m_clist.h>
-#include <m_contacts.h>
#include <m_langpack.h>
#include <m_database.h>
#include <m_options.h>
-#include <m_utils.h>
#include <m_popup.h>
-#include <m_history.h>
#include <m_message.h>
#include <m_icolib.h>
#include <m_hotkeys.h>
#include <win2k.h>
//own includes
-#include "m_folders.h"
-#include "m_metacontacts.h"
-#include "m_variables.h"
-#include "m_userinfoex.h"
-
-#include "../utils/mir_memory.h"
-#include "../utils/mir_options.h"
-#include "../utils/tstring.h"
-#include "../utils/utf8_helpers.h"
-#include "../utils/scope.h"
+#include <m_folders.h>
+#include <m_metacontacts.h>
+#include <m_variables.h>
+#include <m_userinfoex.h>
+#include <m_spellchecker.h>
+
+#include <../utils/mir_options.h>
+#include <../utils/tstring.h>
+#include <../utils/utf8_helpers.h>
+#include <../utils/scope.h>
+
+#include "hunspell/affentry.hxx"
+#include "hunspell/config.h"
+#include "hunspell/hunspell.hxx"
+#include "hunspell/csutil.hxx"
+#include "hunspell/affixmgr.hxx"
+#include "hunspell/langnum.hxx"
+#include "hunspell/atypes.hxx"
+#include "hunspell/dictmgr.hxx"
+#include "hunspell/filemgr.hxx"
+#include "hunspell/hashmgr.hxx"
+#include "hunspell/hunspell.h"
+#include "hunspell/hunzip.hxx"
+#include "hunspell/phonet.hxx"
+#include "hunspell/replist.hxx"
+#include "hunspell/suggestmgr.hxx"
#include "resource.h"
#include "Version.h"
-#include "m_spellchecker.h"
#include "options.h"
#include "autoreplace.h"
#include "dictionary.h"
@@ -92,15 +94,15 @@ extern BOOL variables_enabled; #define ICON_SIZE 16
-#define TIMER_ID 17982 -#define WMU_DICT_CHANGED (WM_USER+100) -#define WMU_KBDL_CHANGED (WM_USER+101) - -#define HOTKEY_ACTION_TOGGLE 1 +#define TIMER_ID 17982
+#define WMU_DICT_CHANGED (WM_USER+100)
+#define WMU_KBDL_CHANGED (WM_USER+101)
+
+#define HOTKEY_ACTION_TOGGLE 1
extern LIST<Dictionary> languages;
extern BITMAP bmpChecked;
-extern HBITMAP hCheckedBmp; +extern HBITMAP hCheckedBmp;
struct WrongWordPopupMenuData
{
@@ -142,24 +144,24 @@ TCHAR *lstrtrim(TCHAR *str); BOOL lstreq(TCHAR *a, TCHAR *b, size_t len = -1);
BOOL IsNumber(TCHAR c);
-int MsgWindowEvent(WPARAM wParam, LPARAM lParam); -int MsgWindowPopup(WPARAM wParam, LPARAM lParam); -int IconPressed(WPARAM wParam, LPARAM lParam); - -int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner); -int RemoveContactTextBox(HWND hwnd); -int ShowPopupMenu(HWND hwnd, HMENU hMenu, POINT pt, HWND hwndOwner); - -INT_PTR AddContactTextBoxService(WPARAM wParam, LPARAM lParam); -INT_PTR RemoveContactTextBoxService(WPARAM wParam, LPARAM lParam); -INT_PTR ShowPopupMenuService(WPARAM wParam, LPARAM lParam); - -LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - -void ModifyIcon(Dialog *dlg); -BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char); -TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel); - -int GetClosestLanguage(TCHAR *lang_name); +int MsgWindowEvent(WPARAM wParam, LPARAM lParam);
+int MsgWindowPopup(WPARAM wParam, LPARAM lParam);
+int IconPressed(WPARAM wParam, LPARAM lParam);
+
+int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner);
+int RemoveContactTextBox(HWND hwnd);
+int ShowPopupMenu(HWND hwnd, HMENU hMenu, POINT pt, HWND hwndOwner);
+
+INT_PTR AddContactTextBoxService(WPARAM wParam, LPARAM lParam);
+INT_PTR RemoveContactTextBoxService(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowPopupMenuService(WPARAM wParam, LPARAM lParam);
+
+LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+void ModifyIcon(Dialog *dlg);
+BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char);
+TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel);
+
+int GetClosestLanguage(TCHAR *lang_name);
#endif // __COMMONS_H__
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 1b36fed403..883f5852f9 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -17,17 +17,8 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
#include "commons.h"
-#include "hunspell/config.h"
-#include "hunspell/hunspell.hxx"
-#include "hunspell/csutil.hxx"
-
-
-#include "codepages.cpp"
-
-
DWORD WINAPI LoadThread(LPVOID hd);
// Additional languages that i could not find in Windows
@@ -36,14 +27,316 @@ TCHAR *aditionalLanguages[] = { LPGENT("de_frami_neu"), LPGENT("German (Germany)")
};
-
+struct {
+ char *name;
+ UINT codepage;
+} codepages[] = {
+ { "ISO8859-1", 28591 },
+ { "UTF-7", CP_UTF7 },
+ { "UTF-8", CP_UTF8 },
+ { "UTF7", CP_UTF7 },
+ { "UTF8", CP_UTF8 },
+ { "ISO8859-2", 28592 },
+ { "ISO8859-3", 28593 },
+ { "ISO8859-4", 28594 },
+ { "ISO8859-5", 28595 },
+ { "ISO8859-6", 28596 },
+ { "ISO8859-7", 28597 },
+ { "ISO8859-8", 28598 },
+ { "ISO8859-9", 28599 },
+ { "ASMO-708", 708 },
+ { "DOS-720", 720 },
+ { "iso-8859-6", 28596 },
+ { "arabic", 28596 },
+ { "csISOLatinArabic", 28596 },
+ { "ECMA-114", 28596 },
+ { "ISO_8859-6", 28596 },
+ { "ISO_8859-6:1987", 28596 },
+ { "iso-ir-127", 28596 },
+ { "x-mac-arabic", 10004 },
+ { "windows-1256", 1256 },
+ { "cp1256", 1256 },
+ { "ibm775", 775 },
+ { "CP500", 775 },
+ { "iso-8859-4", 28594 },
+ { "csISOLatin4", 28594 },
+ { "ISO_8859-4", 28594 },
+ { "ISO_8859-4:1988", 28594 },
+ { "iso-ir-110", 28594 },
+ { "l4", 28594 },
+ { "latin4", 28594 },
+ { "windows-1257", 1257 },
+ { "ibm852", 852 },
+ { "cp852", 852 },
+ { "iso-8859-2", 28592 },
+ { "csISOLatin2", 28592 },
+ { "iso_8859-2", 28592 },
+ { "iso_8859-2:1987", 28592 },
+ { "iso-ir-101", 28592 },
+ { "l2", 28592 },
+ { "latin2", 28592 },
+ { "x-mac-ce", 10029 },
+ { "windows-1250", 1250 },
+ { "x-cp1250", 1250 },
+ { "EUC-CN", 51936 },
+ { "x-euc-cn", 51936 },
+ { "gb2312", 936 },
+ { "chinese", 936 },
+ { "CN-GB", 936 },
+ { "csGB2312", 936 },
+ { "csGB231280", 936 },
+ { "csISO58GB231280", 936 },
+ { "GB_2312-80", 936 },
+ { "GB231280", 936 },
+ { "GB2312-80", 936 },
+ { "GBK", 936 },
+ { "iso-ir-58", 936 },
+ { "hz-gb-2312", 52936 },
+ { "x-mac-chinesesimp", 10008 },
+ { "big5", 950 },
+ { "cn-big5", 950 },
+ { "csbig5", 950 },
+ { "x-x-big5", 950 },
+ { "x-Chinese-CNS", 20000 },
+ { "x-Chinese-Eten", 20002 },
+ { "x-mac-chinesetrad", 10002 },
+ { "cp866", 866 },
+ { "ibm866", 866 },
+ { "iso-8859-5", 28595 },
+ { "csISOLatin5", 28595 },
+ { "csISOLatinCyrillic", 28595 },
+ { "cyrillic", 28595 },
+ { "ISO_8859-5", 28595 },
+ { "ISO_8859-5:1988", 28595 },
+ { "iso-ir-144", 28595 },
+ { "l5", 28595 },
+ { "KOI8-R", 20866 },
+ { "csKOI8R", 20866 },
+ { "koi", 20866 },
+ { "koi8", 20866 },
+ { "koi8r", 20866 },
+ { "KOI8-U", 21866 },
+ { "koi8-ru", 21866 },
+ { "x-mac-cyrillic", 10007 },
+ { "windows-1251", 1251 },
+ { "Win1251", 1251 },
+ { "x-cp1251", 1251 },
+ { "x-Europa", 29001 },
+ { "x-IA5-German", 20106 },
+ { "ibm737", 737 },
+ { "iso-8859-7", 28597 },
+ { "csISOLatinGreek", 28597 },
+ { "ECMA-118", 28597 },
+ { "ELOT_928", 28597 },
+ { "greek", 28597 },
+ { "greek8", 28597 },
+ { "ISO_8859-7", 28597 },
+ { "ISO_8859-7:1987", 28597 },
+ { "iso-ir-126", 28597 },
+ { "x-mac-greek", 10006 },
+ { "windows-1253", 1253 },
+ { "ibm869", 869 },
+ { "DOS-862", 862 },
+ { "iso-8859-8-i", 38598 },
+ { "logical", 38598 },
+ { "iso-8859-8", 28598 },
+ { "csISOLatinHebrew", 28598 },
+ { "hebrew", 28598 },
+ { "ISO_8859-8", 28598 },
+ { "ISO_8859-8:1988", 28598 },
+ { "ISO-8859-8", 28598 },
+ { "iso-ir-138", 28598 },
+ { "visual", 28598 },
+ { "x-mac-hebrew", 10005 },
+ { "windows-1255", 1255 },
+ { "ISO_8859-8-I", 1255 },
+ { "ISO-8859-8", 1255 },
+ { "x-EBCDIC-Arabic", 20420 },
+ { "x-EBCDIC-CyrillicRussian", 20880 },
+ { "x-EBCDIC-CyrillicSerbianBulgarian", 21025 },
+ { "x-EBCDIC-DenmarkNorway", 20277 },
+ { "x-ebcdic-denmarknorway-euro", 1142 },
+ { "x-EBCDIC-FinlandSweden", 20278 },
+ { "x-ebcdic-finlandsweden-euro", 1143 },
+ { "X-EBCDIC-France", 1143 },
+ { "X-EBCDIC-France", 1143 },
+ { "x-ebcdic-france-euro", 1147 },
+ { "x-EBCDIC-Germany", 20273 },
+ { "x-ebcdic-germany-euro", 1141 },
+ { "x-EBCDIC-GreekModern", 875 },
+ { "x-EBCDIC-Greek", 20423 },
+ { "x-EBCDIC-Hebrew", 20424 },
+ { "x-EBCDIC-Icelandic", 20871 },
+ { "x-ebcdic-icelandic-euro", 1149 },
+ { "x-ebcdic-international-euro", 1148 },
+ { "x-EBCDIC-Italy", 20280 },
+ { "x-ebcdic-italy-euro", 1144 },
+ { "x-EBCDIC-JapaneseAndKana", 50930 },
+ { "x-EBCDIC-JapaneseAndJapaneseLatin", 50939 },
+ { "x-EBCDIC-JapaneseAndUSCanada", 50931 },
+ { "x-EBCDIC-JapaneseKatakana", 20290 },
+ { "x-EBCDIC-KoreanAndKoreanExtended", 50933 },
+ { "x-EBCDIC-KoreanExtended", 20833 },
+ { "CP870", 870 },
+ { "x-EBCDIC-SimplifiedChinese", 50935 },
+ { "X-EBCDIC-Spain", 20284 },
+ { "x-ebcdic-spain-euro", 1145 },
+ { "x-EBCDIC-Thai", 20838 },
+ { "x-EBCDIC-TraditionalChinese", 50937 },
+ { "CP1026", 1026 },
+ { "x-EBCDIC-Turkish", 20905 },
+ { "x-EBCDIC-UK", 20285 },
+ { "x-ebcdic-uk-euro", 1146 },
+ { "ebcdic-cp-us", 37 },
+ { "x-ebcdic-cp-us-euro", 1140 },
+ { "ibm861", 861 },
+ { "x-mac-icelandic", 10079 },
+ { "x-iscii-as", 57006 },
+ { "x-iscii-be", 57003 },
+ { "x-iscii-de", 57002 },
+ { "x-iscii-gu", 57010 },
+ { "x-iscii-ka", 57008 },
+ { "x-iscii-ma", 57009 },
+ { "x-iscii-or", 57007 },
+ { "x-iscii-pa", 57011 },
+ { "x-iscii-ta", 57004 },
+ { "x-iscii-te", 57005 },
+ { "euc-jp", 51932 },
+ { "csEUCPkdFmtJapanese", 51932 },
+ { "Extended_UNIX_Code_Packed_Format_for_Japanese", 51932 },
+ { "x-euc", 51932 },
+ { "x-euc-jp", 51932 },
+ { "iso-2022-jp", 50220 },
+ { "iso-2022-jp", 50222 },
+ { "_iso-2022-jp$SIO", 50222 },
+ { "csISO2022JP", 50221 },
+ { "_iso-2022-jp", 50221 },
+ { "x-mac-japanese", 10001 },
+ { "shift_jis", 932 },
+ { "csShiftJIS", 932 },
+ { "csWindows31J", 932 },
+ { "ms_Kanji", 932 },
+ { "shift-jis", 932 },
+ { "x-ms-cp932", 932 },
+ { "x-sjis", 932 },
+ { "ks_c_5601-1987", 949 },
+ { "csKSC56011987", 949 },
+ { "euc-kr", 949 },
+ { "iso-ir-149", 949 },
+ { "korean", 949 },
+ { "ks_c_5601", 949 },
+ { "ks_c_5601_1987", 949 },
+ { "ks_c_5601-1989", 949 },
+ { "KSC_5601", 949 },
+ { "KSC5601", 949 },
+ { "euc-kr", 51949 },
+ { "csEUCKR", 51949 },
+ { "iso-2022-kr", 50225 },
+ { "csISO2022KR", 50225 },
+ { "Johab", 1361 },
+ { "x-mac-korean", 10003 },
+ { "iso-8859-3", 28593 },
+ { "csISO", 28593 },
+ { "Latin3", 28593 },
+ { "ISO_8859-3", 28593 },
+ { "ISO_8859-3:1988", 28593 },
+ { "iso-ir-109", 28593 },
+ { "l3", 28593 },
+ { "latin3", 28593 },
+ { "iso-8859-15", 28605 },
+ { "csISO", 28605 },
+ { "Latin9", 28605 },
+ { "ISO_8859-15", 28605 },
+ { "l9", 28605 },
+ { "latin9", 28605 },
+ { "x-IA5-Norwegian", 20108 },
+ { "IBM437", 437 },
+ { "437", 437 },
+ { "cp437", 437 },
+ { "csPC8", 437 },
+ { "CodePage437", 437 },
+ { "x-IA5-Swedish", 20107 },
+ { "windows-874", 874 },
+ { "DOS-874", 874 },
+ { "iso-8859-11", 874 },
+ { "TIS-620", 874 },
+ { "ibm857", 857 },
+ { "iso-8859-9", 28599 },
+ { "csISO", 28599 },
+ { "Latin5", 28599 },
+ { "ISO_8859-9", 28599 },
+ { "ISO_8859-9:1989", 28599 },
+ { "iso-ir-148", 28599 },
+ { "l5", 28599 },
+ { "latin5", 28599 },
+ { "x-mac-turkish", 10081 },
+ { "windows-1254", 1254 },
+ { "ISO_8859-9", 1254 },
+ { "ISO_8859-9:1989", 1254 },
+ { "iso-8859-9", 1254 },
+ { "iso-ir-148", 1254 },
+ { "latin5", 1254 },
+ { "unicode", 1200 },
+ { "utf-16", 1200 },
+ { "unicodeFFFE", 1201 },
+ { "utf-7", 65000 },
+ { "csUnicode11UTF7", 65000 },
+ { "unicode-1-1-utf-7", 65000 },
+ { "x-unicode-2-0-utf-7", 65000 },
+ { "utf-8", 65001 },
+ { "unicode-1-1-utf-8", 65001 },
+ { "unicode-2-0-utf-8", 65001 },
+ { "x-unicode-2-0-utf-8", 65001 },
+ { "us-ascii", 20127 },
+ { "ANSI_X3.4-1968", 20127 },
+ { "ANSI_X3.4-1986", 20127 },
+ { "ascii", 20127 },
+ { "cp367", 20127 },
+ { "csASCII", 20127 },
+ { "IBM367", 20127 },
+ { "ISO_646.irv:1991", 20127 },
+ { "ISO646-US", 20127 },
+ { "iso-ir-6us", 20127 },
+ { "windows-1258", 1258 },
+ { "ibm850", 850 },
+ { "x-IA5", 20105 },
+ { "iso-8859-1", 28591 },
+ { "cp819", 28591 },
+ { "csISO", 28591 },
+ { "Latin1", 28591 },
+ { "ibm819", 28591 },
+ { "iso_8859-1", 28591 },
+ { "iso_8859-1:1987", 28591 },
+ { "iso-ir-100", 28591 },
+ { "l1", 28591 },
+ { "latin1", 28591 },
+ { "macintosh", 10000 },
+ { "Windows-1252", 1252 },
+ { "ANSI_X3.4-1968", 1252 },
+ { "ANSI_X3.4-1986", 1252 },
+ { "ascii", 1252 },
+ { "cp367", 1252 },
+ { "cp819", 1252 },
+ { "csASCII", 1252 },
+ { "IBM367", 1252 },
+ { "ibm819", 1252 },
+ { "ISO_646.irv:1991", 1252 },
+ { "iso_8859-1", 1252 },
+ { "iso_8859-1:1987", 1252 },
+ { "ISO646-US", 1252 },
+ { "iso-ir-100", 1252 },
+ { "iso-ir-6", 1252 },
+ { "latin1", 1252 },
+ { "us", 1252 },
+ { "us-ascii", 1252 },
+ { "x-ansi", 1252 },
+ { "microsoft-cp1251", 1251 }
+};
#define LANGUAGE_NOT_LOADED 1
#define LANGUAGE_LOADING -1
#define LANGUAGE_LOADED 0
-
-
class HunspellDictionary : public Dictionary {
protected:
TCHAR fileWithoutExtension[1024];
diff --git a/plugins/SpellChecker/src/hunspell/affentry.cxx b/plugins/SpellChecker/src/hunspell/affentry.cxx index fef0cca5f5..6406f2577a 100644 --- a/plugins/SpellChecker/src/hunspell/affentry.cxx +++ b/plugins/SpellChecker/src/hunspell/affentry.cxx @@ -1,13 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include "affentry.hxx" -#include "csutil.hxx" +#include "..\commons.h"
PfxEntry::PfxEntry(AffixMgr* pmgr, affentry* dp) { diff --git a/plugins/SpellChecker/src/hunspell/affixmgr.cxx b/plugins/SpellChecker/src/hunspell/affixmgr.cxx index ae72f70270..59313bfba0 100644 --- a/plugins/SpellChecker/src/hunspell/affixmgr.cxx +++ b/plugins/SpellChecker/src/hunspell/affixmgr.cxx @@ -1,18 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include <vector> - -#include "affixmgr.hxx" -#include "affentry.hxx" -#include "langnum.hxx" - -#include "csutil.hxx" +#include "..\commons.h"
AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key) { diff --git a/plugins/SpellChecker/src/hunspell/csutil.cxx b/plugins/SpellChecker/src/hunspell/csutil.cxx index 35154a73ed..7284f9cdfd 100644 --- a/plugins/SpellChecker/src/hunspell/csutil.cxx +++ b/plugins/SpellChecker/src/hunspell/csutil.cxx @@ -1,14 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include "csutil.hxx" -#include "atypes.hxx" -#include "langnum.hxx" +#include "..\commons.h"
// Unicode character encoding information struct unicode_info { diff --git a/plugins/SpellChecker/src/hunspell/dictmgr.cxx b/plugins/SpellChecker/src/hunspell/dictmgr.cxx index b4a15b1a5b..5310053f76 100644 --- a/plugins/SpellChecker/src/hunspell/dictmgr.cxx +++ b/plugins/SpellChecker/src/hunspell/dictmgr.cxx @@ -1,10 +1,7 @@ #include <stdlib.h> #include <string.h> -#include <ctype.h> -#include <stdio.h> - -#include "dictmgr.hxx" +#include "..\commons.h"
DictMgr::DictMgr(const char * dictpath, const char * etype) : numdict(0) { diff --git a/plugins/SpellChecker/src/hunspell/filemgr.cxx b/plugins/SpellChecker/src/hunspell/filemgr.cxx index 5fb82bcf80..bfd9554271 100644 --- a/plugins/SpellChecker/src/hunspell/filemgr.cxx +++ b/plugins/SpellChecker/src/hunspell/filemgr.cxx @@ -1,11 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "filemgr.hxx" +#include "..\commons.h"
int FileMgr::fail(const char * err, const char * par) { fprintf(stderr, err, par); diff --git a/plugins/SpellChecker/src/hunspell/hashmgr.cxx b/plugins/SpellChecker/src/hunspell/hashmgr.cxx index ea93b8787c..f150437ad6 100644 --- a/plugins/SpellChecker/src/hunspell/hashmgr.cxx +++ b/plugins/SpellChecker/src/hunspell/hashmgr.cxx @@ -1,14 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include "hashmgr.hxx" -#include "csutil.hxx" -#include "atypes.hxx" +#include "..\commons.h"
// build a hash table from a munched word list diff --git a/plugins/SpellChecker/src/hunspell/hunspell.cxx b/plugins/SpellChecker/src/hunspell/hunspell.cxx index 6b35fb51e0..03f8cb42c8 100644 --- a/plugins/SpellChecker/src/hunspell/hunspell.cxx +++ b/plugins/SpellChecker/src/hunspell/hunspell.cxx @@ -1,16 +1,8 @@ -#include "license.hunspell" -#include "license.myspell" +#include "..\commons.h"
-#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "hunspell.hxx" -#include "hunspell.h" #ifndef MOZILLA_CLIENT # include "config.h" #endif -#include "csutil.hxx" Hunspell::Hunspell(const char * affpath, const char * dpath, const char * key) { diff --git a/plugins/SpellChecker/src/hunspell/hunzip.cxx b/plugins/SpellChecker/src/hunspell/hunzip.cxx index b50599fa84..ecd8c7da77 100644 --- a/plugins/SpellChecker/src/hunspell/hunzip.cxx +++ b/plugins/SpellChecker/src/hunspell/hunzip.cxx @@ -1,8 +1,4 @@ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "hunzip.hxx" +#include "..\commons.h"
#define CODELEN 65536 #define BASEBITREC 5000 diff --git a/plugins/SpellChecker/src/hunspell/phonet.cxx b/plugins/SpellChecker/src/hunspell/phonet.cxx index 3a849b4444..6e2e56297f 100644 --- a/plugins/SpellChecker/src/hunspell/phonet.cxx +++ b/plugins/SpellChecker/src/hunspell/phonet.cxx @@ -27,13 +27,7 @@ Porting from Aspell to Hunspell using C-like structs */ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include "csutil.hxx" -#include "phonet.hxx" +#include "..\commons.h"
void init_phonet_hash(phonetable & parms) { diff --git a/plugins/SpellChecker/src/hunspell/replist.cxx b/plugins/SpellChecker/src/hunspell/replist.cxx index bc153733db..cf75a2868d 100644 --- a/plugins/SpellChecker/src/hunspell/replist.cxx +++ b/plugins/SpellChecker/src/hunspell/replist.cxx @@ -1,12 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "replist.hxx" -#include "csutil.hxx" +#include "..\commons.h"
RepList::RepList(int n) { dat = (replentry **) malloc(sizeof(replentry *) * n); diff --git a/plugins/SpellChecker/src/hunspell/suggestmgr.cxx b/plugins/SpellChecker/src/hunspell/suggestmgr.cxx index d08b506b9f..1fdf20c881 100644 --- a/plugins/SpellChecker/src/hunspell/suggestmgr.cxx +++ b/plugins/SpellChecker/src/hunspell/suggestmgr.cxx @@ -1,14 +1,4 @@ -#include "license.hunspell" -#include "license.myspell" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <ctype.h> - -#include "suggestmgr.hxx" -#include "htypes.hxx" -#include "csutil.hxx" +#include "..\commons.h"
const w_char W_VLINE = { '\0', '|' }; diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index d7dfd16406..ef633af616 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -58,7 +58,7 @@ LIST<Dictionary> languages(1); // Functions //////////////////////////////////////////////////////////////////////////// -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { hInst = hinstDLL; return TRUE; |