Compare commits
No commits in common. "master" and "2.5.4" have entirely different histories.
18
.gitmodules
vendored
18
.gitmodules
vendored
@ -1,24 +1,18 @@
|
|||||||
[submodule "lib/stdex"]
|
[submodule "lib/stdex"]
|
||||||
path = lib/stdex
|
path = lib/stdex
|
||||||
url = https://git.amebis.si/Amebis/stdex.git
|
url = https://github.com/Amebis/stdex.git
|
||||||
[submodule "lib/WinStd"]
|
[submodule "lib/WinStd"]
|
||||||
path = lib/WinStd
|
path = lib/WinStd
|
||||||
url = https://git.amebis.si/Amebis/WinStd.git
|
url = https://github.com/Amebis/WinStd.git
|
||||||
[submodule "lib/wxExtend"]
|
[submodule "lib/wxExtend"]
|
||||||
path = lib/wxExtend
|
path = lib/wxExtend
|
||||||
url = https://git.amebis.si/Amebis/wxExtend.git
|
url = https://github.com/Amebis/wxExtend.git
|
||||||
[submodule "MSI/MSIBuild"]
|
[submodule "MSI/MSIBuild"]
|
||||||
path = MSI/MSIBuild
|
path = MSI/MSIBuild
|
||||||
url = https://git.amebis.si/Amebis/MSIBuild.git
|
url = https://github.com/Amebis/MSIBuild.git
|
||||||
[submodule "MSI/MSICA"]
|
[submodule "MSI/MSICA"]
|
||||||
path = MSI/MSICA
|
path = MSI/MSICA
|
||||||
url = https://git.amebis.si/Amebis/MSICA.git
|
url = https://github.com/Amebis/MSICA.git
|
||||||
[submodule "Updater"]
|
[submodule "Updater"]
|
||||||
path = Updater
|
path = Updater
|
||||||
url = https://git.amebis.si/Amebis/Updater.git
|
url = https://github.com/Amebis/Updater.git
|
||||||
[submodule "lib/oatpp"]
|
|
||||||
path = lib/oatpp
|
|
||||||
url = https://github.com/oatpp/oatpp.git
|
|
||||||
[submodule "lib/oatpp-swagger"]
|
|
||||||
path = lib/oatpp-swagger
|
|
||||||
url = https://github.com/oatpp/oatpp-swagger.git
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit b8364dea81f39b321d726317a9dcbf6b13a455e0
|
Subproject commit 05edc2b598f7ea9683cf01c65d74aec264a02ab1
|
@ -1 +1 @@
|
|||||||
Subproject commit f989fdc827d8fa731977d1771097cf038a50e145
|
Subproject commit f98cfef1e7a38bea6ab70547712f4ad2d930d06a
|
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# Copyright © 1991-2022 Amebis
|
# Copyright © 1991-2021 Amebis
|
||||||
|
|
||||||
!INCLUDE "..\..\include\MSIBuildCfg.mak"
|
!INCLUDE "..\..\include\MSIBuildCfg.mak"
|
||||||
!INCLUDE "..\MSIBuild\Makefile"
|
!INCLUDE "..\MSIBuild\Makefile"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,5 @@
|
|||||||
#
|
|
||||||
# Translators:
|
# Translators:
|
||||||
# Simon Rozman <simon@rozman.si>, 2022
|
# Simon Rozman <simon@rozman.si>, 2018
|
||||||
#
|
#
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -9,7 +8,7 @@ msgstr ""
|
|||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
||||||
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
||||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2022\n"
|
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n"
|
||||||
"Language-Team: German (Germany) (https://www.transifex.com/amebis/teams/91592/de_DE/)\n"
|
"Language-Team: German (Germany) (https://www.transifex.com/amebis/teams/91592/de_DE/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@ -3469,8 +3468,8 @@ msgstr ""
|
|||||||
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
||||||
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
||||||
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
||||||
msgid "UIHeader.bmp"
|
msgid "binUIHeader.bmp"
|
||||||
msgstr "UIHeader.bmp"
|
msgstr "binUIHeader.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
||||||
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
||||||
@ -3523,8 +3522,8 @@ msgstr ""
|
|||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
||||||
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
||||||
msgid "fontsubst.bmp"
|
msgid "binfontsubst.bmp"
|
||||||
msgstr "fontsubst.bmp"
|
msgstr "binfontsubst.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
||||||
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#
|
|
||||||
# Translators:
|
# Translators:
|
||||||
# Simon Rozman <simon@rozman.si>, 2022
|
# Simon Rozman <simon@rozman.si>, 2018
|
||||||
#
|
#
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -9,7 +8,7 @@ msgstr ""
|
|||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
||||||
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
||||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2022\n"
|
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n"
|
||||||
"Language-Team: Russian (Russia) (https://www.transifex.com/amebis/teams/91592/ru_RU/)\n"
|
"Language-Team: Russian (Russia) (https://www.transifex.com/amebis/teams/91592/ru_RU/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@ -3469,8 +3468,8 @@ msgstr ""
|
|||||||
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
||||||
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
||||||
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
||||||
msgid "UIHeader.bmp"
|
msgid "binUIHeader.bmp"
|
||||||
msgstr "UIHeader.bmp"
|
msgstr "binUIHeader.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
||||||
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
||||||
@ -3543,8 +3542,8 @@ msgstr "[DlgTitleFont]Шрифт «00 ZRCola» в «ZRCola»"
|
|||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
||||||
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
||||||
msgid "fontsubst.bmp"
|
msgid "binfontsubst.bmp"
|
||||||
msgstr "fontsubst.bmp"
|
msgstr "binfontsubst.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
||||||
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#
|
|
||||||
# Translators:
|
# Translators:
|
||||||
# Simon Rozman <simon@rozman.si>, 2022
|
# Simon Rozman <simon@rozman.si>, 2018
|
||||||
#
|
#
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -9,7 +8,7 @@ msgstr ""
|
|||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
"POT-Creation-Date: 2018-09-19 08:59+0200\n"
|
||||||
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
"PO-Revision-Date: 2018-09-19 07:19+0000\n"
|
||||||
"Last-Translator: Simon Rozman <simon@rozman.si>, 2022\n"
|
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n"
|
||||||
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/amebis/teams/91592/sl_SI/)\n"
|
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/amebis/teams/91592/sl_SI/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@ -3469,8 +3468,8 @@ msgstr ""
|
|||||||
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
#: en_US.Win32.Release.Control-2.idtx:5 en_US.Win32.Release.Control-2.idtx:12
|
||||||
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
#: en_US.x64.Debug.Control-2.idtx:5 en_US.x64.Debug.Control-2.idtx:12
|
||||||
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
#: en_US.x64.Release.Control-2.idtx:5 en_US.x64.Release.Control-2.idtx:12
|
||||||
msgid "UIHeader.bmp"
|
msgid "binUIHeader.bmp"
|
||||||
msgstr "UIHeader.bmp"
|
msgstr "binUIHeader.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
#: en_US.Win32.Debug.Control-2.idtx:6 en_US.Win32.Release.Control-2.idtx:6
|
||||||
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
#: en_US.x64.Debug.Control-2.idtx:6 en_US.x64.Release.Control-2.idtx:6
|
||||||
@ -3504,9 +3503,9 @@ msgstr ""
|
|||||||
"Roman;}Times New Roman CE;}}{\\colortbl "
|
"Roman;}Times New Roman CE;}}{\\colortbl "
|
||||||
";\\red0\\green0\\blue255;}{\\*\\generator Msftedit "
|
";\\red0\\green0\\blue255;}{\\*\\generator Msftedit "
|
||||||
"5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 "
|
"5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 "
|
||||||
"Besedilo je bilo pripravljeno z vna\\'9aalnim sistemom ZRCola "
|
"Besedilo je bilo pripravljeno z vna\\'9aalnim sistemom ZRCola (http://zrcola"
|
||||||
"(http://zrcola.zrc-sazu.si), ki ga je na Znanstvenoraziskovalnem centru SAZU"
|
".zrc-sazu.si), ki ga je na Znanstvenoraziskovalnem centru SAZU v Ljubljani "
|
||||||
" v Ljubljani (http://www.zrc-sazu.si) razvil Peter Weiss.\\i0\\f1\\par}"
|
"(http://www.zrc-sazu.si) razvil Peter Weiss.\\i0\\f1\\par}"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:9 en_US.Win32.Release.Control-2.idtx:9
|
#: en_US.Win32.Debug.Control-2.idtx:9 en_US.Win32.Release.Control-2.idtx:9
|
||||||
#: en_US.x64.Debug.Control-2.idtx:9 en_US.x64.Release.Control-2.idtx:9
|
#: en_US.x64.Debug.Control-2.idtx:9 en_US.x64.Release.Control-2.idtx:9
|
||||||
@ -3536,8 +3535,8 @@ msgstr "[DlgTitleFont]\"00 ZRCola\" v pisavo \"ZRCola\""
|
|||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
#: en_US.Win32.Debug.Control-2.idtx:14 en_US.Win32.Release.Control-2.idtx:14
|
||||||
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
#: en_US.x64.Debug.Control-2.idtx:14 en_US.x64.Release.Control-2.idtx:14
|
||||||
msgid "fontsubst.bmp"
|
msgid "binfontsubst.bmp"
|
||||||
msgstr "fontsubst.bmp"
|
msgstr "binfontsubst.bmp"
|
||||||
|
|
||||||
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
#: en_US.Win32.Debug.Control-2.idtx:15 en_US.Win32.Release.Control-2.idtx:15
|
||||||
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
#: en_US.x64.Debug.Control-2.idtx:15 en_US.x64.Release.Control-2.idtx:15
|
||||||
|
BIN
MakefileLang.mak
BIN
MakefileLang.mak
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
MakefilePlat.mak
BIN
MakefilePlat.mak
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
# ZRCola
|
# ZRCola
|
||||||
|
|
||||||
A Microsoft Windows application for composing texts using a wide range of Slavic (and general) letters from or beyond Unicode.
|
A Microsoft Windows application for composing texts using a wide range of Slavic (and general) letters from or beyond Unicode.
|
||||||
|
|
||||||
@ -56,10 +56,6 @@ Use Microsoft NMAKE to build the project. The resulting files can be found in ou
|
|||||||
|
|
||||||
The `/ls` flag can be appended to the commands above to reduce NMAKE's verbosity. You can combine multiple targets (e.g. nmake Unregister Clean). Please, see NMAKE reference for further reading.
|
The `/ls` flag can be appended to the commands above to reduce NMAKE's verbosity. You can combine multiple targets (e.g. nmake Unregister Clean). Please, see NMAKE reference for further reading.
|
||||||
|
|
||||||
## Building and installing ZRCola webservice
|
|
||||||
|
|
||||||
ZRCola is also available as a Linux web-service. See [ZRColaWS/README.md](ZRColaWS/README.md) for instructions.
|
|
||||||
|
|
||||||
## Translating ZRCola
|
## Translating ZRCola
|
||||||
Instructions how to translate ZRCola to your language can be found [here](LOCALIZATION.md).
|
Instructions how to translate ZRCola to your language can be found [here](LOCALIZATION.md).
|
||||||
|
|
||||||
|
2
Updater
2
Updater
@ -1 +1 @@
|
|||||||
Subproject commit a98ef46c5d38dec796dcb78f48240c17f743e3af
|
Subproject commit 0ba186c9846ca05a4b867ac8842ce8b7ace25d15
|
30
ZRCola.sln
30
ZRCola.sln
@ -18,8 +18,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRCola", "lib\libZRCola\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
|
||||||
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|ARM64 = Debug|ARM64
|
Debug|ARM64 = Debug|ARM64
|
||||||
@ -78,6 +82,18 @@ Global
|
|||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.Build.0 = Release|Win32
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.Build.0 = Release|Win32
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x64.ActiveCfg = Release|x64
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x64.ActiveCfg = Release|x64
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x64.Build.0 = Release|x64
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x64.Build.0 = Release|x64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.Build.0 = Release|x64
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|ARM64.Build.0 = Debug|ARM64
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.ActiveCfg = Debug|Win32
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
@ -90,6 +106,18 @@ Global
|
|||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.Build.0 = Release|Win32
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.Build.0 = Release|Win32
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.ActiveCfg = Release|x64
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.ActiveCfg = Release|x64
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.Build.0 = Release|x64
|
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.Build.0 = Release|x64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -98,7 +126,9 @@ Global
|
|||||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
{990D8CF9-4457-4DC0-AA18-4968EF434741} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
{990D8CF9-4457-4DC0-AA18-4968EF434741} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {EECB5329-0607-4D77-8BC0-48BD8C08BEF9}
|
SolutionGuid = {EECB5329-0607-4D77-8BC0-48BD8C08BEF9}
|
||||||
|
Binary file not shown.
BIN
ZRCola/ZRCola.rc
BIN
ZRCola/ZRCola.rc
Binary file not shown.
@ -108,6 +108,9 @@
|
|||||||
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
|
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
|
||||||
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
|
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
|
||||||
|
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib.vcxproj">
|
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib.vcxproj">
|
||||||
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
|
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@ -30,6 +30,7 @@
|
|||||||
#include <wx/clipbrd.h>
|
#include <wx/clipbrd.h>
|
||||||
#include <wx/dcclient.h>
|
#include <wx/dcclient.h>
|
||||||
#include <wx/ffile.h>
|
#include <wx/ffile.h>
|
||||||
|
#include <wx/fontdlg.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
#include <wx/persist.h>
|
#include <wx/persist.h>
|
||||||
#include <wx/persist/toplevel.h>
|
#include <wx/persist/toplevel.h>
|
||||||
@ -46,7 +47,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <zrcola/idrec.h>
|
#include <stdex/idrec.h>
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
#include <Msi.h>
|
#include <Msi.h>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<property name="minimum_size">150,150</property>
|
<property name="minimum_size">150,150</property>
|
||||||
<property name="name">wxZRColaFrameBase</property>
|
<property name="name">wxZRColaFrameBase</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">600,400</property>
|
<property name="size">660,450</property>
|
||||||
<property name="style">wxDEFAULT_FRAME_STYLE</property>
|
<property name="style">wxDEFAULT_FRAME_STYLE</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="title">ZRCola</property>
|
<property name="title">ZRCola</property>
|
||||||
@ -247,50 +247,18 @@
|
|||||||
<property name="name">separator4</property>
|
<property name="name">separator4</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="submenu" expanded="0">
|
<object class="wxMenuItem" expanded="0">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
<property name="label">(De)&composition</property>
|
<property name="checked">0</property>
|
||||||
<property name="name">m_menuComposition</property>
|
<property name="enabled">1</property>
|
||||||
<property name="permission">none</property>
|
<property name="help">Toggle ZRCola character (De)composition</property>
|
||||||
<object class="wxMenuItem" expanded="0">
|
<property name="id">wxID_COMPOSITION</property>
|
||||||
<property name="bitmap"></property>
|
<property name="kind">wxITEM_CHECK</property>
|
||||||
<property name="checked">0</property>
|
<property name="label">&ZRCola (De)composition</property>
|
||||||
<property name="enabled">1</property>
|
<property name="name">m_menuItemComposition</property>
|
||||||
<property name="help">No character (De)composition</property>
|
<property name="permission">protected</property>
|
||||||
<property name="id">wxID_COMPOSITION_NONE</property>
|
<property name="shortcut"></property>
|
||||||
<property name="kind">wxITEM_RADIO</property>
|
<property name="unchecked_bitmap"></property>
|
||||||
<property name="label">&None</property>
|
|
||||||
<property name="name">m_menuItemCompositionNone</property>
|
|
||||||
<property name="permission">protected</property>
|
|
||||||
<property name="shortcut"></property>
|
|
||||||
<property name="unchecked_bitmap"></property>
|
|
||||||
</object>
|
|
||||||
<object class="wxMenuItem" expanded="0">
|
|
||||||
<property name="bitmap"></property>
|
|
||||||
<property name="checked">0</property>
|
|
||||||
<property name="enabled">1</property>
|
|
||||||
<property name="help">ZRCola character (De)composition</property>
|
|
||||||
<property name="id">wxID_COMPOSITION_ZRCOLA</property>
|
|
||||||
<property name="kind">wxITEM_RADIO</property>
|
|
||||||
<property name="label">&ZRCola</property>
|
|
||||||
<property name="name">m_menuItemCompositionZRCola</property>
|
|
||||||
<property name="permission">protected</property>
|
|
||||||
<property name="shortcut"></property>
|
|
||||||
<property name="unchecked_bitmap"></property>
|
|
||||||
</object>
|
|
||||||
<object class="wxMenuItem" expanded="0">
|
|
||||||
<property name="bitmap"></property>
|
|
||||||
<property name="checked">0</property>
|
|
||||||
<property name="enabled">1</property>
|
|
||||||
<property name="help">Unicode character (De)composition</property>
|
|
||||||
<property name="id">wxID_COMPOSITION_UNICODE</property>
|
|
||||||
<property name="kind">wxITEM_RADIO</property>
|
|
||||||
<property name="label">&Unicode</property>
|
|
||||||
<property name="name">m_menuItemCompositionUnicode</property>
|
|
||||||
<property name="permission">protected</property>
|
|
||||||
<property name="shortcut"></property>
|
|
||||||
<property name="unchecked_bitmap"></property>
|
|
||||||
</object>
|
|
||||||
</object>
|
</object>
|
||||||
<object class="submenu" expanded="0">
|
<object class="submenu" expanded="0">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
@ -302,6 +270,19 @@
|
|||||||
<property name="name">separator5</property>
|
<property name="name">separator5</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="wxMenuItem" expanded="0">
|
||||||
|
<property name="bitmap"></property>
|
||||||
|
<property name="checked">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="help">Select font for composed text</property>
|
||||||
|
<property name="id">wxID_FONT_DESTINATION</property>
|
||||||
|
<property name="kind">wxITEM_NORMAL</property>
|
||||||
|
<property name="label">Composed Text &Font...</property>
|
||||||
|
<property name="name">m_menuItemFontDestination</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<property name="shortcut"></property>
|
||||||
|
<property name="unchecked_bitmap"></property>
|
||||||
|
</object>
|
||||||
<object class="wxMenuItem" expanded="0">
|
<object class="wxMenuItem" expanded="0">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
<property name="checked">0</property>
|
<property name="checked">0</property>
|
||||||
@ -363,6 +344,19 @@
|
|||||||
<property name="shortcut"></property>
|
<property name="shortcut"></property>
|
||||||
<property name="unchecked_bitmap"></property>
|
<property name="unchecked_bitmap"></property>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="wxMenuItem" expanded="0">
|
||||||
|
<property name="bitmap"></property>
|
||||||
|
<property name="checked">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="help">Toggle composed text toolbar</property>
|
||||||
|
<property name="id">wxID_TOOLBAR_DESTINATION</property>
|
||||||
|
<property name="kind">wxITEM_CHECK</property>
|
||||||
|
<property name="label">Composed &Text Toolbar</property>
|
||||||
|
<property name="name">m_menuItemToolbarDestination</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<property name="shortcut"></property>
|
||||||
|
<property name="unchecked_bitmap"></property>
|
||||||
|
</object>
|
||||||
<object class="separator" expanded="0">
|
<object class="separator" expanded="0">
|
||||||
<property name="name">separator</property>
|
<property name="name">separator</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
@ -648,65 +642,16 @@
|
|||||||
<object class="toolSeparator" expanded="0">
|
<object class="toolSeparator" expanded="0">
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="wxChoice" expanded="0">
|
<object class="tool" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="bitmap">Load From Icon Resource; composition.ico; [24; 24]</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="context_menu">0</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="id">wxID_COMPOSITION</property>
|
||||||
<property name="TopDockable">1</property>
|
<property name="kind">wxITEM_CHECK</property>
|
||||||
<property name="aui_layer"></property>
|
<property name="label">ZRCola (De)composition</property>
|
||||||
<property name="aui_name"></property>
|
|
||||||
<property name="aui_position"></property>
|
|
||||||
<property name="aui_row"></property>
|
|
||||||
<property name="best_size"></property>
|
|
||||||
<property name="bg"></property>
|
|
||||||
<property name="caption"></property>
|
|
||||||
<property name="caption_visible">1</property>
|
|
||||||
<property name="center_pane">0</property>
|
|
||||||
<property name="choices">"None" "ZRCola" "Unicode"</property>
|
|
||||||
<property name="close_button">1</property>
|
|
||||||
<property name="context_help"></property>
|
|
||||||
<property name="context_menu">1</property>
|
|
||||||
<property name="default_pane">0</property>
|
|
||||||
<property name="dock">Dock</property>
|
|
||||||
<property name="dock_fixed">0</property>
|
|
||||||
<property name="docking">Left</property>
|
|
||||||
<property name="enabled">1</property>
|
|
||||||
<property name="fg"></property>
|
|
||||||
<property name="floatable">1</property>
|
|
||||||
<property name="font"></property>
|
|
||||||
<property name="gripper">0</property>
|
|
||||||
<property name="hidden">0</property>
|
|
||||||
<property name="id">wxID_ANY</property>
|
|
||||||
<property name="max_size"></property>
|
|
||||||
<property name="maximize_button">0</property>
|
|
||||||
<property name="maximum_size"></property>
|
|
||||||
<property name="min_size"></property>
|
|
||||||
<property name="minimize_button">0</property>
|
|
||||||
<property name="minimum_size">-1,-1</property>
|
|
||||||
<property name="moveable">1</property>
|
|
||||||
<property name="name">m_toolComposition</property>
|
<property name="name">m_toolComposition</property>
|
||||||
<property name="pane_border">1</property>
|
|
||||||
<property name="pane_position"></property>
|
|
||||||
<property name="pane_size"></property>
|
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<property name="pin_button">1</property>
|
<property name="statusbar">Toggle ZRCola character (De)composition</property>
|
||||||
<property name="pos"></property>
|
<property name="tooltip">ZRCola (De)composition</property>
|
||||||
<property name="resize">Resizable</property>
|
|
||||||
<property name="selection">0</property>
|
|
||||||
<property name="show">1</property>
|
|
||||||
<property name="size">120,-1</property>
|
|
||||||
<property name="style"></property>
|
|
||||||
<property name="subclass"></property>
|
|
||||||
<property name="toolbar_pane">0</property>
|
|
||||||
<property name="tooltip"></property>
|
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
|
||||||
<property name="window_name"></property>
|
|
||||||
<property name="window_style"></property>
|
|
||||||
<event name="OnChoice">OnCompositionChoice</event>
|
|
||||||
</object>
|
</object>
|
||||||
<object class="wxChoice" expanded="0">
|
<object class="wxChoice" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -754,7 +699,7 @@
|
|||||||
<property name="resize">Resizable</property>
|
<property name="resize">Resizable</property>
|
||||||
<property name="selection">0</property>
|
<property name="selection">0</property>
|
||||||
<property name="show">1</property>
|
<property name="show">1</property>
|
||||||
<property name="size">180,-1</property>
|
<property name="size">240,-1</property>
|
||||||
<property name="style"></property>
|
<property name="style"></property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
@ -768,8 +713,125 @@
|
|||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
<event name="OnChoice">OnTranslationSeqChoice</event>
|
<event name="OnChoice">OnTranslationSeqChoice</event>
|
||||||
</object>
|
</object>
|
||||||
<object class="toolSeparator" expanded="0">
|
</object>
|
||||||
|
<object class="wxAuiToolBar" expanded="0">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">0</property>
|
||||||
|
<property name="RightDockable">0</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer">1</property>
|
||||||
|
<property name="aui_name">toolbarDestination</property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row">0</property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="bitmapsize">-1,-1</property>
|
||||||
|
<property name="caption">Compose</property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Top</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label_visible">0</property>
|
||||||
|
<property name="margins"></property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size">-1,-1</property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_toolbarDestination</property>
|
||||||
|
<property name="packing">1</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position">-1,-1</property>
|
||||||
|
<property name="pane_size">-1,-1</property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="separation">5</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style">wxAUI_TB_HORZ_LAYOUT</property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_label"></property>
|
||||||
|
<property name="toolbar_pane">1</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="use_explicit_ids">0</property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<object class="wxFontPickerCtrl" expanded="0">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_FONT_DESTINATION</property>
|
||||||
|
<property name="max_point_size">100</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size">180,-1</property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size">120,-1</property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_fontpickerDestination</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style">wxFNTP_FONTDESC_AS_LABEL</property>
|
||||||
|
<property name="subclass">; ; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="validator_data_type"></property>
|
||||||
|
<property name="validator_style">wxFILTER_NONE</property>
|
||||||
|
<property name="validator_type">wxDefaultValidator</property>
|
||||||
|
<property name="validator_variable"></property>
|
||||||
|
<property name="value">ZRCola,90,90,20,70,0</property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnFontChanged">OnFontDestinationChanged</event>
|
||||||
</object>
|
</object>
|
||||||
<object class="tool" expanded="0">
|
<object class="tool" expanded="0">
|
||||||
<property name="bitmap">Load From Icon Resource; warn_pua.ico; [24; 24]</property>
|
<property name="bitmap">Load From Icon Resource; warn_pua.ico; [24; 24]</property>
|
||||||
|
@ -133,19 +133,8 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_menuEdit->AppendSeparator();
|
m_menuEdit->AppendSeparator();
|
||||||
|
|
||||||
wxMenu* m_menuComposition;
|
m_menuItemComposition = new wxMenuItem( m_menuEdit, wxID_COMPOSITION, wxString( _("&ZRCola (De)composition") ) , _("Toggle ZRCola character (De)composition"), wxITEM_CHECK );
|
||||||
m_menuComposition = new wxMenu();
|
m_menuEdit->Append( m_menuItemComposition );
|
||||||
wxMenuItem* m_menuCompositionItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("(De)&composition"), wxEmptyString, wxITEM_NORMAL, m_menuComposition );
|
|
||||||
m_menuItemCompositionNone = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_NONE, wxString( _("&None") ) , _("No character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionNone );
|
|
||||||
|
|
||||||
m_menuItemCompositionZRCola = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_ZRCOLA, wxString( _("&ZRCola") ) , _("ZRCola character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionZRCola );
|
|
||||||
|
|
||||||
m_menuItemCompositionUnicode = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_UNICODE, wxString( _("&Unicode") ) , _("Unicode character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionUnicode );
|
|
||||||
|
|
||||||
m_menuEdit->Append( m_menuCompositionItem );
|
|
||||||
|
|
||||||
m_menuTranslationSeq = new wxMenu();
|
m_menuTranslationSeq = new wxMenu();
|
||||||
wxMenuItem* m_menuTranslationSeqItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("Tra&nslation"), wxEmptyString, wxITEM_NORMAL, m_menuTranslationSeq );
|
wxMenuItem* m_menuTranslationSeqItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("Tra&nslation"), wxEmptyString, wxITEM_NORMAL, m_menuTranslationSeq );
|
||||||
@ -153,6 +142,10 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_menuEdit->AppendSeparator();
|
m_menuEdit->AppendSeparator();
|
||||||
|
|
||||||
|
wxMenuItem* m_menuItemFontDestination;
|
||||||
|
m_menuItemFontDestination = new wxMenuItem( m_menuEdit, wxID_FONT_DESTINATION, wxString( _("Composed Text &Font...") ) , _("Select font for composed text"), wxITEM_NORMAL );
|
||||||
|
m_menuEdit->Append( m_menuItemFontDestination );
|
||||||
|
|
||||||
m_menuItemWarnPUA = new wxMenuItem( m_menuEdit, wxID_WARN_PUA, wxString( _("&PUA Warning") ) , _("Highlight Private Use Area Characters"), wxITEM_CHECK );
|
m_menuItemWarnPUA = new wxMenuItem( m_menuEdit, wxID_WARN_PUA, wxString( _("&PUA Warning") ) , _("Highlight Private Use Area Characters"), wxITEM_CHECK );
|
||||||
m_menuEdit->Append( m_menuItemWarnPUA );
|
m_menuEdit->Append( m_menuItemWarnPUA );
|
||||||
|
|
||||||
@ -173,6 +166,10 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_TRANSLATE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
|
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_TRANSLATE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
|
||||||
m_menuView->Append( m_menuItemToolbarCompose );
|
m_menuView->Append( m_menuItemToolbarCompose );
|
||||||
|
|
||||||
|
wxMenuItem* m_menuItemToolbarDestination;
|
||||||
|
m_menuItemToolbarDestination = new wxMenuItem( m_menuView, wxID_TOOLBAR_DESTINATION, wxString( _("Composed &Text Toolbar") ) , _("Toggle composed text toolbar"), wxITEM_CHECK );
|
||||||
|
m_menuView->Append( m_menuItemToolbarDestination );
|
||||||
|
|
||||||
m_menuView->AppendSeparator();
|
m_menuView->AppendSeparator();
|
||||||
|
|
||||||
wxMenuItem* m_menuItemPanelChrGrps;
|
wxMenuItem* m_menuItemPanelChrGrps;
|
||||||
@ -229,22 +226,27 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_toolbarTranslate->AddSeparator();
|
m_toolbarTranslate->AddSeparator();
|
||||||
|
|
||||||
wxString m_toolCompositionChoices[] = { _("No (De)composition"), _("ZRCola"), _("Unicode") };
|
m_toolComposition = m_toolbarTranslate->AddTool( wxID_COMPOSITION, _("ZRCola (De)composition"), wxIcon( wxT("composition.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_CHECK, _("ZRCola (De)composition"), _("Toggle ZRCola character (De)composition"), NULL );
|
||||||
int m_toolCompositionNChoices = sizeof( m_toolCompositionChoices ) / sizeof( wxString );
|
|
||||||
m_toolComposition = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, wxSize( 120,-1 ), m_toolCompositionNChoices, m_toolCompositionChoices, 0 );
|
|
||||||
m_toolComposition->SetSelection( 0 );
|
|
||||||
m_toolbarTranslate->AddControl( m_toolComposition );
|
|
||||||
wxArrayString m_toolTranslationSeqChoices;
|
wxArrayString m_toolTranslationSeqChoices;
|
||||||
m_toolTranslationSeq = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, wxSize( 180,-1 ), m_toolTranslationSeqChoices, 0 );
|
m_toolTranslationSeq = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, wxSize( 240,-1 ), m_toolTranslationSeqChoices, 0 );
|
||||||
m_toolTranslationSeq->SetSelection( 0 );
|
m_toolTranslationSeq->SetSelection( 0 );
|
||||||
m_toolbarTranslate->AddControl( m_toolTranslationSeq );
|
m_toolbarTranslate->AddControl( m_toolTranslationSeq );
|
||||||
m_toolbarTranslate->AddSeparator();
|
|
||||||
|
|
||||||
m_toolWarnPUA = m_toolbarTranslate->AddTool( wxID_WARN_PUA, _("PUA Warning"), wxIcon( wxT("warn_pua.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_CHECK, _("Highlight Private Use Area Characters"), _("Highlight Private Use Area Characters"), NULL );
|
|
||||||
|
|
||||||
m_toolbarTranslate->Realize();
|
m_toolbarTranslate->Realize();
|
||||||
m_mgr.AddPane( m_toolbarTranslate, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
m_mgr.AddPane( m_toolbarTranslate, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
||||||
|
|
||||||
|
m_toolbarDestination = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
|
||||||
|
m_fontpickerDestination = new wxFontPickerCtrl( m_toolbarDestination, wxID_FONT_DESTINATION, wxFont( 20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola") ), wxDefaultPosition, wxDefaultSize, wxFNTP_FONTDESC_AS_LABEL );
|
||||||
|
m_fontpickerDestination->SetMaxPointSize( 100 );
|
||||||
|
m_fontpickerDestination->SetMinSize( wxSize( 120,-1 ) );
|
||||||
|
m_fontpickerDestination->SetMaxSize( wxSize( 180,-1 ) );
|
||||||
|
|
||||||
|
m_toolbarDestination->AddControl( m_fontpickerDestination );
|
||||||
|
m_toolWarnPUA = m_toolbarDestination->AddTool( wxID_WARN_PUA, _("PUA Warning"), wxIcon( wxT("warn_pua.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_CHECK, _("Highlight Private Use Area Characters"), _("Highlight Private Use Area Characters"), NULL );
|
||||||
|
|
||||||
|
m_toolbarDestination->Realize();
|
||||||
|
m_mgr.AddPane( m_toolbarDestination, wxAuiPaneInfo().Name( wxT("toolbarDestination") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
||||||
|
|
||||||
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
|
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
|
||||||
|
|
||||||
m_mgr.AddPane( m_panelChrCat, wxAuiPaneInfo() .Name( wxT("panelChrGrp") ).Left() .Caption( _("Character Catalog") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).Row( 1 ).BestSize( wxSize( 150,200 ) ).MinSize( wxSize( 100,100 ) ).Layer( 1 ) );
|
m_mgr.AddPane( m_panelChrCat, wxAuiPaneInfo() .Name( wxT("panelChrGrp") ).Left() .Caption( _("Character Catalog") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).Row( 1 ).BestSize( wxSize( 150,200 ) ).MinSize( wxSize( 100,100 ) ).Layer( 1 ) );
|
||||||
@ -262,8 +264,8 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
||||||
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
||||||
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
||||||
m_toolComposition->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnCompositionChoice ), NULL, this );
|
|
||||||
m_toolTranslationSeq->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
m_toolTranslationSeq->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
||||||
|
m_fontpickerDestination->Connect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( wxZRColaFrameBase::OnFontDestinationChanged ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxZRColaFrameBase::~wxZRColaFrameBase()
|
wxZRColaFrameBase::~wxZRColaFrameBase()
|
||||||
@ -272,8 +274,8 @@ wxZRColaFrameBase::~wxZRColaFrameBase()
|
|||||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
||||||
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
||||||
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
||||||
m_toolComposition->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnCompositionChoice ), NULL, this );
|
|
||||||
m_toolTranslationSeq->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
m_toolTranslationSeq->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
||||||
|
m_fontpickerDestination->Disconnect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( wxZRColaFrameBase::OnFontDestinationChanged ), NULL, this );
|
||||||
|
|
||||||
m_mgr.UnInit();
|
m_mgr.UnInit();
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ class wxZRColaCharGrid;
|
|||||||
#include <wx/aui/aui.h>
|
#include <wx/aui/aui.h>
|
||||||
#include <wx/aui/auibar.h>
|
#include <wx/aui/auibar.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
|
#include <wx/fontpicker.h>
|
||||||
class wxZRColaCharacterCatalogPanel;
|
class wxZRColaCharacterCatalogPanel;
|
||||||
class wxZRColaComposerPanel;
|
class wxZRColaComposerPanel;
|
||||||
#include <wx/statusbr.h>
|
#include <wx/statusbr.h>
|
||||||
@ -67,13 +68,13 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxID_SEND_SOURCE,
|
wxID_SEND_SOURCE,
|
||||||
wxID_COPY_SOURCE_AND_RETURN,
|
wxID_COPY_SOURCE_AND_RETURN,
|
||||||
wxID_SEND_ABORT,
|
wxID_SEND_ABORT,
|
||||||
wxID_COMPOSITION_NONE,
|
wxID_COMPOSITION,
|
||||||
wxID_COMPOSITION_ZRCOLA,
|
wxID_FONT_DESTINATION,
|
||||||
wxID_COMPOSITION_UNICODE,
|
|
||||||
wxID_WARN_PUA,
|
wxID_WARN_PUA,
|
||||||
wxID_SETTINGS,
|
wxID_SETTINGS,
|
||||||
wxID_TOOLBAR_EDIT,
|
wxID_TOOLBAR_EDIT,
|
||||||
wxID_TOOLBAR_TRANSLATE,
|
wxID_TOOLBAR_TRANSLATE,
|
||||||
|
wxID_TOOLBAR_DESTINATION,
|
||||||
wxID_PANEL_CHRGRPS,
|
wxID_PANEL_CHRGRPS,
|
||||||
wxID_HELP_INSTRUCTIONS,
|
wxID_HELP_INSTRUCTIONS,
|
||||||
wxID_HELP_SHORTCUTS,
|
wxID_HELP_SHORTCUTS,
|
||||||
@ -84,9 +85,7 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxMenuBar* m_menubar;
|
wxMenuBar* m_menubar;
|
||||||
wxMenu* m_menuProgram;
|
wxMenu* m_menuProgram;
|
||||||
wxMenu* m_menuEdit;
|
wxMenu* m_menuEdit;
|
||||||
wxMenuItem* m_menuItemCompositionNone;
|
wxMenuItem* m_menuItemComposition;
|
||||||
wxMenuItem* m_menuItemCompositionZRCola;
|
|
||||||
wxMenuItem* m_menuItemCompositionUnicode;
|
|
||||||
wxMenu* m_menuTranslationSeq;
|
wxMenu* m_menuTranslationSeq;
|
||||||
wxMenuItem* m_menuItemWarnPUA;
|
wxMenuItem* m_menuItemWarnPUA;
|
||||||
wxMenu* m_menuView;
|
wxMenu* m_menuView;
|
||||||
@ -99,8 +98,10 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxAuiToolBarItem* m_toolCharSelect;
|
wxAuiToolBarItem* m_toolCharSelect;
|
||||||
wxAuiToolBarItem* m_toolSendDestination;
|
wxAuiToolBarItem* m_toolSendDestination;
|
||||||
wxAuiToolBarItem* m_toolSendSource;
|
wxAuiToolBarItem* m_toolSendSource;
|
||||||
wxChoice* m_toolComposition;
|
wxAuiToolBarItem* m_toolComposition;
|
||||||
wxChoice* m_toolTranslationSeq;
|
wxChoice* m_toolTranslationSeq;
|
||||||
|
wxAuiToolBar* m_toolbarDestination;
|
||||||
|
wxFontPickerCtrl* m_fontpickerDestination;
|
||||||
wxAuiToolBarItem* m_toolWarnPUA;
|
wxAuiToolBarItem* m_toolWarnPUA;
|
||||||
wxZRColaCharacterCatalogPanel* m_panelChrCat;
|
wxZRColaCharacterCatalogPanel* m_panelChrCat;
|
||||||
wxStatusBar* m_statusBar;
|
wxStatusBar* m_statusBar;
|
||||||
@ -109,14 +110,14 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
||||||
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
|
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
|
||||||
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCompositionChoice( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
virtual void OnFontDestinationChanged( wxFontPickerEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxZRColaComposerPanel* m_panel;
|
wxZRColaComposerPanel* m_panel;
|
||||||
|
|
||||||
wxZRColaFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 600,400 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("ZRCola") );
|
wxZRColaFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 660,450 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("ZRCola") );
|
||||||
wxAuiManager m_mgr;
|
wxAuiManager m_mgr;
|
||||||
|
|
||||||
~wxZRColaFrameBase();
|
~wxZRColaFrameBase();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -82,7 +82,7 @@ bool ZRColaApp::OnInit()
|
|||||||
ZRCola::recordid_t id;
|
ZRCola::recordid_t id;
|
||||||
if (!stdex::idrec::read_id(dat, id, size)) break;
|
if (!stdex::idrec::read_id(dat, id, size)) break;
|
||||||
|
|
||||||
if (id == ZRCola::translation_rec::id()) {
|
if (id == ZRCola::translation_rec::id) {
|
||||||
dat >> ZRCola::translation_rec(m_t_db);
|
dat >> ZRCola::translation_rec(m_t_db);
|
||||||
if (dat.good()) {
|
if (dat.good()) {
|
||||||
has_translation_data = true;
|
has_translation_data = true;
|
||||||
@ -90,66 +90,60 @@ bool ZRColaApp::OnInit()
|
|||||||
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
|
||||||
m_t_db.clear();
|
m_t_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::transet_rec::id()) {
|
} else if (id == ZRCola::transet_rec::id) {
|
||||||
dat >> ZRCola::transet_rec(m_ts_db);
|
dat >> ZRCola::transet_rec(m_ts_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading translation set data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading translation set data from ZRCola.zrcdb."));
|
||||||
m_ts_db.clear();
|
m_ts_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::transeq_rec::id()) {
|
} else if (id == ZRCola::transeq_rec::id) {
|
||||||
dat >> ZRCola::transeq_rec(m_tsq_db);
|
dat >> ZRCola::transeq_rec(m_tsq_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading translation sequence data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading translation sequence data from ZRCola.zrcdb."));
|
||||||
m_tsq_db.clear();
|
m_tsq_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::langchar_rec::id()) {
|
} else if (id == ZRCola::langchar_rec::id) {
|
||||||
dat >> ZRCola::langchar_rec(m_lc_db);
|
dat >> ZRCola::langchar_rec(m_lc_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
|
||||||
m_lc_db.clear();
|
m_lc_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::language_rec::id()) {
|
} else if (id == ZRCola::language_rec::id) {
|
||||||
dat >> ZRCola::language_rec(m_lang_db);
|
dat >> ZRCola::language_rec(m_lang_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
|
||||||
m_lang_db.clear();
|
m_lang_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::keyseq_rec::id()) {
|
} else if (id == ZRCola::keyseq_rec::id) {
|
||||||
dat >> ZRCola::keyseq_rec(m_ks_db);
|
dat >> ZRCola::keyseq_rec(m_ks_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading key sequences data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading key sequences data from ZRCola.zrcdb."));
|
||||||
m_ks_db.clear();
|
m_ks_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::character_rec::id()) {
|
} else if (id == ZRCola::character_rec::id) {
|
||||||
dat >> ZRCola::character_rec(m_chr_db);
|
dat >> ZRCola::character_rec(m_chr_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading character data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading character data from ZRCola.zrcdb."));
|
||||||
m_chr_db.clear();
|
m_chr_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::chrcat_rec::id()) {
|
} else if (id == ZRCola::chrcat_rec::id) {
|
||||||
dat >> ZRCola::chrcat_rec(m_cc_db);
|
dat >> ZRCola::chrcat_rec(m_cc_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading character category data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading character category data from ZRCola.zrcdb."));
|
||||||
m_cc_db.clear();
|
m_cc_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::chrtag_rec::id()) {
|
} else if (id == ZRCola::chrtag_rec::id) {
|
||||||
dat >> ZRCola::chrtag_rec(m_ct_db);
|
dat >> ZRCola::chrtag_rec(m_ct_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading character tag data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading character tag data from ZRCola.zrcdb."));
|
||||||
m_ct_db.clear();
|
m_ct_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::tagname_rec::id()) {
|
} else if (id == ZRCola::tagname_rec::id) {
|
||||||
dat >> ZRCola::tagname_rec(m_tn_db);
|
dat >> ZRCola::tagname_rec(m_tn_db);
|
||||||
if (!dat.good()) {
|
if (!dat.good()) {
|
||||||
wxFAIL_MSG(wxT("Error reading tag name data from ZRCola.zrcdb."));
|
wxFAIL_MSG(wxT("Error reading tag name data from ZRCola.zrcdb."));
|
||||||
m_tn_db.clear();
|
m_tn_db.clear();
|
||||||
}
|
}
|
||||||
} else if (id == ZRCola::highlight_rec::id()) {
|
|
||||||
dat >> ZRCola::highlight_rec(m_h_db);
|
|
||||||
if (!dat.good()) {
|
|
||||||
wxFAIL_MSG(wxT("Error reading highlight data from ZRCola.zrcdb."));
|
|
||||||
m_h_db.clear();
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
stdex::idrec::ignore<ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
|
stdex::idrec::ignore<ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -21,7 +21,6 @@ class ZRColaApp;
|
|||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#include <zrcola/character.h>
|
#include <zrcola/character.h>
|
||||||
#include <zrcola/highlight.h>
|
|
||||||
#include <zrcola/language.h>
|
#include <zrcola/language.h>
|
||||||
#include <zrcola/translate.h>
|
#include <zrcola/translate.h>
|
||||||
#include <zrcola/tag.h>
|
#include <zrcola/tag.h>
|
||||||
@ -73,7 +72,6 @@ public:
|
|||||||
ZRCola::chrcat_db m_cc_db; ///< Characted category database
|
ZRCola::chrcat_db m_cc_db; ///< Characted category database
|
||||||
ZRCola::chrtag_db m_ct_db; ///< Character tag database
|
ZRCola::chrtag_db m_ct_db; ///< Character tag database
|
||||||
ZRCola::tagname_db m_tn_db; ///< Tag name database
|
ZRCola::tagname_db m_tn_db; ///< Tag name database
|
||||||
ZRCola::highlight_db m_h_db; ///< Highlight database
|
|
||||||
|
|
||||||
wxZRColaFrame *m_mainWnd; ///< Main window
|
wxZRColaFrame *m_mainWnd; ///< Main window
|
||||||
|
|
||||||
@ -82,7 +80,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
winstd::event m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
|
winstd::win_handle<NULL> m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -148,11 +148,11 @@ void wxZRColaCharacterCatalogPanel::Update()
|
|||||||
wxArrayShort(reinterpret_cast<const short*>(cg.chrshow()), reinterpret_cast<const short*>(cg.chrshow_end())));
|
wxArrayShort(reinterpret_cast<const short*>(cg.chrshow()), reinterpret_cast<const short*>(cg.chrshow_end())));
|
||||||
} else {
|
} else {
|
||||||
// Select frequently used characters only.
|
// Select frequently used characters only.
|
||||||
const auto *src = cg.chrlst();
|
const wchar_t *src = cg.chrlst();
|
||||||
const uint16_t *shown = cg.chrshow();
|
const unsigned __int16 *shown = cg.chrshow();
|
||||||
wxArrayString chars;
|
wxArrayString chars;
|
||||||
for (size_t i = 0, i_end = cg.chrlst_len(), j = 0; i < i_end; j++) {
|
for (size_t i = 0, i_end = cg.chrlst_len(), j = 0; i < i_end; j++) {
|
||||||
for (uint16_t k = 0, mask = shown[j]; k < 16 && i < i_end; k++, mask >>= 1) {
|
for (unsigned __int16 k = 0, mask = shown[j]; k < 16 && i < i_end; k++, mask >>= 1) {
|
||||||
size_t len = wcsnlen(src + i, i_end - i);
|
size_t len = wcsnlen(src + i, i_end - i);
|
||||||
if (mask & 1)
|
if (mask & 1)
|
||||||
chars.Add(wxString(src + i, len));
|
chars.Add(wxString(src + i, len));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -110,7 +110,7 @@ wxString wxZRColaCharGrid::GetToolTipText(int idx)
|
|||||||
const auto &chr = m_chars[idx];
|
const auto &chr = m_chars[idx];
|
||||||
|
|
||||||
// See if this character has a key sequence registered.
|
// See if this character has a key sequence registered.
|
||||||
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::char_t)*chr.length()]);
|
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*chr.length()]);
|
||||||
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, chr.data(), chr.length());
|
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, chr.data(), chr.length());
|
||||||
ZRCola::keyseq_db::indexKey::size_type start;
|
ZRCola::keyseq_db::indexKey::size_type start;
|
||||||
if (app->m_ks_db.idxChr.find(*ks, start)) {
|
if (app->m_ks_db.idxChr.find(*ks, start)) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -13,7 +13,7 @@
|
|||||||
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUTF16CharValidator, wxValidator);
|
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUTF16CharValidator, wxValidator);
|
||||||
|
|
||||||
|
|
||||||
wxZRColaUTF16CharValidator::wxZRColaUTF16CharValidator(ZRCola::char_t *val) :
|
wxZRColaUTF16CharValidator::wxZRColaUTF16CharValidator(wchar_t *val) :
|
||||||
m_val(val),
|
m_val(val),
|
||||||
wxValidator()
|
wxValidator()
|
||||||
{
|
{
|
||||||
@ -58,11 +58,11 @@ bool wxZRColaUTF16CharValidator::TransferFromWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, ZRCola::char_t *val_out)
|
bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out)
|
||||||
{
|
{
|
||||||
const wxStringCharType *buf = val_in;
|
const wxStringCharType *buf = val_in;
|
||||||
|
|
||||||
ZRCola::char_t chr = 0;
|
wchar_t chr = 0;
|
||||||
for (size_t i = i_start;;) {
|
for (size_t i = i_start;;) {
|
||||||
if (i >= i_end) {
|
if (i >= i_end) {
|
||||||
// End of Unicode found.
|
// End of Unicode found.
|
||||||
@ -156,7 +156,7 @@ bool wxZRColaUnicodeDumpValidator::Parse(const wxString &val_in, size_t i_start,
|
|||||||
wxString str;
|
wxString str;
|
||||||
for (size_t i = i_start;;) {
|
for (size_t i = i_start;;) {
|
||||||
const wxStringCharType *buf_next;
|
const wxStringCharType *buf_next;
|
||||||
ZRCola::char_t chr;
|
wchar_t chr;
|
||||||
if ((buf_next = wmemchr(buf + i, L'+', i_end - i)) != NULL) {
|
if ((buf_next = wmemchr(buf + i, L'+', i_end - i)) != NULL) {
|
||||||
// Unicode dump separator found.
|
// Unicode dump separator found.
|
||||||
if (!wxZRColaUTF16CharValidator::Parse(val_in, i, buf_next - buf, ctrl, parent, &chr))
|
if (!wxZRColaUTF16CharValidator::Parse(val_in, i, buf_next - buf, ctrl, parent, &chr))
|
||||||
@ -242,7 +242,7 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
|||||||
|
|
||||||
m_gridPreview->SetCellValue(0, 0, m_char);
|
m_gridPreview->SetCellValue(0, 0, m_char);
|
||||||
|
|
||||||
std::unique_ptr<ZRCola::character_db::character> ch((ZRCola::character_db::character*)new char[sizeof(ZRCola::character_db::character) + sizeof(ZRCola::char_t)*m_char.length()]);
|
std::unique_ptr<ZRCola::character_db::character> ch((ZRCola::character_db::character*)new char[sizeof(ZRCola::character_db::character) + sizeof(wchar_t)*m_char.length()]);
|
||||||
ch->ZRCola::character_db::character::character(m_char.data(), m_char.length());
|
ch->ZRCola::character_db::character::character(m_char.data(), m_char.length());
|
||||||
ZRCola::character_db::indexChr::size_type ch_start;
|
ZRCola::character_db::indexChr::size_type ch_start;
|
||||||
if (app->m_chr_db.idxChr.find(*ch, ch_start)) {
|
if (app->m_chr_db.idxChr.find(*ch, ch_start)) {
|
||||||
@ -251,7 +251,7 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
|||||||
m_description->SetValue(wxString(chr.desc(), chr.desc_len()));
|
m_description->SetValue(wxString(chr.desc(), chr.desc_len()));
|
||||||
{
|
{
|
||||||
// See if this character has a key sequence registered.
|
// See if this character has a key sequence registered.
|
||||||
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::char_t)*m_char.length()]);
|
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*m_char.length()]);
|
||||||
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, m_char.data(), m_char.length());
|
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, m_char.data(), m_char.length());
|
||||||
ZRCola::keyseq_db::indexKey::size_type ks_start;
|
ZRCola::keyseq_db::indexKey::size_type ks_start;
|
||||||
if (app->m_ks_db.idxChr.find(*ks, ks_start)) {
|
if (app->m_ks_db.idxChr.find(*ks, ks_start)) {
|
||||||
@ -284,7 +284,7 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
|||||||
|
|
||||||
// Find character tags.
|
// Find character tags.
|
||||||
std::list<std::wstring> tag_names;
|
std::list<std::wstring> tag_names;
|
||||||
std::unique_ptr<ZRCola::chrtag_db::chrtag> ct((ZRCola::chrtag_db::chrtag*)new char[sizeof(ZRCola::chrtag_db::chrtag) + sizeof(ZRCola::char_t)*m_char.length()]);
|
std::unique_ptr<ZRCola::chrtag_db::chrtag> ct((ZRCola::chrtag_db::chrtag*)new char[sizeof(ZRCola::chrtag_db::chrtag) + sizeof(wchar_t)*m_char.length()]);
|
||||||
ct->ZRCola::chrtag_db::chrtag::chrtag(m_char.data(), m_char.length());
|
ct->ZRCola::chrtag_db::chrtag::chrtag(m_char.data(), m_char.length());
|
||||||
ZRCola::chrtag_db::indexChr::size_type ct_start, ct_end;
|
ZRCola::chrtag_db::indexChr::size_type ct_start, ct_end;
|
||||||
if (app->m_ct_db.idxChr.find(*ct, ct_start, ct_end)) {
|
if (app->m_ct_db.idxChr.find(*ct, ct_start, ct_end)) {
|
||||||
@ -301,7 +301,7 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
|||||||
// Add name to the list.
|
// Add name to the list.
|
||||||
tag_names.push_back(std::wstring(tn.name(), tn.name_end()));
|
tag_names.push_back(std::wstring(tn.name(), tn.name_end()));
|
||||||
break;
|
break;
|
||||||
} else if (ZRCola::tagname_db::tagname::CompareName(m_locale, name->data(), (uint16_t)name->length(), tn.name(), tn.name_len()) == 0)
|
} else if (ZRCola::tagname_db::tagname::CompareName(m_locale, name->data(), (unsigned __int16)name->length(), tn.name(), tn.name_len()) == 0)
|
||||||
// Name is already on the list.
|
// Name is already on the list.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -718,7 +718,7 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Search by tags: Get tags with given names. Then, get characters of found tags.
|
// Search by tags: Get tags with given names. Then, get characters of found tags.
|
||||||
std::map<ZRCola::tagid_t, uint16_t> hits_tag;
|
std::map<ZRCola::tagid_t, unsigned __int16> hits_tag;
|
||||||
if (!app->m_tn_db.Search(m_search.c_str(), m_parent->m_locale, hits_tag, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
if (!app->m_tn_db.Search(m_search.c_str(), m_parent->m_locale, hits_tag, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||||
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_cats, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_cats, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||||
}
|
}
|
||||||
@ -766,14 +766,14 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
|
|||||||
|
|
||||||
int __cdecl wxZRColaCharSelect::SearchThread::CompareHits(const void *a, const void *b)
|
int __cdecl wxZRColaCharSelect::SearchThread::CompareHits(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const std::pair<ZRCola::charrank_t, ZRCola::char_t> *_a = (const std::pair<ZRCola::charrank_t, ZRCola::char_t>*)a;
|
const std::pair<ZRCola::charrank_t, wchar_t> *_a = (const std::pair<ZRCola::charrank_t, wchar_t>*)a;
|
||||||
const std::pair<ZRCola::charrank_t, ZRCola::char_t> *_b = (const std::pair<ZRCola::charrank_t, ZRCola::char_t>*)b;
|
const std::pair<ZRCola::charrank_t, wchar_t> *_b = (const std::pair<ZRCola::charrank_t, wchar_t>*)b;
|
||||||
|
|
||||||
if (_a->first > _b->first) return -1;
|
if (_a->first > _b->first) return -1;
|
||||||
if (_a->first < _b->first) return 1;
|
else if (_a->first < _b->first) return 1;
|
||||||
|
|
||||||
if (_a->second < _b->second) return -1;
|
if (_a->second < _b->second) return -1;
|
||||||
if (_a->second > _b->second) return 1;
|
else if (_a->second > _b->second) return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -843,7 +843,7 @@ bool wxPersistentZRColaCharSelect::Restore()
|
|||||||
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
|
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
|
||||||
wxString chr;
|
wxString chr;
|
||||||
for (wxStringTokenizer tok_chr(tok.GetNextToken(), wxT("+")); tok_chr.HasMoreTokens(); )
|
for (wxStringTokenizer tok_chr(tok.GetNextToken(), wxT("+")); tok_chr.HasMoreTokens(); )
|
||||||
chr += (ZRCola::char_t)_tcstoul(tok_chr.GetNextToken().c_str(), NULL, 16);
|
chr += (wchar_t)_tcstoul(tok_chr.GetNextToken().c_str(), NULL, 16);
|
||||||
val.Add(chr);
|
val.Add(chr);
|
||||||
}
|
}
|
||||||
wnd->m_gridRecent->SetCharacters(val);
|
wnd->m_gridRecent->SetCharacters(val);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -40,7 +40,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// Construct the validator with a value to store data
|
/// Construct the validator with a value to store data
|
||||||
///
|
///
|
||||||
wxZRColaUTF16CharValidator(ZRCola::char_t *val = NULL);
|
wxZRColaUTF16CharValidator(wchar_t *val = NULL);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copies this validator
|
/// Copies this validator
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
static inline bool is_pua(_In_ wchar_t c)
|
||||||
|
{
|
||||||
|
return L'\ue000' <= c && c <= L'\uf8ff';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// wxZRColaComposerPanel
|
// wxZRColaComposerPanel
|
||||||
@ -15,9 +20,9 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
|
|||||||
m_destinationChanged(false),
|
m_destinationChanged(false),
|
||||||
m_sourceRestyled(false),
|
m_sourceRestyled(false),
|
||||||
m_destinationRestyled(false),
|
m_destinationRestyled(false),
|
||||||
m_styleNormal(*wxBLACK, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
m_styleSource(*wxBLACK, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
||||||
m_stylePUA(*wxBLUE, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
m_styleDestination(*wxBLACK, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
||||||
m_styleZRColaUnicodeComposedIssues(*wxRED, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
m_styleDestinationPUA(*wxBLUE, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
|
||||||
m_selSource(0, 0),
|
m_selSource(0, 0),
|
||||||
m_selDestination(0, 0),
|
m_selDestination(0, 0),
|
||||||
wxZRColaComposerPanelBase(parent)
|
wxZRColaComposerPanelBase(parent)
|
||||||
@ -49,7 +54,7 @@ void wxZRColaComposerPanel::RestoreFromStateFile()
|
|||||||
wxFFile file(fileName, wxT("rb"));
|
wxFFile file(fileName, wxT("rb"));
|
||||||
if (file.IsOpened()) {
|
if (file.IsOpened()) {
|
||||||
// Load source text.
|
// Load source text.
|
||||||
uint64_t n;
|
unsigned __int64 n;
|
||||||
file.Read(&n, sizeof(n));
|
file.Read(&n, sizeof(n));
|
||||||
if (!file.Error()) {
|
if (!file.Error()) {
|
||||||
wxString source;
|
wxString source;
|
||||||
@ -96,13 +101,11 @@ void wxZRColaComposerPanel::SynchronizePanels()
|
|||||||
|
|
||||||
if (app->m_mainWnd->m_composition) {
|
if (app->m_mainWnd->m_composition) {
|
||||||
// ZRCola decompose first, then re-compose.
|
// ZRCola decompose first, then re-compose.
|
||||||
app->m_t_db.TranslateInv(app->m_mainWnd->m_composition_id, dst.data(), dst.size(), dst2, &map);
|
app->m_t_db.TranslateInv(ZRCOLA_TRANSEQID_DEFAULT, dst.data(), dst.size(), dst2, &map);
|
||||||
m_mapping.push_back(std::move(map));
|
m_mapping.push_back(std::move(map));
|
||||||
map.clear();
|
|
||||||
|
|
||||||
app->m_t_db.Translate(app->m_mainWnd->m_composition_id, dst2.data(), dst2.size(), dst, &map);
|
app->m_t_db.Translate(ZRCOLA_TRANSEQID_DEFAULT, dst2.data(), dst2.size(), dst, &map);
|
||||||
m_mapping.push_back(std::move(map));
|
m_mapping.push_back(std::move(map));
|
||||||
map.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other translations
|
// Other translations
|
||||||
@ -111,9 +114,7 @@ void wxZRColaComposerPanel::SynchronizePanels()
|
|||||||
for (auto s = sets_begin; s != sets_end; ++s) {
|
for (auto s = sets_begin; s != sets_end; ++s) {
|
||||||
app->m_t_db.Translate(*s, dst.data(), dst.size(), dst2, &map);
|
app->m_t_db.Translate(*s, dst.data(), dst.size(), dst2, &map);
|
||||||
m_mapping.push_back(std::move(map));
|
m_mapping.push_back(std::move(map));
|
||||||
map.clear();
|
|
||||||
dst = std::move(dst2);
|
dst = std::move(dst2);
|
||||||
dst2.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
|
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
|
||||||
@ -148,24 +149,18 @@ void wxZRColaComposerPanel::SynchronizePanels()
|
|||||||
for (auto s = sets_end; (s--) != sets_begin;) {
|
for (auto s = sets_end; (s--) != sets_begin;) {
|
||||||
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
|
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
|
||||||
dst = std::move(dst2);
|
dst = std::move(dst2);
|
||||||
dst2.clear();
|
|
||||||
|
|
||||||
for (auto& m : map)
|
map.invert();
|
||||||
m.invert();
|
|
||||||
m_mapping.push_back(std::move(map));
|
m_mapping.push_back(std::move(map));
|
||||||
map.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app->m_mainWnd->m_composition) {
|
if (app->m_mainWnd->m_composition) {
|
||||||
// ZRCola decompose.
|
// ZRCola decompose.
|
||||||
app->m_t_db.TranslateInv(app->m_mainWnd->m_composition_id, dst.data(), dst.size(), &app->m_lc_db, app->m_mainWnd->m_settings->m_lang, dst2, &map);
|
app->m_t_db.TranslateInv(ZRCOLA_TRANSEQID_DEFAULT, dst.data(), dst.size(), &app->m_lc_db, app->m_mainWnd->m_settings->m_lang, dst2, &map);
|
||||||
dst = std::move(dst2);
|
dst = std::move(dst2);
|
||||||
dst2.clear();
|
|
||||||
|
|
||||||
for (auto& m : map)
|
map.invert();
|
||||||
m.invert();
|
|
||||||
m_mapping.push_back(std::move(map));
|
m_mapping.push_back(std::move(map));
|
||||||
map.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
|
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
|
||||||
@ -189,6 +184,41 @@ void wxZRColaComposerPanel::SynchronizePanels()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxZRColaComposerPanel::SetDestinationFont(const wxFont& font, int flags)
|
||||||
|
{
|
||||||
|
m_styleDestination.SetFont(font, flags);
|
||||||
|
m_styleDestinationPUA.SetFont(font, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxZRColaComposerPanel::RestyleSource()
|
||||||
|
{
|
||||||
|
m_sourceRestyled = true;
|
||||||
|
m_source->SetStyle(0, GetWindowTextLength(m_source->GetHWND()), m_styleSource);
|
||||||
|
m_sourceRestyled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxZRColaComposerPanel::RestyleDestination()
|
||||||
|
{
|
||||||
|
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
||||||
|
|
||||||
|
m_destinationRestyled = true;
|
||||||
|
if (app->m_mainWnd->m_warnPUA) {
|
||||||
|
wxString src = m_destination->GetValue();
|
||||||
|
size_t len = src.Length();
|
||||||
|
for (size_t i = 0, j; i < len;) {
|
||||||
|
bool pua_i = is_pua(src[i]);
|
||||||
|
for (j = i + 1; j < len && pua_i == is_pua(src[j]); j++);
|
||||||
|
m_destination->SetStyle((long)i, (long)j, pua_i ? m_styleDestinationPUA : m_styleDestination);
|
||||||
|
i = j;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
m_destination->SetStyle(0, GetWindowTextLength(m_destination->GetHWND()), m_styleDestination);
|
||||||
|
m_destinationRestyled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
|
void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@ -205,16 +235,16 @@ void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
|
|||||||
m_selSource.second = to;
|
m_selSource.second = to;
|
||||||
|
|
||||||
m_sourceHex->SetSelection(
|
m_sourceHex->SetSelection(
|
||||||
m_selSourceHex.first = (long)stdex::src2dst<size_t>(m_mappingSourceHex, from),
|
m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(from),
|
||||||
m_selSourceHex.second = (long)stdex::src2dst<size_t>(m_mappingSourceHex, to ));
|
m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(to ));
|
||||||
|
|
||||||
m_destination->SetSelection(
|
m_destination->SetSelection(
|
||||||
m_selDestination.first = (long)MapToDestination(from),
|
m_selDestination.first = (long)MapToDestination(from),
|
||||||
m_selDestination.second = (long)MapToDestination(to ));
|
m_selDestination.second = (long)MapToDestination(to ));
|
||||||
|
|
||||||
m_destinationHex->SetSelection(
|
m_destinationHex->SetSelection(
|
||||||
m_selDestinationHex.first = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, m_selDestination.first ),
|
m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(m_selDestination.first ),
|
||||||
m_selDestinationHex.second = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, m_selDestination.second));
|
m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(m_selDestination.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,16 +262,16 @@ void wxZRColaComposerPanel::OnSourceHexPaint(wxPaintEvent& event)
|
|||||||
m_selSourceHex.second = to;
|
m_selSourceHex.second = to;
|
||||||
|
|
||||||
m_source->SetSelection(
|
m_source->SetSelection(
|
||||||
m_selSource.first = (long)stdex::dst2src<size_t>(m_mappingSourceHex, from),
|
m_selSource.first = (long)m_mappingSourceHex.to_src(from),
|
||||||
m_selSource.second = (long)stdex::dst2src<size_t>(m_mappingSourceHex, to ));
|
m_selSource.second = (long)m_mappingSourceHex.to_src(to ));
|
||||||
|
|
||||||
m_destination->SetSelection(
|
m_destination->SetSelection(
|
||||||
m_selDestination.first = (long)MapToDestination(m_selSource.first ),
|
m_selDestination.first = (long)MapToDestination(m_selSource.first ),
|
||||||
m_selDestination.second = (long)MapToDestination(m_selSource.second));
|
m_selDestination.second = (long)MapToDestination(m_selSource.second));
|
||||||
|
|
||||||
m_destinationHex->SetSelection(
|
m_destinationHex->SetSelection(
|
||||||
m_selDestinationHex.first = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, m_selDestination.first ),
|
m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(m_selDestination.first ),
|
||||||
m_selDestinationHex.second = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, m_selDestination.second));
|
m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(m_selDestination.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,10 +285,7 @@ void wxZRColaComposerPanel::OnSourceText(wxCommandEvent& event)
|
|||||||
|
|
||||||
// Set the flag the source text changed to trigger idle-time translation.
|
// Set the flag the source text changed to trigger idle-time translation.
|
||||||
m_sourceChanged = true;
|
m_sourceChanged = true;
|
||||||
|
RestyleSource();
|
||||||
m_sourceRestyled = true;
|
|
||||||
m_source->SetStyle(0, GetWindowTextLength(m_source->GetHWND()), m_styleNormal);
|
|
||||||
m_sourceRestyled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -278,16 +305,16 @@ void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event)
|
|||||||
m_selDestination.second = to;
|
m_selDestination.second = to;
|
||||||
|
|
||||||
m_destinationHex->SetSelection(
|
m_destinationHex->SetSelection(
|
||||||
m_selDestinationHex.first = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, from),
|
m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(from),
|
||||||
m_selDestinationHex.second = (long)stdex::src2dst<size_t>(m_mappingDestinationHex, to ));
|
m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(to ));
|
||||||
|
|
||||||
m_source->SetSelection(
|
m_source->SetSelection(
|
||||||
m_selSource.first = (long)MapToSource(from),
|
m_selSource.first = (long)MapToSource(from),
|
||||||
m_selSource.second = (long)MapToSource(to ));
|
m_selSource.second = (long)MapToSource(to ));
|
||||||
|
|
||||||
m_sourceHex->SetSelection(
|
m_sourceHex->SetSelection(
|
||||||
m_selSourceHex.first = (long)stdex::src2dst<size_t>(m_mappingSourceHex, m_selSource.first ),
|
m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(m_selSource.first ),
|
||||||
m_selSourceHex.second = (long)stdex::src2dst<size_t>(m_mappingSourceHex, m_selSource.second));
|
m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(m_selSource.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,16 +332,16 @@ void wxZRColaComposerPanel::OnDestinationHexPaint(wxPaintEvent& event)
|
|||||||
m_selDestinationHex.second = to;
|
m_selDestinationHex.second = to;
|
||||||
|
|
||||||
m_destination->SetSelection(
|
m_destination->SetSelection(
|
||||||
m_selDestination.first = (long)stdex::dst2src<size_t>(m_mappingDestinationHex, from),
|
m_selDestination.first = (long)m_mappingDestinationHex.to_src(from),
|
||||||
m_selDestination.second = (long)stdex::dst2src<size_t>(m_mappingDestinationHex, to ));
|
m_selDestination.second = (long)m_mappingDestinationHex.to_src(to ));
|
||||||
|
|
||||||
m_source->SetSelection(
|
m_source->SetSelection(
|
||||||
m_selSource.first = (long)MapToSource(m_selDestination.first ),
|
m_selSource.first = (long)MapToSource(m_selDestination.first ),
|
||||||
m_selSource.second = (long)MapToSource(m_selDestination.second));
|
m_selSource.second = (long)MapToSource(m_selDestination.second));
|
||||||
|
|
||||||
m_sourceHex->SetSelection(
|
m_sourceHex->SetSelection(
|
||||||
m_selSourceHex.first = (long)stdex::src2dst<size_t>(m_mappingSourceHex, m_selSource.first ),
|
m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(m_selSource.first ),
|
||||||
m_selSourceHex.second = (long)stdex::src2dst<size_t>(m_mappingSourceHex, m_selSource.second));
|
m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(m_selSource.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,29 +355,7 @@ void wxZRColaComposerPanel::OnDestinationText(wxCommandEvent& event)
|
|||||||
|
|
||||||
// Set the flag the destination text changed to trigger idle-time inverse translation.
|
// Set the flag the destination text changed to trigger idle-time inverse translation.
|
||||||
m_destinationChanged = true;
|
m_destinationChanged = true;
|
||||||
|
RestyleDestination();
|
||||||
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
|
||||||
m_destinationRestyled = true;
|
|
||||||
wxString src = m_destination->GetValue();
|
|
||||||
app->m_h_db.Highlight(src, src.Length(), [this, app, src](ZRCola::hlghtsetid_t set, size_t start, size_t end) {
|
|
||||||
switch (set) {
|
|
||||||
case ZRCOLA_HLGHTSETID_ZRCOLA_UNICODE_COMPOSED_ISSUES:
|
|
||||||
m_destination->SetStyle((long)start, (long)end, m_styleZRColaUnicodeComposedIssues);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (app->m_mainWnd->m_warnPUA) {
|
|
||||||
for (size_t i = start, j; i < end;) {
|
|
||||||
bool pua_i = ZRCola::ispua(src[i]);
|
|
||||||
for (j = i + 1; j < end && pua_i == ZRCola::ispua(src[j]); j++);
|
|
||||||
m_destination->SetStyle((long)i, (long)j, pua_i ? m_stylePUA : m_styleNormal);
|
|
||||||
i = j;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
m_destination->SetStyle((long)start, (long)end, m_styleNormal);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_destinationRestyled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -418,8 +423,8 @@ void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &
|
|||||||
|
|
||||||
wnd->SetValue(hex);
|
wnd->SetValue(hex);
|
||||||
wnd->SetSelection(
|
wnd->SetSelection(
|
||||||
range.first = (long)stdex::src2dst<size_t>(mapping, from),
|
range.first = (long)mapping.to_dst(from),
|
||||||
range.second = (long)stdex::src2dst<size_t>(mapping, to ));
|
range.second = (long)mapping.to_dst(to ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -37,6 +37,9 @@ public:
|
|||||||
|
|
||||||
void RestoreFromStateFile();
|
void RestoreFromStateFile();
|
||||||
void SynchronizePanels();
|
void SynchronizePanels();
|
||||||
|
void SetDestinationFont(const wxFont& font, int flags = (wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE));
|
||||||
|
void RestyleSource();
|
||||||
|
void RestyleDestination();
|
||||||
|
|
||||||
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
|
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
|
||||||
|
|
||||||
@ -62,9 +65,9 @@ protected:
|
|||||||
m_sourceRestyled, ///< Boolean flag to mark source text is being restyled
|
m_sourceRestyled, ///< Boolean flag to mark source text is being restyled
|
||||||
m_destinationRestyled; ///< Boolean flag to mark destination text is being restyled
|
m_destinationRestyled; ///< Boolean flag to mark destination text is being restyled
|
||||||
wxTextAttr
|
wxTextAttr
|
||||||
m_styleNormal, ///< Normal text style
|
m_styleSource, ///< Normal source text style
|
||||||
m_stylePUA, ///< PUA character text style
|
m_styleDestination, ///< Normal destination text style
|
||||||
m_styleZRColaUnicodeComposedIssues; ///< ZRCola Unicode Composed issues character text style
|
m_styleDestinationPUA; ///< PUA character destination text style
|
||||||
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
|
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
|
||||||
std::pair<long, long>
|
std::pair<long, long>
|
||||||
m_selSource, ///< Character index of selected text in source text control
|
m_selSource, ///< Character index of selected text in source text control
|
||||||
@ -97,7 +100,7 @@ protected:
|
|||||||
inline size_t wxZRColaComposerPanel::MapToDestination(_In_ size_t src) const
|
inline size_t wxZRColaComposerPanel::MapToDestination(_In_ size_t src) const
|
||||||
{
|
{
|
||||||
for (auto m = m_mapping.cbegin(), m_end = m_mapping.cend(); m != m_end; ++m)
|
for (auto m = m_mapping.cbegin(), m_end = m_mapping.cend(); m != m_end; ++m)
|
||||||
src = stdex::src2dst(*m, src);
|
src = m->to_dst(src);
|
||||||
|
|
||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
@ -106,7 +109,7 @@ inline size_t wxZRColaComposerPanel::MapToDestination(_In_ size_t src) const
|
|||||||
inline size_t wxZRColaComposerPanel::MapToSource(_In_ size_t dst) const
|
inline size_t wxZRColaComposerPanel::MapToSource(_In_ size_t dst) const
|
||||||
{
|
{
|
||||||
for (auto m = m_mapping.crbegin(), m_end = m_mapping.crend(); m != m_end; ++m)
|
for (auto m = m_mapping.crbegin(), m_end = m_mapping.crend(); m != m_end; ++m)
|
||||||
dst = stdex::dst2src(*m, dst);
|
dst = m->to_src(dst);
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -28,9 +28,8 @@ wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
|
|||||||
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
|
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
|
||||||
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
|
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
|
||||||
|
|
||||||
EVT_MENU (wxID_COMPOSITION_NONE , wxZRColaFrame::OnCompositionNone )
|
EVT_MENU (wxID_COMPOSITION , wxZRColaFrame::OnComposition )
|
||||||
EVT_MENU (wxID_COMPOSITION_ZRCOLA , wxZRColaFrame::OnCompositionZRCola )
|
EVT_MENU (wxID_FONT_DESTINATION , wxZRColaFrame::OnFontDestination )
|
||||||
EVT_MENU (wxID_COMPOSITION_UNICODE , wxZRColaFrame::OnCompositionUnicode )
|
|
||||||
EVT_MENU (wxID_WARN_PUA , wxZRColaFrame::OnWarnPUA )
|
EVT_MENU (wxID_WARN_PUA , wxZRColaFrame::OnWarnPUA )
|
||||||
EVT_MENU_RANGE (wxID_TRANSLATION_SEQ_DEFAULT, wxID_TRANSLATION_SEQ_END, wxZRColaFrame::OnTranslationSeqMenu )
|
EVT_MENU_RANGE (wxID_TRANSLATION_SEQ_DEFAULT, wxID_TRANSLATION_SEQ_END, wxZRColaFrame::OnTranslationSeqMenu )
|
||||||
|
|
||||||
@ -40,6 +39,8 @@ wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
|
|||||||
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
|
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
|
||||||
EVT_UPDATE_UI (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslateUpdate )
|
EVT_UPDATE_UI (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslateUpdate )
|
||||||
EVT_MENU (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslate )
|
EVT_MENU (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslate )
|
||||||
|
EVT_UPDATE_UI (wxID_TOOLBAR_DESTINATION , wxZRColaFrame::OnToolbarDestinationUpdate )
|
||||||
|
EVT_MENU (wxID_TOOLBAR_DESTINATION , wxZRColaFrame::OnToolbarDestination )
|
||||||
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
|
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
|
||||||
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
|
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
|
||||||
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
|
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
|
||||||
@ -63,7 +64,7 @@ wxZRColaFrame::wxZRColaFrame() :
|
|||||||
m_settings(NULL),
|
m_settings(NULL),
|
||||||
m_chrReq(NULL),
|
m_chrReq(NULL),
|
||||||
m_composition(true),
|
m_composition(true),
|
||||||
m_composition_id(ZRCOLA_TRANSETID_DEFAULT),
|
m_fontDestination(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola")),
|
||||||
m_warnPUA(false),
|
m_warnPUA(false),
|
||||||
m_transeq_id(ZRCOLA_TRANSEQID_DEFAULT),
|
m_transeq_id(ZRCOLA_TRANSEQID_DEFAULT),
|
||||||
m_transeq(NULL),
|
m_transeq(NULL),
|
||||||
@ -177,17 +178,16 @@ wxZRColaFrame::wxZRColaFrame() :
|
|||||||
persist_mgr.RegisterAndRestore(this, new wxPersistentZRColaFrame(this));
|
persist_mgr.RegisterAndRestore(this, new wxPersistentZRColaFrame(this));
|
||||||
|
|
||||||
// Update (de)composition selection.
|
// Update (de)composition selection.
|
||||||
if (m_composition && m_composition_id == ZRCOLA_TRANSETID_DEFAULT) {
|
if (m_composition) {
|
||||||
m_menuItemCompositionZRCola->Check(true);
|
m_menuItemComposition->Check(true);
|
||||||
m_toolComposition->Select(1);
|
m_toolComposition->SetState(m_toolComposition->GetState() | wxAUI_BUTTON_STATE_CHECKED);
|
||||||
} else if (m_composition && m_composition_id == ZRCOLA_TRANSETID_UNICODE) {
|
|
||||||
m_menuItemCompositionUnicode->Check(true);
|
|
||||||
m_toolComposition->Select(2);
|
|
||||||
} else {
|
} else {
|
||||||
m_menuItemCompositionNone->Check(true);
|
m_menuItemComposition->Check(false);
|
||||||
m_toolComposition->Select(0);
|
m_toolComposition->SetState(m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_fontpickerDestination->SetSelectedFont(m_fontDestination);
|
||||||
|
m_panel->SetDestinationFont(m_fontDestination);
|
||||||
if (m_warnPUA) {
|
if (m_warnPUA) {
|
||||||
m_menuItemWarnPUA->Check(true);
|
m_menuItemWarnPUA->Check(true);
|
||||||
m_toolWarnPUA->SetState(m_toolWarnPUA->GetState() | wxAUI_BUTTON_STATE_CHECKED);
|
m_toolWarnPUA->SetState(m_toolWarnPUA->GetState() | wxAUI_BUTTON_STATE_CHECKED);
|
||||||
@ -344,40 +344,46 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::OnCompositionNone(wxCommandEvent& event)
|
void wxZRColaFrame::OnComposition(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
DoSetComposition(false, ZRCOLA_TRANSETID_DEFAULT);
|
m_composition = !m_composition;
|
||||||
|
m_menuItemComposition->Check(m_composition);
|
||||||
|
m_toolComposition->SetState((m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_composition ? wxAUI_BUTTON_STATE_CHECKED : 0));
|
||||||
m_toolbarTranslate->Refresh();
|
m_toolbarTranslate->Refresh();
|
||||||
|
|
||||||
|
// Notify source text something changed and should re-translate.
|
||||||
|
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
|
||||||
|
m_panel->m_source->ProcessWindowEvent(event2);
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::OnCompositionZRCola(wxCommandEvent& event)
|
void wxZRColaFrame::OnFontDestinationChanged(wxFontPickerEvent& event)
|
||||||
{
|
{
|
||||||
DoSetComposition(true, ZRCOLA_TRANSETID_DEFAULT);
|
m_fontDestination = event.GetFont();
|
||||||
m_toolbarTranslate->Refresh();
|
m_panel->SetDestinationFont(m_fontDestination);
|
||||||
|
m_panel->RestyleDestination();
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::OnCompositionUnicode(wxCommandEvent& event)
|
void wxZRColaFrame::OnFontDestination(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
DoSetComposition(true, ZRCOLA_TRANSETID_UNICODE);
|
wxFontData data;
|
||||||
m_toolbarTranslate->Refresh();
|
data.SetInitialFont(m_fontDestination);
|
||||||
|
wxFontDialog dlg(this, data);
|
||||||
event.Skip();
|
if (dlg.ShowModal() == wxID_OK)
|
||||||
}
|
{
|
||||||
|
data = dlg.GetFontData();
|
||||||
|
m_fontDestination = data.GetChosenFont();
|
||||||
void wxZRColaFrame::OnCompositionChoice(wxCommandEvent& event)
|
m_fontpickerDestination->SetSelectedFont(m_fontDestination);
|
||||||
{
|
m_panel->SetDestinationFont(m_fontDestination);
|
||||||
switch (event.GetSelection()) {
|
m_panel->RestyleDestination();
|
||||||
case 0: DoSetComposition(false, ZRCOLA_TRANSETID_DEFAULT); break;
|
|
||||||
case 1: DoSetComposition(true, ZRCOLA_TRANSETID_DEFAULT); break;
|
|
||||||
case 2: DoSetComposition(true, ZRCOLA_TRANSETID_UNICODE); break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -386,11 +392,8 @@ void wxZRColaFrame::OnWarnPUA(wxCommandEvent& event)
|
|||||||
m_warnPUA = !m_warnPUA;
|
m_warnPUA = !m_warnPUA;
|
||||||
m_menuItemWarnPUA->Check(m_warnPUA);
|
m_menuItemWarnPUA->Check(m_warnPUA);
|
||||||
m_toolWarnPUA->SetState((m_toolWarnPUA->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_warnPUA ? wxAUI_BUTTON_STATE_CHECKED : 0));
|
m_toolWarnPUA->SetState((m_toolWarnPUA->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_warnPUA ? wxAUI_BUTTON_STATE_CHECKED : 0));
|
||||||
m_toolbarTranslate->Refresh();
|
m_toolbarDestination->Refresh();
|
||||||
|
m_panel->RestyleDestination();
|
||||||
// Notify destination text something changed and should re-paint.
|
|
||||||
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
|
|
||||||
m_panel->m_destination->ProcessWindowEvent(event2);
|
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@ -457,6 +460,20 @@ void wxZRColaFrame::OnToolbarTranslate(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxZRColaFrame::OnToolbarDestinationUpdate(wxUpdateUIEvent& event)
|
||||||
|
{
|
||||||
|
event.Check(m_mgr.GetPane(m_toolbarDestination).IsShown());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxZRColaFrame::OnToolbarDestination(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarDestination);
|
||||||
|
paneInfo.Show(!paneInfo.IsShown());
|
||||||
|
m_mgr.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::OnTranslationSeqMenu(wxCommandEvent& event)
|
void wxZRColaFrame::OnTranslationSeqMenu(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
int idx = event.GetId() - wxID_TRANSLATION_SEQ_DEFAULT;
|
int idx = event.GetId() - wxID_TRANSLATION_SEQ_DEFAULT;
|
||||||
@ -672,30 +689,6 @@ void wxZRColaFrame::DoCopyAndReturn(const wxString& str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::DoSetComposition(bool enable, ZRCola::transetid_t transet_id)
|
|
||||||
{
|
|
||||||
if (enable && transet_id == ZRCOLA_TRANSETID_DEFAULT) {
|
|
||||||
m_composition = true;
|
|
||||||
m_composition_id = ZRCOLA_TRANSETID_DEFAULT;
|
|
||||||
m_menuItemCompositionZRCola->Check(true);
|
|
||||||
m_toolComposition->Select(1);
|
|
||||||
} else if (enable && transet_id == ZRCOLA_TRANSETID_UNICODE) {
|
|
||||||
m_composition = true;
|
|
||||||
m_composition_id = ZRCOLA_TRANSETID_UNICODE;
|
|
||||||
m_menuItemCompositionUnicode->Check(true);
|
|
||||||
m_toolComposition->Select(2);
|
|
||||||
} else {
|
|
||||||
m_composition = false;
|
|
||||||
m_menuItemCompositionNone->Check(true);
|
|
||||||
m_toolComposition->Select(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Notify source text something changed and should re-translate.
|
|
||||||
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
|
|
||||||
m_panel->m_source->ProcessWindowEvent(event2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaFrame::DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id)
|
void wxZRColaFrame::DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id)
|
||||||
{
|
{
|
||||||
if (transeq_id == ZRCOLA_TRANSEQID_CUSTOM) {
|
if (transeq_id == ZRCOLA_TRANSEQID_CUSTOM) {
|
||||||
@ -796,10 +789,19 @@ void wxPersistentZRColaFrame::Save() const
|
|||||||
auto wnd = static_cast<const wxZRColaFrame*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
|
auto wnd = static_cast<const wxZRColaFrame*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
|
||||||
|
|
||||||
SaveValue(wxT("composition"), wnd->m_composition);
|
SaveValue(wxT("composition"), wnd->m_composition);
|
||||||
SaveValue(wxT("compositionId"), static_cast<int>(wnd->m_composition_id));
|
|
||||||
SaveValue(wxT("warnPUA"), wnd->m_warnPUA);
|
|
||||||
SaveValue(wxT("transeqId"), static_cast<int>(wnd->m_transeq_id));
|
SaveValue(wxT("transeqId"), static_cast<int>(wnd->m_transeq_id));
|
||||||
|
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 26812) // wxWidgets font enums are unscoped.
|
||||||
|
SaveValue(wxT("fontDestinationSize" ), wnd->m_fontDestination.GetPointSize());
|
||||||
|
SaveValue(wxT("fontDestinationFamily" ), wnd->m_fontDestination.GetFamily());
|
||||||
|
SaveValue(wxT("fontDestinationStyle" ), wnd->m_fontDestination.GetStyle());
|
||||||
|
SaveValue(wxT("fontDestinationWeight" ), wnd->m_fontDestination.GetWeight());
|
||||||
|
SaveValue(wxT("fontDestinationIsUnderlined"), wnd->m_fontDestination.GetUnderlined());
|
||||||
|
SaveValue(wxT("fontDestinationFace" ), wnd->m_fontDestination.GetFaceName());
|
||||||
|
#pragma warning(pop)
|
||||||
|
SaveValue(wxT("warnPUA"), wnd->m_warnPUA);
|
||||||
|
|
||||||
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
|
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
|
||||||
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
|
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
|
||||||
}
|
}
|
||||||
@ -821,8 +823,19 @@ bool wxPersistentZRColaFrame::Restore()
|
|||||||
wnd->m_composition = b;
|
wnd->m_composition = b;
|
||||||
else
|
else
|
||||||
wnd->m_composition = wnd->m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT;
|
wnd->m_composition = wnd->m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT;
|
||||||
if (RestoreValue(wxT("compositionId"), &num))
|
|
||||||
wnd->m_composition_id = (ZRCola::transetid_t)num;
|
int fontSize = 20, fontFamily = wxFONTFAMILY_DEFAULT, fontStyle = wxFONTSTYLE_NORMAL, fontWeight = wxFONTWEIGHT_NORMAL;
|
||||||
|
bool fontIsUnderlined = false;
|
||||||
|
wxString fontFace(wxT("ZRCola"));
|
||||||
|
if (RestoreValue(wxT("fontDestinationSize" ), &fontSize) &&
|
||||||
|
RestoreValue(wxT("fontDestinationFamily" ), &fontFamily) &&
|
||||||
|
RestoreValue(wxT("fontDestinationStyle" ), &fontStyle) &&
|
||||||
|
RestoreValue(wxT("fontDestinationWeight" ), &fontWeight) &&
|
||||||
|
RestoreValue(wxT("fontDestinationIsUnderlined"), &fontIsUnderlined) &&
|
||||||
|
RestoreValue(wxT("fontDestinationFace" ), &fontFace))
|
||||||
|
wnd->m_fontDestination = wxFont(fontSize, (wxFontFamily)fontFamily, (wxFontStyle)fontStyle, (wxFontWeight)fontWeight, fontIsUnderlined, fontFace);
|
||||||
|
else
|
||||||
|
wnd->m_fontDestination = wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"));
|
||||||
if (RestoreValue(wxT("warnPUA"), &b))
|
if (RestoreValue(wxT("warnPUA"), &b))
|
||||||
wnd->m_warnPUA = b;
|
wnd->m_warnPUA = b;
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -76,10 +76,9 @@ protected:
|
|||||||
void OnSendSource(wxCommandEvent& event);
|
void OnSendSource(wxCommandEvent& event);
|
||||||
void OnCopySourceAndReturn(wxCommandEvent& event);
|
void OnCopySourceAndReturn(wxCommandEvent& event);
|
||||||
void OnSendAbort(wxCommandEvent& event);
|
void OnSendAbort(wxCommandEvent& event);
|
||||||
void OnCompositionNone(wxCommandEvent& event);
|
void OnComposition(wxCommandEvent& event);
|
||||||
void OnCompositionZRCola(wxCommandEvent& event);
|
virtual void OnFontDestinationChanged(wxFontPickerEvent& event);
|
||||||
void OnCompositionUnicode(wxCommandEvent& event);
|
void OnFontDestination(wxCommandEvent& event);
|
||||||
virtual void OnCompositionChoice(wxCommandEvent& event);
|
|
||||||
void OnWarnPUA(wxCommandEvent& event);
|
void OnWarnPUA(wxCommandEvent& event);
|
||||||
void OnSettings(wxCommandEvent& event);
|
void OnSettings(wxCommandEvent& event);
|
||||||
virtual void OnIdle(wxIdleEvent& event);
|
virtual void OnIdle(wxIdleEvent& event);
|
||||||
@ -89,6 +88,8 @@ protected:
|
|||||||
void OnToolbarEdit(wxCommandEvent& event);
|
void OnToolbarEdit(wxCommandEvent& event);
|
||||||
void OnToolbarTranslateUpdate(wxUpdateUIEvent& event);
|
void OnToolbarTranslateUpdate(wxUpdateUIEvent& event);
|
||||||
void OnToolbarTranslate(wxCommandEvent& event);
|
void OnToolbarTranslate(wxCommandEvent& event);
|
||||||
|
void OnToolbarDestinationUpdate(wxUpdateUIEvent& event);
|
||||||
|
void OnToolbarDestination(wxCommandEvent& event);
|
||||||
void OnTranslationSeqMenu(wxCommandEvent& event);
|
void OnTranslationSeqMenu(wxCommandEvent& event);
|
||||||
virtual void OnTranslationSeqChoice(wxCommandEvent& event);
|
virtual void OnTranslationSeqChoice(wxCommandEvent& event);
|
||||||
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
|
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
|
||||||
@ -120,7 +121,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void DoSend(const wxString& str);
|
void DoSend(const wxString& str);
|
||||||
void DoCopyAndReturn(const wxString& str);
|
void DoCopyAndReturn(const wxString& str);
|
||||||
void DoSetComposition(bool enable, ZRCola::transetid_t transet_id);
|
|
||||||
void DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id);
|
void DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -132,17 +132,17 @@ protected:
|
|||||||
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
|
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WXHWND m_hWndSource; ///< Handle of the active window, when the ZRCola hotkey was pressed
|
WXHWND m_hWndSource; ///< Handle of the active window, when the ZRCola hotkey was pressed
|
||||||
bool m_wasIconised; ///< Was the ZRCola window iconized, when the ZRCola hotkey was pressed
|
bool m_wasIconised; ///< Was the ZRCola window iconized, when the ZRCola hotkey was pressed
|
||||||
wxTaskBarIcon *m_taskBarIcon; ///< Taskbar icon
|
wxTaskBarIcon *m_taskBarIcon; ///< Taskbar icon
|
||||||
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
|
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
|
||||||
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
|
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
|
||||||
wxZRColaSettings *m_settings; ///< Configuration dialog
|
wxZRColaSettings *m_settings; ///< Configuration dialog
|
||||||
bool m_composition; ///< Is (de)composition enabled?
|
bool m_composition; ///< Is (de)composition enabled?
|
||||||
ZRCola::transetid_t m_composition_id; ///< Which (de)composition is enabled
|
wxFont m_fontDestination; ///< Destination window font
|
||||||
bool m_warnPUA; ///< Mark Private-Use-Area characters in destination text
|
bool m_warnPUA; ///< Mark Private-Use-Area characters in destination text
|
||||||
ZRCola::transeqid_t m_transeq_id; ///< Translation sequence ID
|
ZRCola::transeqid_t m_transeq_id; ///< Translation sequence ID
|
||||||
wxZRColaTranslationSeq *m_transeq; ///< Custom translation sequence dialog
|
wxZRColaTranslationSeq *m_transeq; ///< Custom translation sequence dialog
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ delete old;
|
|||||||
static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
|
static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style, const wxString& name ) : wxFrame( parent, id, title, pos, parent->FromDIP(wxSize(600, 400)), style, name )
|
wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style, const wxString& name ) : wxFrame( parent, id, title, pos, parent->FromDIP(wxSize( 660,450 )), style, name )
|
||||||
{
|
{
|
||||||
this->SetSizeHints( FromDIP(wxSize( 150,150 )), wxDefaultSize );
|
this->SetSizeHints( FromDIP(wxSize( 150,150 )), wxDefaultSize );
|
||||||
m_mgr.SetManagedWindow(this);
|
m_mgr.SetManagedWindow(this);
|
||||||
@ -133,19 +133,8 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_menuEdit->AppendSeparator();
|
m_menuEdit->AppendSeparator();
|
||||||
|
|
||||||
wxMenu* m_menuComposition;
|
m_menuItemComposition = new wxMenuItem( m_menuEdit, wxID_COMPOSITION, wxString( _("&ZRCola (De)composition") ) , _("Toggle ZRCola character (De)composition"), wxITEM_CHECK );
|
||||||
m_menuComposition = new wxMenu();
|
m_menuEdit->Append( m_menuItemComposition );
|
||||||
wxMenuItem* m_menuCompositionItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("(De)&composition"), wxEmptyString, wxITEM_NORMAL, m_menuComposition );
|
|
||||||
m_menuItemCompositionNone = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_NONE, wxString( _("&None") ) , _("No character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionNone );
|
|
||||||
|
|
||||||
m_menuItemCompositionZRCola = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_ZRCOLA, wxString( _("&ZRCola") ) , _("ZRCola character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionZRCola );
|
|
||||||
|
|
||||||
m_menuItemCompositionUnicode = new wxMenuItem( m_menuComposition, wxID_COMPOSITION_UNICODE, wxString( _("&Unicode") ) , _("Unicode character (De)composition"), wxITEM_RADIO );
|
|
||||||
m_menuComposition->Append( m_menuItemCompositionUnicode );
|
|
||||||
|
|
||||||
m_menuEdit->Append( m_menuCompositionItem );
|
|
||||||
|
|
||||||
m_menuTranslationSeq = new wxMenu();
|
m_menuTranslationSeq = new wxMenu();
|
||||||
wxMenuItem* m_menuTranslationSeqItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("Tra&nslation"), wxEmptyString, wxITEM_NORMAL, m_menuTranslationSeq );
|
wxMenuItem* m_menuTranslationSeqItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("Tra&nslation"), wxEmptyString, wxITEM_NORMAL, m_menuTranslationSeq );
|
||||||
@ -153,6 +142,10 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_menuEdit->AppendSeparator();
|
m_menuEdit->AppendSeparator();
|
||||||
|
|
||||||
|
wxMenuItem* m_menuItemFontDestination;
|
||||||
|
m_menuItemFontDestination = new wxMenuItem( m_menuEdit, wxID_FONT_DESTINATION, wxString( _("Composed Text &Font...") ) , _("Select font for composed text"), wxITEM_NORMAL );
|
||||||
|
m_menuEdit->Append( m_menuItemFontDestination );
|
||||||
|
|
||||||
m_menuItemWarnPUA = new wxMenuItem( m_menuEdit, wxID_WARN_PUA, wxString( _("&PUA Warning") ) , _("Highlight Private Use Area Characters"), wxITEM_CHECK );
|
m_menuItemWarnPUA = new wxMenuItem( m_menuEdit, wxID_WARN_PUA, wxString( _("&PUA Warning") ) , _("Highlight Private Use Area Characters"), wxITEM_CHECK );
|
||||||
m_menuEdit->Append( m_menuItemWarnPUA );
|
m_menuEdit->Append( m_menuItemWarnPUA );
|
||||||
|
|
||||||
@ -173,6 +166,10 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_TRANSLATE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
|
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_TRANSLATE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
|
||||||
m_menuView->Append( m_menuItemToolbarCompose );
|
m_menuView->Append( m_menuItemToolbarCompose );
|
||||||
|
|
||||||
|
wxMenuItem* m_menuItemToolbarDestination;
|
||||||
|
m_menuItemToolbarDestination = new wxMenuItem( m_menuView, wxID_TOOLBAR_DESTINATION, wxString( _("Composed &Text Toolbar") ) , _("Toggle composed text toolbar"), wxITEM_CHECK );
|
||||||
|
m_menuView->Append( m_menuItemToolbarDestination );
|
||||||
|
|
||||||
m_menuView->AppendSeparator();
|
m_menuView->AppendSeparator();
|
||||||
|
|
||||||
wxMenuItem* m_menuItemPanelChrGrps;
|
wxMenuItem* m_menuItemPanelChrGrps;
|
||||||
@ -229,22 +226,27 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
m_toolbarTranslate->AddSeparator();
|
m_toolbarTranslate->AddSeparator();
|
||||||
|
|
||||||
wxString m_toolCompositionChoices[] = { _("No (De)composition"), _("ZRCola"), _("Unicode") };
|
m_toolComposition = m_toolbarTranslate->AddTool( wxID_COMPOSITION, _("ZRCola (De)composition"), wxIcon( wxT("composition.ico"), wxBITMAP_TYPE_ICO_RESOURCE, FromDIP(24), FromDIP(24) ), wxNullBitmap, wxITEM_CHECK, _("ZRCola (De)composition"), _("Toggle ZRCola character (De)composition"), NULL );
|
||||||
int m_toolCompositionNChoices = sizeof( m_toolCompositionChoices ) / sizeof( wxString );
|
|
||||||
m_toolComposition = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, FromDIP(wxSize( 120,-1 )), m_toolCompositionNChoices, m_toolCompositionChoices, 0 );
|
|
||||||
m_toolComposition->SetSelection( 0 );
|
|
||||||
m_toolbarTranslate->AddControl( m_toolComposition );
|
|
||||||
wxArrayString m_toolTranslationSeqChoices;
|
wxArrayString m_toolTranslationSeqChoices;
|
||||||
m_toolTranslationSeq = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, FromDIP(wxSize( 180,-1 )), m_toolTranslationSeqChoices, 0 );
|
m_toolTranslationSeq = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, FromDIP(wxSize( 240,-1 )), m_toolTranslationSeqChoices, 0 );
|
||||||
m_toolTranslationSeq->SetSelection( 0 );
|
m_toolTranslationSeq->SetSelection( 0 );
|
||||||
m_toolbarTranslate->AddControl( m_toolTranslationSeq );
|
m_toolbarTranslate->AddControl( m_toolTranslationSeq );
|
||||||
m_toolbarTranslate->AddSeparator();
|
|
||||||
|
|
||||||
m_toolWarnPUA = m_toolbarTranslate->AddTool( wxID_WARN_PUA, _("PUA Warning"), wxIcon( wxT("warn_pua.ico"), wxBITMAP_TYPE_ICO_RESOURCE, FromDIP(24), FromDIP(24) ), wxNullBitmap, wxITEM_CHECK, _("Highlight Private Use Area Characters"), _("Highlight Private Use Area Characters"), NULL );
|
|
||||||
|
|
||||||
m_toolbarTranslate->Realize();
|
m_toolbarTranslate->Realize();
|
||||||
m_mgr.AddPane( m_toolbarTranslate, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
m_mgr.AddPane( m_toolbarTranslate, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
||||||
|
|
||||||
|
m_toolbarDestination = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
|
||||||
|
m_fontpickerDestination = new wxFontPickerCtrl( m_toolbarDestination, wxID_FONT_DESTINATION, wxFont( 20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola") ), wxDefaultPosition, wxDefaultSize, wxFNTP_FONTDESC_AS_LABEL );
|
||||||
|
m_fontpickerDestination->SetMaxPointSize( 100 );
|
||||||
|
m_fontpickerDestination->SetMinSize( FromDIP(wxSize( 120,-1 )) );
|
||||||
|
m_fontpickerDestination->SetMaxSize( FromDIP(wxSize( 180,-1 )) );
|
||||||
|
|
||||||
|
m_toolbarDestination->AddControl( m_fontpickerDestination );
|
||||||
|
m_toolWarnPUA = m_toolbarDestination->AddTool( wxID_WARN_PUA, _("PUA Warning"), wxIcon( wxT("warn_pua.ico"), wxBITMAP_TYPE_ICO_RESOURCE, FromDIP(24), FromDIP(24) ), wxNullBitmap, wxITEM_CHECK, _("Highlight Private Use Area Characters"), _("Highlight Private Use Area Characters"), NULL );
|
||||||
|
|
||||||
|
m_toolbarDestination->Realize();
|
||||||
|
m_mgr.AddPane( m_toolbarDestination, wxAuiPaneInfo().Name( wxT("toolbarDestination") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
|
||||||
|
|
||||||
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
|
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
|
||||||
|
|
||||||
m_mgr.AddPane( m_panelChrCat, wxAuiPaneInfo() .Name( wxT("panelChrGrp") ).Left() .Caption( _("Character Catalog") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).Row( 1 ).BestSize(FromDIP(wxSize( 150,200 )) ).MinSize( FromDIP(wxSize( 100,100 )) ).Layer( 1 ) );
|
m_mgr.AddPane( m_panelChrCat, wxAuiPaneInfo() .Name( wxT("panelChrGrp") ).Left() .Caption( _("Character Catalog") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).Row( 1 ).BestSize(FromDIP(wxSize( 150,200 )) ).MinSize( FromDIP(wxSize( 100,100 )) ).Layer( 1 ) );
|
||||||
@ -262,8 +264,8 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
||||||
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
||||||
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
||||||
m_toolComposition->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnCompositionChoice ), NULL, this );
|
|
||||||
m_toolTranslationSeq->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
m_toolTranslationSeq->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
||||||
|
m_fontpickerDestination->Connect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( wxZRColaFrameBase::OnFontDestinationChanged ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxZRColaFrameBase::~wxZRColaFrameBase()
|
wxZRColaFrameBase::~wxZRColaFrameBase()
|
||||||
@ -272,8 +274,8 @@ wxZRColaFrameBase::~wxZRColaFrameBase()
|
|||||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
|
||||||
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
|
||||||
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
|
||||||
m_toolComposition->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnCompositionChoice ), NULL, this );
|
|
||||||
m_toolTranslationSeq->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
m_toolTranslationSeq->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
|
||||||
|
m_fontpickerDestination->Disconnect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( wxZRColaFrameBase::OnFontDestinationChanged ), NULL, this );
|
||||||
|
|
||||||
m_mgr.UnInit();
|
m_mgr.UnInit();
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ class wxZRColaCharGrid;
|
|||||||
#include <wx/aui/aui.h>
|
#include <wx/aui/aui.h>
|
||||||
#include <wx/aui/auibar.h>
|
#include <wx/aui/auibar.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
|
#include <wx/fontpicker.h>
|
||||||
class wxZRColaCharacterCatalogPanel;
|
class wxZRColaCharacterCatalogPanel;
|
||||||
class wxZRColaComposerPanel;
|
class wxZRColaComposerPanel;
|
||||||
#include <wx/statusbr.h>
|
#include <wx/statusbr.h>
|
||||||
@ -67,13 +68,13 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxID_SEND_SOURCE,
|
wxID_SEND_SOURCE,
|
||||||
wxID_COPY_SOURCE_AND_RETURN,
|
wxID_COPY_SOURCE_AND_RETURN,
|
||||||
wxID_SEND_ABORT,
|
wxID_SEND_ABORT,
|
||||||
wxID_COMPOSITION_NONE,
|
wxID_COMPOSITION,
|
||||||
wxID_COMPOSITION_ZRCOLA,
|
wxID_FONT_DESTINATION,
|
||||||
wxID_COMPOSITION_UNICODE,
|
|
||||||
wxID_WARN_PUA,
|
wxID_WARN_PUA,
|
||||||
wxID_SETTINGS,
|
wxID_SETTINGS,
|
||||||
wxID_TOOLBAR_EDIT,
|
wxID_TOOLBAR_EDIT,
|
||||||
wxID_TOOLBAR_TRANSLATE,
|
wxID_TOOLBAR_TRANSLATE,
|
||||||
|
wxID_TOOLBAR_DESTINATION,
|
||||||
wxID_PANEL_CHRGRPS,
|
wxID_PANEL_CHRGRPS,
|
||||||
wxID_HELP_INSTRUCTIONS,
|
wxID_HELP_INSTRUCTIONS,
|
||||||
wxID_HELP_SHORTCUTS,
|
wxID_HELP_SHORTCUTS,
|
||||||
@ -84,9 +85,7 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxMenuBar* m_menubar;
|
wxMenuBar* m_menubar;
|
||||||
wxMenu* m_menuProgram;
|
wxMenu* m_menuProgram;
|
||||||
wxMenu* m_menuEdit;
|
wxMenu* m_menuEdit;
|
||||||
wxMenuItem* m_menuItemCompositionNone;
|
wxMenuItem* m_menuItemComposition;
|
||||||
wxMenuItem* m_menuItemCompositionZRCola;
|
|
||||||
wxMenuItem* m_menuItemCompositionUnicode;
|
|
||||||
wxMenu* m_menuTranslationSeq;
|
wxMenu* m_menuTranslationSeq;
|
||||||
wxMenuItem* m_menuItemWarnPUA;
|
wxMenuItem* m_menuItemWarnPUA;
|
||||||
wxMenu* m_menuView;
|
wxMenu* m_menuView;
|
||||||
@ -99,8 +98,10 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
wxAuiToolBarItem* m_toolCharSelect;
|
wxAuiToolBarItem* m_toolCharSelect;
|
||||||
wxAuiToolBarItem* m_toolSendDestination;
|
wxAuiToolBarItem* m_toolSendDestination;
|
||||||
wxAuiToolBarItem* m_toolSendSource;
|
wxAuiToolBarItem* m_toolSendSource;
|
||||||
wxChoice* m_toolComposition;
|
wxAuiToolBarItem* m_toolComposition;
|
||||||
wxChoice* m_toolTranslationSeq;
|
wxChoice* m_toolTranslationSeq;
|
||||||
|
wxAuiToolBar* m_toolbarDestination;
|
||||||
|
wxFontPickerCtrl* m_fontpickerDestination;
|
||||||
wxAuiToolBarItem* m_toolWarnPUA;
|
wxAuiToolBarItem* m_toolWarnPUA;
|
||||||
wxZRColaCharacterCatalogPanel* m_panelChrCat;
|
wxZRColaCharacterCatalogPanel* m_panelChrCat;
|
||||||
wxStatusBar* m_statusBar;
|
wxStatusBar* m_statusBar;
|
||||||
@ -109,8 +110,8 @@ class wxZRColaFrameBase : public wxFrame
|
|||||||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
||||||
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
|
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
|
||||||
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCompositionChoice( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
virtual void OnFontDestinationChanged( wxFontPickerEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///
|
///
|
||||||
|
Binary file not shown.
@ -66,6 +66,9 @@
|
|||||||
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
|
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
|
||||||
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
|
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
|
||||||
|
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib.vcxproj">
|
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib.vcxproj">
|
||||||
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
|
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -42,7 +42,7 @@ void ZRCola::DBSource::character_bank::build_related()
|
|||||||
|
|
||||||
|
|
||||||
ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to) :
|
ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to) :
|
||||||
winstd::thread((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
|
win_handle<INVALID_HANDLE_VALUE>((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
|
||||||
m_heap(HeapCreate(0, 0, 0)),
|
m_heap(HeapCreate(0, 0, 0)),
|
||||||
m_cb(cb),
|
m_cb(cb),
|
||||||
m_from(from),
|
m_from(from),
|
||||||
@ -186,7 +186,7 @@ void ZRCola::DBSource::character_desc_idx::add_keywords(const set<wstring> &term
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindex<wchar_t, wchar_t, uint32_t> &idx) const
|
void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const
|
||||||
{
|
{
|
||||||
idx .clear();
|
idx .clear();
|
||||||
idx.keys .clear();
|
idx.keys .clear();
|
||||||
@ -205,7 +205,7 @@ void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindex<wchar_t, wchar
|
|||||||
|
|
||||||
// Convert the index.
|
// Convert the index.
|
||||||
for (const_iterator i = cbegin(), i_end = cend(); i != i_end; ++i) {
|
for (const_iterator i = cbegin(), i_end = cend(); i != i_end; ++i) {
|
||||||
ZRCola::mappair_t<uint32_t> p = { idx.keys.size(), idx.values.size() };
|
ZRCola::mappair_t<unsigned __int32> p = { idx.keys.size(), idx.values.size() };
|
||||||
idx.push_back(p);
|
idx.push_back(p);
|
||||||
idx.keys.insert(idx.keys.end(), i->first.cbegin(), i->first.cend());
|
idx.keys.insert(idx.keys.end(), i->first.cbegin(), i->first.cend());
|
||||||
idx.values.insert(idx.values.end(), i->second.cbegin(), i->second.cend());
|
idx.values.insert(idx.values.end(), i->second.cbegin(), i->second.cend());
|
||||||
@ -242,8 +242,6 @@ ZRCola::DBSource::~DBSource()
|
|||||||
m_comTranslation.free();
|
m_comTranslation.free();
|
||||||
m_pCharacterGroup1.free();
|
m_pCharacterGroup1.free();
|
||||||
m_comCharacterGroup.free();
|
m_comCharacterGroup.free();
|
||||||
m_pHighlight1.free();
|
|
||||||
m_comHighlight.free();
|
|
||||||
|
|
||||||
if (m_db)
|
if (m_db)
|
||||||
m_db->Close();
|
m_db->Close();
|
||||||
@ -307,7 +305,7 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
|
|||||||
com_obj<ADOParameters> params;
|
com_obj<ADOParameters> params;
|
||||||
wxVERIFY(SUCCEEDED(m_comTranslation->get_Parameters(¶ms)));
|
wxVERIFY(SUCCEEDED(m_comTranslation->get_Parameters(¶ms)));
|
||||||
wxASSERT_MSG(!m_pTranslation1, wxT("ADO command parameter already created"));
|
wxASSERT_MSG(!m_pTranslation1, wxT("ADO command parameter already created"));
|
||||||
wxVERIFY(SUCCEEDED(m_comTranslation->CreateParameter(bstr(L"@Script"), adSmallInt, adParamInput, 0, variant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pTranslation1)));
|
wxVERIFY(SUCCEEDED(m_comTranslation->CreateParameter(bstr(L"@Script"), adInteger, adParamInput, 0, variant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pTranslation1)));
|
||||||
wxVERIFY(SUCCEEDED(params->Append(m_pTranslation1)));
|
wxVERIFY(SUCCEEDED(params->Append(m_pTranslation1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,27 +322,10 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
|
|||||||
com_obj<ADOParameters> params;
|
com_obj<ADOParameters> params;
|
||||||
wxVERIFY(SUCCEEDED(m_comTranslationSets->get_Parameters(¶ms)));
|
wxVERIFY(SUCCEEDED(m_comTranslationSets->get_Parameters(¶ms)));
|
||||||
wxASSERT_MSG(!m_pTranslationSets1, wxT("ADO command parameter already created"));
|
wxASSERT_MSG(!m_pTranslationSets1, wxT("ADO command parameter already created"));
|
||||||
wxVERIFY(SUCCEEDED(m_comTranslationSets->CreateParameter(bstr(L"@ID"), adSmallInt, adParamInput, 0, variant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pTranslationSets1)));
|
wxVERIFY(SUCCEEDED(m_comTranslationSets->CreateParameter(bstr(L"@ID"), adInteger, adParamInput, 0, variant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pTranslationSets1)));
|
||||||
wxVERIFY(SUCCEEDED(params->Append(m_pTranslationSets1)));
|
wxVERIFY(SUCCEEDED(params->Append(m_pTranslationSets1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxASSERT_MSG(!m_comHighlight, wxT("ADO command already created"));
|
|
||||||
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comHighlight)));
|
|
||||||
wxVERIFY(SUCCEEDED(m_comHighlight->put_ActiveConnection(variant(m_db))));
|
|
||||||
wxVERIFY(SUCCEEDED(m_comHighlight->put_CommandType(adCmdText)));
|
|
||||||
wxVERIFY(SUCCEEDED(m_comHighlight->put_CommandText(bstr(L"SELECT [komb] "
|
|
||||||
L"FROM [VRS_HighlightChars2] "
|
|
||||||
L"WHERE [group]=? "
|
|
||||||
L"ORDER BY [komb]"))));
|
|
||||||
{
|
|
||||||
// Create and add command parameters.
|
|
||||||
com_obj<ADOParameters> params;
|
|
||||||
wxVERIFY(SUCCEEDED(m_comHighlight->get_Parameters(¶ms)));
|
|
||||||
wxASSERT_MSG(!m_pHighlight1, wxT("ADO command parameter already created"));
|
|
||||||
wxVERIFY(SUCCEEDED(m_comHighlight->CreateParameter(bstr(L"@group"), adSmallInt, adParamInput, 0, variant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pHighlight1)));
|
|
||||||
wxVERIFY(SUCCEEDED(params->Append(m_pHighlight1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0011: Could not open database (0x%x).\n"), (LPCTSTR)filename, hr);
|
_ftprintf(stderr, wxT("%s: error ZCC0011: Could not open database (0x%x).\n"), (LPCTSTR)filename, hr);
|
||||||
@ -405,15 +386,15 @@ bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, bool& val) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, short& val) const
|
bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, int& val) const
|
||||||
{
|
{
|
||||||
wxASSERT_MSG(f, wxT("field is empty"));
|
wxASSERT_MSG(f, wxT("field is empty"));
|
||||||
|
|
||||||
variant v;
|
variant v;
|
||||||
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
|
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
|
||||||
wxCHECK(SUCCEEDED(v.change_type(VT_I2)), false);
|
wxCHECK(SUCCEEDED(v.change_type(VT_I4)), false);
|
||||||
|
|
||||||
val = V_I2(&v);
|
val = V_I4(&v);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -670,7 +651,7 @@ bool ZRCola::DBSource::GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid
|
|||||||
// Add name to the list.
|
// Add name to the list.
|
||||||
names.push_back(std::move(name));
|
names.push_back(std::move(name));
|
||||||
break;
|
break;
|
||||||
} else if (ZRCola::tagname_db::tagname::CompareName(lcid, n->data(), (uint16_t)n->length(), name.data(), (uint16_t)name.length()) == CSTR_EQUAL) {
|
} else if (ZRCola::tagname_db::tagname::CompareName(lcid, n->data(), (unsigned __int16)n->length(), name.data(), (unsigned __int16)name.length()) == CSTR_EQUAL) {
|
||||||
// Name is already on the list.
|
// Name is already on the list.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -756,7 +737,7 @@ bool ZRCola::DBSource::SelectTranslations(com_obj<ADORecordset> &rs) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZRCola::DBSource::SelectTranslations(short set, winstd::com_obj<ADORecordset>& rs) const
|
bool ZRCola::DBSource::SelectTranslations(int set, winstd::com_obj<ADORecordset>& rs) const
|
||||||
{
|
{
|
||||||
// Create a new recordset.
|
// Create a new recordset.
|
||||||
rs.free();
|
rs.free();
|
||||||
@ -942,7 +923,7 @@ bool ZRCola::DBSource::GetTranslationSeq(const com_obj<ADORecordset>& rs, ZRCola
|
|||||||
wxVERIFY(SUCCEEDED(flds2->get_Item(variant(L"Script"), &f_set)));
|
wxVERIFY(SUCCEEDED(flds2->get_Item(variant(L"Script"), &f_set)));
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext(), n++) {
|
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext(), n++) {
|
||||||
short set;
|
int set;
|
||||||
wxCHECK(GetValue(f_set, set), false);
|
wxCHECK(GetValue(f_set, set), false);
|
||||||
ts.sets.push_back(set);
|
ts.sets.push_back(set);
|
||||||
}
|
}
|
||||||
@ -986,21 +967,21 @@ bool ZRCola::DBSource::GetKeySequence(const com_obj<ADORecordset>& rs, ZRCola::D
|
|||||||
wxCHECK(GetUnicodeString(f, ks.chr), false);
|
wxCHECK(GetUnicodeString(f, ks.chr), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
short modifiers;
|
int modifiers;
|
||||||
{
|
{
|
||||||
com_obj<ADOField> f;
|
com_obj<ADOField> f;
|
||||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Modifiers"), &f)));
|
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Modifiers"), &f)));
|
||||||
wxCHECK(GetValue(f, modifiers), false);
|
wxCHECK(GetValue(f, modifiers), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
short keycode1;
|
int keycode1;
|
||||||
{
|
{
|
||||||
com_obj<ADOField> f;
|
com_obj<ADOField> f;
|
||||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"KeyCodePre"), &f)));
|
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"KeyCodePre"), &f)));
|
||||||
wxCHECK(GetValue(f, keycode1), false);
|
wxCHECK(GetValue(f, keycode1), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
short keycode;
|
int keycode;
|
||||||
{
|
{
|
||||||
com_obj<ADOField> f;
|
com_obj<ADOField> f;
|
||||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"KeyCode"), &f)));
|
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"KeyCode"), &f)));
|
||||||
@ -1018,18 +999,18 @@ bool ZRCola::DBSource::GetKeySequence(const com_obj<ADORecordset>& rs, ZRCola::D
|
|||||||
if (keycode1) {
|
if (keycode1) {
|
||||||
// First key in the sequence is complete.
|
// First key in the sequence is complete.
|
||||||
keyseq::keycode kc1 = {
|
keyseq::keycode kc1 = {
|
||||||
keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode1)),
|
keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode1 & 0xffff)),
|
||||||
(modifiers & 0x100) != 0,
|
(modifiers & 0x100) != 0,
|
||||||
(modifiers & 0x200) != 0,
|
(modifiers & 0x200) != 0,
|
||||||
(modifiers & 0x400) != 0 };
|
(modifiers & 0x400) != 0 };
|
||||||
ks.seq.push_back(kc1);
|
ks.seq.push_back(kc1);
|
||||||
|
|
||||||
keyseq::keycode kc2 = { keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode)), shift };
|
keyseq::keycode kc2 = { keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode & 0xffff)), shift };
|
||||||
ks.seq.push_back(kc2);
|
ks.seq.push_back(kc2);
|
||||||
} else {
|
} else {
|
||||||
// First key in the sequence is only modifier(s).
|
// First key in the sequence is only modifier(s).
|
||||||
keyseq::keycode kc1 = {
|
keyseq::keycode kc1 = {
|
||||||
keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode)),
|
keyseq::keycode::translate_slen(static_cast<wchar_t>(keycode & 0xffff)),
|
||||||
shift || (modifiers & 0x100) != 0,
|
shift || (modifiers & 0x100) != 0,
|
||||||
(modifiers & 0x200) != 0,
|
(modifiers & 0x200) != 0,
|
||||||
(modifiers & 0x400) != 0 };
|
(modifiers & 0x400) != 0 };
|
||||||
@ -1458,41 +1439,3 @@ bool ZRCola::DBSource::GetTagName(const winstd::com_obj<ADORecordset>& rs, tagna
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZRCola::DBSource::SelectHighlights(short set, winstd::com_obj<ADORecordset>& rs) const
|
|
||||||
{
|
|
||||||
// Create a new recordset.
|
|
||||||
rs.free();
|
|
||||||
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)));
|
|
||||||
wxVERIFY(SUCCEEDED(rs->put_CursorLocation(adUseClient)));
|
|
||||||
wxVERIFY(SUCCEEDED(rs->put_CursorType(adOpenForwardOnly)));
|
|
||||||
wxVERIFY(SUCCEEDED(rs->put_LockType(adLockReadOnly)));
|
|
||||||
|
|
||||||
// Open it.
|
|
||||||
wxVERIFY(SUCCEEDED(m_pHighlight1->put_Value(variant(set))));
|
|
||||||
if (FAILED(rs->Open(variant(m_comHighlight), variant(DISP_E_PARAMNOTFOUND, VT_ERROR)))) {
|
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0101: Error loading highlights from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
|
|
||||||
LogErrors();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool ZRCola::DBSource::GetHighlight(const com_obj<ADORecordset>& rs, ZRCola::DBSource::highlight& h) const
|
|
||||||
{
|
|
||||||
wxASSERT_MSG(rs, wxT("recordset is empty"));
|
|
||||||
|
|
||||||
com_obj<ADOFields> flds;
|
|
||||||
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
|
|
||||||
|
|
||||||
{
|
|
||||||
com_obj<ADOField> f;
|
|
||||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"komb"), &f)));
|
|
||||||
wxCHECK(GetUnicodeString(f, h.chr), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <zrcola/character.h>
|
#include <zrcola/character.h>
|
||||||
#include <zrcola/highlight.h>
|
#include <zrcola/common.h>
|
||||||
#include <zrcola/language.h>
|
#include <zrcola/language.h>
|
||||||
#include <zrcola/tag.h>
|
#include <zrcola/tag.h>
|
||||||
#include <zrcola/translate.h>
|
#include <zrcola/translate.h>
|
||||||
@ -47,7 +47,7 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class charseq {
|
class charseq {
|
||||||
public:
|
public:
|
||||||
short rank; ///< Sequence rank
|
int rank; ///< Sequence rank
|
||||||
std::wstring str; ///< Sequence string
|
std::wstring str; ///< Sequence string
|
||||||
|
|
||||||
inline charseq() :
|
inline charseq() :
|
||||||
@ -55,19 +55,19 @@ namespace ZRCola {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline charseq(_In_ short _rank, _In_z_ const wchar_t *_str) :
|
inline charseq(_In_ int _rank, _In_z_ const wchar_t *_str) :
|
||||||
rank(_rank),
|
rank(_rank),
|
||||||
str (_str)
|
str (_str)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline charseq(_In_ short _rank, _In_ const std::wstring &_str) :
|
inline charseq(_In_ int _rank, _In_ const std::wstring &_str) :
|
||||||
rank(_rank),
|
rank(_rank),
|
||||||
str (_str)
|
str (_str)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline charseq(_In_ short _rank, _Inout_ std::wstring &&_str) :
|
inline charseq(_In_ int _rank, _Inout_ std::wstring &&_str) :
|
||||||
rank(_rank),
|
rank(_rank),
|
||||||
str (std::move(_str))
|
str (std::move(_str))
|
||||||
{
|
{
|
||||||
@ -113,12 +113,12 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class translation {
|
class translation {
|
||||||
public:
|
public:
|
||||||
short set; ///< Translation set ID
|
int set; ///< Translation set ID
|
||||||
charseq src; ///< Source sequence
|
charseq src; ///< Source sequence
|
||||||
std::string norm; ///< Normalization footprint
|
std::string norm; ///< Normalization footprint
|
||||||
charseq dst; ///< Destination sequence
|
charseq dst; ///< Destination sequence
|
||||||
|
|
||||||
inline translation() : set((short)ZRCOLA_TRANSETID_DEFAULT) {}
|
inline translation() : set((int)ZRCOLA_TRANSEQID_DEFAULT) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -127,11 +127,11 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class transet {
|
class transet {
|
||||||
public:
|
public:
|
||||||
short set; ///< ID
|
int set; ///< ID
|
||||||
std::wstring src; ///< Source name
|
std::wstring src; ///< Source name
|
||||||
std::wstring dst; ///< Destination name
|
std::wstring dst; ///< Destination name
|
||||||
|
|
||||||
inline transet() : set((short)ZRCOLA_TRANSETID_DEFAULT) {}
|
inline transet() : set((int)ZRCOLA_TRANSEQID_DEFAULT) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -140,10 +140,10 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class transeq {
|
class transeq {
|
||||||
public:
|
public:
|
||||||
short seq; ///< ID
|
int seq; ///< ID
|
||||||
short rank; ///< Rank
|
int rank; ///< Rank
|
||||||
std::wstring name; ///< Name
|
std::wstring name; ///< Name
|
||||||
std::vector<short> sets; ///< Sets
|
std::vector<int> sets; ///< Sets
|
||||||
|
|
||||||
inline transeq() :
|
inline transeq() :
|
||||||
seq(0),
|
seq(0),
|
||||||
@ -222,11 +222,11 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class chrgrp {
|
class chrgrp {
|
||||||
public:
|
public:
|
||||||
short grp; ///< Character group ID
|
int grp; ///< Character group ID
|
||||||
short rank; ///< Rank
|
int rank; ///< Rank
|
||||||
std::wstring name; ///< Name
|
std::wstring name; ///< Name
|
||||||
std::vector<wchar_t> chars; ///< Characters (zero-delimited)
|
std::vector<wchar_t> chars; ///< Characters (zero-delimited)
|
||||||
std::vector<uint16_t> show; ///< Bit vector if particular character from \c chars is displayed initially
|
std::vector<unsigned __int16> show; ///< Bit vector if particular character from \c chars is displayed initially
|
||||||
|
|
||||||
inline chrgrp() : grp(0), rank(0) {}
|
inline chrgrp() : grp(0), rank(0) {}
|
||||||
};
|
};
|
||||||
@ -275,7 +275,7 @@ namespace ZRCola {
|
|||||||
void build_related();
|
void build_related();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class build_related_worker : public winstd::thread
|
class build_related_worker : public winstd::win_handle<INVALID_HANDLE_VALUE>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to);
|
build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to);
|
||||||
@ -308,12 +308,19 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
/// Character description index key comparator
|
/// Character description index key comparator
|
||||||
///
|
///
|
||||||
struct character_desc_idx_less
|
struct character_desc_idx_less : public std::binary_function<std::wstring, std::wstring, bool>
|
||||||
{
|
{
|
||||||
inline bool operator()(const std::wstring& _Left, const std::wstring& _Right) const
|
inline bool operator()(const std::wstring& _Left, const std::wstring& _Right) const
|
||||||
{
|
{
|
||||||
auto &coll = std::use_facet<std::collate<wchar_t>>(std::locale());
|
size_t
|
||||||
return coll.compare(&*_Left.cbegin(), &*_Left.cend(), &*_Right.cbegin(), &*_Right.cend()) < 0;
|
_Left_len = _Left .size(),
|
||||||
|
_Right_len = _Right.size();
|
||||||
|
|
||||||
|
int r = _wcsncoll(_Left.c_str(), _Right.c_str(), std::min<size_t>(_Left_len, _Right_len));
|
||||||
|
if (r != 0 ) return r < 0;
|
||||||
|
else if (_Left_len < _Right_len) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -333,7 +340,7 @@ namespace ZRCola {
|
|||||||
add_keywords(terms, chr, sub);
|
add_keywords(terms, chr, sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
void save(ZRCola::textindex<wchar_t, wchar_t, uint32_t> &idx) const;
|
void save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline void add_keyword(const std::wstring &term, const std::wstring &chr)
|
inline void add_keyword(const std::wstring &term, const std::wstring &chr)
|
||||||
@ -366,7 +373,7 @@ namespace ZRCola {
|
|||||||
class chrcat {
|
class chrcat {
|
||||||
public:
|
public:
|
||||||
ZRCola::chrcatid_t cat; ///> Category ID
|
ZRCola::chrcatid_t cat; ///> Category ID
|
||||||
short rank; ///< Rank
|
int rank; ///< Rank
|
||||||
std::wstring name; ///< Name
|
std::wstring name; ///< Name
|
||||||
|
|
||||||
inline chrcat() : cat(ZRCola::chrcatid_t::blank), rank(0) {}
|
inline chrcat() : cat(ZRCola::chrcatid_t::blank), rank(0) {}
|
||||||
@ -379,7 +386,7 @@ namespace ZRCola {
|
|||||||
class chrtag {
|
class chrtag {
|
||||||
public:
|
public:
|
||||||
std::wstring chr; ///> Character
|
std::wstring chr; ///> Character
|
||||||
short tag; ///< Tag ID
|
int tag; ///< Tag ID
|
||||||
|
|
||||||
inline chrtag() : tag(0) {}
|
inline chrtag() : tag(0) {}
|
||||||
};
|
};
|
||||||
@ -390,25 +397,13 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
class tagname {
|
class tagname {
|
||||||
public:
|
public:
|
||||||
short tag; ///< Tag ID
|
int tag; ///< Tag ID
|
||||||
std::map<LCID, std::list<std::wstring> > names; ///< Names
|
std::map<LCID, std::list<std::wstring> > names; ///< Names
|
||||||
|
|
||||||
inline tagname() : tag(0) {}
|
inline tagname() : tag(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Highlight
|
|
||||||
///
|
|
||||||
class highlight {
|
|
||||||
public:
|
|
||||||
short set; ///< Highlight set ID
|
|
||||||
std::wstring chr; ///< Character sequence
|
|
||||||
|
|
||||||
inline highlight() : set((short)ZRCOLA_HLGHTSETID_DEFAULT) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DBSource();
|
DBSource();
|
||||||
virtual ~DBSource();
|
virtual ~DBSource();
|
||||||
@ -457,6 +452,18 @@ namespace ZRCola {
|
|||||||
return SUCCEEDED(rs->get_RecordCount(&count)) ? count : (size_t)-1;
|
return SUCCEEDED(rs->get_RecordCount(&count)) ? count : (size_t)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Splits string to individual keywords
|
||||||
|
///
|
||||||
|
/// \param[in ] str String
|
||||||
|
/// \param[out] keywords Array of keywords
|
||||||
|
///
|
||||||
|
/// \returns
|
||||||
|
/// - true when successful
|
||||||
|
/// - false otherwise
|
||||||
|
///
|
||||||
|
static bool GetKeywords(const wchar_t *str, std::vector< std::wstring > &keywords);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Gets boolean from ZRCola.zrc database
|
/// Gets boolean from ZRCola.zrc database
|
||||||
///
|
///
|
||||||
@ -479,7 +486,7 @@ namespace ZRCola {
|
|||||||
/// - true when successful
|
/// - true when successful
|
||||||
/// - false otherwise
|
/// - false otherwise
|
||||||
///
|
///
|
||||||
bool GetValue(const winstd::com_obj<ADOField>& f, short& val) const;
|
bool GetValue(const winstd::com_obj<ADOField>& f, int& val) const;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Gets string from ZRCola.zrc database
|
/// Gets string from ZRCola.zrc database
|
||||||
@ -621,7 +628,7 @@ namespace ZRCola {
|
|||||||
/// - true when query succeeds
|
/// - true when query succeeds
|
||||||
/// - false otherwise
|
/// - false otherwise
|
||||||
///
|
///
|
||||||
bool SelectTranslations(short set, winstd::com_obj<ADORecordset>& rs) const;
|
bool SelectTranslations(int set, winstd::com_obj<ADORecordset>& rs) const;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns translation data
|
/// Returns translation data
|
||||||
@ -865,30 +872,6 @@ namespace ZRCola {
|
|||||||
///
|
///
|
||||||
bool GetTagName(const winstd::com_obj<ADORecordset>& rs, tagname& tn) const;
|
bool GetTagName(const winstd::com_obj<ADORecordset>& rs, tagname& tn) const;
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns character highlights by set
|
|
||||||
///
|
|
||||||
/// \param[in ] set Highlight set ID
|
|
||||||
/// \param[out] rs Recordset with results
|
|
||||||
///
|
|
||||||
/// \returns
|
|
||||||
/// - true when query succeeds
|
|
||||||
/// - false otherwise
|
|
||||||
///
|
|
||||||
bool SelectHighlights(short set, winstd::com_obj<ADORecordset>& rs) const;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns highlight data
|
|
||||||
///
|
|
||||||
/// \param[in] rs Recordset with results
|
|
||||||
/// \param[out] h Highlight
|
|
||||||
///
|
|
||||||
/// \returns
|
|
||||||
/// - true when succeeded
|
|
||||||
/// - false otherwise
|
|
||||||
///
|
|
||||||
bool GetHighlight(const winstd::com_obj<ADORecordset>& rs, highlight& h) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::basic_string<TCHAR> m_filename; ///< Database filename
|
std::basic_string<TCHAR> m_filename; ///< Database filename
|
||||||
winstd::com_obj<ADOConnection> m_db; ///< Database
|
winstd::com_obj<ADOConnection> m_db; ///< Database
|
||||||
@ -903,9 +886,6 @@ namespace ZRCola {
|
|||||||
winstd::com_obj<ADOCommand> m_comTranslationSets; ///< ADO Command for GetTranslationSeq subquery
|
winstd::com_obj<ADOCommand> m_comTranslationSets; ///< ADO Command for GetTranslationSeq subquery
|
||||||
winstd::com_obj<ADOParameter> m_pTranslationSets1; ///< \c m_comTranslationSets parameter
|
winstd::com_obj<ADOParameter> m_pTranslationSets1; ///< \c m_comTranslationSets parameter
|
||||||
|
|
||||||
winstd::com_obj<ADOCommand> m_comHighlight; ///< ADO Command for SelectHighlights subquery
|
|
||||||
winstd::com_obj<ADOParameter> m_pHighlight1; ///< \c m_comHighlights parameter
|
|
||||||
|
|
||||||
std::set<std::wstring> m_terms_ignore; ///< Terms to ignore when comparing characters
|
std::set<std::wstring> m_terms_ignore; ///< Terms to ignore when comparing characters
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -913,16 +893,19 @@ namespace ZRCola {
|
|||||||
|
|
||||||
inline ZRCola::translation_db& operator<<(_Inout_ ZRCola::translation_db &db, _In_ const ZRCola::DBSource::translation &rec)
|
inline ZRCola::translation_db& operator<<(_Inout_ ZRCola::translation_db &db, _In_ const ZRCola::DBSource::translation &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.set);
|
wxASSERT_MSG((int)0xffff0000 <= rec.set && rec.set <= (int)0x0000ffff, wxT("translation set id out of bounds"));
|
||||||
db.data.push_back((uint16_t)rec.dst.rank);
|
db.data.push_back((unsigned __int16)rec.set);
|
||||||
db.data.push_back((uint16_t)rec.src.rank);
|
wxASSERT_MSG((int)0xffff8000 <= rec.dst.rank && rec.dst.rank <= (int)0x00007fff, wxT("destination character rank out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.dst.rank);
|
||||||
|
wxASSERT_MSG((int)0xffff8000 <= rec.src.rank && rec.src.rank <= (int)0x00007fff, wxT("source character rank out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.src.rank);
|
||||||
std::wstring::size_type n = rec.dst.str.length();
|
std::wstring::size_type n = rec.dst.str.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("destination overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("destination overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.src.str.length();
|
n += rec.src.str.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("source overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("source overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.dst.str.cbegin(), rec.dst.str.cend());
|
db.data.insert(db.data.end(), rec.dst.str.cbegin(), rec.dst.str.cend());
|
||||||
db.data.insert(db.data.end(), rec.src.str.cbegin(), rec.src.str.cend());
|
db.data.insert(db.data.end(), rec.src.str.cbegin(), rec.src.str.cend());
|
||||||
db.idxSrc.push_back(idx);
|
db.idxSrc.push_back(idx);
|
||||||
@ -934,14 +917,15 @@ inline ZRCola::translation_db& operator<<(_Inout_ ZRCola::translation_db &db, _I
|
|||||||
|
|
||||||
inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const ZRCola::DBSource::transet &rec)
|
inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const ZRCola::DBSource::transet &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.set);
|
wxASSERT_MSG((int)0xffff0000 <= rec.set && rec.set <= (int)0x0000ffff, wxT("translation set id out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.set);
|
||||||
std::wstring::size_type n = rec.src.length();
|
std::wstring::size_type n = rec.src.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("translation set source name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("translation set source name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.dst.length();
|
n += rec.dst.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("translation set destination name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("translation set destination name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.src.cbegin(), rec.src.cend());
|
db.data.insert(db.data.end(), rec.src.cbegin(), rec.src.cend());
|
||||||
db.data.insert(db.data.end(), rec.dst.cbegin(), rec.dst.cend());
|
db.data.insert(db.data.end(), rec.dst.cbegin(), rec.dst.cend());
|
||||||
db.idxTranSet.push_back(idx);
|
db.idxTranSet.push_back(idx);
|
||||||
@ -952,18 +936,23 @@ inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const
|
|||||||
|
|
||||||
inline ZRCola::transeq_db& operator<<(_Inout_ ZRCola::transeq_db &db, _In_ const ZRCola::DBSource::transeq &rec)
|
inline ZRCola::transeq_db& operator<<(_Inout_ ZRCola::transeq_db &db, _In_ const ZRCola::DBSource::transeq &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.seq);
|
wxASSERT_MSG((int)0xffff8000 <= rec.seq && rec.seq <= (int)0x00007fff, wxT("translation sequence id out of bounds"));
|
||||||
db.data.push_back((uint16_t)rec.rank);
|
db.data.push_back((unsigned __int16)rec.seq);
|
||||||
|
wxASSERT_MSG((int)0xffff8000 <= rec.rank && rec.rank <= (int)0x00007fff, wxT("translation rank id out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.rank);
|
||||||
std::wstring::size_type n = rec.name.length();
|
std::wstring::size_type n = rec.name.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.sets.size();
|
n += rec.sets.size();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence sets overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence sets overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
||||||
for (auto s = rec.sets.cbegin(), s_end = rec.sets.cend(); s != s_end; ++s)
|
for (auto s = rec.sets.cbegin(), s_end = rec.sets.cend(); s != s_end; ++s) {
|
||||||
db.data.push_back((uint16_t)*s);
|
int val = *s;
|
||||||
|
wxASSERT_MSG(val <= 0xffff, wxT("translation sequence ID overflow"));
|
||||||
|
db.data.push_back((unsigned __int16)val);
|
||||||
|
}
|
||||||
db.idxTranSeq.push_back(idx);
|
db.idxTranSeq.push_back(idx);
|
||||||
db.idxRank .push_back(idx);
|
db.idxRank .push_back(idx);
|
||||||
|
|
||||||
@ -973,13 +962,13 @@ inline ZRCola::transeq_db& operator<<(_Inout_ ZRCola::transeq_db &db, _In_ const
|
|||||||
|
|
||||||
inline ZRCola::keyseq_db& operator<<(_Inout_ ZRCola::keyseq_db &db, _In_ const ZRCola::DBSource::keyseq &rec)
|
inline ZRCola::keyseq_db& operator<<(_Inout_ ZRCola::keyseq_db &db, _In_ const ZRCola::DBSource::keyseq &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
std::wstring::size_type n = rec.chr.length();
|
std::wstring::size_type n = rec.chr.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.seq.size() * sizeof(ZRCola::keyseq_db::keyseq::key_t) / sizeof(wchar_t);
|
n += rec.seq.size() * sizeof(ZRCola::keyseq_db::keyseq::key_t) / sizeof(wchar_t);
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("key sequence overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("key sequence overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
||||||
for (auto kc = rec.seq.cbegin(), kc_end = rec.seq.cend(); kc != kc_end; ++kc) {
|
for (auto kc = rec.seq.cbegin(), kc_end = rec.seq.cend(); kc != kc_end; ++kc) {
|
||||||
db.data.push_back(kc->key);
|
db.data.push_back(kc->key);
|
||||||
@ -997,11 +986,11 @@ inline ZRCola::keyseq_db& operator<<(_Inout_ ZRCola::keyseq_db &db, _In_ const Z
|
|||||||
|
|
||||||
inline ZRCola::language_db& operator<<(_Inout_ ZRCola::language_db &db, _In_ const ZRCola::DBSource::language &rec)
|
inline ZRCola::language_db& operator<<(_Inout_ ZRCola::language_db &db, _In_ const ZRCola::DBSource::language &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.lang), reinterpret_cast<const uint16_t*>(&rec.lang + 1));
|
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.lang), reinterpret_cast<const unsigned __int16*>(&rec.lang + 1));
|
||||||
std::wstring::size_type n = rec.name.length();
|
std::wstring::size_type n = rec.name.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("language name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("language name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
||||||
db.idxLang.push_back(idx);
|
db.idxLang.push_back(idx);
|
||||||
|
|
||||||
@ -1011,11 +1000,11 @@ inline ZRCola::language_db& operator<<(_Inout_ ZRCola::language_db &db, _In_ con
|
|||||||
|
|
||||||
inline ZRCola::langchar_db& operator<<(_Inout_ ZRCola::langchar_db &db, _In_ const ZRCola::DBSource::langchar &rec)
|
inline ZRCola::langchar_db& operator<<(_Inout_ ZRCola::langchar_db &db, _In_ const ZRCola::DBSource::langchar &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.lang), reinterpret_cast<const uint16_t*>(&rec.lang + 1));
|
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.lang), reinterpret_cast<const unsigned __int16*>(&rec.lang + 1));
|
||||||
std::wstring::size_type n = rec.chr.length();
|
std::wstring::size_type n = rec.chr.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
||||||
db.idxChr .push_back(idx);
|
db.idxChr .push_back(idx);
|
||||||
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
|
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
|
||||||
@ -1028,15 +1017,17 @@ inline ZRCola::langchar_db& operator<<(_Inout_ ZRCola::langchar_db &db, _In_ con
|
|||||||
|
|
||||||
inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const ZRCola::DBSource::chrgrp &rec)
|
inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const ZRCola::DBSource::chrgrp &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.grp);
|
wxASSERT_MSG((int)0xffff8000 <= rec.grp && rec.grp <= (int)0x00007fff, wxT("character group ID out of bounds"));
|
||||||
db.data.push_back((uint16_t)rec.rank);
|
db.data.push_back((unsigned __int16)rec.grp);
|
||||||
|
wxASSERT_MSG((int)0xffff8000 <= rec.rank && rec.rank <= (int)0x00007fff, wxT("character group rank out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.rank);
|
||||||
std::wstring::size_type n = rec.name.length();
|
std::wstring::size_type n = rec.name.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character group name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character group name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.chars.size();
|
n += rec.chars.size();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character group characters overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character group characters overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.name .cbegin(), rec.name .cend());
|
db.data.insert(db.data.end(), rec.name .cbegin(), rec.name .cend());
|
||||||
db.data.insert(db.data.end(), rec.chars.cbegin(), rec.chars.cend());
|
db.data.insert(db.data.end(), rec.chars.cbegin(), rec.chars.cend());
|
||||||
db.data.insert(db.data.end(), rec.show .cbegin(), rec.show .cend());
|
db.data.insert(db.data.end(), rec.show .cbegin(), rec.show .cend());
|
||||||
@ -1048,17 +1039,17 @@ inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const Z
|
|||||||
|
|
||||||
inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ const ZRCola::DBSource::character &rec)
|
inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ const ZRCola::DBSource::character &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.second.cat), reinterpret_cast<const uint16_t*>(&rec.second.cat + 1));
|
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.second.cat), reinterpret_cast<const unsigned __int16*>(&rec.second.cat + 1));
|
||||||
std::wstring::size_type n = rec.first.length();
|
std::wstring::size_type n = rec.first.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.second.desc.length();
|
n += rec.second.desc.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character description overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character description overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
n += rec.second.rel.size();
|
n += rec.second.rel.size();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("related characters overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("related characters overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.first .cbegin(), rec.first .cend());
|
db.data.insert(db.data.end(), rec.first .cbegin(), rec.first .cend());
|
||||||
db.data.insert(db.data.end(), rec.second.desc.cbegin(), rec.second.desc.cend());
|
db.data.insert(db.data.end(), rec.second.desc.cbegin(), rec.second.desc.cend());
|
||||||
db.data.insert(db.data.end(), rec.second.rel .cbegin(), rec.second.rel .cend());
|
db.data.insert(db.data.end(), rec.second.rel .cbegin(), rec.second.rel .cend());
|
||||||
@ -1070,12 +1061,13 @@ inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ c
|
|||||||
|
|
||||||
inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const ZRCola::DBSource::chrcat &rec)
|
inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const ZRCola::DBSource::chrcat &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.cat), reinterpret_cast<const uint16_t*>(&rec.cat + 1));
|
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.cat), reinterpret_cast<const unsigned __int16*>(&rec.cat + 1));
|
||||||
db.data.push_back((uint16_t)rec.rank);
|
wxASSERT_MSG((int)0xffff8000 <= rec.rank && rec.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.rank);
|
||||||
std::wstring::size_type n = rec.name.length();
|
std::wstring::size_type n = rec.name.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character category name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character category name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
||||||
db.idxChrCat.push_back(idx);
|
db.idxChrCat.push_back(idx);
|
||||||
db.idxRank .push_back(idx);
|
db.idxRank .push_back(idx);
|
||||||
@ -1086,11 +1078,12 @@ inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const Z
|
|||||||
|
|
||||||
inline ZRCola::chrtag_db& operator<<(_Inout_ ZRCola::chrtag_db &db, _In_ const ZRCola::DBSource::chrtag &rec)
|
inline ZRCola::chrtag_db& operator<<(_Inout_ ZRCola::chrtag_db &db, _In_ const ZRCola::DBSource::chrtag &rec)
|
||||||
{
|
{
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.tag);
|
wxASSERT_MSG((int)0xffff8000 <= rec.tag && rec.tag <= (int)0x00007fff, wxT("tag out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.tag);
|
||||||
std::wstring::size_type n = rec.chr.length();
|
std::wstring::size_type n = rec.chr.length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
||||||
db.idxChr.push_back(idx);
|
db.idxChr.push_back(idx);
|
||||||
db.idxTag.push_back(idx);
|
db.idxTag.push_back(idx);
|
||||||
@ -1103,13 +1096,14 @@ inline ZRCola::tagname_db& operator<<(_Inout_ ZRCola::tagname_db &db, _In_ const
|
|||||||
{
|
{
|
||||||
for (auto ln = rec.names.cbegin(), ln_end = rec.names.cend(); ln != ln_end; ++ln) {
|
for (auto ln = rec.names.cbegin(), ln_end = rec.names.cend(); ln != ln_end; ++ln) {
|
||||||
for (auto nm = ln->second.cbegin(), nm_end = ln->second.cend(); nm != nm_end; ++nm) {
|
for (auto nm = ln->second.cbegin(), nm_end = ln->second.cend(); nm != nm_end; ++nm) {
|
||||||
uint32_t idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
db.data.push_back((uint16_t)rec.tag);
|
wxASSERT_MSG((int)0xffff8000 <= rec.tag && rec.tag <= (int)0x00007fff, wxT("tag out of bounds"));
|
||||||
|
db.data.push_back((unsigned __int16)rec.tag);
|
||||||
db.data.push_back(LOWORD(ln->first));
|
db.data.push_back(LOWORD(ln->first));
|
||||||
db.data.push_back(HIWORD(ln->first));
|
db.data.push_back(HIWORD(ln->first));
|
||||||
std::wstring::size_type n = nm->length();
|
std::wstring::size_type n = nm->length();
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("tag name overflow"));
|
wxASSERT_MSG(n <= 0xffff, wxT("tag name overflow"));
|
||||||
db.data.push_back((uint16_t)n);
|
db.data.push_back((unsigned __int16)n);
|
||||||
db.data.insert(db.data.end(), nm->cbegin(), nm->cend());
|
db.data.insert(db.data.end(), nm->cbegin(), nm->cend());
|
||||||
db.idxName.push_back(idx);
|
db.idxName.push_back(idx);
|
||||||
db.idxTag .push_back(idx);
|
db.idxTag .push_back(idx);
|
||||||
@ -1118,17 +1112,3 @@ inline ZRCola::tagname_db& operator<<(_Inout_ ZRCola::tagname_db &db, _In_ const
|
|||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline ZRCola::highlight_db& operator<<(_Inout_ ZRCola::highlight_db &db, _In_ const ZRCola::DBSource::highlight &rec)
|
|
||||||
{
|
|
||||||
uint32_t idx = db.data.size();
|
|
||||||
db.data.push_back((uint16_t)rec.set);
|
|
||||||
std::wstring::size_type n = rec.chr.length();
|
|
||||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
|
||||||
db.data.push_back((uint16_t)n);
|
|
||||||
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
|
|
||||||
db.idxChr.push_back(idx);
|
|
||||||
|
|
||||||
return db;
|
|
||||||
}
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: ZRColaCompile\n"
|
"Project-Id-Version: ZRColaCompile\n"
|
||||||
"POT-Creation-Date: 2022-02-17 13:30+0100\n"
|
"POT-Creation-Date: 2018-09-19 09:00+0200\n"
|
||||||
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
|
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
|
||||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||||
@ -10,25 +10,25 @@ msgstr ""
|
|||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Generator: Poedit 2.4.2\n"
|
"X-Generator: Poedit 2.1.1\n"
|
||||||
"X-Poedit-Basepath: ..\n"
|
"X-Poedit-Basepath: ..\n"
|
||||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||||
"X-Poedit-SourceCharset: UTF-8\n"
|
"X-Poedit-SourceCharset: UTF-8\n"
|
||||||
"X-Poedit-KeywordsList: _\n"
|
"X-Poedit-KeywordsList: _\n"
|
||||||
"X-Poedit-SearchPath-0: .\n"
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
|
||||||
#: main.cpp:239
|
#: main.cpp:251
|
||||||
msgid "Show this help message"
|
msgid "Show this help message"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: main.cpp:240
|
#: main.cpp:252
|
||||||
msgid "<Input file>"
|
msgid "<input file>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: main.cpp:241
|
#: main.cpp:253
|
||||||
msgid "<Output file>"
|
msgid "<output file>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: main.cpp:242
|
#: main.cpp:254
|
||||||
msgid "Output POT catalog"
|
msgid "<output POT catalog>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@ -16,8 +16,8 @@ using namespace winstd;
|
|||||||
class com_translation
|
class com_translation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
short rank_src; ///< Source sequence rank
|
int rank_src; ///< Source sequence rank
|
||||||
short rank_dst; ///< Destination character rank
|
int rank_dst; ///< Destination character rank
|
||||||
string norm; ///< Normalization footprint
|
string norm; ///< Normalization footprint
|
||||||
|
|
||||||
inline com_translation() :
|
inline com_translation() :
|
||||||
@ -26,20 +26,20 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline com_translation(short _rank_src, short _rank_dst) :
|
inline com_translation(int _rank_src, int _rank_dst) :
|
||||||
rank_src(_rank_src),
|
rank_src(_rank_src),
|
||||||
rank_dst(_rank_dst)
|
rank_dst(_rank_dst)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline com_translation(short _rank_src, short _rank_dst, const char *_norm) :
|
inline com_translation(int _rank_src, int _rank_dst, const char *_norm) :
|
||||||
rank_src(_rank_src),
|
rank_src(_rank_src),
|
||||||
rank_dst(_rank_dst),
|
rank_dst(_rank_dst),
|
||||||
norm (_norm )
|
norm (_norm )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline com_translation(short _rank_src, short _rank_dst, string &&_norm) :
|
inline com_translation(int _rank_src, int _rank_dst, string &&_norm) :
|
||||||
rank_src( _rank_src ),
|
rank_src( _rank_src ),
|
||||||
rank_dst( _rank_dst ),
|
rank_dst( _rank_dst ),
|
||||||
norm (std::move(_norm ))
|
norm (std::move(_norm ))
|
||||||
@ -365,8 +365,8 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
translation_db::mapped_type::mapped_type ct(d1->second.rank_src + r->rank, d1->second.rank_dst);
|
translation_db::mapped_type::mapped_type ct(d1->second.rank_src + r->rank, d1->second.rank_dst);
|
||||||
auto hit = t2->second.find(r->str);
|
auto hit = t2->second.find(r->str);
|
||||||
if (hit != t2->second.end()) {
|
if (hit != t2->second.end()) {
|
||||||
hit->second.rank_src = std::min<short>(hit->second.rank_src, ct.rank_src);
|
hit->second.rank_src = std::min<int>(hit->second.rank_src, ct.rank_src);
|
||||||
hit->second.rank_dst = std::max<short>(hit->second.rank_dst, ct.rank_dst);
|
hit->second.rank_dst = std::max<int>(hit->second.rank_dst, ct.rank_dst);
|
||||||
} else
|
} else
|
||||||
t2->second.insert(pair<translation_db::mapped_type::key_type, translation_db::mapped_type::mapped_type>(r->str, std::move(ct)));
|
t2->second.insert(pair<translation_db::mapped_type::key_type, translation_db::mapped_type::mapped_type>(r->str, std::move(ct)));
|
||||||
}
|
}
|
||||||
@ -374,34 +374,21 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Preallocate memory.
|
// Preallocate memory.
|
||||||
db_trans.idxSrc.reserve(count*2);
|
db_trans.idxSrc.reserve(count);
|
||||||
db_trans.idxDst.reserve(count*2);
|
db_trans.idxDst.reserve(count);
|
||||||
db_trans.data .reserve(count*2*8);
|
db_trans.data .reserve(count*5);
|
||||||
|
|
||||||
// Parse translations and build index and data.
|
// Parse translations and build index and data.
|
||||||
ZRCola::DBSource::translation trans;
|
ZRCola::DBSource::translation trans;
|
||||||
|
trans.set = 0;
|
||||||
for (auto t = db_temp2.cbegin(), t_end = db_temp2.cend(); t != t_end; ++t) {
|
for (auto t = db_temp2.cbegin(), t_end = db_temp2.cend(); t != t_end; ++t) {
|
||||||
// Add translation to index and data.
|
// Add translation to index and data.
|
||||||
trans.dst.str = t->first;
|
trans.dst.str = t->first;
|
||||||
for (auto d = t->second.cbegin(), d_end = t->second.cend(); d != d_end; ++d) {
|
for (auto d = t->second.cbegin(), d_end = t->second.cend(); d != d_end; ++d) {
|
||||||
trans.set = (short)ZRCOLA_TRANSETID_DEFAULT;
|
|
||||||
trans.dst.rank = d->second.rank_dst;
|
trans.dst.rank = d->second.rank_dst;
|
||||||
trans.src.rank = d->second.rank_src;
|
trans.src.rank = d->second.rank_src;
|
||||||
trans.src.str = d->first;
|
trans.src.str = d->first;
|
||||||
db_trans << trans;
|
db_trans << trans;
|
||||||
|
|
||||||
// If destination contains no PUA characters, add it to the ZRCola » Unicode transliteration too.
|
|
||||||
bool has_pua = false;
|
|
||||||
for (auto ch = trans.dst.str.cbegin(), ch_end = trans.dst.str.cend(); ch != ch_end; ++ch)
|
|
||||||
if (ZRCola::ispua(*ch)) {
|
|
||||||
has_pua = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!has_pua) {
|
|
||||||
trans.set = (short)ZRCOLA_TRANSETID_UNICODE;
|
|
||||||
trans.dst.rank += 50;
|
|
||||||
db_trans << trans;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -414,37 +401,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
com_obj<ADORecordset> rs_tran;
|
|
||||||
if (src.SelectTranslations(static_cast<short>(ZRCOLA_TRANSETID_UNICODE), rs_tran)) {
|
|
||||||
size_t count = src.GetRecordsetCount(rs_tran);
|
|
||||||
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
|
||||||
// Preallocate memory.
|
|
||||||
db_trans.idxSrc.reserve(db_trans.idxSrc.size() + count);
|
|
||||||
db_trans.idxDst.reserve(db_trans.idxDst.size() + count);
|
|
||||||
db_trans.data .reserve(db_trans.data.size() + count*8);
|
|
||||||
|
|
||||||
// Parse translations and build temporary database.
|
|
||||||
ZRCola::DBSource::translation trans;
|
|
||||||
trans.set = (short)ZRCOLA_TRANSETID_UNICODE;
|
|
||||||
for (; !ZRCola::DBSource::IsEOF(rs_tran); rs_tran->MoveNext()) {
|
|
||||||
// Read translation from the database.
|
|
||||||
if (src.GetTranslation(rs_tran, trans)) {
|
|
||||||
// Add translation to index and data.
|
|
||||||
db_trans << trans;
|
|
||||||
} else
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0004: Error getting Unicode translation count from database or too many translations.\n"), (LPCTSTR)filenameIn.c_str());
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0003: Error getting Unicode translations from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Get translation sets.
|
// Get translation sets.
|
||||||
com_obj<ADORecordset> rs;
|
com_obj<ADORecordset> rs;
|
||||||
@ -460,8 +416,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
// Read translation set from the database.
|
// Read translation set from the database.
|
||||||
ZRCola::DBSource::transet ts;
|
ZRCola::DBSource::transet ts;
|
||||||
if (src.GetTranslationSet(rs, ts)) {
|
if (src.GetTranslationSet(rs, ts)) {
|
||||||
if (ts.set <= (short)ZRCOLA_TRANSETID_DEFAULT || (short)ZRCOLA_TRANSETID_UNICODE <= ts.set)
|
if (ts.set <= (int)ZRCOLA_TRANSEQID_DEFAULT) {
|
||||||
|
_ftprintf(stderr, wxT("%s: error ZCC0008: Translation set is using reserved ID %i.\n"), (LPCTSTR)filenameIn.c_str(), ts.set);
|
||||||
|
has_errors = true;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (build_pot) {
|
if (build_pot) {
|
||||||
pot.insert(ts.src);
|
pot.insert(ts.src);
|
||||||
@ -474,13 +433,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
// Get translations.
|
// Get translations.
|
||||||
com_obj<ADORecordset> rs_tran;
|
com_obj<ADORecordset> rs_tran;
|
||||||
if (src.SelectTranslations(ts.set, rs_tran)) {
|
if (src.SelectTranslations(ts.set, rs_tran)) {
|
||||||
count = src.GetRecordsetCount(rs_tran);
|
if (src.GetRecordsetCount(rs_tran) < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
||||||
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
|
||||||
// Preallocate memory.
|
|
||||||
db_trans.idxSrc.reserve(db_trans.idxSrc.size() + count);
|
|
||||||
db_trans.idxDst.reserve(db_trans.idxDst.size() + count);
|
|
||||||
db_trans.data .reserve(db_trans.data.size() + count*8);
|
|
||||||
|
|
||||||
// Parse translations and build temporary database.
|
// Parse translations and build temporary database.
|
||||||
ZRCola::DBSource::translation trans;
|
ZRCola::DBSource::translation trans;
|
||||||
trans.set = ts.set;
|
trans.set = ts.set;
|
||||||
@ -513,13 +466,17 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write translation sets to file.
|
// Sort indices.
|
||||||
db_transset.idxTranSet.sort();
|
db_transset.idxTranSet.sort();
|
||||||
|
|
||||||
|
// Write translation sets to file.
|
||||||
dst << ZRCola::transet_rec(db_transset);
|
dst << ZRCola::transet_rec(db_transset);
|
||||||
|
|
||||||
// Write translations to file.
|
// Sort indices.
|
||||||
db_trans.idxSrc.sort();
|
db_trans.idxSrc.sort();
|
||||||
db_trans.idxDst.sort();
|
db_trans.idxDst.sort();
|
||||||
|
|
||||||
|
// Write translations to file.
|
||||||
dst << ZRCola::translation_rec(db_trans);
|
dst << ZRCola::translation_rec(db_trans);
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -549,9 +506,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write translation sequences to file.
|
// Sort indices.
|
||||||
db.idxTranSeq.sort();
|
db.idxTranSeq.sort();
|
||||||
db.idxRank .sort();
|
db.idxRank .sort();
|
||||||
|
|
||||||
|
// Write translation sequences to file.
|
||||||
dst << ZRCola::transeq_rec(db);
|
dst << ZRCola::transeq_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0025: Error getting translation sequence count from database or too many translation sequences.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0025: Error getting translation sequence count from database or too many translation sequences.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -646,8 +605,10 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write languages to file.
|
// Sort indices.
|
||||||
db.idxLang.sort();
|
db.idxLang.sort();
|
||||||
|
|
||||||
|
// Write languages to file.
|
||||||
dst << ZRCola::language_rec(db);
|
dst << ZRCola::language_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0009: Error getting language count from database or too many languages.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0009: Error getting language count from database or too many languages.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -685,11 +646,13 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write language characters to file.
|
// Sort indices.
|
||||||
db.idxChr .sort();
|
db.idxChr .sort();
|
||||||
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
|
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
|
||||||
db.idxLang.sort();
|
db.idxLang.sort();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Write language characters to file.
|
||||||
dst << ZRCola::langchar_rec(db);
|
dst << ZRCola::langchar_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0011: Error getting language characters count from database or too many langchars.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0011: Error getting language characters count from database or too many langchars.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -732,8 +695,10 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write character groups to file.
|
// Sort indices.
|
||||||
db.idxRank.sort();
|
db.idxRank.sort();
|
||||||
|
|
||||||
|
// Write character groups to file.
|
||||||
dst << ZRCola::chrgrp_rec(db);
|
dst << ZRCola::chrgrp_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0015: Error getting character group count from database or too many character groups.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0015: Error getting character group count from database or too many character groups.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -754,6 +719,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
size_t count = src.GetRecordsetCount(rs);
|
size_t count = src.GetRecordsetCount(rs);
|
||||||
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
||||||
ZRCola::DBSource::character_desc_idx idxChrDsc, idxChrDscSub;
|
ZRCola::DBSource::character_desc_idx idxChrDsc, idxChrDscSub;
|
||||||
|
|
||||||
ZRCola::DBSource::character_bank chrs;
|
ZRCola::DBSource::character_bank chrs;
|
||||||
|
|
||||||
// Phase 1: Parse characters and build indexes.
|
// Phase 1: Parse characters and build indexes.
|
||||||
@ -788,10 +754,14 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
categories_used.insert(chr->second.cat);
|
categories_used.insert(chr->second.cat);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write characters to file.
|
// Sort indices.
|
||||||
db.idxChr.sort();
|
db.idxChr.sort();
|
||||||
|
|
||||||
|
// Save text indices.
|
||||||
idxChrDsc .save(db.idxDsc );
|
idxChrDsc .save(db.idxDsc );
|
||||||
idxChrDscSub.save(db.idxDscSub);
|
idxChrDscSub.save(db.idxDscSub);
|
||||||
|
|
||||||
|
// Write characters to file.
|
||||||
dst << ZRCola::character_rec(db);
|
dst << ZRCola::character_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0017: Error getting character count from database or too many characters.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0017: Error getting character count from database or too many characters.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -835,9 +805,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write character categories to file.
|
// Sort indices.
|
||||||
db.idxChrCat.sort();
|
db.idxChrCat.sort();
|
||||||
db.idxRank .sort();
|
db.idxRank .sort();
|
||||||
|
|
||||||
|
// Write character categories to file.
|
||||||
dst << ZRCola::chrcat_rec(db);
|
dst << ZRCola::chrcat_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0019: Error getting character category count from database or too many character categories.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0019: Error getting character category count from database or too many character categories.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -873,9 +845,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write characters tags to file.
|
// Sort indices.
|
||||||
db.idxChr.sort();
|
db.idxChr.sort();
|
||||||
db.idxTag.sort();
|
db.idxTag.sort();
|
||||||
|
|
||||||
|
// Write characters tags to file.
|
||||||
dst << ZRCola::chrtag_rec(db);
|
dst << ZRCola::chrtag_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0021: Error getting characters tags count from database or too many character tags.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0021: Error getting characters tags count from database or too many character tags.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -911,9 +885,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
has_errors = true;
|
has_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write tags to file.
|
// Sort indices.
|
||||||
db.idxName.sort();
|
db.idxName.sort();
|
||||||
db.idxTag .sort();
|
db.idxTag .sort();
|
||||||
|
|
||||||
|
// Write tags to file.
|
||||||
dst << ZRCola::tagname_rec(db);
|
dst << ZRCola::tagname_rec(db);
|
||||||
} else {
|
} else {
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0023: Error getting tag name count from database or too many tags.\n"), (LPCTSTR)filenameIn.c_str());
|
_ftprintf(stderr, wxT("%s: error ZCC0023: Error getting tag name count from database or too many tags.\n"), (LPCTSTR)filenameIn.c_str());
|
||||||
@ -925,43 +901,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
// Get highlights.
|
|
||||||
com_obj<ADORecordset> rs;
|
|
||||||
if (src.SelectHighlights((short)ZRCOLA_HLGHTSETID_ZRCOLA_UNICODE_COMPOSED_ISSUES, rs)) {
|
|
||||||
size_t count = src.GetRecordsetCount(rs);
|
|
||||||
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
|
||||||
ZRCola::DBSource::highlight h;
|
|
||||||
ZRCola::highlight_db db;
|
|
||||||
|
|
||||||
// Preallocate memory.
|
|
||||||
db.idxChr.reserve(count);
|
|
||||||
db.data .reserve(count*5);
|
|
||||||
|
|
||||||
// Parse highlights and build index and data.
|
|
||||||
h.set = (short)ZRCOLA_HLGHTSETID_ZRCOLA_UNICODE_COMPOSED_ISSUES;
|
|
||||||
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
|
||||||
// Read tag name from the database.
|
|
||||||
if (src.GetHighlight(rs, h)) {
|
|
||||||
// Add highlight to index and data.
|
|
||||||
db << h;
|
|
||||||
} else
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write highlights to file.
|
|
||||||
db.idxChr.sort();
|
|
||||||
dst << ZRCola::highlight_rec(db);
|
|
||||||
} else {
|
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0027: Error getting highlight count from database or too many tags.\n"), (LPCTSTR)filenameIn.c_str());
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_ftprintf(stderr, wxT("%s: error ZCC0026: Error getting highlights from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
|
|
||||||
has_errors = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
idrec::close<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dst, dst_start);
|
idrec::close<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dst, dst_start);
|
||||||
|
|
||||||
if (dst.fail()) {
|
if (dst.fail()) {
|
||||||
@ -981,10 +920,10 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
<< "\"Content-Transfer-Encoding: 8bit\\n\"" << endl
|
<< "\"Content-Transfer-Encoding: 8bit\\n\"" << endl
|
||||||
<< "\"X-Generator: ZRColaCompile\\n\"" << endl;
|
<< "\"X-Generator: ZRColaCompile\\n\"" << endl;
|
||||||
|
|
||||||
charset_encoder<wchar_t, char> conv(stdex::wchar_t_charset, charset_id::utf8);
|
wstring_convert<codecvt_utf8<wchar_t>> conv;
|
||||||
for (auto p = pot.cbegin(); p != pot.cend(); ++p) {
|
for (auto p = pot.cbegin(); p != pot.cend(); ++p) {
|
||||||
// Convert UTF-16 to UTF-8 and escape.
|
// Convert UTF-16 to UTF-8 and escape.
|
||||||
string t(conv.convert(*p)), u;
|
string t(conv.to_bytes(*p)), u;
|
||||||
for (size_t i = 0, n = t.size(); i < n; i++) {
|
for (size_t i = 0, n = t.size(); i < n; i++) {
|
||||||
char c = t[i];
|
char c = t[i];
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2018-2022 Amebis
|
Copyright © 2018-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2018-2022 Amebis
|
Copyright © 2018-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@ -20,7 +20,7 @@
|
|||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <zrcola/idrec.h>
|
#include <stdex/idrec.h>
|
||||||
|
|
||||||
#include <WinStd/Common.h>
|
#include <WinStd/Common.h>
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -16,10 +16,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaCompile", "ZRColaComp
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
|
||||||
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaInstall", "ZRColaInstall\ZRColaInstall.vcxproj", "{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaInstall", "ZRColaInstall\ZRColaInstall.vcxproj", "{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
@ -38,6 +42,10 @@ Global
|
|||||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|Win32.Build.0 = Debug|Win32
|
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.ActiveCfg = Release|Win32
|
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.Build.0 = Release|Win32
|
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.Build.0 = Release|Win32
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|Win32.ActiveCfg = Debug|Win32
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|Win32.Build.0 = Debug|Win32
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.ActiveCfg = Release|Win32
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
@ -46,6 +54,10 @@ Global
|
|||||||
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|Win32.Build.0 = Debug|Win32
|
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|Win32.ActiveCfg = Release|Win32
|
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|Win32.Build.0 = Release|Win32
|
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -53,7 +65,9 @@ Global
|
|||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
||||||
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
||||||
|
{518777CC-0A59-4415-A12A-82751ED75343} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
||||||
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
||||||
|
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {22B0355E-423C-4ACC-81F8-DAD72A8BEC0E}
|
SolutionGuid = {22B0355E-423C-4ACC-81F8-DAD72A8BEC0E}
|
||||||
|
3
ZRColaWS/.gitignore
vendored
3
ZRColaWS/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
/*.d
|
|
||||||
/*.o
|
|
||||||
/zrcolaws
|
|
@ -1,91 +0,0 @@
|
|||||||
CPPFLAGS := $(CPPFLAGS) -I../lib/libZRCola/include -I../lib/stdex/include -I../lib/oatpp-swagger/src -I../lib/oatpp/src
|
|
||||||
LDFLAGS := $(LDFLAGS) -L../lib/libZRCola/lib -L../lib/oatpp-swagger/build/src -L../lib/oatpp/build/src
|
|
||||||
LDLIBS := $(LDLIBS) -lZRCola -loatpp-swagger -loatpp -lstdc++
|
|
||||||
SRCS := zrcolaws.cpp
|
|
||||||
|
|
||||||
include ../include/props.mak
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: zrcolaws
|
|
||||||
|
|
||||||
zrcolaws: \
|
|
||||||
../lib/oatpp/build/src/liboatpp.a \
|
|
||||||
../lib/oatpp-swagger/build/src/liboatpp-swagger.a \
|
|
||||||
../lib/libZRCola/lib/libZRCola.a \
|
|
||||||
$(OBJS)
|
|
||||||
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LDLIBS)
|
|
||||||
|
|
||||||
../lib/oatpp/build/src/liboatpp.a: ../lib/oatpp/build/Makefile
|
|
||||||
$(MAKE) $(MFLAGS) -C ../lib/oatpp/build
|
|
||||||
|
|
||||||
../lib/oatpp/build/Makefile: ../lib/oatpp/CMakeLists.txt
|
|
||||||
cmake -D OATPP_INSTALL=OFF -D OATPP_BUILD_TESTS=OFF -D OATPP_LINK_TEST_LIBRARY=OFF -S ../lib/oatpp -B ../lib/oatpp/build
|
|
||||||
|
|
||||||
../lib/oatpp-swagger/build/src/liboatpp-swagger.a: ../lib/oatpp-swagger/build/Makefile
|
|
||||||
$(MAKE) $(MFLAGS) -C ../lib/oatpp-swagger/build
|
|
||||||
|
|
||||||
../lib/oatpp-swagger/build/Makefile: ../lib/oatpp-swagger/CMakeLists.txt
|
|
||||||
cmake -D OATPP_INSTALL=OFF -D OATPP_BUILD_TESTS=OFF -D OATPP_MODULES_LOCATION=CUSTOM -D OATPP_DIR_SRC=${CURDIR}/../lib/oatpp/src -D OATPP_DIR_LIB=${CURDIR}/../lib/oatpp/build/src -S ../lib/oatpp-swagger -B ../lib/oatpp-swagger/build
|
|
||||||
|
|
||||||
../lib/libZRCola/lib/libZRCola.a:
|
|
||||||
$(MAKE) $(MFLAGS) -C ../lib/libZRCola/build
|
|
||||||
|
|
||||||
.PHONY: install
|
|
||||||
install: zrcolaws ../output/data/ZRCola.zrcdb
|
|
||||||
install -d $(PREFIX)/bin/
|
|
||||||
install -m 755 zrcolaws $(PREFIX)/bin/
|
|
||||||
install -d $(PREFIX)/share/zrcola/
|
|
||||||
install -m 644 ../output/data/ZRCola.zrcdb $(PREFIX)/share/zrcola/
|
|
||||||
install -d $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/favicon-16x16.png $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/favicon-32x32.png $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/index.html $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/oauth2-redirect.html $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-bundle.js $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-bundle.js.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle-core.js $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle-core.js.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle.js $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle.js.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-standalone-preset.js $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-standalone-preset.js.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.css $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.css.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.js $(PREFIX)/share/zrcola/res/
|
|
||||||
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.js.map $(PREFIX)/share/zrcola/res/
|
|
||||||
install -d $(PREFIX)/etc/sysconfig/
|
|
||||||
{ echo '#!/bin/sh'; \
|
|
||||||
echo ''; \
|
|
||||||
echo '# Interface to listen on. Default: localhost'; \
|
|
||||||
echo '#HOST=0.0.0.0'; \
|
|
||||||
echo ''; \
|
|
||||||
echo '# Port to listen on. Default: 54591'; \
|
|
||||||
echo '#PORT=54591'; \
|
|
||||||
echo ''; \
|
|
||||||
echo '# Additional zrcolaws command line options'; \
|
|
||||||
echo '#OPTIONS=-4'; \
|
|
||||||
} > $(PREFIX)/etc/sysconfig/zrcolaws
|
|
||||||
install -d $(PREFIX)/lib/systemd/system/
|
|
||||||
{ echo '[Unit]'; \
|
|
||||||
echo 'Description=ZRCola Web Service'; \
|
|
||||||
echo 'After=network.target'; \
|
|
||||||
echo ''; \
|
|
||||||
echo '[Service]'; \
|
|
||||||
echo 'Environment="HOST=localhost" "PORT=54591"'; \
|
|
||||||
echo 'EnvironmentFile=-$(PREFIX)/etc/sysconfig/zrcolaws'; \
|
|
||||||
echo 'DynamicUser=yes'; \
|
|
||||||
echo 'ExecStart=/usr/local/bin/zrcolaws --host $$HOST --port $$PORT $$OPTIONS'; \
|
|
||||||
echo 'Type=exec'; \
|
|
||||||
echo 'Restart=always'; \
|
|
||||||
echo ''; \
|
|
||||||
echo '[Install]'; \
|
|
||||||
echo 'WantedBy=multi-user.target'; \
|
|
||||||
echo 'RequiredBy=network.target'; \
|
|
||||||
} > $(PREFIX)/lib/systemd/system/zrcolaws.service
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
-rm -r *.{d,o} zrcolaws
|
|
||||||
|
|
||||||
include ../include/targets.mak
|
|
||||||
-include $(DEPS)
|
|
@ -1,23 +0,0 @@
|
|||||||
# ZRCola Web Service
|
|
||||||
|
|
||||||
## Building and Installation
|
|
||||||
|
|
||||||
1. Install prerequisites: `sudo dnf install git cmake gcc gcc-c++ make libatomic`
|
|
||||||
|
|
||||||
2. Clone this Git repository: `git clone --recursive https://github.com/Amebis/ZRCola.git`
|
|
||||||
|
|
||||||
3. Build ZRColaWS: `make -C ZRCola/ZRColaWS`
|
|
||||||
|
|
||||||
4. Install ZRColaWS: `sudo make -C ZRCola/ZRColaWS install`
|
|
||||||
|
|
||||||
5. Configure ZRColaWS by editing _/usr/local/etc/sysconfig/zrcolaws_
|
|
||||||
|
|
||||||
6. Start ZRColaWS: `sudo systemctl start zrcolaws.service`
|
|
||||||
|
|
||||||
7. Configure ZRColaWS for auto-start: `sudo systemctl enable zrcolaws.service`
|
|
||||||
|
|
||||||
8. Remember to open webservice port in firewall, should the service require external access.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Web service API documentation is available at _http://host:port/swagger/ui_.
|
|
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../include/version.h"
|
|
||||||
#include "controller.hpp"
|
|
||||||
#include <oatpp-swagger/Model.hpp>
|
|
||||||
#include <oatpp-swagger/Resources.hpp>
|
|
||||||
#include <oatpp/core/base/CommandLineArguments.hpp>
|
|
||||||
#include <oatpp/core/macro/component.hpp>
|
|
||||||
#include <oatpp/network/Server.hpp>
|
|
||||||
#include <oatpp/network/tcp/server/ConnectionProvider.hpp>
|
|
||||||
#include <oatpp/parser/json/mapping/ObjectMapper.hpp>
|
|
||||||
#include <oatpp/web/server/HttpConnectionHandler.hpp>
|
|
||||||
|
|
||||||
class AppComponent
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
oatpp::network::Address m_address;
|
|
||||||
|
|
||||||
public:
|
|
||||||
AppComponent(const oatpp::network::Address& address) : m_address(address) {}
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([this] {
|
|
||||||
return oatpp::network::tcp::server::ConnectionProvider::createShared({m_address.host, m_address.port, m_address.family});
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, httpRouter)([] {
|
|
||||||
return oatpp::web::server::HttpRouter::createShared();
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)([] {
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
|
|
||||||
return oatpp::web::server::HttpConnectionHandler::createShared(router);
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, apiObjectMapper)([] {
|
|
||||||
auto serializerConfig = oatpp::parser::json::mapping::Serializer::Config::createShared();
|
|
||||||
serializerConfig->escapeFlags &= ~oatpp::parser::json::Utils::FLAG_ESCAPE_UTF8CHAR;
|
|
||||||
return oatpp::parser::json::mapping::ObjectMapper::createShared(
|
|
||||||
serializerConfig,
|
|
||||||
oatpp::parser::json::mapping::Deserializer::Config::createShared());
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::Server>, server)([] {
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, connectionProvider);
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, connectionHandler);
|
|
||||||
return oatpp::network::Server::createShared(connectionProvider, connectionHandler);
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::DocumentInfo>, swaggerDocumentInfo)([] {
|
|
||||||
oatpp::swagger::DocumentInfo::Builder builder;
|
|
||||||
builder
|
|
||||||
.setTitle("ZRCola Web Service")
|
|
||||||
.setDescription(
|
|
||||||
"ZRCola is an input system designed mainly, although not exclusively, for linguistic use. "
|
|
||||||
"It allows the user to combine basic letters with any diacritic marks and insert the resulting complex characters into the texts with ease.")
|
|
||||||
.setVersion(PRODUCT_VERSION_STR)
|
|
||||||
.setContactName("ZRCola")
|
|
||||||
.setContactUrl("https://zrcola.zrc-sazu.si/en/")
|
|
||||||
|
|
||||||
.setLicenseName("GNU General Public License, Version 3")
|
|
||||||
.setLicenseUrl("https://www.gnu.org/licenses/gpl-3.0.en.html");
|
|
||||||
return builder.build();
|
|
||||||
}());
|
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::Resources>, swaggerResources)([] {
|
|
||||||
return oatpp::swagger::Resources::loadResources(PREFIX "/share/zrcola/res");
|
|
||||||
}());
|
|
||||||
};
|
|
@ -1,243 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../include/version.h"
|
|
||||||
#include "dto.hpp"
|
|
||||||
#include "iconverter.hpp"
|
|
||||||
#include "zrcolaws.hpp"
|
|
||||||
#include <zrcola/translate.h>
|
|
||||||
#include <oatpp/core/macro/codegen.hpp>
|
|
||||||
#include <oatpp/core/macro/component.hpp>
|
|
||||||
#include <oatpp/web/server/api/ApiController.hpp>
|
|
||||||
|
|
||||||
#include OATPP_CODEGEN_BEGIN(ApiController)
|
|
||||||
|
|
||||||
class Controller : public oatpp::web::server::api::ApiController
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Controller(const std::shared_ptr<oatpp::data::mapping::ObjectMapper>& defaultObjectMapper, const oatpp::String &routerPrefix = nullptr) :
|
|
||||||
oatpp::web::server::api::ApiController(defaultObjectMapper, routerPrefix)
|
|
||||||
{}
|
|
||||||
|
|
||||||
ADD_CORS(getAbout)
|
|
||||||
ENDPOINT_INFO(getAbout) {
|
|
||||||
info->summary = "Returns service information";
|
|
||||||
info->addResponse<Object<dto::About>>(Status::CODE_200, "application/json");
|
|
||||||
}
|
|
||||||
ENDPOINT("GET", "/about", getAbout)
|
|
||||||
{
|
|
||||||
auto dto = dto::About::createShared();
|
|
||||||
dto->vendor = PRODUCT_CFG_VENDOR;
|
|
||||||
dto->application = PRODUCT_CFG_APPLICATION;
|
|
||||||
dto->version = PRODUCT_VERSION_STR;
|
|
||||||
return createDtoResponse(Status::CODE_200, dto);
|
|
||||||
}
|
|
||||||
|
|
||||||
ADD_CORS(getTranset)
|
|
||||||
ENDPOINT_INFO(getTranset) {
|
|
||||||
info->summary = "Lists supported translation sets";
|
|
||||||
info->description = "Each translation set describes a set of replacements that are performed to translate text from one script or encoding to another. ";
|
|
||||||
info->addResponse<oatpp::Vector<oatpp::Object<dto::TranSet>>>(Status::CODE_200, "application/json");
|
|
||||||
}
|
|
||||||
ENDPOINT("GET", "/transet", getTranset)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
utf16toutf8 c;
|
|
||||||
auto result = oatpp::Vector<oatpp::Object<dto::TranSet>>::createShared();
|
|
||||||
auto dto = dto::TranSet::createShared();
|
|
||||||
dto->set = ZRCOLA_TRANSETID_DEFAULT;
|
|
||||||
dto->src = "ZRCola Decomposed";
|
|
||||||
dto->dst = "ZRCola Composed";
|
|
||||||
result->push_back(dto);
|
|
||||||
for (size_t i = 0, n = ts_db.idxTranSet.size(); i < n; i++) {
|
|
||||||
const auto &ts = ts_db.idxTranSet[i];
|
|
||||||
dto = dto::TranSet::createShared();
|
|
||||||
dto->set = ts.set;
|
|
||||||
dto->src = c.convert(ts.src(), ts.src_len());
|
|
||||||
dto->dst = c.convert(ts.dst(), ts.dst_len());
|
|
||||||
result->push_back(dto);
|
|
||||||
}
|
|
||||||
dto = dto::TranSet::createShared();
|
|
||||||
dto->set = ZRCOLA_TRANSETID_UNICODE;
|
|
||||||
dto->src = "ZRCola Decomposed";
|
|
||||||
dto->dst = "Unicode";
|
|
||||||
result->push_back(dto);
|
|
||||||
return createDtoResponse(Status::CODE_200, result);
|
|
||||||
} catch (std::exception &ex) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "%s: %s", typeid(ex).name(), ex.what());
|
|
||||||
return ResponseFactory::createResponse(Status::CODE_500, ex.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ADD_CORS(getLanguage)
|
|
||||||
ENDPOINT_INFO(getLanguage) {
|
|
||||||
info->summary = "Lists supported languages";
|
|
||||||
info->description = "Each language describes a set of special characters that are specific to that language (e.g. č, š, ž in Slovenian, or ä, ö, ü in German).";
|
|
||||||
info->addResponse<oatpp::Vector<oatpp::Object<dto::Language>>>(Status::CODE_200, "application/json");
|
|
||||||
}
|
|
||||||
ENDPOINT("GET", "/language", getLanguage)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
utf16toutf8 c;
|
|
||||||
auto result = oatpp::Vector<oatpp::Object<dto::Language>>::createShared();
|
|
||||||
for (size_t i = 0, n = lang_db.idxLang.size(); i < n; i++) {
|
|
||||||
const auto &lang = lang_db.idxLang[i];
|
|
||||||
auto dto = dto::Language::createShared();
|
|
||||||
dto->lang = std::string(&lang.lang.data[0], strnlen(lang.lang.data, std::size(lang.lang.data)));
|
|
||||||
dto->name = c.convert(lang.name(), lang.name_len());
|
|
||||||
result->push_back(dto);
|
|
||||||
}
|
|
||||||
return createDtoResponse(Status::CODE_200, result);
|
|
||||||
} catch (std::exception &ex) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "%s: %s", typeid(ex).name(), ex.what());
|
|
||||||
return ResponseFactory::createResponse(Status::CODE_500, ex.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ADD_CORS(postTranslate)
|
|
||||||
ENDPOINT_INFO(postTranslate) {
|
|
||||||
info->summary = "Translate text";
|
|
||||||
info->description =
|
|
||||||
"Performs any number of supported translations (see /transet) on a given input text in a sequence. "
|
|
||||||
"Together with the output text, it also returns character index mapping between input and output texts.";
|
|
||||||
auto transet = oatpp::Vector<UInt16>::createShared();
|
|
||||||
transet->push_back(ZRCOLA_TRANSETID_DEFAULT);
|
|
||||||
auto dto = dto::TranslateIn::createShared();
|
|
||||||
dto->transet = transet;
|
|
||||||
dto->text = "To je test.";
|
|
||||||
info->addConsumes<Object<dto::TranslateIn>>("application/json")
|
|
||||||
.addExample("Perform ZRCola composition", dto);
|
|
||||||
info->addResponse<Object<dto::TranslateOut>>(Status::CODE_200, "application/json");
|
|
||||||
}
|
|
||||||
ENDPOINT("POST", "/translate", postTranslate, BODY_DTO(Object<dto::TranslateIn>, input))
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
utf8toutf16 cIn;
|
|
||||||
std::u16string dst, dst2;
|
|
||||||
if (input->text)
|
|
||||||
dst = cIn.convert(*input->text);
|
|
||||||
size_t src_len = dst.size();
|
|
||||||
std::vector<ZRCola::mapping_vector> mapping;
|
|
||||||
if (input->transet) {
|
|
||||||
ZRCola::mapping_vector map;
|
|
||||||
const auto ts_end = input->transet->cend();
|
|
||||||
for (auto ts = input->transet->cbegin(); ts != ts_end; ++ts) {
|
|
||||||
switch (*ts) {
|
|
||||||
case ZRCOLA_TRANSETID_DEFAULT:
|
|
||||||
case ZRCOLA_TRANSETID_UNICODE:
|
|
||||||
// Decompose first, then re-compose.
|
|
||||||
t_db.TranslateInv(*ts, dst.data(), dst.size(), dst2, &map);
|
|
||||||
mapping.push_back(std::move(map));
|
|
||||||
map.clear();
|
|
||||||
t_db.Translate(*ts, dst2.data(), dst2.size(), dst, &map);
|
|
||||||
mapping.push_back(std::move(map));
|
|
||||||
map.clear();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
t_db.Translate(*ts, dst.data(), dst.size(), dst2, &map);
|
|
||||||
mapping.push_back(std::move(map));
|
|
||||||
map.clear();
|
|
||||||
dst = std::move(dst2);
|
|
||||||
dst2.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
utf16toutf8 cOut;
|
|
||||||
auto dto = dto::TranslateOut::createShared();
|
|
||||||
dto->text = cOut.convert(dst);
|
|
||||||
auto map = oatpp::Vector<oatpp::UInt32>::createShared();
|
|
||||||
auto m_end = mapping.cend();
|
|
||||||
for (size_t i = 0; i < src_len; ++i) {
|
|
||||||
auto j = i;
|
|
||||||
for (auto m = mapping.cbegin(); m != m_end; ++m)
|
|
||||||
j = m->to_dst(j);
|
|
||||||
map->push_back(j);
|
|
||||||
}
|
|
||||||
dto->map = map;
|
|
||||||
return createDtoResponse(Status::CODE_200, dto);
|
|
||||||
} catch (std::exception &ex) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "%s: %s", typeid(ex).name(), ex.what());
|
|
||||||
return ResponseFactory::createResponse(Status::CODE_500, ex.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ADD_CORS(postTranslateInv)
|
|
||||||
ENDPOINT_INFO(postTranslateInv) {
|
|
||||||
info->summary = "Inverse translate text";
|
|
||||||
info->description =
|
|
||||||
"Performs any number of supported translations (see /transet) on a given input text in a sequence in reverse. "
|
|
||||||
"Together with the output text, it also returns character index mapping between input and output texts.";
|
|
||||||
auto transet = oatpp::Vector<UInt16>::createShared();
|
|
||||||
transet->push_back(ZRCOLA_TRANSETID_DEFAULT);
|
|
||||||
auto dto = dto::TranslateIn::createShared();
|
|
||||||
dto->transet = transet;
|
|
||||||
dto->text = "T ťᵉⓢṭ.";
|
|
||||||
dto->lang = "slv";
|
|
||||||
info->addConsumes<Object<dto::TranslateIn>>("application/json")
|
|
||||||
.addExample("Perform ZRCola decomposition", dto);
|
|
||||||
info->addResponse<Object<dto::TranslateOut>>(Status::CODE_200, "application/json");
|
|
||||||
}
|
|
||||||
ENDPOINT("POST", "/translateInv", postTranslateInv, BODY_DTO(Object<dto::TranslateIn>, input))
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
utf8toutf16 cIn;
|
|
||||||
std::u16string dst, dst2;
|
|
||||||
ZRCola::langid_t lang;
|
|
||||||
if (input->text)
|
|
||||||
dst = cIn.convert(*input->text);
|
|
||||||
lang = input->lang->c_str();
|
|
||||||
size_t src_len = dst.size();
|
|
||||||
std::vector<ZRCola::mapping_vector> mapping;
|
|
||||||
if (input->transet) {
|
|
||||||
ZRCola::mapping_vector map;
|
|
||||||
const auto ts_begin = input->transet->cbegin();
|
|
||||||
for (auto ts = input->transet->cend(); (ts--) != ts_begin; ) {
|
|
||||||
switch (*ts) {
|
|
||||||
case ZRCOLA_TRANSETID_DEFAULT:
|
|
||||||
case ZRCOLA_TRANSETID_UNICODE:
|
|
||||||
t_db.TranslateInv(*ts, dst.data(), dst.size(), &lc_db, lang, dst2, &map);
|
|
||||||
dst = std::move(dst2);
|
|
||||||
dst2.clear();
|
|
||||||
map.invert();
|
|
||||||
mapping.push_back(std::move(map));
|
|
||||||
map.clear();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
t_db.TranslateInv(*ts, dst.data(), dst.size(), dst2, &map);
|
|
||||||
dst = std::move(dst2);
|
|
||||||
dst2.clear();
|
|
||||||
map.invert();
|
|
||||||
mapping.push_back(std::move(map));
|
|
||||||
map.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
utf16toutf8 cOut;
|
|
||||||
auto dto = dto::TranslateOut::createShared();
|
|
||||||
dto->text = cOut.convert(dst);
|
|
||||||
auto map = oatpp::Vector<oatpp::UInt32>::createShared();
|
|
||||||
auto m_end = mapping.crend();
|
|
||||||
for (size_t i = 0; i < src_len; ++i) {
|
|
||||||
auto j = i;
|
|
||||||
for (auto m = mapping.crbegin(); m != m_end; ++m)
|
|
||||||
j = m->to_src(j);
|
|
||||||
map->push_back(j);
|
|
||||||
}
|
|
||||||
dto->map = map;
|
|
||||||
return createDtoResponse(Status::CODE_200, dto);
|
|
||||||
} catch (std::exception &ex) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "%s: %s", typeid(ex).name(), ex.what());
|
|
||||||
return ResponseFactory::createResponse(Status::CODE_500, ex.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#include OATPP_CODEGEN_END(ApiController)
|
|
@ -1,90 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <oatpp/core/data/mapping/type/Object.hpp>
|
|
||||||
#include <oatpp/core/macro/codegen.hpp>
|
|
||||||
#include <oatpp/core/Types.hpp>
|
|
||||||
|
|
||||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
|
||||||
|
|
||||||
namespace dto {
|
|
||||||
|
|
||||||
class About : public oatpp::DTO
|
|
||||||
{
|
|
||||||
DTO_INIT(About, DTO)
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(vendor) { info->description = "Application vendor"; }
|
|
||||||
DTO_FIELD(String, vendor);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(application) { info->description = "Application name"; }
|
|
||||||
DTO_FIELD(String, application);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(version) { info->description = "Application version"; }
|
|
||||||
DTO_FIELD(String, version);
|
|
||||||
};
|
|
||||||
|
|
||||||
class TranSet : public oatpp::DTO
|
|
||||||
{
|
|
||||||
DTO_INIT(TranSet, DTO)
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(set) { info->description = "Translation set ID"; }
|
|
||||||
DTO_FIELD(UInt16, set);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(src) { info->description = "Input transcript name in English"; }
|
|
||||||
DTO_FIELD(String, src);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(dst) { info->description = "Output transcript name in English"; }
|
|
||||||
DTO_FIELD(String, dst);
|
|
||||||
};
|
|
||||||
|
|
||||||
class Language : public oatpp::DTO
|
|
||||||
{
|
|
||||||
DTO_INIT(Language, DTO)
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(lang) { info->description = "Language ID"; }
|
|
||||||
DTO_FIELD(String, lang);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(name) { info->description = "Language name in English"; }
|
|
||||||
DTO_FIELD(String, name);
|
|
||||||
};
|
|
||||||
|
|
||||||
class TranslateIn : public oatpp::DTO
|
|
||||||
{
|
|
||||||
DTO_INIT(TranslateIn, DTO)
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(transet) {
|
|
||||||
info->description = "Array of one or multiple translation set IDs to perform translation on the text. When inverse translating, the translation sets are read in reverse order listed in this array. Use /transet to get IDs of all supported translation sets.";
|
|
||||||
info->required = true;
|
|
||||||
}
|
|
||||||
DTO_FIELD(Vector<UInt16>, transet);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(text) {
|
|
||||||
info->description = "Text to be translated";
|
|
||||||
info->required = true;
|
|
||||||
}
|
|
||||||
DTO_FIELD(String, text);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(lang) {
|
|
||||||
info->description = "Language ID of the text to be translated. This is used on inverse translating to skip decomposing language-specific common characters (e.g. č, š, ž in Slovenian, or ä, ö, ü in German). Use /language to get IDs of all supported languages.";
|
|
||||||
}
|
|
||||||
DTO_FIELD(String, lang) = "slv";
|
|
||||||
};
|
|
||||||
|
|
||||||
class TranslateOut : public oatpp::DTO
|
|
||||||
{
|
|
||||||
DTO_INIT(TranslateOut, DTO)
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(text) { info->description = "Translated text"; }
|
|
||||||
DTO_FIELD(String, text);
|
|
||||||
|
|
||||||
DTO_FIELD_INFO(map) { info->description = "Character index mapping between input and translated text. The map[i] value represents the index of the beginning of a character (in translated text) that translated from the character (in the input text) beginning at index i. All input indexes are measured in characters after input string is translated to UTF-16, and all output indexes are measured in characters before output string is translated from UTF-16."; }
|
|
||||||
DTO_FIELD(Vector<UInt32>, map);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#include OATPP_CODEGEN_END(DTO)
|
|
@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdex/compat.hpp>
|
|
||||||
#include <iconv.h>
|
|
||||||
#include <cstring>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
inline static std::runtime_error errno_error(_In_z_ const char *file, _In_ int line, _In_z_ const char *func)
|
|
||||||
{
|
|
||||||
int _errno = errno;
|
|
||||||
return std::runtime_error(
|
|
||||||
std::string(file) + ":" + std::to_string(line) +
|
|
||||||
std::string(func) + " error " + std::to_string(_errno) + ": " +
|
|
||||||
std::strerror(_errno));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T_from, typename T_to>
|
|
||||||
class iconverter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
iconverter(_In_z_ const char* from, _In_z_ const char* to)
|
|
||||||
{
|
|
||||||
m_handle = iconv_open(to, from);
|
|
||||||
if (m_handle == (iconv_t)-1)
|
|
||||||
throw errno_error(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
}
|
|
||||||
|
|
||||||
~iconverter()
|
|
||||||
{
|
|
||||||
iconv_close(m_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::basic_string<T_to> convert(_In_z_count_(count) const T_from* input, _In_ size_t count) const
|
|
||||||
{
|
|
||||||
T_to buf[0x100];
|
|
||||||
std::basic_string<T_to> result;
|
|
||||||
size_t inSize = sizeof(T_from) * count;
|
|
||||||
do {
|
|
||||||
T_to* output = &buf[0];
|
|
||||||
size_t outSize = sizeof(buf);
|
|
||||||
errno = 0;
|
|
||||||
iconv(m_handle, (char**)&input, &inSize, (char**)&output, &outSize);
|
|
||||||
if (errno)
|
|
||||||
throw errno_error(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
result.insert(result.end(), buf, (T_to*)((char*)buf + sizeof(buf) - outSize));
|
|
||||||
} while (inSize);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::basic_string<T_to> convert(_In_ const std::basic_string<T_from>& input)
|
|
||||||
{
|
|
||||||
return convert(input.c_str(), input.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
iconv_t m_handle;
|
|
||||||
};
|
|
||||||
|
|
||||||
class utf16toutf8 : public iconverter<char16_t, char>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
utf16toutf8() : iconverter("UTF-16LE", "UTF-8") {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class utf8toutf16 : public iconverter<char, char16_t>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
utf8toutf16() : iconverter("UTF-8", "UTF-16LE") {}
|
|
||||||
};
|
|
@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <oatpp/core/base/Environment.hpp>
|
|
||||||
#include <iostream>
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
class StdLogger : public oatpp::base::Logger
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
std::mutex m_lock;
|
|
||||||
|
|
||||||
public:
|
|
||||||
StdLogger() {}
|
|
||||||
|
|
||||||
void log(v_uint32 priority, const std::string& tag, const std::string& message) override
|
|
||||||
{
|
|
||||||
if (!isLogPriorityEnabled(priority))
|
|
||||||
return;
|
|
||||||
std::lock_guard<std::mutex> guard(m_lock);
|
|
||||||
(priority < oatpp::base::Logger::PRIORITY_W ? std::cout : std::cerr) << tag << ": " << message << std::endl;
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,176 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "appcomponent.hpp"
|
|
||||||
#include "controller.hpp"
|
|
||||||
#include "stdlogger.hpp"
|
|
||||||
#include "zrcolaws.hpp"
|
|
||||||
#include <oatpp-swagger/Controller.hpp>
|
|
||||||
#include <oatpp/core/base/CommandLineArguments.hpp>
|
|
||||||
#include <oatpp/network/Server.hpp>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace ZRCola;
|
|
||||||
|
|
||||||
translation_db t_db;
|
|
||||||
transet_db ts_db;
|
|
||||||
// transeq_db tsq_db;
|
|
||||||
langchar_db lc_db;
|
|
||||||
language_db lang_db;
|
|
||||||
// character_db chr_db;
|
|
||||||
// chrcat_db cc_db;
|
|
||||||
// chrtag_db ct_db;
|
|
||||||
// tagname_db tn_db;
|
|
||||||
// highlight_db h_db;
|
|
||||||
|
|
||||||
static void load_database()
|
|
||||||
{
|
|
||||||
fstream dat(PREFIX "/share/zrcola/ZRCola.zrcdb", ios_base::in | ios_base::binary);
|
|
||||||
if (!dat.good())
|
|
||||||
throw runtime_error(PREFIX "/share/zrcola/ZRCola.zrcdb not found or cannot be opened.");
|
|
||||||
|
|
||||||
if (!stdex::idrec::find<recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN>(dat, ZRCOLA_DB_ID, sizeof(recordid_t)))
|
|
||||||
throw runtime_error(PREFIX "/share/zrcola/ZRCola.zrcdb is not a valid ZRCola database.");
|
|
||||||
|
|
||||||
recordsize_t size;
|
|
||||||
dat.read((char*)&size, sizeof(recordsize_t));
|
|
||||||
if (dat.good()) {
|
|
||||||
bool has_translation_data = false;
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
recordid_t id;
|
|
||||||
if (!stdex::idrec::read_id(dat, id, size)) break;
|
|
||||||
|
|
||||||
if (id == translation_rec::id()) {
|
|
||||||
dat >> translation_rec(t_db);
|
|
||||||
if (dat.good()) {
|
|
||||||
has_translation_data = true;
|
|
||||||
} else {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "Error reading translation data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
t_db.clear();
|
|
||||||
}
|
|
||||||
} else if (id == transet_rec::id()) {
|
|
||||||
dat >> transet_rec(ts_db);
|
|
||||||
if (!dat.good()) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "Error reading translation set data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
ts_db.clear();
|
|
||||||
}
|
|
||||||
// } else if (id == transeq_rec::id()) {
|
|
||||||
// dat >> transeq_rec(tsq_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading translation sequence data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// tsq_db.clear();
|
|
||||||
// }
|
|
||||||
} else if (id == langchar_rec::id()) {
|
|
||||||
dat >> langchar_rec(lc_db);
|
|
||||||
if (!dat.good()) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "Error reading language character data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
lc_db.clear();
|
|
||||||
}
|
|
||||||
} else if (id == language_rec::id()) {
|
|
||||||
dat >> language_rec(lang_db);
|
|
||||||
if (!dat.good()) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "Error reading language character data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
lang_db.clear();
|
|
||||||
}
|
|
||||||
// } else if (id == character_rec::id()) {
|
|
||||||
// dat >> character_rec(chr_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading character data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// chr_db.clear();
|
|
||||||
// }
|
|
||||||
// } else if (id == chrcat_rec::id()) {
|
|
||||||
// dat >> chrcat_rec(cc_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading character category data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// cc_db.clear();
|
|
||||||
// }
|
|
||||||
// } else if (id == chrtag_rec::id()) {
|
|
||||||
// dat >> chrtag_rec(ct_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading character tag data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// ct_db.clear();
|
|
||||||
// }
|
|
||||||
// } else if (id == tagname_rec::id()) {
|
|
||||||
// dat >> tagname_rec(tn_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading tag name data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// tn_db.clear();
|
|
||||||
// }
|
|
||||||
// } else if (id == highlight_rec::id()) {
|
|
||||||
// dat >> highlight_rec(h_db);
|
|
||||||
// if (!dat.good()) {
|
|
||||||
// OATPP_LOGE(__FUNCTION__, "Error reading highlight data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
|
||||||
// h_db.clear();
|
|
||||||
// }
|
|
||||||
} else
|
|
||||||
stdex::idrec::ignore<recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!has_translation_data)
|
|
||||||
throw runtime_error(PREFIX "/share/zrcola/ZRCola.zrcdb has no translation data.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sig_handler(int s)
|
|
||||||
{
|
|
||||||
OATPP_LOGD(__FUNCTION__, "Caught signal %d", s);
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::Server>, server);
|
|
||||||
server->stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, const char* argv[])
|
|
||||||
{
|
|
||||||
auto logger = std::make_shared<StdLogger>();
|
|
||||||
oatpp::base::Environment::init(logger);
|
|
||||||
try {
|
|
||||||
{
|
|
||||||
oatpp::base::CommandLineArguments cmdArgs(argc, argv);
|
|
||||||
if (cmdArgs.hasArgument("-?") || cmdArgs.hasArgument("--help")) {
|
|
||||||
cerr << "ZRColaWS " << PRODUCT_VERSION_STR << " Copyright © 2022 Amebis" << endl;
|
|
||||||
cerr << endl;
|
|
||||||
cerr << argv[0] << " [--host <interface name>] [--port <port number>] [-4|-6]" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
load_database();
|
|
||||||
|
|
||||||
struct sigaction sigIntHandler;
|
|
||||||
sigIntHandler.sa_handler = sig_handler;
|
|
||||||
sigemptyset(&sigIntHandler.sa_mask);
|
|
||||||
sigIntHandler.sa_flags = 0;
|
|
||||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
|
||||||
|
|
||||||
oatpp::String host = cmdArgs.getNamedArgumentValue("--host", "localhost");
|
|
||||||
v_uint16 port = oatpp::utils::conversion::strToInt32(cmdArgs.getNamedArgumentValue("--port", "54591"));
|
|
||||||
oatpp::network::Address::Family family = oatpp::network::Address::UNSPEC;
|
|
||||||
if (cmdArgs.hasArgument("-4"))
|
|
||||||
family = oatpp::network::Address::IP_4;
|
|
||||||
else if (cmdArgs.hasArgument("-6"))
|
|
||||||
family = oatpp::network::Address::IP_6;
|
|
||||||
AppComponent components({host, port, family});
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper);
|
|
||||||
auto controller = std::make_shared<Controller>(objectMapper);
|
|
||||||
router->addController(controller);
|
|
||||||
auto swaggerController = oatpp::swagger::Controller::createShared(controller->getEndpoints());
|
|
||||||
router->addController(swaggerController);
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, connectionProvider);
|
|
||||||
OATPP_LOGI(__FUNCTION__, "Server " PRODUCT_VERSION_STR " starting on %s:%s",
|
|
||||||
connectionProvider->getProperty("host").getData(), connectionProvider->getProperty("port").getData());
|
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::Server>, server);
|
|
||||||
server->run();
|
|
||||||
OATPP_LOGI(__FUNCTION__, "Server stopped");
|
|
||||||
}
|
|
||||||
oatpp::base::Environment::destroy();
|
|
||||||
} catch (exception &ex) {
|
|
||||||
OATPP_LOGE(__FUNCTION__, "%s: %s", typeid(ex).name(), ex.what());
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
Copyright © 2022 Amebis
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../include/version.h"
|
|
||||||
#include <zrcola/idrec.h>
|
|
||||||
|
|
||||||
#ifndef PREFIX
|
|
||||||
#define PREFIX "/usr/local"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern ZRCola::translation_db t_db;
|
|
||||||
extern ZRCola::transet_db ts_db;
|
|
||||||
// extern ZRCola::transeq_db tsq_db;
|
|
||||||
extern ZRCola::langchar_db lc_db;
|
|
||||||
extern ZRCola::language_db lang_db;
|
|
||||||
// extern ZRCola::character_db chr_db;
|
|
||||||
// extern ZRCola::chrcat_db cc_db;
|
|
||||||
// extern ZRCola::chrtag_db ct_db;
|
|
||||||
// extern ZRCola::tagname_db tn_db;
|
|
||||||
// extern ZRCola::highlight_db h_db;
|
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2017-2022 Amebis
|
Copyright © 2017-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<package>
|
<package>
|
||||||
<job id="CanoPerm">
|
<job id="CanoPerm">
|
||||||
<runtime>
|
<runtime>
|
||||||
<description>Generates character index permutations - Amebis, Copyright © 2017-2022</description>
|
<description>Generates character index permutations - Amebis, Copyright © 2017-2021</description>
|
||||||
<unnamed name="<Pattern>" required="true" helpstring="Cannonical form (X=unmoveable character; 0-9=moveable character, characters of the same number must preserve global order of appearance; maximum 10 characters)"/>
|
<unnamed name="<Pattern>" required="true" helpstring="Cannonical form (X=unmoveable character; 0-9=moveable character, characters of the same number must preserve global order of appearance; maximum 10 characters)"/>
|
||||||
<example>
|
<example>
|
||||||
Example:
|
Example:
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<package>
|
<package>
|
||||||
<job id="InstFont">
|
<job id="InstFont">
|
||||||
<runtime>
|
<runtime>
|
||||||
<description>Installs font - Amebis, Copyright © 2016-2022</description>
|
<description>Installs font - Amebis, Copyright © 2016-2021</description>
|
||||||
<unnamed name="<Shortcut.lnk>" required="true" helpstring="Shortcut file to create"/>
|
<unnamed name="<Shortcut.lnk>" required="true" helpstring="Shortcut file to create"/>
|
||||||
<example>
|
<example>
|
||||||
Example:
|
Example:
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 1991-2022 Amebis
|
Copyright © 1991-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<package>
|
<package>
|
||||||
<job id="MkLnk">
|
<job id="MkLnk">
|
||||||
<runtime>
|
<runtime>
|
||||||
<description>Creates shortcut to a program - Amebis, Copyright © 1991-2022</description>
|
<description>Creates shortcut to a program - Amebis, Copyright © 1991-2021</description>
|
||||||
<unnamed name="<Shortcut.lnk>" required="true" helpstring="Shortcut file to create"/>
|
<unnamed name="<Shortcut.lnk>" required="true" helpstring="Shortcut file to create"/>
|
||||||
<unnamed name="<Target>" required="true" helpstring="Target file the shortcut invokes"/>
|
<unnamed name="<Target>" required="true" helpstring="Target file the shortcut invokes"/>
|
||||||
<named name="A" type="string" required="false" helpstring="Command line arguments"/>
|
<named name="A" type="string" required="false" helpstring="Command line arguments"/>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<package>
|
<package>
|
||||||
<job id="CharImport">
|
<job id="CharImport">
|
||||||
|
1
include/.gitignore
vendored
1
include/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
|
/UpdaterKeypair.txt
|
||||||
/UpdaterKeyPrivate.bin
|
/UpdaterKeyPrivate.bin
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets" />
|
<ImportGroup Label="PropertySheets" />
|
||||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets" />
|
<ImportGroup Label="PropertySheets" />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@ -31,7 +31,6 @@
|
|||||||
<DisableSpecificWarnings>4100;4505</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;4505</DisableSpecificWarnings>
|
||||||
<SupportJustMyCode>false</SupportJustMyCode>
|
<SupportJustMyCode>false</SupportJustMyCode>
|
||||||
<EnablePREfast>true</EnablePREfast>
|
<EnablePREfast>true</EnablePREfast>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
ifeq ($(PREFIX),)
|
|
||||||
PREFIX := /usr/local
|
|
||||||
endif
|
|
||||||
CPPFLAGS := $(CPPFLAGS) -MMD -MP -DPREFIX='"$(PREFIX)"'
|
|
||||||
ifeq ($(CFG),Debug)
|
|
||||||
CPPFLAGS := $(CPPFLAGS) -D_DEBUG
|
|
||||||
CFLAGS := $(CFLAGS) -Og -g
|
|
||||||
CXXFLAGS := $(CXXFLAGS) -Og -g
|
|
||||||
else
|
|
||||||
CPPFLAGS := $(CPPFLAGS) -DNDEBUG
|
|
||||||
CFLAGS := $(CFLAGS) -O3 -fdata-sections -ffunction-sections
|
|
||||||
CXXFLAGS := $(CXXFLAGS) -O3 -fdata-sections -ffunction-sections
|
|
||||||
LDFLAGS := $(LDFLAGS) -Wl,--gc-sections
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS := $(SRCS:%=%.o)
|
|
||||||
DEPS := $(OBJS:.o=.d)
|
|
@ -1,5 +0,0 @@
|
|||||||
%.h.gch: %.h
|
|
||||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header -o $@ -c $<
|
|
||||||
|
|
||||||
%.cpp.o: %.cpp
|
|
||||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
|
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2015-2022 Amebis
|
Copyright © 2015-2021 Amebis
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@ -9,7 +9,7 @@
|
|||||||
// Product version as a single DWORD
|
// Product version as a single DWORD
|
||||||
// Note: Used for version comparison within C/C++ code.
|
// Note: Used for version comparison within C/C++ code.
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION 0x02070100
|
#define PRODUCT_VERSION 0x02050400
|
||||||
|
|
||||||
//
|
//
|
||||||
// Product version by components
|
// Product version by components
|
||||||
@ -18,27 +18,27 @@
|
|||||||
// separately.
|
// separately.
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_MAJ 2
|
#define PRODUCT_VERSION_MAJ 2
|
||||||
#define PRODUCT_VERSION_MIN 7
|
#define PRODUCT_VERSION_MIN 5
|
||||||
#define PRODUCT_VERSION_REV 1
|
#define PRODUCT_VERSION_REV 4
|
||||||
#define PRODUCT_VERSION_BUILD 0
|
#define PRODUCT_VERSION_BUILD 0
|
||||||
|
|
||||||
//
|
//
|
||||||
// Human readable product version and build year for UI
|
// Human readable product version and build year for UI
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_STR "2.7.1"
|
#define PRODUCT_VERSION_STR "2.5.4"
|
||||||
#define PRODUCT_BUILD_YEAR_STR "2024"
|
#define PRODUCT_BUILD_YEAR_STR "2021"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Numerical version presentation for ProductVersion propery in
|
// Numerical version presentation for ProductVersion propery in
|
||||||
// MSI packages (syntax: N.N[.N[.N]])
|
// MSI packages (syntax: N.N[.N[.N]])
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_INST "2.7.1"
|
#define PRODUCT_VERSION_INST "2.5.4"
|
||||||
|
|
||||||
//
|
//
|
||||||
// The product code for ProductCode property in MSI packages
|
// The product code for ProductCode property in MSI packages
|
||||||
// Replace with new on every version change, regardless how minor it is.
|
// Replace with new on every version change, regardless how minor it is.
|
||||||
//
|
//
|
||||||
#define PRODUCT_VERSION_GUID "{9423BEC3-3159-4130-8C3E-48D5DE24D48A}"
|
#define PRODUCT_VERSION_GUID "{EBF841F9-2BFB-444C-AC5E-874586350EFD}"
|
||||||
|
|
||||||
//
|
//
|
||||||
// The product vendor and application name for configuration keeping.
|
// The product vendor and application name for configuration keeping.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 2016-2022 Amebis
|
Copyright © 2016-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 1991-2022 Amebis
|
Copyright © 1991-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup Condition="'$(POCompileBeforeTargets)' == '' and '$(POCompileAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
|
<PropertyGroup Condition="'$(POCompileBeforeTargets)' == '' and '$(POCompileAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 1991-2022 Amebis
|
Copyright © 1991-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
Copyright © 1991-2022 Amebis
|
Copyright © 1991-2021 Amebis
|
||||||
-->
|
-->
|
||||||
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
|
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
|
||||||
<Rule Name="POCompile" PageTemplate="tool" DisplayName="PO Compiler" SwitchPrefix="--" Order="200">
|
<Rule Name="POCompile" PageTemplate="tool" DisplayName="PO Compiler" SwitchPrefix="--" Order="200">
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user