Compare commits

..

38 Commits

Author SHA1 Message Date
Simon Rozman
fb4faf2724 Remove MFC dependency 2018-09-17 09:45:56 +02:00
Simon Rozman
c75bb7ab94 Add missing #include <algorithm> 2018-09-17 09:44:25 +02:00
Simon Rozman
e47a882cdc Simplify property sheet inclusion 2018-09-17 09:42:27 +02:00
Simon Rozman
139a020cac Revert MSI URLs from HTTPS to HTTP
Updater doesn't handle HTTPS. Yet.
2018-09-17 09:38:59 +02:00
Simon Rozman
3aec40b884 Fix intermediate/output folder creation on nmake register 2018-09-03 13:10:14 +02:00
Simon Rozman
71043e48f3 Switch to wxWidgets 3.1.1 2018-09-03 13:09:35 +02:00
Simon Rozman
8a321137a0 Use local wxWidget DLLs 2018-09-03 10:26:30 +02:00
Simon Rozman
b01d3b9f58 Fix output path for Updater operations 2018-09-01 07:34:47 +02:00
Simon Rozman
2257e7aa5f Update wxExtend sub-module 2018-09-01 06:48:12 +02:00
Simon Rozman
9a0dd940c1 Update sub-modules 2018-08-31 14:26:32 +02:00
Simon Rozman
f4de83bf06 Preset version to 2.0.3 2018-08-28 08:55:21 +02:00
Simon Rozman
8596e6fb28 Set version to 2.0.2 2018-08-28 08:49:05 +02:00
Simon Rozman
d5f4b76835 Register en_US language in nmake register
When "Language" setting is absent in registry, the initialization of
wxWidget localization raises asserts.
2018-08-24 14:48:20 +02:00
Simon Rozman
6c79118505 Update font and database 2018-08-24 13:56:53 +02:00
Simon Rozman
3d56cdd59b Update submodules 2018-08-24 13:53:32 +02:00
Simon Rozman
c7677d4a90 Update Amebis URL 2018-08-24 13:41:02 +02:00
Simon Rozman
613241d5ab Use absolute devenv.com path 2018-08-24 13:40:36 +02:00
Simon Rozman
bb4304d439 Update submodule 2018-08-24 13:38:31 +02:00
Simon Rozman
8539e6eb9f Update wxWidgets to 3.0.3 2017-12-22 10:31:59 +01:00
Simon Rozman
bd914829c5 Update documentation 2017-12-22 10:28:00 +01:00
Simon Rozman
bc22273385 Update submodules 2017-12-22 10:23:59 +01:00
Simon Rozman
1d579c922b Extend copyright to 2017 2017-12-22 10:23:48 +01:00
Simon Rozman
083ee099df Update MSI build config 2017-12-22 10:03:18 +01:00
Simon Rozman
7a6607827e Update submodule 2017-12-22 10:02:58 +01:00
Simon Rozman
3839f0f99e Remove lib/MSICALib submodule 2017-12-22 09:59:51 +01:00
Simon Rozman
e0881da497 Remove lib/atlex submodule 2017-12-22 09:45:00 +01:00
Simon Rozman
fde9d40105 Main frame no longer deletes child dialogues in destructor, causing after-death wxPersist saving of deleted dialogue states later. 2017-12-22 08:50:22 +01:00
Simon Rozman
c87d95204e ZRCola::translation_db::Compose fixed to honor inputMax==-1 correctly 2017-12-22 08:47:45 +01:00
Simon Rozman
ee9db7e262 Reverted to SHA1 Authenticode signatures for Windows XP compatibility 2017-12-22 08:47:26 +01:00
Simon Rozman
520c5a9b31 ZRCola tutorial is now displayed only if ZRCola feature was installed 2017-12-22 08:46:52 +01:00
Simon Rozman
a330bd3c62 wxWidget RTL dependencies fixed 2017-12-22 08:46:31 +01:00
Simon Rozman
9d36cc2d45 Changed to RFC3161 time-stamping and forced SHA1 digest to support Vista 2017-12-22 08:46:04 +01:00
Simon Rozman
d200094c7d Folder options added 2017-12-22 08:45:14 +01:00
Simon Rozman
214991e4e3 00ZRCOla fonts replaced with ZRCOla 2017-12-22 08:44:48 +01:00
Simon Rozman
fdadb29377 Unicode apostrophe changed to ASCII version for simplicity 2017-12-22 08:44:07 +01:00
Simon Rozman
1bcea13f57 Update sub-modules 2017-12-22 08:42:44 +01:00
Simon Rozman
2fa697ea74 Font and database updated 2017-12-22 08:09:24 +01:00
Simon Rozman
c9ba0d97bf Preset version to 2.0.1 2017-12-22 08:01:52 +01:00
152 changed files with 11726 additions and 29756 deletions

5
.gitignore vendored
View File

@@ -1,3 +1,6 @@
/.vs
/*.opensdf
/*.sdf
/*.suo
/ipch
*.user
temp

View File

@@ -2,17 +2,16 @@
In order to get ZRCola experience in your language the following resources should be translated:
1. [ZRCola Application](https://www.transifex.com/amebis/zrcola/app/)
2. [ZRCola Database](https://www.transifex.com/amebis/zrcola/database/)
3. [ZRCola Core](https://www.transifex.com/amebis/zrcola/core/)
4. [Updater](https://www.transifex.com/amebis/updater/updater/) and [Updater UpdCheck](https://www.transifex.com/amebis/updater/updcheck/)
5. [wxExtend](https://www.transifex.com/amebis/wxextend/wxextend/)
1. [ZRCola](https://poeditor.com/join/project/NTidhEPdDM)
2. [ZRCola-zrcdb](https://poeditor.com/join/project/QBuYsTwk0d)
3. [libZRColaUI](https://poeditor.com/join/project/vrnIvk5IOM)
4. [Updater](https://poeditor.com/join/project/oDK4ktH3ZV)
5. [wxExtend](https://poeditor.com/join/project/YmsdlC3CBv)
6. Setup
- [ZRCola Setup](https://www.transifex.com/amebis/zrcola/setup/)
- [MSIBuild UI](https://www.transifex.com/amebis/msibuild/ui/)
- [MSIBuild Core](https://www.transifex.com/amebis/msibuild/core/)
- [MSICALib](https://www.transifex.com/amebis/msicalib/msicalib/)
- [MSICA](https://www.transifex.com/amebis/msica/msica/)
- [MSIBuildUI](https://poeditor.com/join/project/ikxWBlq1o5)
- [MSIBuildCore](https://poeditor.com/join/project/RSCSsz9fXi)
- [MSICALib](https://poeditor.com/join/project/cKP0wwBrHU)
- [MSICA](https://poeditor.com/join/project/gCNPagUQvn)
## General Guidelines

5
MSI/MSM/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/*.log
/Microsoft_VC100_CRT_x64.msm
/Microsoft_VC100_CRT_x86.msm
/Microsoft_VC100_DebugCRT_x64.msm
/Microsoft_VC100_DebugCRT_x86.msm

View File

@@ -0,0 +1,2 @@
Win\System64\msvcp100.dll
Win\System64\msvcr100.dll

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
[splosno]
jezik=0
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -0,0 +1,2 @@
Win\System\msvcp100.dll
Win\System\msvcr100.dll

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
[splosno]
jezik=0
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -0,0 +1,2 @@
Win\System64\msvcp100d.dll
Win\System64\msvcr100d.dll

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
[splosno]
jezik=0
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -0,0 +1,2 @@
Win\System\msvcp100d.dll
Win\System\msvcr100d.dll

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
[splosno]
jezik=0
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2018 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2018 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

9
MSI/ZRCola/wxWidgets/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
/*-1.idt
/*-2.idt
/*-2.idtx
/*.Binary-1
/*.Binary-2
/*.Icon-1
/*.Icon-2
/*.lst
/*.msm

View File

@@ -0,0 +1,94 @@
#
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
!INCLUDE "..\..\..\include\MSIBuildCfg.mak"
# Note: When changing WXWIDGETS_VER or WXWIDGETS_COMPILER, the DLL filenames will change.
# Then, you MUST change the component GUIDs as well.
WXWIDGETS_VER=311
WXWIDGETS_COMPILER=_vc100
!IF "$(PLAT)" == "x64"
WXWIDGETS_PLAT=_x64
!ELSE
WXWIDGETS_PLAT=
!ENDIF
!IF "$(CFG)" == "Debug"
WXWIDGETS_CFG=ud
!ELSE
WXWIDGETS_CFG=u
!ENDIF
######################################################################
# Component
All :: "$(LANG).$(PLAT).$(CFG).Component-1.idt"
"$(LANG).$(PLAT).$(CFG).Component-1.idt" : "Makefile" "..\..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Component ComponentId Directory_ Attributes Condition KeyPath
s$(MSIBUILD_LENGTH_ID) S38 s$(MSIBUILD_LENGTH_ID) i2 S255 S$(MSIBUILD_LENGTH_ID)
Component Component
!IF "$(PLAT)" == "Win32"
compwxbase.dll.Win32 {4C7F5A16-5B74-47D5-A405-57C7BD96F090} ZRCOLABINDIR 0 filewxbase.dll.Win32
compwxbase_net.dll.Win32 {00534942-B21F-4401-BFE4-C7677F4BE3E5} ZRCOLABINDIR 0 filewxbase_net.dll.Win32
compwxbase_xml.dll.Win32 {71E30748-DD22-4D8B-B26F-60C5150D9AAE} ZRCOLABINDIR 0 filewxbase_xml.dll.Win32
compwxmsw_core.dll.Win32 {FB8D46B9-86DC-4590-8F0A-8294F6A45E6A} ZRCOLABINDIR 0 filewxwxmsw_core.dll.Win32
compwxmsw_adv.dll.Win32 {7B7DB31D-1760-493A-BBE9-35237A6EF9E0} ZRCOLABINDIR 0 filewxmsw_adv.dll.Win32
compwxmsw_aui.dll.Win32 {49CF9864-63B6-4F43-8EC7-7294B966B419} ZRCOLABINDIR 0 filewxmsw_aui.dll.Win32
!ENDIF
!IF "$(PLAT)" == "x64"
compwxbase.dll.x64 {905D8859-BFD2-410A-81DB-93231088C066} ZRCOLABINDIR 256 filewxbase.dll.x64
compwxbase_net.dll.x64 {8A0A49C8-DAEB-4983-8E8D-9DE30AE1D0B6} ZRCOLABINDIR 256 filewxbase_net.dll.x64
compwxbase_xml.dll.x64 {24A5F181-EFE7-4542-8AAB-1D21DB74E954} ZRCOLABINDIR 256 filewxbase_xml.dll.x64
compwxmsw_core.dll.x64 {F5B3F6E6-4FFB-4A79-A794-202D6F93F716} ZRCOLABINDIR 256 filewxwxmsw_core.dll.x64
compwxmsw_adv.dll.x64 {D7722FB9-59BB-498F-93C3-78451471A023} ZRCOLABINDIR 256 filewxmsw_adv.dll.x64
compwxmsw_aui.dll.x64 {FB703979-0E3D-458E-82DD-DAC33329FA9D} ZRCOLABINDIR 256 filewxmsw_aui.dll.x64
!ENDIF
<<NOKEEP
######################################################################
# File
All :: "$(LANG).$(PLAT).$(CFG).File-1.idt"
"$(LANG).$(PLAT).$(CFG).File-1.idt" : "Makefile" "..\..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
File Component_ FileName FileSize Version Language Attributes Sequence
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l255 i4 S$(MSIBUILD_LENGTH_ID) S20 I2 i2
File File
filewxbase.dll.$(PLAT) compwxbase.dll.$(PLAT) WXBASE~1.DLL|wxbase$(WXWIDGETS_VER)$(WXWIDGETS_CFG)$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
filewxbase_net.dll.$(PLAT) compwxbase_net.dll.$(PLAT) WXBASE~2.DLL|wxbase$(WXWIDGETS_VER)$(WXWIDGETS_CFG)_net$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
filewxbase_xml.dll.$(PLAT) compwxbase_xml.dll.$(PLAT) WXBASE~3.DLL|wxbase$(WXWIDGETS_VER)$(WXWIDGETS_CFG)_xml$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
filewxwxmsw_core.dll.$(PLAT) compwxmsw_core.dll.$(PLAT) WXMSW3~1.DLL|wxmsw$(WXWIDGETS_VER)$(WXWIDGETS_CFG)_core$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
filewxmsw_adv.dll.$(PLAT) compwxmsw_adv.dll.$(PLAT) WXMSW3~2.DLL|wxmsw$(WXWIDGETS_VER)$(WXWIDGETS_CFG)_adv$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
filewxmsw_aui.dll.$(PLAT) compwxmsw_aui.dll.$(PLAT) WXMSW3~3.DLL|wxmsw$(WXWIDGETS_VER)$(WXWIDGETS_CFG)_aui$(WXWIDGETS_COMPILER)$(WXWIDGETS_PLAT).dll 0 0 512 1
<<NOKEEP
######################################################################
# Build MSM module!
######################################################################
!INCLUDE "..\..\MSIBuild\MSM.mak"

BIN
MSILocal.mak Normal file

Binary file not shown.

544
Makefile
View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2018 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -25,17 +25,12 @@ PLAT=x64
REG_FLAGS=/f /reg:64
REG_FLAGS32=/f /reg:32
PROGRAM_FILES_32=C:\Program Files (x86)
!ELSEIF "$(PROCESSOR_ARCHITECTURE)" == "ARM64"
PLAT=ARM64
REG_FLAGS=/f /reg:64
REG_FLAGS32=/f /reg:32
PROGRAM_FILES_32=C:\Program Files (x86)
!ELSE
PLAT=Win32
REG_FLAGS=/f
PROGRAM_FILES_32=C:\Program Files
!ENDIF
MSBUILDFLAGS=/v:m /m
DEVENV10=$(PROGRAM_FILES_32)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com
All ::
@@ -44,7 +39,91 @@ Clean ::
cd "MSI\MSIBuild\Version"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean
cd "$(MAKEDIR)"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
"$(DEVENV10)" "ZRCola.sln" /clean "Release|Win32"
"$(DEVENV10)" "ZRCola.sln" /clean "Debug|Win32"
"$(DEVENV10)" "ZRCola.sln" /clean "Release|x64"
"$(DEVENV10)" "ZRCola.sln" /clean "Debug|x64"
"$(DEVENV10)" "ZRColaUtils.sln" /clean "Release|Win32"
"$(DEVENV10)" "ZRColaUtils.sln" /clean "Debug|Win32"
"$(DEVENV10)" "MSI\MSICA\MSICA.sln" /clean "Release|Win32"
"$(DEVENV10)" "MSI\MSICA\MSICA.sln" /clean "Debug|Win32"
"$(DEVENV10)" "MSI\MSICA\MSICA.sln" /clean "Release|x64"
"$(DEVENV10)" "MSI\MSICA\MSICA.sln" /clean "Debug|x64"
"$(DEVENV10)" "Updater\Updater.sln" /clean "Release|Win32"
"$(DEVENV10)" "Updater\Updater.sln" /clean "Debug|Win32"
"$(DEVENV10)" "Updater\Updater.sln" /clean "Release|x64"
"$(DEVENV10)" "Updater\Updater.sln" /clean "Debug|x64"
-if exist "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.pdb"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.dll" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.dll"
-if exist "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.pdb" del /f /q "$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.pdb"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.dll" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.dll"
-if exist "$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.pdb" del /f /q "$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.pdb"
-if exist "$(OUTPUT_DIR)\ZRCola32.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola32D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32D.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64D.rpt"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
!IFNDEF HAS_VERSION
@@ -88,6 +167,26 @@ PUBLISH_PACKAGE_URL=http://www.amebis.si/prenos/ZRCola/$(MSIBUILD_VERSION_STR)
All :: \
Setup
Setup :: \
# "$(OUTPUT_DIR)\ZRColaDe32.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64.msi" \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
SetupDebug :: \
# "$(OUTPUT_DIR)\ZRColaDe32D.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64D.msi" \
"$(OUTPUT_DIR)\ZRColaEn32D.msi" \
"$(OUTPUT_DIR)\ZRColaEn64D.msi" \
"$(OUTPUT_DIR)\ZRColaRu32D.msi" \
"$(OUTPUT_DIR)\ZRColaRu64D.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.msi"
######################################################################
# Publishing
@@ -95,7 +194,19 @@ All :: \
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PUBLISH_DIR)"
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe32.msi" \
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl64.msi" \
"$(PUBLISH_DIR)" \
# "$(PUBLISH_DIR)\ZRColaInstallDe.exe" \
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" \
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" \
"$(PUBLISH_DIR)\ZRColaInstallSl.exe"
Publish :: \
PublishPre \
@@ -109,6 +220,7 @@ Publish :: \
Register :: \
RegisterSettings \
InstallFonts \
InstallwxWidgets \
RegisterShortcuts
Unregister :: \
@@ -120,7 +232,7 @@ RegisterSettings ::
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "Language" /t REG_SZ /d "en_US" $(REG_FLAGS) > NUL
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\locale" $(REG_FLAGS) > NUL
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\data" $(REG_FLAGS) > NUL
!IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" || "$(PROCESSOR_ARCHITECTURE)" == "ARM64"
!IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "Language" /t REG_SZ /d "en_US" $(REG_FLAGS32) > NUL
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\locale" $(REG_FLAGS32) > NUL
reg.exe add "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\data" $(REG_FLAGS32) > NUL
@@ -130,7 +242,7 @@ UnregisterSettings ::
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "Language" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" $(REG_FLAGS) > NUL
!IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" || "$(PROCESSOR_ARCHITECTURE)" == "ARM64"
!IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "Language" $(REG_FLAGS32) > NUL
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" $(REG_FLAGS32) > NUL
-reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" $(REG_FLAGS32) > NUL
@@ -147,6 +259,72 @@ InstallFonts :: \
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold Italic (TrueType)" /t REG_SZ /d "ZRCola_BI.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" /v "00 ZRCola" /t REG_SZ /d "ZRCola" $(REG_FLAGS) > NUL
InstallwxWidgets :: \
InstallwxWidgets_Debug_Win32 \
InstallwxWidgets_Release_Win32 \
InstallwxWidgets_Debug_x64 \
InstallwxWidgets_Release_x64
InstallwxWidgets_Debug_Win32 :: \
"$(OUTPUT_DIR)\Win32.Debug" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.pdb"
InstallwxWidgets_Release_Win32 :: \
"$(OUTPUT_DIR)\Win32.Release" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.pdb" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.pdb"
InstallwxWidgets_Debug_x64 :: \
"$(OUTPUT_DIR)\x64.Debug" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.pdb"
InstallwxWidgets_Release_x64 :: \
"$(OUTPUT_DIR)\x64.Release" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.pdb" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.dll" \
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.pdb"
UninstallFonts::
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Italic (TrueType)" $(REG_FLAGS) > NUL
@@ -165,6 +343,21 @@ RegisterShortcuts :: \
UnregisterShortcuts ::
-if exist "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" rd /s /q "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola"
######################################################################
# Localization
######################################################################
Localization :: \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" \
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" \
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" \
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
######################################################################
# Folder creation
@@ -173,13 +366,28 @@ UnregisterShortcuts ::
"$(OUTPUT_DIR)" \
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\locale" \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(OUTPUT_DIR)\Win32.Debug" \
"$(OUTPUT_DIR)\Win32.Release" \
"$(OUTPUT_DIR)\x64.Debug" \
"$(OUTPUT_DIR)\x64.Release" \
"$(PUBLISH_DIR)" \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" :
if not exist $@ md $@
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\locale" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale" \
"$(OUTPUT_DIR)\Win32.Debug" \
"$(OUTPUT_DIR)\Win32.Release" \
"$(OUTPUT_DIR)\x64.Debug" \
"$(OUTPUT_DIR)\x64.Release" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" : "$(OUTPUT_DIR)\locale"
"$(PUBLISH_PACKAGE_DIR)" : "$(PUBLISH_DIR)"
@@ -200,6 +408,150 @@ UnregisterShortcuts ::
"$(WINDIR)\Fonts\ZRCola_BI.otf" : "$(OUTPUT_DIR)\ZRCola_BI.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311u_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311u_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_net_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_net_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_net_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311u_net_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_net_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311u_net_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_net_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_net_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_net_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_net_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_net_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_net_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_xml_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxbase311ud_xml_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311ud_xml_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxbase311u_xml_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxbase311u_xml_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxbase311u_xml_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_xml_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxbase311ud_xml_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311ud_xml_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_xml_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxbase311u_xml_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxbase311u_xml_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_core_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_core_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_core_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_core_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_core_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_core_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_core_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_core_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_core_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_core_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_core_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_core_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_adv_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_adv_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_adv_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_adv_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_adv_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_adv_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_adv_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_adv_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_adv_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_adv_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_adv_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_adv_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_aui_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\wxmsw311ud_aui_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311ud_aui_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.dll" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_aui_vc100.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Win32.Release\wxmsw311u_aui_vc100.pdb" : "$(WXWIN)\lib\vc100_dll\wxmsw311u_aui_vc100.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_aui_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Debug\wxmsw311ud_aui_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311ud_aui_vc100_x64.pdb"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.dll" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_aui_vc100_x64.dll"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\x64.Release\wxmsw311u_aui_vc100_x64.pdb" : "$(WXWIN)\lib\vc100_x64_dll\wxmsw311u_aui_vc100_x64.pdb"
copy /y $** $@ > NUL
######################################################################
# Shortcut creation
@@ -213,6 +565,136 @@ UnregisterShortcuts ::
# Building
######################################################################
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" : "$(WXWIN)\locale\de.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" : "$(WXWIN)\locale\ru.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" : "$(WXWIN)\locale\sl.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" :: Localization InstallwxWidgets
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" :: Localization InstallwxWidgets_Release_Win32
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" :: Localization InstallwxWidgets_Release_x64
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" :: Localization InstallwxWidgets_Debug_x64
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" ::
"$(DEVENV10)" "ZRCola.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" ::
"$(DEVENV10)" "ZRCola.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" ::
"$(DEVENV10)" "ZRCola.sln" /build "Release|x64"
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" ::
"$(DEVENV10)" "ZRCola.sln" /build "Debug|x64"
"$(OUTPUT_DIR)\ZRCola32.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRCola32D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRCola64.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRCola64D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRCola32.cab" \
"$(OUTPUT_DIR)\ZRCola32.inf" \
"$(OUTPUT_DIR)\ZRCola32.rpt" : "$(OUTPUT_DIR)\ZRCola32.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRCola32D.cab" \
"$(OUTPUT_DIR)\ZRCola32D.inf" \
"$(OUTPUT_DIR)\ZRCola32D.rpt" : "$(OUTPUT_DIR)\ZRCola32D.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRCola64.cab" \
"$(OUTPUT_DIR)\ZRCola64.inf" \
"$(OUTPUT_DIR)\ZRCola64.rpt" : "$(OUTPUT_DIR)\ZRCola64.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRCola64D.cab" \
"$(OUTPUT_DIR)\ZRCola64D.inf" \
"$(OUTPUT_DIR)\ZRCola64D.rpt" : "$(OUTPUT_DIR)\ZRCola64D.ddf"
makecab.exe /F $**
"$(PUBLISH_DIR)\catalog-0000.xml" : "$(OUTPUT_DIR)\catalog.xml"
if exist $@ del /f /q $@
"$(OUTPUT_DIR)\$(PLAT).Release\UpdSignXML.exe" $** $@
@@ -241,41 +723,19 @@ UnregisterShortcuts ::
!ENDIF
######################################################################
# Platform Specific
######################################################################
PLAT=Win32
PLAT_SUFFIX=32
PLAT_SLN=x86
!INCLUDE "MakefilePlat.mak"
PLAT=x64
PLAT_SUFFIX=64
PLAT_SLN=x64
!INCLUDE "MakefilePlat.mak"
######################################################################
# Language Specific
######################################################################
#LANG=de_DE
#LANG_BASE=de
#LANG_SUFFIX=De
#!INCLUDE "MakefileLang.mak"
#LANG_OUT=De
#!INCLUDE "MSILocal.mak"
LANG=en_US
LANG_BASE=en
LANG_SUFFIX=En
!INCLUDE "MakefileLang.mak"
LANG_OUT=En
!INCLUDE "MSILocal.mak"
LANG=ru_RU
LANG_BASE=ru
LANG_SUFFIX=Ru
!INCLUDE "MakefileLang.mak"
LANG_OUT=Ru
!INCLUDE "MSILocal.mak"
LANG=sl_SI
LANG_BASE=sl
LANG_SUFFIX=Sl
!INCLUDE "MakefileLang.mak"
LANG_OUT=Sl
!INCLUDE "MSILocal.mak"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,66 +0,0 @@
#
# Copyright 1991-2018 Amebis
#
# This file is part of ZRCola.
#
# ZRCola is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ZRCola is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
#
All ::
Clean ::
msbuild.exe $(MSBUILDFLAGS) "ZRCola.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT_SLN)
!IF "$(PLAT)" == "Win32"
msbuild.exe $(MSBUILDFLAGS) "ZRColaUtils.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT_SLN)
!ENDIF
msbuild.exe $(MSBUILDFLAGS) "MSI\MSICA\MSICA.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT_SLN)
msbuild.exe $(MSBUILDFLAGS) "Updater\Updater.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT_SLN)
-if exist "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).ddf" del /f /q "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).ddf"
-if exist "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).cab" del /f /q "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).cab"
-if exist "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).inf" del /f /q "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).inf"
-if exist "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).rpt" del /f /q "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).rpt"
!IFDEF HAS_VERSION
######################################################################
# 2nd Phase
# - The version is known, do the rest.
######################################################################
######################################################################
# Building
######################################################################
"$(OUTPUT_DIR)\$(PLAT).$(CFG)\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\$(PLAT).$(CFG)\ZRCola.exe" ::
msbuild.exe $(MSBUILDFLAGS) "ZRCola.sln" /t:Build /p:Configuration=$(CFG) /p:Platform=$(PLAT_SLN)
"$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.$(PLAT_SUFFIX)$(CFG_SUFFIX).2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.$(PLAT_SUFFIX)$(CFG_SUFFIX).2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.$(PLAT_SUFFIX)$(CFG_SUFFIX).2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.$(PLAT_SUFFIX)$(CFG_SUFFIX).2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX)" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).cab" \
"$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).inf" \
"$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).rpt" : "$(OUTPUT_DIR)\ZRCola$(PLAT_SUFFIX)$(CFG_SUFFIX).ddf"
makecab.exe /F $**
!ENDIF

View File

@@ -12,28 +12,11 @@ https://www.amebis.si/prenos/ZRCola/
### Building Environment Requirements
- Microsoft Windows Vista or later
- Microsoft Visual Studio 2017
- Microsoft Visual Studio 2010 SP1
- _sed.exe_ and _grep.exe_
- Command line utilities from Microsoft Windows SDK Bin folder: distributed with Visual Studio, add Bin folder to path manually.
- Additional command line utilities from project's bin folder: add bin folder to path. The source code is provided on request.
### wxWidgets
ZRCola is using wxWidgets static libraries. You have to compile static libraries yourself.
#### Compiling wxWidgets x86 static libraries
1. Start _x86 Native Tools Command Prompt for VS 2017_
2. Change working folder to `build\msw`
3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141`
4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 BUILD=release`
#### Compiling wxWidgets x64 static libraries
1. Start _x64 Native Tools Command Prompt for VS 2017_
2. Change working folder to `build\msw`
3. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=X64`
4. Run: `nmake /f makefile.vc /ls RUNTIME_LIBS=static SHARED=0 COMPILER_VERSION=141 TARGET_CPU=X64 BUILD=release`
#### Specifying wxWidgets path
ZRCola compilation references wxWidgets libraries using `WXWIN` environment variable. Please set it to wxWidgets folder (i.e. `C:\SDK\wxWidgets`).
- wxWidgets 3.1.1 - set `WXWIN` environment variable to the folder where wxWidgets include and lib files are located. Official binary builds are required.
### Digital Signing of Build Outputs
In order to have the build process digitally sign output files, one should provide the following:
@@ -46,7 +29,7 @@ In order to have the build process digitally sign output files, one should provi
Please note that only Release builds are configured for timestamp signing. Debug configurations do not attempt to timestamp sign the resulting DLL and EXE files in order to speed up the building process and enable offline building.
### Building
Use Microsoft NMAKE to build the project. The resulting files can be found in output subfolder. Open _x64 Native Tools Command Prompt for VS 2017_ for building.
Use Microsoft NMAKE to build the project. The resulting files can be found in output subfolder.
- `nmake Clean` Delete all intermediate and output files.
- `nmake Setup` Build a release version of project and release MSI setup files.

Submodule Updater updated: 6fbcede83b...c160d4b9eb

View File

@@ -1,13 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2016
MinimumVisualStudioVersion = 10.0.40219.1
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRCola", "ZRCola\ZRCola.vcxproj", "{CD9E4170-92DD-440E-980C-D15F62032249}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib-15.0.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendDll-10.0.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFEBC17E-C840-4507-BDE6-1EF5B52DDCC5}"
ProjectSection(SolutionItems) = preProject
@@ -18,119 +16,86 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRCola", "lib\libZRCola\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex-15.0.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex-10.0.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-15.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-10.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|ARM64.ActiveCfg = Debug|ARM64
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|ARM64.Build.0 = Debug|ARM64
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|Win32.ActiveCfg = Debug|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|Win32.Build.0 = Debug|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|x64.ActiveCfg = Debug|x64
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|x64.Build.0 = Debug|x64
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|x86.ActiveCfg = Debug|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Debug|x86.Build.0 = Debug|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|ARM64.ActiveCfg = Release|ARM64
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|ARM64.Build.0 = Release|ARM64
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|Win32.ActiveCfg = Release|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|Win32.Build.0 = Release|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|x64.ActiveCfg = Release|x64
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|x64.Build.0 = Release|x64
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|x86.ActiveCfg = Release|Win32
{CD9E4170-92DD-440E-980C-D15F62032249}.Release|x86.Build.0 = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|ARM64.Build.0 = Debug|ARM64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x64.ActiveCfg = Debug|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x64.Build.0 = Debug|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x86.ActiveCfg = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x86.Build.0 = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|ARM64.ActiveCfg = Release|ARM64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|ARM64.Build.0 = Release|ARM64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.ActiveCfg = Release|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x64.Build.0 = Release|x64
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x86.ActiveCfg = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x86.Build.0 = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|ARM64.Build.0 = Debug|ARM64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|Win32.ActiveCfg = Debug|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|Win32.Build.0 = Debug|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|x64.ActiveCfg = Debug|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|x64.Build.0 = Debug|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|Win32.ActiveCfg = Release|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|Win32.Build.0 = Release|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|x64.ActiveCfg = Release|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|x64.Build.0 = Release|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|Win32.ActiveCfg = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|Win32.Build.0 = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x64.ActiveCfg = Debug|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x64.Build.0 = Debug|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x86.ActiveCfg = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x86.Build.0 = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|ARM64.ActiveCfg = Release|ARM64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|ARM64.Build.0 = Release|ARM64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|Win32.ActiveCfg = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|Win32.Build.0 = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x64.ActiveCfg = Release|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x64.Build.0 = Release|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x86.ActiveCfg = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x86.Build.0 = Release|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|ARM64.Build.0 = Debug|ARM64
{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|x64.ActiveCfg = Debug|x64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x64.Build.0 = Debug|x64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x86.ActiveCfg = Debug|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x86.Build.0 = Debug|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|ARM64.ActiveCfg = Release|ARM64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|ARM64.Build.0 = Release|ARM64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.ActiveCfg = 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.Build.0 = Release|x64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x86.ActiveCfg = Release|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|x86.Build.0 = Debug|Win32
{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
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x86.ActiveCfg = Release|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x86.Build.0 = Release|Win32
{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|Win32.ActiveCfg = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.Build.0 = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.ActiveCfg = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.Build.0 = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x86.ActiveCfg = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x86.Build.0 = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|ARM64.ActiveCfg = Release|ARM64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|ARM64.Build.0 = Release|ARM64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.ActiveCfg = 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.Build.0 = Release|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x86.ActiveCfg = Release|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x86.Build.0 = Debug|Win32
{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
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x86.ActiveCfg = Release|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{A3A36689-AC35-4026-93DA-A3BA0C0E767C} = {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}
{518777CC-0A59-4415-A12A-82751ED75343} = {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
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EECB5329-0607-4D77-8BC0-48BD8C08BEF9}
EndGlobalSection
EndGlobal

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2018 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -241,6 +241,16 @@ Feature_ Component_
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID)
FeatureComponents Feature_ Component_
featZRCola compZRCola.exe.$(PLAT)
featZRCola complibZRCola.dll.$(PLAT)
featZRCola complibZRColaUI.dll.$(PLAT)
featZRCola compwxExtend.dll.$(PLAT)
featZRCola compUpdater.dll.$(PLAT)
featZRCola compwxbase.dll.$(PLAT)
featZRCola compwxbase_net.dll.$(PLAT)
featZRCola compwxbase_xml.dll.$(PLAT)
featZRCola compwxmsw_core.dll.$(PLAT)
featZRCola compwxmsw_adv.dll.$(PLAT)
featZRCola compwxmsw_aui.dll.$(PLAT)
featZRCola compLocalizationRepositoryPath
featZRCola compLanguage
featZRCola compDatabasePath

File diff suppressed because it is too large Load Diff

View File

@@ -9,12 +9,6 @@
<ClCompile>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\Updater\Updater\include;..\lib\stdex\include;..\lib\WinStd\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include</AdditionalIncludeDirectories>
</ClCompile>
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
</Manifest>
<ResourceCompile>
<AdditionalIncludeDirectories>..\Updater\Updater\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Binary file not shown.

View File

@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -13,10 +9,6 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -29,87 +21,55 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{CD9E4170-92DD-440E-980C-D15F62032249}</ProjectGuid>
<RootNamespace>ZRCola</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\x64.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\x64.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRCola.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
@@ -118,9 +78,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="zrcolaabout.cpp" />
<ClCompile Include="zrcolaapp.cpp" />
@@ -133,7 +91,6 @@
<ClCompile Include="zrcolagui.cpp" />
<ClCompile Include="zrcolakeyhndlr.cpp" />
<ClCompile Include="zrcolasettings.cpp" />
<ClCompile Include="zrcolatranseq.cpp" />
<ClCompile Include="zrcolaupdater.cpp" />
</ItemGroup>
<ItemGroup>
@@ -149,7 +106,6 @@
<ClInclude Include="zrcolagui.h" />
<ClInclude Include="zrcolakeyhndlr.h" />
<ClInclude Include="zrcolasettings.h" />
<ClInclude Include="zrcolatranseq.h" />
<ClInclude Include="zrcolaupdater.h" />
</ItemGroup>
<ItemGroup>
@@ -159,11 +115,11 @@
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj">
<ProjectReference Include="..\lib\WinStd\build\WinStd-10.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib-15.0.vcxproj">
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendDll-10.0.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
<ProjectReference Include="..\Updater\Updater\build\Updater.vcxproj">
<Project>{990d8cf9-4457-4dc0-aa18-4968ef434741}</Project>
@@ -172,8 +128,6 @@
<ItemGroup>
<None Include="locale\ZRCola.pot" />
<None Include="res\char_select.ico" />
<None Include="res\copy_composed_and_return.ico" />
<None Include="res\copy_decomposed_and_return.ico" />
<None Include="res\edit_copy.ico" />
<None Include="res\edit_cut.ico" />
<None Include="res\edit_paste.ico" />
@@ -183,9 +137,7 @@
<None Include="res\send_composed.ico" />
<None Include="res\send_decomposed.ico" />
<None Include="res\zrcola.ico" />
<None Include="res\ZRCola.fbp">
<SubType>Designer</SubType>
</None>
<None Include="ZRCola.fbp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc" />
@@ -195,9 +147,6 @@
<POCompile Include="locale\ru_RU.po" />
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<ItemGroup>
<Image Include="res\composition.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\include\xgettext.targets" />

View File

@@ -58,9 +58,6 @@
<ClCompile Include="zrcolachrreq.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolatranseq.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@@ -102,9 +99,6 @@
<ClInclude Include="zrcolachrreq.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolatranseq.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\zrcola.ico">
@@ -128,7 +122,7 @@
<None Include="res\edit_paste.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\ZRCola.fbp">
<None Include="ZRCola.fbp">
<Filter>Resource Files</Filter>
</None>
<None Include="res\char_select.ico">
@@ -143,12 +137,6 @@
<None Include="res\navigate_forward.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_composed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_decomposed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc">
@@ -166,9 +154,4 @@
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
<ItemGroup>
<Image Include="res\composition.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,418 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 8 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ZRCOLAGUI_H__
#define __ZRCOLAGUI_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/cshelp.h>
#include <wx/intl.h>
class wxZRColaCharGrid;
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
#include <wx/choice.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/grid.h>
#include <wx/checkbox.h>
#include <wx/srchctrl.h>
#include <wx/hyperlink.h>
#include <wx/checklst.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/listbox.h>
#include <wx/listbook.h>
#include <wx/listctrl.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaFrameBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaFrameBase : public wxFrame
{
private:
protected:
enum
{
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_DESTINATION,
wxID_COPY_DESTINATION_AND_RETURN,
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_COMPOSITION_MENU,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_TRANSLATE,
wxID_PANEL_CHRGRPS,
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE,
wxID_COMPOSITION_TOOLBAR
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenuItem* m_menuItemComposition;
wxMenu* m_menuTranslationSeq;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarTranslate;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxAuiToolBarItem* m_toolComposition;
wxChoice* m_toolTranslationSeq;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
public:
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") );
wxAuiManager m_mgr;
~wxZRColaFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaComposerPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaComposerPanelBase : public wxPanel
{
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
wxTextCtrl* m_sourceHex;
wxSplitterWindow* m_splitterDestination;
wxPanel* m_panelDestinationEdit;
wxPanel* m_panelDestinationHex;
wxTextCtrl* m_destinationHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnSourcePaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourceText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSourceHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDestinationHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_source;
wxTextCtrl* m_destination;
wxZRColaComposerPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaComposerPanel") );
~wxZRColaComposerPanelBase();
void m_splitterSourceOnIdle( wxIdleEvent& )
{
m_splitterSource->SetSashPosition( -5 );
m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, this );
}
void m_splitterDestinationOnIdle( wxIdleEvent& )
{
m_splitterDestination->SetSashPosition( -5 );
m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, this );
}
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharacterCatalogPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharacterCatalogPanelBase : public wxPanel
{
private:
protected:
wxChoice* m_choice;
wxZRColaCharGrid* m_grid;
wxCheckBox* m_show_all;
// Virtual event handlers, overide them in your derived class
virtual void OnChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnGridClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnGridKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnShowAll( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharacterCatalogPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaCharacterCatalog") );
~wxZRColaCharacterCatalogPanelBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharSelectBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
wxPanel* m_search_panel;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
wxHyperlinkCtrl* m_categoriesInvert;
wxZRColaCharGrid* m_gridResults;
wxZRColaCharGrid* m_gridRecent;
wxStaticText* m_labelUnicode;
wxTextCtrl* m_unicode;
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_tags;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnRecentCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnUnicodeText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPreviewKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnNavigateBack( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnNavigateForward( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Character Search"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharSelect") );
~wxZRColaCharSelectBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaSettingsBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
wxStaticText* m_langLabel;
wxRadioButton* m_langAuto;
wxRadioButton* m_langManual;
wxListBox* m_languages;
wxPanel* m_panelAutoStart;
wxStaticText* m_autoStartLabel;
wxCheckBox* m_autoStart;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsApply;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnLanguageUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaSettingsBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaSettings") );
~wxZRColaSettingsBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaAboutBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
wxStaticText* m_staticTextVersion;
wxStaticText* m_staticTextColophone;
wxStaticText* m_staticTextCopyright;
wxHyperlinkCtrl* m_hyperlink;
wxStaticText* m_staticTextDeclaration;
wxTextCtrl* m_declaration;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
public:
wxZRColaAboutBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaAbout") );
~wxZRColaAboutBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaUpdaterBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaUpdaterBase : public wxDialog
{
private:
protected:
wxTextCtrl* m_log;
wxButton* m_buttonUpdate;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Product Update"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaUpdater") );
~wxZRColaUpdaterBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharRequestBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
wxStaticText* m_characterNote;
wxStaticText* m_contextLbl;
wxTextCtrl* m_context;
wxStaticText* m_note;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharRequestBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Request a New Character"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharRequest") );
~wxZRColaCharRequestBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaTranslationSeqBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaTranslationSeqBase : public wxDialog
{
private:
protected:
wxStaticText* m_transLbl;
wxStaticText* m_availableLbl;
wxListBox* m_available;
wxButton* m_add;
wxButton* m_remove;
wxStaticText* m_selectedLbl;
wxListBox* m_selected;
wxButton* m_selectedUp;
wxButton* m_selectedDown;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnAvailableChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnAvailableDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAdd( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemove( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnSelectedDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedUp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedDown( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaTranslationSeqBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Custom Translation Sequence"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaTranslationSeq") );
~wxZRColaTranslationSeqBase();
};
#endif //__ZRCOLAGUI_H__

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -29,7 +29,6 @@
#include "zrcolafrm.h"
#include "zrcolakeyhndlr.h"
#include "zrcolasettings.h"
#include "zrcolatranseq.h"
#include "zrcolaupdater.h"
#include <Updater/chkthread.h>
@@ -37,18 +36,14 @@
#include <wxex/common.h>
#include <wxex/url.h>
#include <wxex/persist/auimanager.h>
#include <wxex/persist/toplevel.h>
#include <wx/clipbrd.h>
#include <wx/dcclient.h>
#include <wx/ffile.h>
#include <wx/msgdlg.h>
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
#include <wx/socket.h>
#include <wx/tokenzr.h>
#include <wx/utils.h>
#include <wx/valtext.h>
#include <wx/socket.h>
#include <WinStd/MSI.h>

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -102,18 +102,6 @@ bool ZRColaApp::OnInit()
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
m_t_db.clear();
}
} else if (id == ZRCola::transet_rec::id) {
dat >> ZRCola::transet_rec(m_ts_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation set data from ZRCola.zrcdb."));
m_ts_db.clear();
}
} else if (id == ZRCola::transeq_rec::id) {
dat >> ZRCola::transeq_rec(m_tsq_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation sequence data from ZRCola.zrcdb."));
m_tsq_db.clear();
}
} else if (id == ZRCola::langchar_rec::id) {
dat >> ZRCola::langchar_rec(m_lc_db);
if (!dat.good()) {
@@ -171,6 +159,7 @@ bool ZRColaApp::OnInit()
wxSocketBase::Initialize();
m_mainWnd = new wxZRColaFrame();
wxPersistentRegisterAndRestore<wxZRColaFrame>(m_mainWnd);
m_mainWnd->Show();
return true;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -73,8 +73,6 @@ public:
public:
ZRCola::translation_db m_t_db; ///< Translation database
ZRCola::transet_db m_ts_db; ///< Translation set database
ZRCola::transeq_db m_tsq_db; ///< Translation sequence database
ZRCola::langchar_db m_lc_db; ///< Language character database
ZRCola::language_db m_lang_db; ///< Language database
ZRCola::keyseq_db m_ks_db; ///< Key sequence database
@@ -90,7 +88,7 @@ public:
protected:
#ifdef __WXMSW__
winstd::win_handle<NULL> m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
winstd::win_handle m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
#endif
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -25,7 +25,7 @@
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaCharacterCatalogPanel, wxZRColaCharacterCatalogPanelBase)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_SOURCE, wxZRColaCharacterCatalogPanel::OnFocusSource)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_DECOMPOSED, wxZRColaCharacterCatalogPanel::OnFocusDecomposed)
END_EVENT_TABLE()
@@ -42,8 +42,8 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
dat >> rec;
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character group data from ZRCola.zrcdb."));
m_cg_db.idxRank.clear();
m_cg_db.data .clear();
m_cg_db.idxRnk.clear();
m_cg_db.data .clear();
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb has no character group data."));
@@ -52,16 +52,16 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
if (!m_cg_db.idxRank.empty()) {
if (!m_cg_db.idxRnk.empty()) {
// Populate character group list.
for (size_t i = 0, n = m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[i];
for (size_t i = 0, n = m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[i];
wxString
label(cg.name(), cg.name_len()),
label(cg.data, cg.name_len),
label_tran2(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_choice->Insert(label_tran2, i);
}
m_cg_id = m_cg_db.idxRank[0].grp;
m_cg_id = m_cg_db.idxRnk[0].id;
m_choice->Select(0);
Update();
@@ -70,7 +70,7 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_SOURCE);
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_DECOMPOSED);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
}
@@ -83,10 +83,10 @@ wxZRColaCharacterCatalogPanel::~wxZRColaCharacterCatalogPanel()
void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
{
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[event.GetSelection()];
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[event.GetSelection()];
if (m_cg_id != cg.grp) {
m_cg_id = cg.grp;
if (m_cg_id != cg.id) {
m_cg_id = cg.id;
Update();
}
@@ -98,8 +98,8 @@ void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_source->SetFocus();
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
}
event.Skip();
@@ -113,8 +113,8 @@ void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
case WXK_NUMPAD_ENTER:
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol()));
app->m_mainWnd->m_panel->m_source->SetFocus();
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
event.StopPropagation();
return;
@@ -135,11 +135,11 @@ void wxZRColaCharacterCatalogPanel::OnShowAll(wxCommandEvent& event)
}
void wxZRColaCharacterCatalogPanel::OnFocusSource(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_source->SetFocus();
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
event.StopPropagation();
return;
@@ -151,23 +151,21 @@ void wxZRColaCharacterCatalogPanel::OnFocusSource(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::Update()
{
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[m_choice->GetSelection()];
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[m_choice->GetSelection()];
if (m_show_all->GetValue()) {
m_grid->SetCharacters(
wxString(cg.chrlst(), cg.chrlst_end()),
wxArrayShort(reinterpret_cast<const short*>(cg.chrshow()), reinterpret_cast<const short*>(cg.chrshow_end())));
wxString(cg.get_chars(), cg.char_len),
wxArrayShort((const short*)cg.get_char_shown(), (const short*)cg.get_char_shown() + (cg.char_len + 15)/16));
} else {
// Select frequently used characters only.
const wchar_t *src = cg.chrlst();
const unsigned __int16 *shown = cg.chrshow();
wxArrayString chars;
for (size_t i = 0, i_end = cg.chrlst_len(), j = 0; i < i_end; j++) {
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);
const wchar_t *src = cg.get_chars();
const unsigned __int16 *shown = cg.get_char_shown();
wxString chars;
for (unsigned __int16 i = 0, j = 0; i < cg.char_len; j++) {
for (unsigned __int16 k = 0, mask = shown[j]; k < 16 && i < cg.char_len; k++, mask >>= 1, i++) {
if (mask & 1)
chars.Add(wxString(src + i, len));
i += len + 1;
chars += src[i];
}
}
m_grid->SetCharacters(chars);
@@ -210,11 +208,11 @@ bool wxPersistentZRColaCharacterCatalogPanel::Restore()
// Restore selected character group.
int cg_id;
if (RestoreValue(wxT("charGroup"), &cg_id)) {
for (size_t i = 0, n = wnd->m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRank[i];
if (cg.grp == cg_id) {
if (wnd->m_cg_id != cg.grp) {
wnd->m_cg_id = cg.grp;
for (size_t i = 0, n = wnd->m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRnk[i];
if (cg.id == cg_id) {
if (wnd->m_cg_id != cg.id) {
wnd->m_cg_id = cg.id;
wnd->m_choice->Select(i);
update = true;
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -38,7 +38,7 @@ class wxZRColaCharacterCatalogPanel : public wxZRColaCharacterCatalogPanelBase
public:
enum
{
wxID_FOCUS_SOURCE = 6000,
wxID_FOCUS_DECOMPOSED = 6000,
};
wxZRColaCharacterCatalogPanel(wxWindow* parent);
@@ -51,7 +51,7 @@ protected:
virtual void OnGridClick(wxGridEvent& event);
virtual void OnGridKeyDown(wxKeyEvent& event);
virtual void OnShowAll(wxCommandEvent& event);
void OnFocusSource(wxCommandEvent& event);
void OnFocusDecomposed(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
void Update();

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -41,7 +41,7 @@ wxZRColaCharGrid::wxZRColaCharGrid(wxWindow *parent, wxWindowID id, const wxPoin
{
Init();
SetDefaultRowSize(FromDIP(wxZRColaCharacterGridRowHeight));
SetDefaultRowSize(wxZRColaCharacterGridRowHeight);
// Create timer for saving the state.
m_timerToolTip.SetOwner(this, wxID_TOOLTIP_TIMER);
@@ -68,24 +68,6 @@ void wxZRColaCharGrid::Init()
void wxZRColaCharGrid::SetCharacters(const wxString &chars)
{
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_relevance.Clear();
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
void wxZRColaCharGrid::SetCharacters(const wxArrayString &chars)
{
m_chars = chars;
m_relevance.Clear();
@@ -100,12 +82,7 @@ void wxZRColaCharGrid::SetCharacters(const wxArrayString &chars)
void wxZRColaCharGrid::SetCharacters(const wxString &chars, const wxArrayShort &relevance)
{
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_chars = chars;
m_relevance = relevance;
m_regenerate = true;
@@ -118,23 +95,22 @@ void wxZRColaCharGrid::SetCharacters(const wxString &chars, const wxArrayShort &
wxString wxZRColaCharGrid::GetToolTipText(int idx)
{
wxASSERT_MSG(idx < (int)m_chars.GetCount(), wxT("index out of bounds"));
wxASSERT_MSG(idx < (int)m_chars.Length(), wxT("index out of bounds"));
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &chr = m_chars[idx];
// 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(wchar_t)*chr.length()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, chr.data(), chr.length());
char ks[sizeof(ZRCola::keyseq_db::keyseq)] = {};
((ZRCola::keyseq_db::keyseq*)ks)->chr = m_chars[idx];
ZRCola::keyseq_db::indexKey::size_type start;
if (app->m_ks_db.idxChr.find(*ks, start)) {
if (app->m_ks_db.idxChr.find(*(ZRCola::keyseq_db::keyseq*)ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
return wxString::Format(wxT("U+%s (%s)"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str(), ks_str.c_str());
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq, seq.seq_len, ks_str))
return wxString::Format(wxT("U+%04X (%s)"), (int)m_chars[idx], ks_str.c_str());
}
return wxString::Format(wxT("U+%s"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str());
return wxString::Format(wxT("U+%04X"), (int)m_chars[idx]);
}
@@ -150,19 +126,17 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
// Calculate initial estimate of columns and rows.
wxSize size(event.GetSize());
size_t
char_count = m_chars.GetCount();
char_len = m_chars.Length();
int
col_width = FromDIP(wxZRColaCharacterGridColumnWidth),
row_height = FromDIP(wxZRColaCharacterGridRowHeight),
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / col_width, 1),
rows = std::max<int>((char_count + cols - 1) / cols, 1);
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1),
rows = std::max<int>((char_len + cols - 1) / cols, 1);
if (m_colLabelHeight + rows*row_height + m_extraHeight > size.GetHeight()) {
if (m_colLabelHeight + rows*wxZRColaCharacterGridRowHeight + m_extraHeight > size.GetHeight()) {
// Vertical scrollbar will be shown. Adjust the width and recalculate layout to avoid horizontal scrollbar.
width = std::max<int>(width - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this), 0);
cols = std::max<int>(width / col_width, 1);
rows = std::max<int>((char_count + cols - 1) / cols, 1);
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1);
rows = std::max<int>((char_len + cols - 1) / cols, 1);
}
BeginBatch();
@@ -172,14 +146,14 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
wxGridStringTable *table = new wxGridStringTable(rows, cols);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
table->SetValue(r, c, i < (int)char_count ? m_chars[i] : wxEmptyString);
table->SetValue(r, c, i < (int)char_len ? wxString(1, m_chars[i]) : wxEmptyString);
SetTable(table, true);
if (!m_relevance.IsEmpty()) {
const wxColour colour_def;
const wxColour colour_irr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
SetCellBackgroundColour(r, c, i >= (int)char_count || ((unsigned short)(m_relevance[i/16]) & (1<<(i%16))) ? colour_def : colour_irr);
SetCellBackgroundColour(r, c, i >= (int)char_len || ((unsigned short)(m_relevance[i/16]) & (1<<(i%16))) ? colour_def : colour_irr);
} else {
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
@@ -189,7 +163,7 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
}
for (int c = 0; c < cols; c++)
SetColSize(c, col_width);
SetColSize(c, wxZRColaCharacterGridColumnWidth);
//// Set column widths to stretch to full width.
//for (int c = 0, x_l = 0; c < cols; c++) {
@@ -243,7 +217,7 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event)
return;
size_t toolTipIdx = row*m_numCols + col;
if (toolTipIdx >= m_chars.GetCount()) {
if (toolTipIdx >= m_chars.Length()) {
// Index out of range.
m_toolTipIdx = (size_t)-1;
m_timerToolTip.Stop();
@@ -267,7 +241,7 @@ void wxZRColaCharGrid::OnTooltipTimer(wxTimerEvent& event)
{
event.Skip();
if (m_toolTipIdx >= m_chars.GetCount())
if (m_toolTipIdx >= m_chars.Length())
return;
GetGridWindow()->SetToolTip(GetToolTipText(m_toolTipIdx));

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -54,21 +54,14 @@ public:
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display (zero delimited)
/// \param[in] chars The string containing characters to display
///
void SetCharacters(const wxString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The array of characters to display
///
void SetCharacters(const wxArrayString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display (zero delimited)
/// \param[in] chars The string containing characters to display
/// \param[in] relevance Bit-array of \p chars relevance (1=more relevant, 0=less relevant)
///
void SetCharacters(const wxString &chars, const wxArrayShort &relevance);
@@ -78,7 +71,7 @@ public:
///
/// \returns The string containing displayed characters
///
inline const wxArrayString& GetCharacters() const
inline wxString GetCharacters() const
{
return m_chars;
}
@@ -90,14 +83,10 @@ public:
///
/// \returns Grid coordinates of selected character or (-1, -1) if character not found.
///
inline wxGridCellCoords GetCharacterCoords(const wxString &c) const
inline wxGridCellCoords GetCharacterCoords(wchar_t c) const
{
for (size_t i = 0, n = m_chars.GetCount(); ; i++) {
if (i >= n)
return wxGridCellCoords(-1, -1);
else if (m_chars[i] == c)
return wxGridCellCoords(i / m_numCols, i % m_numCols);
}
int i = m_chars.Find(c);
return i != wxNOT_FOUND ? wxGridCellCoords(i / m_numCols, i % m_numCols) : wxGridCellCoords(-1, -1);
}
protected:
@@ -113,7 +102,7 @@ private:
void Init(); // common part of all ctors
protected:
wxArrayString m_chars; ///< Array of Unicode characters to display in the grid
wxString m_chars; ///< Array of Unicode characters to display in the grid
wxArrayShort m_relevance; ///< Bit-array of `m_chars` relevance
private:

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -71,18 +71,14 @@ void wxZRColaCharRequest::OnOKButtonClick(wxCommandEvent& event)
// wxPersistentZRColaCharRequest
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaCharRequest::s_guiLevel = 1;
wxPersistentZRColaCharRequest::wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd) : wxPersistentTLWEx(wnd)
wxPersistentZRColaCharRequest::wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaCharRequest::Save() const
{
SaveValue(wxT("guiLevel"), s_guiLevel);
wxPersistentTLWEx::Save();
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaCharRequest*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
@@ -101,6 +97,5 @@ bool wxPersistentZRColaCharRequest::Restore()
if (RestoreValue(wxT("context"), &str))
wnd->m_context->SetValue(str);
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;
return wxPersistentDialog::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -21,14 +21,12 @@
/// Forward declarations
///
class wxZRColaCharRequest;
class wxPersistentZRColaCharRequest;
#pragma once
#include "zrcolagui.h"
#include "zrcolakeyhndlr.h"
#include <wxex/persist/toplevel.h>
///
@@ -51,16 +49,13 @@ protected:
///
/// Supports saving/restoring wxZRColaCharRequest state
///
class wxPersistentZRColaCharRequest : public wxPersistentTLWEx
class wxPersistentZRColaCharRequest : public wxPersistentDialog
{
public:
wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd);
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -20,174 +20,6 @@
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////
// wxZRColaUTF16CharValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUTF16CharValidator, wxValidator);
wxZRColaUTF16CharValidator::wxZRColaUTF16CharValidator(wchar_t *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUTF16CharValidator::Clone() const
{
return new wxZRColaUTF16CharValidator(*this);
}
bool wxZRColaUTF16CharValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUTF16CharValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(wxString::Format(wxT("%04X"), *m_val));
return true;
}
bool wxZRColaUTF16CharValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
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;
wchar_t chr = 0;
for (size_t i = i_start;;) {
if (i >= i_end) {
// End of Unicode found.
if (val_out) *val_out = chr;
return true;
} else if (i >= i_start + 4) {
// Maximum characters exceeded.
ctrl->SetFocus();
ctrl->SetSelection(i, i_end);
wxMessageBox(_("Too many digits in Unicode."), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
} else if (_T('0') <= buf[i] && buf[i] <= _T('9')) {
// Digit found.
chr = (chr << 4) | (buf[i] - _T('0'));
i++;
} else if (_T('A') <= buf[i] && buf[i] <= _T('F')) {
// Capital letter found.
chr = (chr << 4) | (buf[i] - _T('A') + 10);
i++;
} else if (_T('a') <= buf[i] && buf[i] <= _T('f')) {
// Lower letter found.
chr = (chr << 4) | (buf[i] - _T('a') + 10);
i++;
} else {
// Invalid character found.
ctrl->SetFocus();
ctrl->SetSelection(i, i + 1);
wxMessageBox(wxString::Format(_("Invalid character in Unicode found: %c"), buf[i]), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
}
}
}
//////////////////////////////////////////////////////////////////////
// wxZRColaUnicodeDumpValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator, wxValidator);
wxZRColaUnicodeDumpValidator::wxZRColaUnicodeDumpValidator(wxString *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUnicodeDumpValidator::Clone() const
{
return new wxZRColaUnicodeDumpValidator(*this);
}
bool wxZRColaUnicodeDumpValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUnicodeDumpValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(ZRCola::GetUnicodeDumpW(m_val->c_str(), m_val->length(), L"+"));
return true;
}
bool wxZRColaUnicodeDumpValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
bool wxZRColaUnicodeDumpValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out)
{
const wxStringCharType *buf = val_in;
wxString str;
for (size_t i = i_start;;) {
const wxStringCharType *buf_next;
wchar_t chr;
if ((buf_next = wmemchr(buf + i, L'+', i_end - i)) != NULL) {
// Unicode dump separator found.
if (!wxZRColaUTF16CharValidator::Parse(val_in, i, buf_next - buf, ctrl, parent, &chr))
return false;
str += chr;
i = buf_next - buf + 1;
} else if (wxZRColaUTF16CharValidator::Parse(val_in, i, i_end, ctrl, parent, &chr)) {
// The rest of the FQDN parsed succesfully.
if (chr) str += chr;
if (val_out) *val_out = str;
return true;
} else
return false;
}
}
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
@@ -198,6 +30,7 @@ wxDEFINE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
m_searchChanged(false),
m_unicodeChanged(false),
m_char(0),
m_searchThread(NULL),
wxZRColaCharSelectBase(parent)
{
@@ -213,15 +46,15 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
m_search_more->SetLabel(_(L"▸ Search Options"));
m_unicode->SetValidator(wxZRColaUnicodeDumpValidator(&m_char));
m_unicode->SetValidator(wxHexValidator<wchar_t>(&m_char, wxNUM_VAL_DEFAULT, 4));
// Fill categories.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), i);
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRnk[i];
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name, cc.name_len), wxT("ZRCola-zrcdb")), i);
m_categories->Check(idx);
m_ccOrder.insert(std::make_pair(cc.cat, idx));
m_ccOrder.insert(std::make_pair(cc.id, idx));
}
ResetResults();
@@ -251,24 +84,24 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
if (m_unicode->GetValidator()->TransferFromWindow()) {
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_gridPreview->SetCellValue(0, 0, m_char);
m_gridPreview->SetCellValue(0, 0, wxString(1, m_char));
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());
ZRCola::character_db::indexChr::size_type ch_start;
if (app->m_chr_db.idxChr.find(*ch, ch_start)) {
const auto &chr = app->m_chr_db.idxChr[ch_start];
char chr[sizeof(ZRCola::character_db::character)] = {};
((ZRCola::character_db::character*)chr)->chr = m_char;
size_t start;
if (app->m_chr_db.idxChr.find(*(ZRCola::character_db::character*)chr, start)) {
const auto &chr = app->m_chr_db.idxChr[start];
// Update character description.
m_description->SetValue(wxString(chr.desc(), chr.desc_len()));
m_description->SetValue(wxString(chr.data, chr.desc_len));
{
// 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(wchar_t)*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;
if (app->m_ks_db.idxChr.find(*ks, ks_start)) {
const auto &seq = app->m_ks_db.idxChr[ks_start];
char ks[sizeof(ZRCola::keyseq_db::keyseq)] = {};
((ZRCola::keyseq_db::keyseq*)ks)->chr = m_char;
ZRCola::keyseq_db::indexKey::size_type start;
if (app->m_ks_db.idxChr.find(*(ZRCola::keyseq_db::keyseq*)ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq, seq.seq_len, ks_str))
m_shortcut->SetValue(ks_str);
else
m_shortcut->SetValue(wxEmptyString);
@@ -276,16 +109,18 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
m_shortcut->SetValue(wxEmptyString);
}
{
char cc[sizeof(ZRCola::chrcat_db::chrcat)] = {};
((ZRCola::chrcat_db::chrcat*)cc)->id = chr.cat;
size_t start;
// Update character category.
ZRCola::chrcat_db::indexChrCat::size_type cc_start;
if (app->m_cc_db.idxChrCat.find(ZRCola::chrcat_db::chrcat(chr.cat), cc_start)) {
const auto &cat = app->m_cc_db.idxChrCat[cc_start];
m_category->SetValue(wxGetTranslation(wxString(cat.name(), cat.name_len()), wxT("ZRCola-zrcdb")));
if (app->m_cc_db.idxChrCat.find(*((ZRCola::chrcat_db::chrcat*)cc), start)) {
const auto &cat = app->m_cc_db.idxChrCat[start];
m_category->SetValue(wxGetTranslation(wxString(cat.name, cat.name_len), wxT("ZRCola-zrcdb")));
} else
m_category->SetValue(wxEmptyString);
}
// Update related characters.
m_gridRelated->SetCharacters(wxString(chr.rel(), chr.rel_end()));
m_gridRelated->SetCharacters(wxString(chr.data + chr.desc_len, chr.rel_len));
} else {
m_description->SetValue(wxEmptyString);
m_shortcut->SetValue(wxEmptyString);
@@ -295,24 +130,28 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
// Find character tags.
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(wchar_t)*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;
if (app->m_ct_db.idxChr.find(*ct, ct_start, ct_end)) {
for (auto i = ct_start; i < ct_end; i++) {
ZRCola::chrtag_db::chrtag ct = { m_char };
size_t end;
if (app->m_ct_db.idxChr.find(ct, start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::chrtag_db::chrtag &ct = app->m_ct_db.idxChr[i];
// Find tag names.
ZRCola::tagname_db::indexTag::size_type tn_start, tn_end;
if (app->m_tn_db.idxTag.find(ZRCola::tagname_db::tagname(app->m_ct_db.idxChr[i].tag, m_locale), tn_start, tn_end)) {
for (auto j = tn_start; j < tn_end; j++) {
const auto &tn = app->m_tn_db.idxTag[j];
char tn[sizeof(ZRCola::tagname_db::tagname)] = {};
((ZRCola::tagname_db::tagname*)tn)->locale = m_locale;
((ZRCola::tagname_db::tagname*)tn)->tag = ct.tag;
size_t start, end;
if (app->m_tn_db.idxTag.find(*((ZRCola::tagname_db::tagname*)tn), start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::tagname_db::tagname &tn = app->m_tn_db.idxTag[i];
// Add tag name to the list (prevent duplicates).
for (auto name = tag_names.cbegin(), name_end = tag_names.cend();; ++name) {
if (name == name_end) {
// 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 + tn.name_len));
break;
} else if (ZRCola::tagname_db::tagname::CompareName(m_locale, name->data(), (unsigned __int16)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.
break;
}
@@ -352,10 +191,10 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
m_searchThread->m_search.assign(val.c_str(), val.Length());
// Select categories.
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRnk[i];
if (m_categories->IsChecked(i))
m_searchThread->m_cats.insert(cc.cat);
m_searchThread->m_cats.insert(cc.id);
}
if (m_searchThread->Run() != wxTHREAD_NO_ERROR) {
@@ -400,7 +239,7 @@ void wxZRColaCharSelect::OnCategoriesAll(wxHyperlinkEvent& event)
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
m_categories->Check(i, true);
m_searchChanged = true;
@@ -412,7 +251,7 @@ void wxZRColaCharSelect::OnCategoriesNone(wxHyperlinkEvent& event)
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
m_categories->Check(i, false);
m_searchChanged = true;
@@ -424,7 +263,7 @@ void wxZRColaCharSelect::OnCategoriesInvert(wxHyperlinkEvent& event)
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
m_categories->Check(i, !m_categories->IsChecked(i));
m_searchChanged = true;
@@ -445,10 +284,10 @@ void wxZRColaCharSelect::OnSearchComplete(wxThreadEvent& event)
if (m_searchThread) {
// Display results.
wxArrayString chars;
wxString chars;
chars.reserve(m_searchThread->m_hits.size());
for (auto i = m_searchThread->m_hits.cbegin(), i_end = m_searchThread->m_hits.cend(); i != i_end; ++i)
chars.Add(i->second);
chars += i->second;
m_gridResults->SetCharacters(chars);
m_searchThread->Delete();
@@ -465,7 +304,7 @@ void wxZRColaCharSelect::OnResultSelectCell(wxGridEvent& event)
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
NavigateTo(val[0]);
}
@@ -475,7 +314,7 @@ void wxZRColaCharSelect::OnResultCellDClick(wxGridEvent& event)
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
@@ -489,7 +328,7 @@ void wxZRColaCharSelect::OnResultsKeyDown(wxKeyEvent& event)
case WXK_NUMPAD_ENTER:
wxString val(m_gridResults->GetCellValue(m_gridResults->GetGridCursorRow(), m_gridResults->GetGridCursorCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
@@ -508,7 +347,7 @@ void wxZRColaCharSelect::OnRecentSelectCell(wxGridEvent& event)
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
NavigateTo(val[0]);
}
@@ -518,7 +357,7 @@ void wxZRColaCharSelect::OnRecentCellDClick(wxGridEvent& event)
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
@@ -532,7 +371,7 @@ void wxZRColaCharSelect::OnRecentKeyDown(wxKeyEvent& event)
case WXK_NUMPAD_ENTER:
wxString val(m_gridRecent->GetCellValue(m_gridRecent->GetGridCursorRow(), m_gridRecent->GetGridCursorCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
@@ -592,7 +431,7 @@ void wxZRColaCharSelect::OnRelatedSelectCell(wxGridEvent& event)
wxString val(m_gridRelated->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
NavigateTo(val[0]);
}
@@ -600,15 +439,15 @@ void wxZRColaCharSelect::OnOKButtonClick(wxCommandEvent& event)
{
event.Skip();
const wxArrayString &recent = m_gridRecent->GetCharacters();
wxArrayString val;
val.reserve(recent.GetCount() + 1);
val.Add(m_char);
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
const wxString &c = recent[i];
wxString
recent(m_gridRecent->GetCharacters()),
val(1, m_char);
for (size_t i = 0, n = recent.Length(); i < n; i++) {
const wxStringCharType c = recent[i];
if (c != m_char)
val.Add(c);
val += c;
}
m_gridRecent->SetCharacters(val);
}
@@ -618,13 +457,13 @@ void wxZRColaCharSelect::ResetResults()
// Fill the results.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
size_t i, n = app->m_chr_db.idxChr.size();
wxArrayString val;
wxString val;
val.reserve(n);
for (i = 0; i < n; i++) {
const auto &chr = app->m_chr_db.idxChr[i];
auto idx = m_ccOrder.find(chr.cat);
if (idx == m_ccOrder.end() || m_categories->IsChecked(idx->second))
val.Add(wxString(chr.chr(), chr.chr_len()));
val += chr.chr;
}
m_gridResults->SetCharacters(val);
}
@@ -668,7 +507,7 @@ void wxZRColaCharSelect::NavigateBy(int offset)
}
void wxZRColaCharSelect::NavigateTo(const wxString &c)
void wxZRColaCharSelect::NavigateTo(wchar_t c)
{
if (m_char != c) {
// Update history state
@@ -709,7 +548,7 @@ wxZRColaCharSelect::SearchThread::SearchThread(wxZRColaCharSelect *parent) :
wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
std::map<std::wstring, ZRCola::charrank_t> hits;
std::map<wchar_t, ZRCola::charrank_t> hits;
if (TestDestroy()) return (wxThread::ExitCode)1;
@@ -722,7 +561,7 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
{
// Search by description and merge results.
std::map<std::wstring, ZRCola::charrank_t> hits_sub;
std::map<wchar_t, ZRCola::charrank_t> hits_sub;
if (!app->m_chr_db.Search(m_search.c_str(), m_cats, hits, hits_sub, TestDestroyS, this)) return (wxThread::ExitCode)1;
for (auto i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
@@ -750,7 +589,7 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
if (i->second > rank_threshold)
m_hits.push_back(std::make_pair(i->second, i->first));
}
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<ZRCola::charrank_t, std::wstring>), CompareHits);
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<ZRCola::charrank_t, wchar_t>), CompareHits);
// Signal the event handler that this thread is going to be destroyed.
// NOTE: here we assume that using the m_parent pointer is safe,
@@ -786,41 +625,24 @@ bool __cdecl wxZRColaCharSelect::SearchThread::TestDestroyS(void *cookie)
// wxPersistentZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaCharSelect::s_guiLevel = 1;
wxPersistentZRColaCharSelect::wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd) : wxPersistentTLWEx(wnd)
wxPersistentZRColaCharSelect::wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaCharSelect::Save() const
{
SaveValue(wxT("guiLevel"), s_guiLevel);
wxPersistentTLWEx::Save();
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaCharSelect*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str, str2;
auto &recent = wnd->m_gridRecent->GetCharacters();
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
if (i) str2 += wxT('|');
auto &chr = recent[i];
for (size_t j = 0, m = chr.Length(); j < m; j++) {
if (j) str2 += wxT('+');
str2 += wxString::Format(wxT("%04X"), chr[j]);
}
if (chr.Length() == 1)
str += chr[0];
}
SaveValue(wxT("recentChars" ), str ); // Save in legacy format for backward compatibility.
SaveValue(wxT("recentChars2"), str2); // Save in native format
SaveValue(wxT("recentChars"), wnd->m_gridRecent->GetCharacters());
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRnk[i];
wxString name(wxT("category"));
name.Append(cc.cat.data, _countof(cc.cat.data));
name.Append(cc.id.data, _countof(cc.id.data));
SaveValue(name, wnd->m_categories->IsChecked(i));
}
@@ -833,29 +655,14 @@ bool wxPersistentZRColaCharSelect::Restore()
auto wnd = dynamic_cast<wxZRColaCharSelect*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str;
if (RestoreValue(wxT("recentChars2"), &str)) {
// Native format found.
wxArrayString val;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
wxString chr;
for (wxStringTokenizer tok_chr(tok.GetNextToken(), wxT("+")); tok_chr.HasMoreTokens(); )
chr += (wchar_t)_tcstoul(tok_chr.GetNextToken().c_str(), NULL, 16);
val.Add(chr);
}
wnd->m_gridRecent->SetCharacters(val);
} else if (RestoreValue(wxT("recentChars"), &str)) {
// Legacy value found.
wxArrayString val;
for (size_t i = 0, n = str.Length(); i < n; i++)
val.Add(wxString(1, str[i]));
wnd->m_gridRecent->SetCharacters(val);
}
wxString recent;
if (RestoreValue(wxT("recentChars"), &recent))
wnd->m_gridRecent->SetCharacters(recent);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRnk[i];
wxString name(wxT("category"));
name.Append(cc.cat.data, _countof(cc.cat.data));
name.Append(cc.id.data, _countof(cc.id.data));
bool val;
if (RestoreValue(name, &val))
wnd->m_categories->Check(i, val);
@@ -874,6 +681,5 @@ bool wxPersistentZRColaCharSelect::Restore()
wnd->ResetResults();
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;
return wxPersistentDialog::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -28,106 +28,15 @@ class wxPersistentZRColaCharSelect;
#include "zrcolagui.h"
#include <zrcola/character.h>
#include <wxex/persist/toplevel.h>
#include <wx/validate.h>
#include <wxex/valhex.h>
#include <wxex/persist/dialog.h>
#include <wx/event.h>
#include <wx/thread.h>
#include <list>
#include <map>
#include <string>
#include <vector>
///
/// Validator for Unicode character
///
class wxZRColaUTF16CharValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUTF16CharValidator(wchar_t *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses FQDN value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out = NULL);
protected:
wchar_t *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUTF16CharValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUTF16CharValidator);
};
///
/// Validator for Unicode dump
///
class wxZRColaUnicodeDumpValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUnicodeDumpValidator(wxString *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses Unicode dump value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out = NULL);
protected:
wxString *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUnicodeDumpValidator);
};
wxDECLARE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
@@ -167,10 +76,10 @@ protected:
void ResetResults();
void NavigateBy(int offset);
void NavigateTo(const wxString &c);
void NavigateTo(wchar_t c);
public:
wxString m_char; ///< Currently selected character (empty when none)
wchar_t m_char; ///< Currently selected character (0 when none)
protected:
LCID m_locale; ///< Locale for tag lookup
@@ -195,7 +104,7 @@ protected:
public:
std::wstring m_search; ///< Search phrase
std::set<ZRCola::chrcatid_t> m_cats; ///< Search categories
std::vector<std::pair<ZRCola::charrank_t, std::wstring> > m_hits; ///< Search results
std::vector<std::pair<ZRCola::charrank_t, wchar_t> > m_hits; ///< Search results
protected:
wxZRColaCharSelect *m_parent; ///< Thread owner
@@ -207,7 +116,7 @@ protected:
///
struct NavigationState
{
std::wstring m_char;
wchar_t m_char;
struct {
wxGridCellCoords m_selected;
} m_related;
@@ -221,16 +130,13 @@ protected:
///
/// Supports saving/restoring wxZRColaCharSelect state
///
class wxPersistentZRColaCharSelect : public wxPersistentTLWEx
class wxPersistentZRColaCharSelect : public wxPersistentDialog
{
public:
wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd);
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -25,42 +25,42 @@
//////////////////////////////////////////////////////////////////////////
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
m_sourceChanged(false),
m_destinationChanged(false),
m_selSource(0, 0),
m_selDestination(0, 0),
m_decomposedChanged(false),
m_composedChanged(false),
m_selDecomposed(0, 0),
m_selComposed(0, 0),
wxZRColaComposerPanelBase(parent)
{
m_source->PushEventHandler(&m_keyhandler);
m_decomposed->PushEventHandler(&m_keyhandler);
// Restore the previously saved state (if exists).
wxString fileName(GetStateFileName());
if (wxFileExists(fileName)) {
wxFFile file(fileName, wxT("rb"));
if (file.IsOpened()) {
// Load source text.
// Load decomposed text.
unsigned __int64 n;
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString source;
file.Read(wxStringBuffer(source, n), sizeof(wchar_t)*n);
wxString decomposed;
file.Read(wxStringBuffer(decomposed, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Load destination text.
// Load composed text.
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString destination;
file.Read(wxStringBuffer(destination, n), sizeof(wchar_t)*n);
wxString composed;
file.Read(wxStringBuffer(composed, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Restore state.
m_source->SetValue(source);
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, source.GetData(), source.Length(), m_selSource.first, m_selSource.second);
m_sourceChanged = false;
m_decomposed->SetValue(decomposed);
m_decomposed->GetSelection(&m_selDecomposed.first, &m_selDecomposed.second);
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, decomposed.GetData(), decomposed.Length(), m_selDecomposed.first, m_selDecomposed.second);
m_decomposedChanged = false;
m_destination->SetValue(destination);
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, destination.GetData(), destination.Length(), m_selDestination.first, m_selDestination.second);
m_destinationChanged = false;
m_composed->SetValue(composed);
m_composed->GetSelection(&m_selComposed.first, &m_selComposed.second);
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, composed.GetData(), composed.Length(), m_selComposed.first, m_selComposed.second);
m_composedChanged = false;
}
}
}
@@ -72,7 +72,7 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
wxZRColaComposerPanel::~wxZRColaComposerPanel()
{
m_source->PopEventHandler();
m_decomposed->PopEventHandler();
// This is a controlled exit. Purge saved state.
wxString fileName(GetStateFileName());
@@ -83,223 +83,195 @@ wxZRColaComposerPanel::~wxZRColaComposerPanel()
void wxZRColaComposerPanel::SynchronizePanels()
{
if (m_sourceChanged) {
if (m_decomposedChanged) {
m_timerSave.Stop();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_source, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
size_t len = GetValue(m_decomposed, src);
m_mapping.clear();
std::wstring norm;
app->m_t_db.Decompose(src.data(), len, norm, &m_mapping1);
if (app->m_mainWnd->m_composition) {
// ZRCola Decomposed => ZRCola Composed should decompose first.
app->m_t_db.TranslateInv(ZRCOLA_TRANSEQID_DEFAULT, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
std::wstring dst;
app->m_t_db.Compose(norm.data(), norm.size(), dst, &m_mapping2);
app->m_t_db.Translate(ZRCOLA_TRANSEQID_DEFAULT, dst2.data(), dst2.size(), dst, &map);
m_mapping.push_back(std::move(map));
}
m_decomposed->GetSelection(&m_selDecomposed.first, &m_selDecomposed.second);
// Other translations
const ZRCola::transetid_t *sets_begin, *sets_end;
GetTranslationSeq(sets_begin, sets_end);
for (auto s = sets_begin; s != sets_end; ++s) {
app->m_t_db.Translate(*s, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
dst = std::move(dst2);
}
// Update decomposed HEX dump.
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, src.data(), len, m_selDecomposed.first, m_selDecomposed.second);
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
// Update source HEX dump.
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, src.data(), len, m_selSource.first, m_selSource.second);
// Update destination text, and its HEX dump.
m_destination->SetValue(dst);
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, dst.data(), dst.length(), m_selDestination.first, m_selDestination.second);
// Update composed text, and its HEX dump.
m_composed->SetValue(dst);
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.first )),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.second)));
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, dst.data(), dst.length(), m_selComposed.first, m_selComposed.second);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
} else if (m_destinationChanged) {
} else if (m_composedChanged) {
m_timerSave.Stop();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_destination, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
size_t len = GetValue(m_composed, src);
m_mapping.clear();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
std::wstring dst;
wxZRColaFrame *mainWnd = dynamic_cast<wxZRColaFrame*>(wxGetActiveWindow());
if (mainWnd)
app->m_t_db.Decompose(src.data(), len, &app->m_lc_db, mainWnd->m_settings->m_lang, dst, &m_mapping2);
else
app->m_t_db.Decompose(src.data(), len, dst, &m_mapping2);
// Other translations
const ZRCola::transetid_t *sets_begin, *sets_end;
GetTranslationSeq(sets_begin, sets_end);
for (auto s = sets_end; (s--) != sets_begin;) {
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
dst = std::move(dst2);
m_mapping1.clear();
m_mapping2.invert();
map.invert();
m_mapping.push_back(std::move(map));
}
m_composed->GetSelection(&m_selComposed.first, &m_selComposed.second);
if (app->m_mainWnd->m_composition) {
// ZRCola Decomposed => ZRCola Composed
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);
}
// Update composed HEX dump.
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, src.data(), len, m_selComposed.first, m_selComposed.second);
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
// Update destination HEX dump.
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, src.data(), len, m_selDestination.first, m_selDestination.second);
// Update source text, and its HEX dump.
m_source->SetValue(dst);
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, dst.data(), dst.length(), m_selSource.first, m_selSource.second);
// Update decomposed text, and its HEX dump.
m_decomposed->SetValue(dst);
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.first )),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.second)));
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, dst.data(), dst.length(), m_selDecomposed.first, m_selDecomposed.second);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
}
m_sourceChanged = false;
m_destinationChanged = false;
m_decomposedChanged = false;
m_composedChanged = false;
}
void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnDecomposedPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_source->GetSelection(&from, &to);
m_decomposed->GetSelection(&from, &to);
if (m_selSource.first != from || m_selSource.second != to) {
if (m_selDecomposed.first != from || m_selDecomposed.second != to) {
// Save new selection first, to avoid loop.
m_selSource.first = from;
m_selSource.second = to;
m_selDecomposed.first = from;
m_selDecomposed.second = to;
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(from),
m_selSourceHex.second = m_mappingSourceHex.to_dst(to ));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(from),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(to ));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(from),
m_selDestination.second = MapToDestination(to ));
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(from)),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(to )));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
}
}
void wxZRColaComposerPanel::OnSourceHexPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnDecomposedHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_sourceHex->GetSelection(&from, &to);
m_decomposedHex->GetSelection(&from, &to);
if (m_selSourceHex.first != from || m_selSourceHex.second != to) {
if (m_selDecomposedHex.first != from || m_selDecomposedHex.second != to) {
// Save new selection first, to avoid loop.
m_selSourceHex.first = from;
m_selSourceHex.second = to;
m_selDecomposedHex.first = from;
m_selDecomposedHex.second = to;
m_source->SetSelection(
m_selSource.first = m_mappingSourceHex.to_src(from),
m_selSource.second = m_mappingSourceHex.to_src(to ));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mappingDecomposedHex.to_src(from),
m_selDecomposed.second = m_mappingDecomposedHex.to_src(to ));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.first )),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.second)));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
}
}
void wxZRColaComposerPanel::OnSourceText(wxCommandEvent& event)
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the source text changed to trigger idle-time translation.
m_sourceChanged = true;
// Set the flag the decomposed text changed to trigger idle-time composition.
m_decomposedChanged = true;
}
void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnComposedPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_destination->GetSelection(&from, &to);
m_composed->GetSelection(&from, &to);
if (m_selDestination.first != from || m_selDestination.second != to) {
if (m_selComposed.first != from || m_selComposed.second != to) {
// Save new selection first, to avoid loop.
m_selDestination.first = from;
m_selDestination.second = to;
m_selComposed.first = from;
m_selComposed.second = to;
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(from),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(to ));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(from),
m_selComposedHex.second = m_mappingComposedHex.to_dst(to ));
m_source->SetSelection(
m_selSource.first = MapToSource(from),
m_selSource.second = MapToSource(to ));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(from)),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(to )));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
}
}
void wxZRColaComposerPanel::OnDestinationHexPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnComposedHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_destinationHex->GetSelection(&from, &to);
m_composedHex->GetSelection(&from, &to);
if (m_selDestinationHex.first != from || m_selDestinationHex.second != to) {
if (m_selComposedHex.first != from || m_selComposedHex.second != to) {
// Save new selection first, to avoid loop.
m_selDestinationHex.first = from;
m_selDestinationHex.second = to;
m_selComposedHex.first = from;
m_selComposedHex.second = to;
m_destination->SetSelection(
m_selDestination.first = m_mappingDestinationHex.to_src(from),
m_selDestination.second = m_mappingDestinationHex.to_src(to ));
m_composed->SetSelection(
m_selComposed.first = m_mappingComposedHex.to_src(from),
m_selComposed.second = m_mappingComposedHex.to_src(to ));
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.first )),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.second)));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
}
}
void wxZRColaComposerPanel::OnDestinationText(wxCommandEvent& event)
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the destination text changed to trigger idle-time inverse translation.
m_destinationChanged = true;
// Set the flag the composed text changed to trigger idle-time decomposition.
m_composedChanged = true;
}
@@ -311,13 +283,13 @@ void wxZRColaComposerPanel::OnSaveTimer(wxTimerEvent& event)
wxString text;
size_t len;
// Save source text.
len = GetValue(m_source, text);
// Save decomposed text.
len = GetValue(m_decomposed, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
// Save destination text.
len = GetValue(m_destination, text);
// Save composed text.
len = GetValue(m_composed, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
}
@@ -398,9 +370,6 @@ void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &
// wxPersistentZRColaComposerPanel
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaComposerPanel::s_guiLevel = 1;
wxPersistentZRColaComposerPanel::wxPersistentZRColaComposerPanel(wxZRColaComposerPanel *wnd) : wxPersistentWindow<wxZRColaComposerPanel>(wnd)
{
}
@@ -414,12 +383,10 @@ wxString wxPersistentZRColaComposerPanel::GetKind() const
void wxPersistentZRColaComposerPanel::Save() const
{
auto wnd = static_cast<wxZRColaComposerPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
auto const wnd = static_cast<const wxZRColaComposerPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("guiLevel" ), s_guiLevel);
SaveValue(wxT("dpiX" ), wxClientDC(wnd).GetPPI().x);
SaveValue(wxT("splitDecomposed"), wnd->m_splitterSource ->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterDestination->GetSashPosition());
SaveValue(wxT("splitDecomposed"), wnd->m_splitterDecomposed->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterComposed ->GetSashPosition());
}
@@ -427,27 +394,18 @@ bool wxPersistentZRColaComposerPanel::Restore()
{
auto wnd = dynamic_cast<wxZRColaComposerPanel*>(GetWindow());
int guiLevel;
if (!RestoreValue(wxT("guiLevel"), &guiLevel) || guiLevel != s_guiLevel)
return true;
int dpiHorz = wxClientDC(wnd).GetPPI().x;
int dpiHorzVal;
int sashVal;
if (!RestoreValue(wxT("dpiX"), &dpiHorzVal))
dpiHorzVal = 96;
if (RestoreValue(wxT("splitDecomposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, wnd );
wnd->m_splitterSource->SetSashPosition(wxMulDivInt32(sashVal, dpiHorz, dpiHorzVal));
wnd->m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, wnd );
wnd->m_splitterDecomposed->SetSashPosition(sashVal);
}
if (RestoreValue(wxT("splitComposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, wnd );
wnd->m_splitterDestination->SetSashPosition(wxMulDivInt32(sashVal, dpiHorz, dpiHorzVal));
wnd->m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, wnd );
wnd->m_splitterComposed->SetSashPosition(sashVal);
}
return true;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -30,7 +30,6 @@ class wxZRColaComposerPanel;
#include <wx/persist/window.h>
#include <wx/timer.h>
#include <utility>
#include <vector>
///
@@ -47,33 +46,31 @@ public:
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
protected:
virtual void OnSourcePaint(wxPaintEvent& event);
virtual void OnSourceHexPaint(wxPaintEvent& event);
virtual void OnSourceText(wxCommandEvent& event);
virtual void OnDestinationPaint(wxPaintEvent& event);
virtual void OnDestinationHexPaint(wxPaintEvent& event);
virtual void OnDestinationText(wxCommandEvent& event);
virtual void OnDecomposedPaint(wxPaintEvent& event);
virtual void OnDecomposedHexPaint(wxPaintEvent& event);
virtual void OnDecomposedText(wxCommandEvent& event);
virtual void OnComposedPaint(wxPaintEvent& event);
virtual void OnComposedHexPaint(wxPaintEvent& event);
virtual void OnComposedText(wxCommandEvent& event);
virtual void OnSaveTimer(wxTimerEvent& event);
inline size_t MapToDestination(_In_ size_t src) const;
inline size_t MapToSource(_In_ size_t dst) const;
inline void GetTranslationSeq(_Out_ const ZRCola::transetid_t *&sets_begin, _Out_ const ZRCola::transetid_t *&sets_end) const;
static wxString GetStateFileName();
static size_t GetValue(wxTextCtrl *wnd, wxString &text);
static void SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &range, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len, long from, long to);
protected:
bool m_sourceChanged; ///< Boolean flag to mark source text "dirty" to trigger translation
bool m_destinationChanged; ///< Boolean flag to mark destination text "dirty" to trigger inverse translation
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
bool m_decomposedChanged; ///< Boolean flag to mark decomposed text "dirty" to trigger composition
bool m_composedChanged; ///< Boolean flag to mark composed text "dirty" to trigger decomposition
ZRCola::mapping_vector m_mapping1; ///< Character index mapping vector between decomposed and normalized text
ZRCola::mapping_vector m_mapping2; ///< Character index mapping vector between normalized and composed text
std::pair<long, long>
m_selSource, ///< Character index of selected text in source text control
m_selSourceHex, ///< Character index of selected text in source HEX dump text control
m_selDestination, ///< Character index of selected text in destination text control
m_selDestinationHex; ///< Character index of selected text in destination HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for source window
ZRCola::mapping_vector m_mappingSourceHex; ///< Character index mapping vector between source text and its HEX dump
ZRCola::mapping_vector m_mappingDestinationHex; ///< Character index mapping vector between destination text and its HEX dump
m_selDecomposed, ///< Character index of selected text in decomposed text control
m_selDecomposedHex, ///< Character index of selected text in decomposed HEX dump text control
m_selComposed, ///< Character index of selected text in composed text control
m_selComposedHex; ///< Character index of selected text in composed HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for decomposed window
ZRCola::mapping_vector m_mappingDecomposedHex; ///< Character index mapping vector between decomposed text and its HEX dump
ZRCola::mapping_vector m_mappingComposedHex; ///< Character index mapping vector between composed text and its HEX dump
};
@@ -88,54 +85,9 @@ public:
virtual wxString GetKind() const;
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};
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)
src = m->to_dst(src);
return src;
}
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)
dst = m->to_src(dst);
return dst;
}
inline void wxZRColaComposerPanel::GetTranslationSeq(_Out_ const ZRCola::transetid_t *&sets_begin, _Out_ const ZRCola::transetid_t *&sets_end) const
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd->m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT) {
sets_begin = NULL;
sets_end = NULL;
} else if (app->m_mainWnd->m_transeq_id == ZRCOLA_TRANSEQID_CUSTOM) {
sets_begin = app->m_mainWnd->m_transeq->m_transeq.data();
sets_end = sets_begin + app->m_mainWnd->m_transeq->m_transeq.size();
} else {
size_t start;
if (app->m_tsq_db.idxTranSeq.find(ZRCola::transeq_db::transeq(app->m_mainWnd->m_transeq_id), start)) {
const auto &ts = app->m_tsq_db.idxTranSeq[start];
sets_begin = ts.sets();
sets_end = ts.sets_end();
} else {
sets_begin = NULL;
sets_end = NULL;
}
}
}
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaComposerPanel *wnd)
{
return new wxPersistentZRColaComposerPanel(wnd);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -25,89 +25,52 @@
//////////////////////////////////////////////////////////////////////////
wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_UPDATE_UI_RANGE(wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI_RANGE(wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
EVT_MENU (wxID_CHARACTER_SELECTOR , wxZRColaFrame::OnInsertCharacter )
EVT_MENU (wxID_CHARACTER_SELECTOR , wxZRColaFrame::OnInsertCharacter )
EVT_UPDATE_UI_RANGE(wxID_SEND_DESTINATION , wxID_SEND_ABORT , wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_COPY_DESTINATION_AND_RETURN , wxZRColaFrame::OnCopyDestinationAndReturn )
EVT_MENU (wxID_SEND_DESTINATION , wxZRColaFrame::OnSendDestination )
EVT_MENU (wxID_COPY_SOURCE_AND_RETURN , wxZRColaFrame::OnCopySourceAndReturn )
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_UPDATE_UI_RANGE(wxID_SEND_COMPOSED , wxID_SEND_ABORT, wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_SEND_COMPOSED , wxZRColaFrame::OnSendComposed )
EVT_MENU (wxID_SEND_DECOMPOSED , wxZRColaFrame::OnSendDecomposed )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_COMPOSITION_MENU , wxZRColaFrame::OnCompositionMenu )
EVT_MENU (wxID_COMPOSITION_TOOLBAR , wxZRColaFrame::OnCompositionToolbar )
EVT_MENU_RANGE (wxID_TRANSLATION_SEQ_DEFAULT, wxID_TRANSLATION_SEQ_END, wxZRColaFrame::OnTranslationSeqMenu )
EVT_MENU (wxID_SETTINGS , wxZRColaFrame::OnSettings )
EVT_MENU (wxID_SETTINGS , wxZRColaFrame::OnSettings )
EVT_UPDATE_UI (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEditUpdate )
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
EVT_UPDATE_UI (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarComposeUpdate )
EVT_MENU (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarCompose )
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
EVT_UPDATE_UI (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEditUpdate )
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
EVT_UPDATE_UI (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslateUpdate )
EVT_MENU (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslate )
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
EVT_MENU (wxID_HELP_INSTRUCTIONS , wxZRColaFrame::OnHelpInstructions )
EVT_MENU (wxID_HELP_SHORTCUTS , wxZRColaFrame::OnHelpShortcuts )
EVT_MENU (wxID_HELP_INSTRUCTIONS , wxZRColaFrame::OnHelpInstructions )
EVT_MENU (wxID_HELP_SHORTCUTS , wxZRColaFrame::OnHelpShortcuts )
EVT_MENU (wxID_HELP_REQCHAR , wxZRColaFrame::OnHelpReqChar )
EVT_MENU (wxID_HELP_UPDATE , wxZRColaFrame::OnHelpUpdate )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnHelpAbout )
EVT_MENU (wxID_HELP_REQCHAR , wxZRColaFrame::OnHelpReqChar )
EVT_MENU (wxID_HELP_UPDATE , wxZRColaFrame::OnHelpUpdate )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnHelpAbout )
wxEND_EVENT_TABLE()
const int wxZRColaFrame::s_guiLevel = 1;
wxZRColaFrame::wxZRColaFrame() :
m_hWndSource(NULL),
m_wasIconised(false),
m_chrSelect(NULL),
m_settings(NULL),
m_chrReq(NULL),
m_composition(true),
m_transeq_id(ZRCOLA_TRANSEQID_DEFAULT),
m_transeq(NULL),
wxZRColaFrameBase(NULL)
{
{
// wxFrameBuilder 3.5 does not support wxAUI_TB_HORIZONTAL flag. Add it manually.
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTranslate);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
paneInfo.LeftDockable(false);
paneInfo.RightDockable(false);
m_toolbarTranslate->SetWindowStyleFlag(m_toolbarTranslate->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Populate list of translation sequences.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_toolTranslationSeq->Clear();
{
wxString name_tran(_("No Translation"));
m_menuTranslationSeq->AppendRadioItem(wxID_TRANSLATION_SEQ_DEFAULT, name_tran);
m_toolTranslationSeq->Append(name_tran, reinterpret_cast<void*>(ZRCOLA_TRANSEQID_DEFAULT));
}
for (size_t i = 0, n = app->m_tsq_db.idxRank.size(); ; i++) {
if (i < n) {
const ZRCola::transeq_db::transeq &ts = app->m_tsq_db.idxRank[i];
wxString
name(ts.name(), ts.name_len()),
name_tran(wxGetTranslation(name, wxT("ZRCola-zrcdb")));
m_menuTranslationSeq->AppendRadioItem(wxID_TRANSLATION_SEQ_START + i, name_tran);
m_toolTranslationSeq->Append(name_tran, reinterpret_cast<void*>(ts.seq));
} else {
wxString name_tran(_("Custom Translation..."));
m_menuTranslationSeq->AppendRadioItem(wxID_TRANSLATION_SEQ_START + i, name_tran);
m_toolTranslationSeq->Append(name_tran, reinterpret_cast<void*>(ZRCOLA_TRANSEQID_CUSTOM));
break;
}
m_toolbarCompose->SetWindowStyleFlag(m_toolbarCompose->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Load main window icons.
@@ -129,25 +92,19 @@ wxZRColaFrame::wxZRColaFrame() :
} else {
// Taskbar icon creation failed. Not the end of the world. No taskbar icon then.
delete m_taskBarIcon;
m_taskBarIcon = NULL;
}
wxPersistenceManager &persist_mgr = wxPersistenceManager::Get();
m_settings = new wxZRColaSettings(this);
persist_mgr.RegisterAndRestore(m_settings, new wxPersistentZRColaSettings(m_settings));
m_transeq = new wxZRColaTranslationSeq(this);
persist_mgr.RegisterAndRestore(m_transeq, new wxPersistentZRColaTranslationSeq(m_transeq));
wxPersistentRegisterAndRestore<wxZRColaSettings>(m_settings);
m_chrSelect = new wxZRColaCharSelect(this);
persist_mgr.RegisterAndRestore(m_chrSelect, new wxPersistentZRColaCharSelect(m_chrSelect));
wxPersistentRegisterAndRestore<wxZRColaCharSelect>(m_chrSelect);
m_chrReq = new wxZRColaCharRequest(this);
persist_mgr.RegisterAndRestore(m_chrReq, new wxPersistentZRColaCharRequest(m_chrReq));
wxPersistentRegisterAndRestore<wxZRColaCharRequest>(m_chrReq);
// Set focus.
m_panel->m_source->SetFocus();
m_panel->m_decomposed->SetFocus();
#if defined(__WXMSW__)
// Register notification sink for language detection.
@@ -176,43 +133,13 @@ wxZRColaFrame::wxZRColaFrame() :
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
int guiLevel;
if (wxConfigBase::Get()->Read(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel) {
// Restore persistent state of wxAuiManager manually, since m_mgr is not a standalone heap object
// and cannot be registered for persistence.
wxPersistentAuiManager(&m_mgr).Restore();
}
persist_mgr.RegisterAndRestore(this, new wxPersistentZRColaFrame(this));
// Update (de)composition selection.
if (m_composition) {
m_menuItemComposition->Check(true);
m_toolComposition->SetState(m_toolComposition->GetState() | wxAUI_BUTTON_STATE_CHECKED);
} else {
m_menuItemComposition->Check(false);
m_toolComposition->SetState(m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED);
}
// Update translation sequence selection.
for (unsigned int i = 0, n = m_toolTranslationSeq->GetCount(); ; i++) {
if (i < n) {
if (static_cast<ZRCola::transeqid_t>((size_t)m_toolTranslationSeq->GetClientData(i)) == m_transeq_id) {
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT + i, true);
m_toolTranslationSeq->SetSelection(i);
break;
}
} else {
m_transeq_id = ZRCOLA_TRANSEQID_DEFAULT;
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT, true);
m_toolTranslationSeq->SetSelection(0);
break;
}
}
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE, wxMOD_WIN, VK_F5))
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE_INV, wxMOD_WIN, VK_F6))
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
}
@@ -220,14 +147,8 @@ wxZRColaFrame::wxZRColaFrame() :
wxZRColaFrame::~wxZRColaFrame()
{
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE_INV);
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE );
// Save wxAuiManager's state before destructor is finished.
// m_mgr is not a standalone heap object and is bound to wxZRColaFrame, which is being destroyed.
wxConfigBase::Get()->Write(wxT("guiLevel"), s_guiLevel);
wxPersistentAuiManager(&m_mgr).Save();
wxPersistenceManager::Get().SaveAndUnregister(this);
UnregisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE);
UnregisterHotKey(wxZRColaHKID_INVOKE_COMPOSE);
#if defined(__WXMSW__)
if (m_tfSource) {
@@ -243,6 +164,16 @@ wxZRColaFrame::~wxZRColaFrame()
}
void wxZRColaFrame::OnClose(wxCloseEvent& event)
{
event.Skip();
// Save wxAuiManager's state before destructor.
// Since the destructor calls m_mgr.UnInit() the regular persistence mechanism is useless to save wxAuiManager's state.
wxPersistentAuiManager(&m_mgr).Save();
}
void wxZRColaFrame::OnExit(wxCommandEvent& event)
{
Close();
@@ -271,9 +202,9 @@ void wxZRColaFrame::OnForwardEvent(wxCommandEvent& event)
void wxZRColaFrame::OnInsertCharacter(wxCommandEvent& event)
{
if (m_chrSelect->ShowModal() == wxID_OK && !m_chrSelect->m_char.empty()) {
m_panel->m_source->WriteText(m_chrSelect->m_char);
m_panel->m_source->SetFocus();
if (m_chrSelect->ShowModal() == wxID_OK && m_chrSelect->m_char) {
m_panel->m_decomposed->WriteText(m_chrSelect->m_char);
m_panel->m_decomposed->SetFocus();
}
}
@@ -284,37 +215,19 @@ void wxZRColaFrame::OnSendUpdate(wxUpdateUIEvent& event)
}
void wxZRColaFrame::OnSendDestination(wxCommandEvent& event)
void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_destination->GetValue());
DoSend(m_panel->m_composed->GetValue());
event.Skip();
}
void wxZRColaFrame::OnCopyDestinationAndReturn(wxCommandEvent& event)
void wxZRColaFrame::OnSendDecomposed(wxCommandEvent& event)
{
if (m_hWndSource)
DoCopyAndReturn(m_panel->m_destination->GetValue());
event.Skip();
}
void wxZRColaFrame::OnSendSource(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_source->GetValue());
event.Skip();
}
void wxZRColaFrame::OnCopySourceAndReturn(wxCommandEvent& event)
{
if (m_hWndSource)
DoCopyAndReturn(m_panel->m_source->GetValue());
DoSend(m_panel->m_decomposed->GetValue());
event.Skip();
}
@@ -324,43 +237,14 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
{
if (m_hWndSource) {
// Return focus to the source window.
::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
if (m_wasIconised) Iconize();
::SetActiveWindow(m_hWndSource);
::SetForegroundWindow(m_hWndSource);
m_hWndSource = NULL;
}
// Select all input in composer to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
event.Skip();
}
void wxZRColaFrame::OnCompositionMenu(wxCommandEvent& event)
{
m_composition = m_menuItemComposition->IsChecked();
m_toolComposition->SetState((m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_composition ? wxAUI_BUTTON_STATE_CHECKED : 0));
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();
}
void wxZRColaFrame::OnCompositionToolbar(wxCommandEvent& event)
{
m_composition = (m_toolComposition->GetState() & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
m_menuItemComposition->Check(m_composition);
// Notify source text something changed and should re-translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_source->ProcessWindowEvent(event2);
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
event.Skip();
}
@@ -382,8 +266,8 @@ void wxZRColaFrame::OnIdle(wxIdleEvent& event)
void wxZRColaFrame::OnTaskbarIconClick(wxTaskBarIconEvent& event)
{
Show(true);
Iconize(false);
Show(true);
Raise();
event.Skip();
@@ -413,45 +297,20 @@ void wxZRColaFrame::OnToolbarEdit(wxCommandEvent& event)
}
void wxZRColaFrame::OnToolbarTranslateUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnToolbarComposeUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_toolbarTranslate).IsShown());
event.Check(m_mgr.GetPane(m_toolbarCompose).IsShown());
}
void wxZRColaFrame::OnToolbarTranslate(wxCommandEvent& event)
void wxZRColaFrame::OnToolbarCompose(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTranslate);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
void wxZRColaFrame::OnTranslationSeqMenu(wxCommandEvent& event)
{
int idx = event.GetId() - wxID_TRANSLATION_SEQ_DEFAULT;
ZRCola::transeqid_t transeq_id = static_cast<ZRCola::transeqid_t>((size_t)m_toolTranslationSeq->GetClientData(idx));
DoSetTranslationSeq(idx, transeq_id);
m_toolTranslationSeq->Select(idx);
}
void wxZRColaFrame::OnTranslationSeqChoice(wxCommandEvent& event)
{
int idx = event.GetSelection();
ZRCola::transeqid_t transeq_id = static_cast<ZRCola::transeqid_t>((size_t)event.GetClientData());
DoSetTranslationSeq(idx, transeq_id);
if (m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT)
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT, true);
else
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT + idx, true);
}
void wxZRColaFrame::OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_panelChrCat).IsShown());
@@ -493,7 +352,7 @@ void wxZRColaFrame::OnHelpShortcuts(wxCommandEvent& event)
INSTALLSTATE pdf_is = ::MsiGetComponentPath(_T(PRODUCT_VERSION_GUID), _T("{68AC2C38-10E2-41A3-B92C-844C03FFDF6A}"), pdf_path);
if ((pdf_is == INSTALLSTATE_LOCAL || pdf_is == INSTALLSTATE_SOURCE) &&
wxFileExists(pdf_path) &&
(intptr_t)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
#endif
// Search and try to launch local PDF copy.
@@ -501,7 +360,7 @@ void wxZRColaFrame::OnHelpShortcuts(wxCommandEvent& event)
pdf_path = app->GetDatabasePath();
pdf_path += _T("ZRCola_keyboard.pdf");
if (wxFileExists(pdf_path) &&
(intptr_t)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
// When everything else fail, try the online version.
wxLaunchDefaultBrowser(_("http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"));
@@ -609,66 +468,15 @@ void wxZRColaFrame::DoSend(const wxString& str)
}
// Return focus to the source window and send the input.
::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
if (m_wasIconised) Iconize();
::SetActiveWindow(m_hWndSource);
::SetForegroundWindow(m_hWndSource);
::Sleep(200);
::SendInput(input.size(), input.data(), sizeof(INPUT));
m_hWndSource = NULL;
// Select all input in source and destination to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
}
void wxZRColaFrame::DoCopyAndReturn(const wxString& str)
{
if (wxTheClipboard->Open()) {
wxTheClipboard->SetData(new wxTextDataObject(str));
wxTheClipboard->Close();
}
// Return focus to the source window.
::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
if (m_wasIconised) Iconize();
::SetActiveWindow(m_hWndSource);
::SetForegroundWindow(m_hWndSource);
m_hWndSource = NULL;
// Select all input in composer and source to prepare for the overwrite next time.
m_panel->m_source->SelectAll();
m_panel->m_destination->SelectAll();
}
void wxZRColaFrame::DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id)
{
if (transeq_id == ZRCOLA_TRANSEQID_CUSTOM) {
// Prompt user to modify translation.
if (m_transeq->ShowModal() != wxID_OK)
return;
if (m_transeq->m_transeq.empty()) {
// User submitted an empty translation. Revert to "No Translation" case.
m_transeq_id = ZRCOLA_TRANSEQID_DEFAULT;
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT, true);
m_toolTranslationSeq->SetSelection(0);
} else {
m_transeq_id = ZRCOLA_TRANSEQID_CUSTOM;
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT + idx, true);
}
} else if (m_transeq_id != transeq_id) {
// User choose a new translation sequence.
m_transeq_id = transeq_id;
m_menuTranslationSeq->Check(wxID_TRANSLATION_SEQ_DEFAULT + idx, true);
} else
return;
// Notify source text something changed and should re-translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_source->ProcessWindowEvent(event2);
// Select all input in composer and decomposed to prepare for the overwrite next time.
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
}
@@ -681,8 +489,8 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
WXHWND hWndSource = ::GetForegroundWindow();
switch (wParam) {
case wxZRColaHKID_INVOKE_TRANSLATE: m_panel->m_source->SetFocus(); break;
case wxZRColaHKID_INVOKE_TRANSLATE_INV: m_panel->m_destination->SetFocus(); break;
case wxZRColaHKID_INVOKE_COMPOSE : m_panel->m_decomposed->SetFocus(); break;
case wxZRColaHKID_INVOKE_DECOMPOSE: m_panel->m_composed ->SetFocus(); break;
default:
wxFAIL_MSG(wxT("not our registered shortcut"));
return wxZRColaFrameBase::MSWWindowProc(message, wParam, lParam);
@@ -694,14 +502,12 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
}
m_hWndSource = hWndSource;
m_wasIconised = IsIconized();
//if (m_state == wxABS_FLOAT) {
Show(true);
Iconize(false);
Raise();
::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
::SetActiveWindow(m_hWnd);
if (IsIconized())
::SendMessage(m_hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(m_hWnd);
::SetForegroundWindow(m_hWnd);
//} else if (wxAppBarIsDocked(m_state)) {
// // ZRCola window is currently docked.
@@ -716,8 +522,7 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
// wxFAIL_MSG(wxT("unsupported application bar state"));
return 0;
}
else
} else
return wxZRColaFrameBase::MSWWindowProc(message, wParam, lParam);
}
@@ -728,24 +533,17 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
// wxPersistentZRColaFrame
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaFrame::s_guiLevel = 1;
wxPersistentZRColaFrame::wxPersistentZRColaFrame(wxZRColaFrame *wnd) : wxPersistentTLWEx(wnd)
wxPersistentZRColaFrame::wxPersistentZRColaFrame(wxZRColaFrame *wnd) : wxPersistentTLW(wnd)
{
}
void wxPersistentZRColaFrame::Save() const
{
SaveValue(wxT("guiLevel"), s_guiLevel);
wxPersistentTLWEx::Save();
wxPersistentTLW::Save();
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("transeqId"), static_cast<int>(wnd->m_transeq_id));
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
}
@@ -758,16 +556,5 @@ bool wxPersistentZRColaFrame::Restore()
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Restore();
wxPersistentZRColaComposerPanel(wnd->m_panel).Restore();
int num;
if (RestoreValue(wxT("transeqId"), &num))
wnd->m_transeq_id = num;
bool b;
if (RestoreValue(wxT("composition"), &b))
wnd->m_composition = b;
else
wnd->m_composition = wnd->m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT;
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;
return wxPersistentTLW::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -21,7 +21,6 @@
/// Forward declarations
///
class wxZRColaFrame;
class wxPersistentZRColaFrame;
#pragma once
@@ -30,11 +29,9 @@ class wxPersistentZRColaFrame;
#include "zrcolachrslct.h"
#include "zrcolachrreq.h"
#include "zrcolasettings.h"
#include "zrcolatranseq.h"
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <wxex/persist/toplevel.h>
#include <wx/taskbar.h>
#include <wx/persist/toplevel.h>
#if defined(__WXMSW__)
#include <msctf.h>
#endif
@@ -43,8 +40,8 @@ class wxPersistentZRColaFrame;
///
/// Global hotkey message identifiers
///
#define wxZRColaHKID_INVOKE_TRANSLATE 0
#define wxZRColaHKID_INVOKE_TRANSLATE_INV 1
#define wxZRColaHKID_INVOKE_COMPOSE 0
#define wxZRColaHKID_INVOKE_DECOMPOSE 1
///
@@ -60,9 +57,6 @@ public:
enum
{
wxID_FOCUS_CHARACTER_CATALOG = 2000,
wxID_TRANSLATION_SEQ_DEFAULT = 2001,
wxID_TRANSLATION_SEQ_START = 2002,
wxID_TRANSLATION_SEQ_END = 2100,
};
wxZRColaFrame();
@@ -72,28 +66,23 @@ public:
friend class wxZRColaComposerPanel;
protected:
virtual void OnClose(wxCloseEvent& event);
void OnExit(wxCommandEvent& event);
void OnForwardEventUpdate(wxUpdateUIEvent& event);
void OnForwardEvent(wxCommandEvent& event);
void OnInsertCharacter(wxCommandEvent& event);
void OnSendUpdate(wxUpdateUIEvent& event);
void OnSendDestination(wxCommandEvent& event);
void OnCopyDestinationAndReturn(wxCommandEvent& event);
void OnSendSource(wxCommandEvent& event);
void OnCopySourceAndReturn(wxCommandEvent& event);
void OnSendComposed(wxCommandEvent& event);
void OnSendDecomposed(wxCommandEvent& event);
void OnSendAbort(wxCommandEvent& event);
void OnCompositionMenu(wxCommandEvent& event);
void OnCompositionToolbar(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
virtual void OnIdle(wxIdleEvent& event);
void OnTaskbarIconClick(wxTaskBarIconEvent& event);
virtual void OnIconize(wxIconizeEvent& event);
void OnToolbarEditUpdate(wxUpdateUIEvent& event);
void OnToolbarEdit(wxCommandEvent& event);
void OnToolbarTranslateUpdate(wxUpdateUIEvent& event);
void OnToolbarTranslate(wxCommandEvent& event);
void OnTranslationSeqMenu(wxCommandEvent& event);
virtual void OnTranslationSeqChoice(wxCommandEvent& event);
void OnToolbarComposeUpdate(wxUpdateUIEvent& event);
void OnToolbarCompose(wxCommandEvent& event);
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
void OnPanelCharacterCatalog(wxCommandEvent& event);
void OnPanelCharacterCatalogFocus(wxCommandEvent& event);
@@ -122,43 +111,31 @@ protected:
private:
void DoSend(const wxString& str);
void DoCopyAndReturn(const wxString& str);
void DoSetTranslationSeq(int idx, ZRCola::transeqid_t transeq_id);
protected:
#ifdef __WXMSW__
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
#endif
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
protected:
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
wxTaskBarIcon *m_taskBarIcon; ///< Taskbar icon
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
wxZRColaSettings *m_settings; ///< Configuration dialog
bool m_composition; ///< Is (de)composition enabled?
ZRCola::transeqid_t m_transeq_id; ///< Translation sequence ID
wxZRColaTranslationSeq *m_transeq; ///< Custom translation sequence dialog
};
///
/// Supports saving/restoring wxZRColaFrame GUI state
///
class wxPersistentZRColaFrame : public wxPersistentTLWEx
class wxPersistentZRColaFrame : public wxPersistentTLW
{
public:
wxPersistentZRColaFrame(wxZRColaFrame *wnd);
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,418 +1,368 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 8 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ZRCOLAGUI_H__
#define __ZRCOLAGUI_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/cshelp.h>
#include <wx/intl.h>
class wxZRColaCharGrid;
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
#include <wx/choice.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/grid.h>
#include <wx/checkbox.h>
#include <wx/srchctrl.h>
#include <wx/hyperlink.h>
#include <wx/checklst.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/listbox.h>
#include <wx/listbook.h>
#include <wx/listctrl.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaFrameBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaFrameBase : public wxFrame
{
private:
protected:
enum
{
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_DESTINATION,
wxID_COPY_DESTINATION_AND_RETURN,
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_COMPOSITION_MENU,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_TRANSLATE,
wxID_PANEL_CHRGRPS,
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE,
wxID_COMPOSITION_TOOLBAR
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenuItem* m_menuItemComposition;
wxMenu* m_menuTranslationSeq;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarTranslate;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxAuiToolBarItem* m_toolComposition;
wxChoice* m_toolTranslationSeq;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaComposerPanel* m_panel;
wxZRColaFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("ZRCola"), const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("ZRCola") );
wxAuiManager m_mgr;
~wxZRColaFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaComposerPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaComposerPanelBase : public wxPanel
{
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
wxTextCtrl* m_sourceHex;
wxSplitterWindow* m_splitterDestination;
wxPanel* m_panelDestinationEdit;
wxPanel* m_panelDestinationHex;
wxTextCtrl* m_destinationHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnSourcePaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourceText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSourceHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDestinationHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_source;
wxTextCtrl* m_destination;
wxZRColaComposerPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaComposerPanel") );
~wxZRColaComposerPanelBase();
void m_splitterSourceOnIdle( wxIdleEvent& )
{
m_splitterSource->SetSashPosition( FromDIP(-5) );
m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, this );
}
void m_splitterDestinationOnIdle( wxIdleEvent& )
{
m_splitterDestination->SetSashPosition( FromDIP(-5) );
m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, this );
}
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharacterCatalogPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharacterCatalogPanelBase : public wxPanel
{
private:
protected:
wxChoice* m_choice;
wxZRColaCharGrid* m_grid;
wxCheckBox* m_show_all;
// Virtual event handlers, overide them in your derived class
virtual void OnChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnGridClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnGridKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnShowAll( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharacterCatalogPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaCharacterCatalog") );
~wxZRColaCharacterCatalogPanelBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharSelectBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
wxPanel* m_search_panel;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
wxHyperlinkCtrl* m_categoriesInvert;
wxZRColaCharGrid* m_gridResults;
wxZRColaCharGrid* m_gridRecent;
wxStaticText* m_labelUnicode;
wxTextCtrl* m_unicode;
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_tags;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnRecentCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnUnicodeText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPreviewKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnNavigateBack( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnNavigateForward( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Character Search"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharSelect") );
~wxZRColaCharSelectBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaSettingsBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
wxStaticText* m_langLabel;
wxRadioButton* m_langAuto;
wxRadioButton* m_langManual;
wxListBox* m_languages;
wxPanel* m_panelAutoStart;
wxStaticText* m_autoStartLabel;
wxCheckBox* m_autoStart;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsApply;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnLanguageUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaSettingsBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaSettings") );
~wxZRColaSettingsBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaAboutBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
wxStaticText* m_staticTextVersion;
wxStaticText* m_staticTextColophone;
wxStaticText* m_staticTextCopyright;
wxHyperlinkCtrl* m_hyperlink;
wxStaticText* m_staticTextDeclaration;
wxTextCtrl* m_declaration;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
public:
wxZRColaAboutBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaAbout") );
~wxZRColaAboutBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaUpdaterBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaUpdaterBase : public wxDialog
{
private:
protected:
wxTextCtrl* m_log;
wxButton* m_buttonUpdate;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Product Update"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaUpdater") );
~wxZRColaUpdaterBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharRequestBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
wxStaticText* m_characterNote;
wxStaticText* m_contextLbl;
wxTextCtrl* m_context;
wxStaticText* m_note;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharRequestBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Request a New Character"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharRequest") );
~wxZRColaCharRequestBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaTranslationSeqBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaTranslationSeqBase : public wxDialog
{
private:
protected:
wxStaticText* m_transLbl;
wxStaticText* m_availableLbl;
wxListBox* m_available;
wxButton* m_add;
wxButton* m_remove;
wxStaticText* m_selectedLbl;
wxListBox* m_selected;
wxButton* m_selectedUp;
wxButton* m_selectedDown;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnAvailableChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnAvailableDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAdd( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemove( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnSelectedDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedUp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedDown( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaTranslationSeqBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Custom Translation Sequence"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaTranslationSeq") );
~wxZRColaTranslationSeqBase();
};
#endif //__ZRCOLAGUI_H__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ZRCOLAGUI_H__
#define __ZRCOLAGUI_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/cshelp.h>
#include <wx/intl.h>
class wxZRColaCharGrid;
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/choice.h>
#include <wx/grid.h>
#include <wx/checkbox.h>
#include <wx/srchctrl.h>
#include <wx/hyperlink.h>
#include <wx/checklst.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/listbox.h>
#include <wx/listbook.h>
#include <wx/listctrl.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaFrameBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaFrameBase : public wxFrame
{
private:
protected:
enum
{
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_COMPOSED,
wxID_SEND_DECOMPOSED,
wxID_SEND_ABORT,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_COMPOSE,
wxID_PANEL_CHRGRPS,
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarCompose;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendComposed;
wxAuiToolBarItem* m_toolSendDecomposed;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
public:
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") );
wxAuiManager m_mgr;
~wxZRColaFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaComposerPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaComposerPanelBase : public wxPanel
{
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterDecomposed;
wxPanel* m_panelDecomposedEdit;
wxPanel* m_panelDecomposedHex;
wxTextCtrl* m_decomposedHex;
wxSplitterWindow* m_splitterComposed;
wxPanel* m_panelComposedEdit;
wxPanel* m_panelComposedHex;
wxTextCtrl* m_composedHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnDecomposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDecomposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDecomposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnComposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_decomposed;
wxTextCtrl* m_composed;
wxZRColaComposerPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaComposerPanel") );
~wxZRColaComposerPanelBase();
void m_splitterDecomposedOnIdle( wxIdleEvent& )
{
m_splitterDecomposed->SetSashPosition( -5 );
m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, this );
}
void m_splitterComposedOnIdle( wxIdleEvent& )
{
m_splitterComposed->SetSashPosition( -5 );
m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, this );
}
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharacterCatalogPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharacterCatalogPanelBase : public wxPanel
{
private:
protected:
wxChoice* m_choice;
wxZRColaCharGrid* m_grid;
wxCheckBox* m_show_all;
// Virtual event handlers, overide them in your derived class
virtual void OnChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnGridClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnGridKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnShowAll( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharacterCatalogPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaCharacterCatalog") );
~wxZRColaCharacterCatalogPanelBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharSelectBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
wxPanel* m_search_panel;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
wxHyperlinkCtrl* m_categoriesInvert;
wxZRColaCharGrid* m_gridResults;
wxZRColaCharGrid* m_gridRecent;
wxStaticText* m_labelUnicode;
wxTextCtrl* m_unicode;
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_tags;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnRecentCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnUnicodeText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPreviewKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnNavigateBack( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnNavigateForward( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Character Search"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharSelect") );
~wxZRColaCharSelectBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaSettingsBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
wxStaticText* m_langLabel;
wxRadioButton* m_langAuto;
wxRadioButton* m_langManual;
wxListBox* m_languages;
wxPanel* m_panelAutoStart;
wxStaticText* m_autoStartLabel;
wxCheckBox* m_autoStart;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsApply;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnLangAuto( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLangManual( wxCommandEvent& event ) { event.Skip(); }
virtual void OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaSettingsBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaSettings") );
~wxZRColaSettingsBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaAboutBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
wxStaticText* m_staticTextVersion;
wxStaticText* m_staticTextColophone;
wxStaticText* m_staticTextCopyright;
wxHyperlinkCtrl* m_hyperlink;
wxStaticText* m_staticTextDeclaration;
wxTextCtrl* m_declaration;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
public:
wxZRColaAboutBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaAbout") );
~wxZRColaAboutBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaUpdaterBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaUpdaterBase : public wxDialog
{
private:
protected:
wxTextCtrl* m_log;
wxButton* m_buttonUpdate;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Product Update"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaUpdater") );
~wxZRColaUpdaterBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharRequestBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
wxStaticText* m_characterNote;
wxStaticText* m_contextLbl;
wxTextCtrl* m_context;
wxStaticText* m_note;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharRequestBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Request a New Character"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharRequest") );
~wxZRColaCharRequestBase();
};
#endif //__ZRCOLAGUI_H__

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -96,9 +96,13 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
(e.AltDown() ? ZRCola::keyseq_db::keyseq::ALT : 0);
m_seq.push_back(key);
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*m_seq.size()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(m_seq.data(), m_seq.size());
auto n = m_seq.size();
ZRCola::keyseq_db::keyseq *ks = (ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*n];
ks->chr = 0;
ks->seq_len = n;
memcpy(ks->seq, m_seq.data(), sizeof(ZRCola::keyseq_db::keyseq::key_t)*n);
found = app->m_ks_db.idxKey.find(*ks, start);
delete ks;
}
if (found) {
@@ -112,14 +116,14 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
wxObject *obj = event.GetEventObject();
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
// Push text to source control.
((wxTextCtrl*)obj)->WriteText(wxString(ks.chr(), ks.chr_len()));
((wxTextCtrl*)obj)->WriteText(ks.chr);
// Event is fully processed now.
event.StopPropagation();
return true;
}
} else if (start < app->m_ks_db.idxKey.size() &&
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq(), std::min<size_t>(app->m_ks_db.idxKey[start].seq_len(), m_seq.size())) == 0)
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq, std::min<unsigned __int16>(app->m_ks_db.idxKey[start].seq_len, m_seq.size())) == 0)
{
// The sequence is a partial match. Continue watching.
if (pFrame && pFrame->GetStatusBar())

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -31,10 +31,10 @@ wxZRColaSettings::wxZRColaSettings(wxWindow* parent) :
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_languages->Clear();
for (size_t i = 0, n = app->m_lang_db.idxLang.size(); i < n; i++) {
const auto &lang = app->m_lang_db.idxLang[i];
for (size_t i = 0, n = app->m_lang_db.idxLng.size(); i < n; i++) {
const auto &lang = app->m_lang_db.idxLng[i];
wxString
label(lang.name(), lang.name_len()),
label(lang.name, lang.name_len),
label_tran(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_languages->Insert(label_tran, i);
}
@@ -58,16 +58,22 @@ void wxZRColaSettings::OnInitDialog(wxInitDialogEvent& event)
(m_lang_auto ? m_langAuto : m_langManual)->SetValue(true);
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
char l[sizeof(ZRCola::language_db::language)] = {};
((ZRCola::language_db::language*)l)->id = m_lang;
ZRCola::language_db::indexLang::size_type start;
m_languages->Select(app->m_lang_db.idxLang.find(ZRCola::language_db::language(m_lang), start) ? start : -1);
m_languages->Select(app->m_lang_db.idxLng.find(*(ZRCola::language_db::language*)l, start) ? start : -1);
}
void wxZRColaSettings::OnLanguageUpdate(wxUpdateUIEvent& event)
void wxZRColaSettings::OnLangAuto(wxCommandEvent& event)
{
m_languages->Enable(m_langManual->GetValue());
m_languages->Enable(!event.IsChecked());
}
wxZRColaSettingsBase::OnLanguageUpdate(event);
void wxZRColaSettings::OnLangManual(wxCommandEvent& event)
{
m_languages->Enable(event.IsChecked());
}
@@ -116,19 +122,20 @@ void wxZRColaSettings::OnApplyButtonClick(wxCommandEvent& event)
m_lang_auto = false;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &lang = app->m_lang_db.idxLang[m_languages->GetSelection()];
const auto &lang = app->m_lang_db.idxLng[m_languages->GetSelection()];
if (m_lang != lang.lang) {
m_lang = lang.lang;
if (m_lang != lang.id) {
m_lang = lang.id;
// Notify destination text something changed and should re-inverse translate.
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_destination->ProcessWindowEvent(event2);
app->m_mainWnd->m_panel->m_composed->ProcessWindowEvent(event2);
}
}
}
void wxZRColaSettings::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaSettings::OnApplyButtonClick(event);
@@ -139,18 +146,14 @@ void wxZRColaSettings::OnOKButtonClick(wxCommandEvent& event)
// wxPersistentZRColaSettings
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaSettings::s_guiLevel = 1;
wxPersistentZRColaSettings::wxPersistentZRColaSettings(wxZRColaSettings *wnd) : wxPersistentTLWEx(wnd)
wxPersistentZRColaSettings::wxPersistentZRColaSettings(wxZRColaSettings *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaSettings::Save() const
{
SaveValue(wxT("guiLevel"), s_guiLevel);
wxPersistentTLWEx::Save();
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaSettings*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
@@ -176,11 +179,11 @@ bool wxPersistentZRColaSettings::Restore()
} else if (RestoreValue(wxT("lang"), &lang) && lang.Length() == 3) {
// The language was read from configuration.
wnd->m_lang = lang.c_str();
} else if (!app->m_lang_db.idxLang.empty()) {
wnd->m_lang = app->m_lang_db.idxLang[0].lang;
} else if (!app->m_lang_db.idxLng.empty()) {
const auto &lang = app->m_lang_db.idxLng[0];
wnd->m_lang = lang.id;
} else
wnd->m_lang = ZRCola::langid_t::blank;
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;
return wxPersistentDialog::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -27,8 +27,7 @@ class wxPersistentZRColaSettings;
#pragma once
#include "zrcolagui.h"
#include <wxex/persist/toplevel.h>
#include <vector>
#include <wxex/persist/dialog.h>
///
@@ -43,29 +42,27 @@ public:
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnLanguageUpdate(wxUpdateUIEvent& event);
virtual void OnLangAuto(wxCommandEvent& event);
virtual void OnLangManual(wxCommandEvent& event);
virtual void OnApplyButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
public:
bool m_lang_auto; ///< Is language for inverse translation resolved using currently selected keyboard
ZRCola::langid_t m_lang; ///< Language for inverse translation
bool m_lang_auto; ///< Is language for decomposing resolved using currently selected keyboard
ZRCola::langid_t m_lang; ///< Language for decomposing
};
///
/// Supports saving/restoring wxZRColaSettings state
///
class wxPersistentZRColaSettings : public wxPersistentTLWEx
class wxPersistentZRColaSettings : public wxPersistentDialog
{
public:
wxPersistentZRColaSettings(wxZRColaSettings *wnd);
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};

View File

@@ -1,258 +0,0 @@
/*
Copyright 2015-2018 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaTranslationSeq
//////////////////////////////////////////////////////////////////////////
wxZRColaTranslationSeq::wxZRColaTranslationSeq(wxWindow* parent) :
wxZRColaTranslationSeqBase(parent)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_available->Clear();
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[i];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_available->Append(label_tran, (void*)ts.set);
}
}
void wxZRColaTranslationSeq::OnInitDialog(wxInitDialogEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_selected->Clear();
for (auto s = m_transeq.cbegin(), s_end = m_transeq.cend(); s != s_end; ++s) {
ZRCola::transet_db::indexTranSet::size_type start;
if (app->m_ts_db.idxTranSet.find(ZRCola::transet_db::transet(*s), start)) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[start];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_selected->Append(label_tran, (void*)ts.set);
} else {
wxString label_tran(wxString::Format(_("Unknown translation (%u)"), (unsigned int)*s));
m_selected->Append(label_tran, (void*)*s);
}
}
wxZRColaTranslationSeqBase::OnInitDialog(event);
}
void wxZRColaTranslationSeq::OnUpdate(wxUpdateUIEvent& event)
{
m_add->Enable(m_available->GetSelection() != wxNOT_FOUND);
int idx = m_selected->GetSelection();
m_remove ->Enable(idx != wxNOT_FOUND);
m_selectedUp ->Enable(idx != wxNOT_FOUND && (unsigned int)idx > 0);
m_selectedDown->Enable(idx != wxNOT_FOUND && (unsigned int)idx < m_selected->GetCount() - 1);
wxZRColaTranslationSeqBase::OnUpdate(event);
}
void wxZRColaTranslationSeq::OnAvailableChar(wxKeyEvent& event)
{
if (event.GetRawKeyCode() == VK_INSERT) {
int idx = m_available->GetSelection();
if (idx != wxNOT_FOUND) {
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
}
}
wxZRColaTranslationSeqBase::OnAvailableChar(event);
}
void wxZRColaTranslationSeq::OnAvailableDClick(wxCommandEvent& event)
{
int idx = m_available->GetSelection();
if (idx != wxNOT_FOUND) {
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
}
wxZRColaTranslationSeqBase::OnAvailableDClick(event);
}
void wxZRColaTranslationSeq::OnAdd(wxCommandEvent& event)
{
int idx = m_available->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no available translation selected"));
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
wxZRColaTranslationSeqBase::OnAdd(event);
}
void wxZRColaTranslationSeq::OnRemove(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no active translation selected"));
m_selected->Delete(idx);
wxZRColaTranslationSeqBase::OnRemove(event);
}
void wxZRColaTranslationSeq::OnSelectedChar(wxKeyEvent& event)
{
if (event.GetRawKeyCode() == VK_DELETE) {
int idx = m_selected->GetSelection();
if (idx != wxNOT_FOUND)
m_selected->Delete(idx);
}
wxZRColaTranslationSeqBase::OnSelectedChar(event);
}
void wxZRColaTranslationSeq::OnSelectedDClick(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
if (idx != wxNOT_FOUND)
m_selected->Delete(idx);
wxZRColaTranslationSeqBase::OnSelectedDClick(event);
}
void wxZRColaTranslationSeq::OnSelectedUp(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx > 0, wxT("no or first active translation selected"));
wxString label = m_selected->GetString(idx);
void *data = m_selected->GetClientData(idx);
m_selected->Delete(idx);
m_selected->Insert(label, idx - 1, data);
m_selected->Select(idx - 1);
wxZRColaTranslationSeqBase::OnSelectedUp(event);
}
void wxZRColaTranslationSeq::OnSelectedDown(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx < m_selected->GetCount() - 1, wxT("no or last active translation selected"));
wxString label = m_selected->GetString(idx);
void *data = m_selected->GetClientData(idx);
m_selected->Delete(idx);
m_selected->Insert(label, idx + 1, data);
m_selected->Select(idx + 1);
wxZRColaTranslationSeqBase::OnSelectedDown(event);
}
void wxZRColaTranslationSeq::OnApplyButtonClick(wxCommandEvent& event)
{
event.Skip();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_transeq.clear();
for (unsigned int i = 0, n = m_selected->GetCount(); i < n; i++)
m_transeq.push_back(static_cast<ZRCola::transetid_t>((size_t)m_selected->GetClientData(i)));
// Notify source text something changed and should re-translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_source->ProcessWindowEvent(event2);
}
void wxZRColaTranslationSeq::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaTranslationSeq::OnApplyButtonClick(event);
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaTranslationSeq
//////////////////////////////////////////////////////////////////////////
const int wxPersistentZRColaTranslationSeq::s_guiLevel = 1;
wxPersistentZRColaTranslationSeq::wxPersistentZRColaTranslationSeq(wxZRColaTranslationSeq *wnd) : wxPersistentTLWEx(wnd)
{
}
void wxPersistentZRColaTranslationSeq::Save() const
{
SaveValue(wxT("guiLevel"), s_guiLevel);
wxPersistentTLWEx::Save();
auto wnd = static_cast<const wxZRColaTranslationSeq*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
wxString str;
bool first = true;
for (auto s = wnd->m_transeq.cbegin(), s_end = wnd->m_transeq.cend(); s != s_end; ++s, first = false)
str += wxString::Format(first ? wxT("%u") : wxT("|%u"), *s);
SaveValue(wxT("transeq"), str);
}
bool wxPersistentZRColaTranslationSeq::Restore()
{
auto wnd = dynamic_cast<wxZRColaTranslationSeq*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str;
if (RestoreValue(wxT("transeq"), &str)) {
std::vector<ZRCola::transetid_t> transet;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
unsigned long val = _tcstoul(tok.GetNextToken().c_str(), NULL, 10);
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &cg = app->m_ts_db.idxTranSet[i];
if (cg.set == val) {
transet.push_back(val);
break;
}
}
}
if (!transet.empty())
wnd->m_transeq = std::move(transet);
}
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;
}

View File

@@ -1,83 +0,0 @@
/*
Copyright 2015-2018 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaTranslationSeq;
class wxPersistentZRColaTranslationSeq;
#pragma once
#include "zrcolagui.h"
#include <zrcola/translate.h>
#include <wxex/persist/toplevel.h>
#include <vector>
///
/// Configuration dialog
///
class wxZRColaTranslationSeq : public wxZRColaTranslationSeqBase
{
public:
wxZRColaTranslationSeq(wxWindow* parent);
friend class wxPersistentZRColaTranslationSeq; // Allow saving/restoring window state.
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnUpdate(wxUpdateUIEvent& event);
virtual void OnAvailableChar(wxKeyEvent& event);
virtual void OnAvailableDClick(wxCommandEvent& event);
virtual void OnAdd(wxCommandEvent& event);
virtual void OnRemove(wxCommandEvent& event);
virtual void OnSelectedChar(wxKeyEvent& event);
virtual void OnSelectedDClick(wxCommandEvent& event);
virtual void OnSelectedUp(wxCommandEvent& event);
virtual void OnSelectedDown(wxCommandEvent& event);
virtual void OnApplyButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
public:
std::vector<ZRCola::transetid_t> m_transeq; ///< Custom translation set sequence
};
///
/// Supports saving/restoring wxZRColaTranslationSeq state
///
class wxPersistentZRColaTranslationSeq : public wxPersistentTLWEx
{
public:
wxPersistentZRColaTranslationSeq(wxZRColaTranslationSeq *wnd);
virtual void Save() const;
virtual bool Restore();
protected:
static const int s_guiLevel; ///< Persisted placements/sizing are considered incompatible between different GUI levels
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaTranslationSeq *wnd)
{
return new wxPersistentZRColaTranslationSeq(wnd);
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -13,42 +13,38 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}</ProjectGuid>
<RootNamespace>ZRColaCompile</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRColaCompile.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\$(Platform).props" />
<Import Project="..\include\$(Configuration).props" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRColaCompile.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemGroup>
<ClCompile Include="dbsource.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="parse.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -56,7 +52,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="dbsource.h" />
<ClInclude Include="parse.h" />
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
@@ -66,11 +61,11 @@
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\WinStd\build\WinStd-15.0.vcxproj">
<ProjectReference Include="..\lib\WinStd\build\WinStd-10.0.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendLib-15.0.vcxproj">
<Project>{D3E29951-D9F5-486D-A167-20AE8E90B1FA}</Project>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendDll-10.0.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>

View File

@@ -28,9 +28,6 @@
<ClCompile Include="dbsource.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="parse.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@@ -39,9 +36,6 @@
<ClInclude Include="dbsource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="parse.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaCompile.rc">

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -28,19 +28,35 @@ using namespace winstd;
// ZRCola::DBSource::character_bank
//////////////////////////////////////////////////////////////////////////
ZRCola::DBSource::character_bank::character_bank() : vector<unique_ptr<ZRCola::DBSource::character> >()
{
resize(0x10000);
}
void ZRCola::DBSource::character_bank::build_related()
{
// Initialize ignore list.
m_ignore.insert(L"letter");
m_ignore.insert(L"modifier");
m_ignore.insert(L"symbol");
m_ignore.insert(L"accent");
m_ignore.insert(L"with");
m_ignore.insert(L"and");
m_ignore.insert(L"capital");
m_ignore.insert(L"small");
m_ignore.insert(L"combining");
SYSTEM_INFO si;
GetSystemInfo(&si);
// Launch workers.
build_related_worker **workers = new build_related_worker*[si.dwNumberOfProcessors];
size_type from = 0, total = size();
iterator chr_from = begin(), chr_to;
for (DWORD i = 0; i < si.dwNumberOfProcessors; i++, chr_from = chr_to) {
size_type to = MulDiv(i + 1, total, si.dwNumberOfProcessors);
for (chr_to = chr_from; from < to; from++, ++chr_to);
workers[i] = new build_related_worker(this, chr_from, chr_to);
size_type from = 0, to;
for (DWORD i = 0; i < si.dwNumberOfProcessors; i++) {
to = MulDiv(i + 1, 0x10000, si.dwNumberOfProcessors);
workers[i] = new build_related_worker(this, from, to);
from = to;
}
// Wait for workers.
@@ -55,8 +71,8 @@ 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) :
win_handle<INVALID_HANDLE_VALUE>((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ const character_bank *cb, _In_ size_type from, _In_ size_type to) :
win_handle((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
m_heap(HeapCreate(0, 0, 0)),
m_cb(cb),
m_from(from),
@@ -70,39 +86,40 @@ ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In
unsigned int ZRCola::DBSource::character_bank::build_related_worker::process()
{
heap_allocator<wchar_t> al(m_heap);
vector<wchar_t, heap_allocator<wchar_t> > rel(al);
basic_string<wchar_t, char_traits<wchar_t>, heap_allocator<wchar_t> > rel(al);
set<wstring, less<wstring>, heap_allocator<wstring> > matching(less<wstring>(), al);
for (auto c = m_from; c != m_to; c++) {
for (size_type i = m_from; i < m_to; i++) {
auto &chr = *(m_cb->at(i).get());
if (&chr == NULL) continue;
rel.clear();
// Skip all unexisting, or self related characters.
auto m_cb_end = m_cb->cend();
for (std::vector<wchar_t>::const_pointer c_rel = c->second.rel.data(), c_rel_end = c_rel + c->second.rel.size(), c_rel_next = c_rel_end; c_rel < c_rel_end; c_rel = c_rel_next) {
c_rel_next = c_rel + wcsnlen(c_rel, c_rel_end - c_rel) + 1;
if (m_cb->find(c_rel) != m_cb_end && c->first.compare(c_rel) != 0)
rel.insert(rel.end(), c_rel, c_rel_next);
// Remove all unexisting, inactive, or self related characters.
for (auto j = chr.rel.length(); j--;) {
wchar_t c = chr.rel[j];
if (m_cb->at(c) && (wchar_t)j != c)
rel += c;
}
// Add all characters that share enough keywords.
for (auto c2 = m_cb->cbegin(), c2_end = m_cb->cend(); c2 != c2_end; ++c2) {
if (c == c2)
// Add all characters that share enought keywords.
for (size_type j = 0, j_end = m_cb->size(); j < j_end; j++) {
if (i == j || rel.find((wchar_t)j) != wstring::npos)
continue;
bool already_present = false;
for (std::vector<wchar_t>::const_pointer c_rel = rel.data(), c_rel_end = c_rel + rel.size(), c_rel_next = c_rel_end; c_rel < c_rel_end; c_rel = c_rel_next) {
c_rel_next = c_rel + wcsnlen(c_rel, c_rel_end - c_rel) + 1;
if (c2->first.compare(c_rel) == 0) {
already_present = true;
break;
}
}
if (already_present)
const auto &chr2 = *(m_cb->at(j).get());
if (&chr2 == NULL)
continue;
set<wstring>::size_type comparisons = 0;
matching.clear();
for (auto term = c->second.terms_rel.cbegin(), term_end = c->second.terms_rel.cend(); term != term_end; ++term) {
for (auto term2 = c2->second.terms_rel.cbegin(), term2_end = c2->second.terms_rel.cend(); term2 != term2_end; ++term2) {
for (auto term = chr.terms.cbegin(), term_end = chr.terms.cend(); term != term_end; ++term) {
// Test for ignored word(s).
if (m_cb->m_ignore.find(*term) != m_cb->m_ignore.cend())
continue;
for (auto term2 = chr2.terms.cbegin(), term2_end = chr2.terms.cend(); term2 != term2_end; ++term2) {
// Test for ignored word(s).
if (m_cb->m_ignore.find(*term2) != m_cb->m_ignore.cend())
continue;
comparisons++;
if (*term == *term2)
matching.insert(*term);
@@ -113,11 +130,11 @@ unsigned int ZRCola::DBSource::character_bank::build_related_worker::process()
// If 1/2 terms match, assume related.
auto hits = matching.size();
if (hits*hits*2 >= comparisons)
rel.insert(rel.end(), c2->first.data(), c2->first.data() + c2->first.length() + 1);
rel += chr2.chr;
}
}
c->second.rel.assign(rel.cbegin(), rel.cend());
chr.rel.assign(rel.c_str(), rel.length());
}
return 0;
@@ -180,7 +197,7 @@ void ZRCola::DBSource::character_desc_idx::parse_keywords(const wchar_t *str, se
}
void ZRCola::DBSource::character_desc_idx::add_keywords(const set<wstring> &terms, const wstring &chr, size_t sub)
void ZRCola::DBSource::character_desc_idx::add_keywords(const set<wstring> &terms, wchar_t chr, size_t sub)
{
for (auto term = terms.cbegin(), term_end = terms.cend(); term != term_end; ++term) {
if (sub) {
@@ -233,26 +250,12 @@ void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindex<wchar_t, wchar
ZRCola::DBSource::DBSource()
{
// Initialize ignore list.
m_terms_ignore.insert(L"letter");
m_terms_ignore.insert(L"modifier");
m_terms_ignore.insert(L"symbol");
m_terms_ignore.insert(L"accent");
m_terms_ignore.insert(L"with");
m_terms_ignore.insert(L"and");
m_terms_ignore.insert(L"capital");
m_terms_ignore.insert(L"small");
m_terms_ignore.insert(L"combining");
}
ZRCola::DBSource::~DBSource()
{
// Manually release all COM objects related to the database before we close the database.
m_pTranslationSets1.free();
m_comTranslationSets.free();
m_pTranslation1.free();
m_comTranslation.free();
m_pCharacterGroup1.free();
m_comCharacterGroup.free();
@@ -283,16 +286,13 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
m_filename = filename;
m_locale = _create_locale(LC_ALL, "Slovenian_Slovenia.1250");
// Create ADO command(s).
wxASSERT_MSG(!m_comCharacterGroup, wxT("ADO command already created"));
// Create ADO command(s).
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comCharacterGroup)));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_ActiveConnection(variant(m_db))));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandType(adCmdText)));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandText(bstr(L"SELECT [VRS_SkupineZnakov].[Znak], [VRS_SkupineZnakov].[pogost] "
L"FROM [VRS_SkupineZnakov] "
L"LEFT JOIN [VRS_CharList] ON [VRS_SkupineZnakov].[Znak]=[VRS_CharList].[znak] "
L"WHERE [VRS_CharList].[aktiven]=1 AND [VRS_SkupineZnakov].[Skupina]=? "
L"ORDER BY [VRS_SkupineZnakov].[Rang] ASC, [VRS_SkupineZnakov].[Znak] ASC"))));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandText(bstr(L"SELECT [VRS_SkupineZnakov].[Znak], [VRS_SkupineZnakov].[pogost] FROM [VRS_SkupineZnakov] LEFT JOIN [VRS_CharList] ON [VRS_SkupineZnakov].[Znak]=[VRS_CharList].[znak] WHERE [VRS_CharList].[aktiven]=1 AND [VRS_SkupineZnakov].[Skupina]=? ORDER BY [VRS_SkupineZnakov].[Rang] ASC, [VRS_SkupineZnakov].[Znak] ASC"))));
{
// Create and add command parameters.
com_obj<ADOParameters> params;
@@ -302,40 +302,6 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
wxVERIFY(SUCCEEDED(params->Append(m_pCharacterGroup1)));
}
wxASSERT_MSG(!m_comTranslation, wxT("ADO command already created"));
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comTranslation)));
wxVERIFY(SUCCEEDED(m_comTranslation->put_ActiveConnection(variant(m_db))));
wxVERIFY(SUCCEEDED(m_comTranslation->put_CommandType(adCmdText)));
wxVERIFY(SUCCEEDED(m_comTranslation->put_CommandText(bstr(L"SELECT [Komb1] AS [komb], [rang_komb1] AS [rang_komb], '' AS [Kano], 0 AS [Kanoniziraj], [Komb2] AS [znak], [rang_komb2] AS [rang_znak] "
L"FROM [VRS_ScriptRepl2] "
L"WHERE [Script]=? "
L"ORDER BY [Komb2], [rang_komb2], [rang_komb1], [Komb1]"))));
{
// Create and add command parameters.
com_obj<ADOParameters> params;
wxVERIFY(SUCCEEDED(m_comTranslation->get_Parameters(&params)));
wxASSERT_MSG(!m_pTranslation1, wxT("ADO command parameter already created"));
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)));
}
wxASSERT_MSG(!m_comTranslationSets, wxT("ADO command already created"));
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comTranslationSets)));
wxVERIFY(SUCCEEDED(m_comTranslationSets->put_ActiveConnection(variant(m_db))));
wxVERIFY(SUCCEEDED(m_comTranslationSets->put_CommandType(adCmdText)));
wxVERIFY(SUCCEEDED(m_comTranslationSets->put_CommandText(bstr(L"SELECT [Script] "
L"FROM [VRS_Script2SeqScr] "
L"WHERE [ID]=? "
L"ORDER BY [Rank] ASC"))));
{
// Create and add command parameters.
com_obj<ADOParameters> params;
wxVERIFY(SUCCEEDED(m_comTranslationSets->get_Parameters(&params)));
wxASSERT_MSG(!m_pTranslationSets1, wxT("ADO command parameter already created"));
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)));
}
return true;
} else {
_ftprintf(stderr, wxT("%s: error ZCC0011: Could not open database (0x%x).\n"), (LPCTSTR)filename, hr);
@@ -410,23 +376,6 @@ bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, int& val) const
}
bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, string& val) const
{
wxASSERT_MSG(f, wxT("field is empty"));
variant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.change_type(VT_BSTR)), false);
WideCharToMultiByte(CP_ACP, 0, V_BSTR(&v), ::SysStringLen(V_BSTR(&v)), val, NULL, NULL);
} else
val.clear();
return true;
}
bool ZRCola::DBSource::GetValue(const com_obj<ADOField>& f, wstring& val) const
{
wxASSERT_MSG(f, wxT("field is empty"));
@@ -485,73 +434,35 @@ bool ZRCola::DBSource::GetUnicodeString(const com_obj<ADOField>& f, wstring& str
variant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
wxCHECK(SUCCEEDED(v.change_type(VT_BSTR)), false);
// Parse the field. Must be "xxxx+xxxx+xxxx..." sequence.
str.clear();
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.change_type(VT_BSTR)), false);
// Parse the field. Must be "xxxx+xxxx+xxxx..." sequence.
for (UINT i = 0, n = ::SysStringLen(V_BSTR(&v)); i < n && V_BSTR(&v)[i];) {
// Parse Unicode code.
UINT j = 0;
wchar_t c = 0;
for (; i < n && V_BSTR(&v)[i]; i++, j++) {
if (L'0' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'9') c = c*0x10 + (V_BSTR(&v)[i] - L'0');
else if (L'A' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'F') c = c*0x10 + (V_BSTR(&v)[i] - L'A' + 10);
else if (L'a' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'f') c = c*0x10 + (V_BSTR(&v)[i] - L'a' + 10);
else break;
}
if (j <= 0 || 4 < j) {
bstr fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0020: Syntax error in \"%.*ls\" field (\"%.*ls\"). Unicode code must be one to four hexadecimal characters long.\n"), m_filename.c_str(), fieldname.length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
str += c;
// Skip delimiter(s) and whitespace.
for (; i < n && V_BSTR(&v)[i] && (V_BSTR(&v)[i] == L'+' || _iswspace_l(V_BSTR(&v)[i], m_locale)); i++);
for (UINT i = 0, n = ::SysStringLen(V_BSTR(&v)); i < n && V_BSTR(&v)[i];) {
// Parse Unicode code.
UINT j = 0;
wchar_t c = 0;
for (; i < n && V_BSTR(&v)[i]; i++, j++) {
if (L'0' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'9') c = c*0x10 + (V_BSTR(&v)[i] - L'0');
else if (L'A' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'F') c = c*0x10 + (V_BSTR(&v)[i] - L'A' + 10);
else if (L'a' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'f') c = c*0x10 + (V_BSTR(&v)[i] - L'a' + 10);
else break;
}
if (j <= 0 || 4 < j) {
bstr fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0020: Syntax error in \"%.*ls\" field (\"%.*ls\"). Unicode code must be one to four hexadecimal characters long.\n"), m_filename.c_str(), fieldname.length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
str += c;
// Skip delimiter(s) and whitespace.
for (; i < n && V_BSTR(&v)[i] && (V_BSTR(&v)[i] == L'+' || _iswspace_l(V_BSTR(&v)[i], m_locale)); i++);
}
return true;
}
bool ZRCola::DBSource::GetNormPerm(const winstd::com_obj<ADOField>& f, normperm& np) const
{
wxASSERT_MSG(f, wxT("field is empty"));
variant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
np.clear();
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.change_type(VT_BSTR)), false);
// Parse the field. Must be "nnnn,nnnn,nnnn..." sequence.
for (UINT i = 0, n = ::SysStringLen(V_BSTR(&v)); i < n && V_BSTR(&v)[i];) {
// Parse Unicode code.
UINT j = 0;
std::vector<size_t> p;
for (; i < n && V_BSTR(&v)[i]; i++, j++) {
if (L'0' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'9') p.push_back(V_BSTR(&v)[i] - L'0');
else break;
}
if (j <= 0) {
bstr fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0150: Syntax error in \"%.*ls\" field (\"%.*ls\"). Permutation sequence must be at least one decimal digit long.\n"), m_filename.c_str(), fieldname.length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
np.insert(std::move(p));
// Skip delimiter(s) and whitespace.
for (; i < n && V_BSTR(&v)[i] && (V_BSTR(&v)[i] == L',' || _iswspace_l(V_BSTR(&v)[i], m_locale)); i++);
}
}
return true;
}
bool ZRCola::DBSource::GetLanguage(const com_obj<ADOField>& f, ZRCola::langid_t& lang) const
{
wxASSERT_MSG(f, wxT("field is empty"));
@@ -638,7 +549,7 @@ bool ZRCola::DBSource::GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid
// Parse the field. Must be "name, name, name..." sequence.
names.clear();
for (UINT i = 0, i_end = ::SysStringLen(V_BSTR(&v)); i < i_end && V_BSTR(&v)[i];) {
for (UINT i = 0, n = ::SysStringLen(V_BSTR(&v)); i < n && V_BSTR(&v)[i];) {
if (iswspace(V_BSTR(&v)[i])) {
// Skip leading white space.
i++; continue;
@@ -646,7 +557,7 @@ bool ZRCola::DBSource::GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid
// Parse name.
UINT j = i, j_end = i;
for (; i < i_end && V_BSTR(&v)[i]; i++) {
for (; i < n && V_BSTR(&v)[i]; i++) {
if (V_BSTR(&v)[i] == L',' || V_BSTR(&v)[i] == L';') {
// Delimiter found.
i++; break;
@@ -672,59 +583,6 @@ bool ZRCola::DBSource::GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid
}
bool ZRCola::DBSource::SelectNormPermSets(winstd::com_obj<ADORecordset>& rs) const
{
// Create a new recordset.
rs.free();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(variant(
L"SELECT [oblika], [oblike] "
L"FROM [VRS_CharCanoOblike] "
L"ORDER BY [oblika], [oblike]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0160: Error loading normalization permutation sets from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetNormPerm(const winstd::com_obj<ADORecordset>& rs, std::string& norm, normperm& np) 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"oblika"), &f)));
wxCHECK(GetValue(f, norm), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"oblike"), &f)));
wxCHECK(GetNormPerm(f, np), false);
}
// Verify all lengths match.
size_t n = norm.length();
for (auto p = np.cbegin(), p_end = np.cend(); p != p_end; ++p) {
if (p->size() != n) {
_ftprintf(stderr, wxT("%s: error ZCC0170: Inconsistent normalization sequence \"%.*hs\" permutation length. Please make sure all permutation lengths match normalization sequence length (%u).\n"), m_filename.c_str(), n, norm.c_str(), n);
return false;
}
}
return true;
}
bool ZRCola::DBSource::SelectTranslations(com_obj<ADORecordset> &rs) const
{
// Create a new recordset.
@@ -733,33 +591,12 @@ bool ZRCola::DBSource::SelectTranslations(com_obj<ADORecordset> &rs) const
// Open it.
if (FAILED(rs->Open(variant(
L"SELECT [komb], [rang_komb], [Kano], [Kanoniziraj], [znak], [rang_znak] "
L"SELECT [komb], [znak], [rang_znak] "
L"FROM [VRS_ReplChar] "
L"WHERE [rang_komb]=1 "
L"ORDER BY [znak], [rang_znak], [rang_komb], [komb]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
L"ORDER BY [znak], [rang_znak], [komb]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0040: Error loading translations from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::SelectTranslations(int 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_pTranslation1->put_Value(variant(set))));
if (FAILED(rs->Open(variant(m_comTranslation), variant(DISP_E_PARAMNOTFOUND, VT_ERROR)))) {
_ftprintf(stderr, wxT("%s: error ZCC0100: Error loading translations from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
_ftprintf(stderr, wxT("%s: error ZCC0040: Error loading compositions from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
@@ -778,165 +615,19 @@ bool ZRCola::DBSource::GetTranslation(const com_obj<ADORecordset>& rs, ZRCola::D
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"komb"), &f)));
wxCHECK(GetUnicodeString(f, t.src.str), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"rang_komb"), &f)));
wxCHECK(GetValue(f, t.src.rank), false);
}
{
bool norm;
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Kanoniziraj"), &f)));
wxCHECK(GetValue(f, norm), false);
if (norm) {
com_obj<ADOField> f2;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Kano"), &f2)));
wxCHECK(GetValue(f2, t.norm), false);
} else
t.norm.clear();
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"rang_znak"), &f)));
wxCHECK(GetValue(f, t.dst.rank), false);
wxCHECK(GetUnicodeString(f, t.decomp.str), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak"), &f)));
wxCHECK(GetUnicodeString(f, t.dst.str), false);
}
return true;
}
bool ZRCola::DBSource::SelectTranlationSets(com_obj<ADORecordset> &rs) const
{
// Create a new recordset.
rs.free();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(variant(
L"SELECT DISTINCT [entCode], [Src_En], [Dst_En] "
L"FROM [VRS_Script2] "
L"ORDER BY [entCode], [Src_En], [Dst_En]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0060: Error loading translation sets from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetTranslationSet(const com_obj<ADORecordset>& rs, ZRCola::DBSource::transet& ts) 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"entCode"), &f)));
wxCHECK(GetValue(f, ts.set), false);
wxCHECK(GetUnicodeCharacter(f, t.chr), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Src_En"), &f)));
wxCHECK(GetValue(f, ts.src), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Dst_En"), &f)));
wxCHECK(GetValue(f, ts.dst), false);
}
return true;
}
bool ZRCola::DBSource::SelectTranlationSeqs(com_obj<ADORecordset> &rs) const
{
// Create a new recordset.
rs.free();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(variant(
L"SELECT DISTINCT [ID], [Descr], [Rank] "
L"FROM [VRS_Script2Seq] "
L"ORDER BY [Rank], [Descr]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0060: Error loading translation sequences from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetTranslationSeq(const com_obj<ADORecordset>& rs, ZRCola::DBSource::transeq& ts) 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"ID"), &f)));
wxCHECK(GetValue(f, ts.seq), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Rank"), &f)));
wxCHECK(GetValue(f, ts.rank), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Descr"), &f)));
wxCHECK(GetValue(f, ts.name), false);
}
// Read translation sequence sets from database.
wxVERIFY(SUCCEEDED(m_pTranslationSets1->put_Value(variant(ts.seq))));
com_obj<ADORecordset> rs_chars;
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs_chars)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorLocation(adUseClient)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorType(adOpenForwardOnly)));
wxVERIFY(SUCCEEDED(rs_chars->put_LockType(adLockReadOnly)));
if (FAILED(rs_chars->Open(variant(m_comTranslationSets), variant(DISP_E_PARAMNOTFOUND, VT_ERROR)))) {
_ftprintf(stderr, wxT("%s: error ZCC0140: Error loading character group characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
{
ts.sets.clear();
com_obj<ADOFields> flds2;
wxVERIFY(SUCCEEDED(rs_chars->get_Fields(&flds2)));
com_obj<ADOField> f_set;
wxVERIFY(SUCCEEDED(flds2->get_Item(variant(L"Script"), &f_set)));
size_t n = 0;
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext(), n++) {
int set;
wxCHECK(GetValue(f_set, set), false);
ts.sets.push_back(set);
}
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"rang_znak"), &f)));
wxCHECK(GetValue(f, t.decomp.rank), false);
}
return true;
@@ -974,7 +665,7 @@ bool ZRCola::DBSource::GetKeySequence(const com_obj<ADORecordset>& rs, ZRCola::D
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Znak"), &f)));
wxCHECK(GetUnicodeString(f, ks.chr), false);
wxCHECK(GetUnicodeCharacter(f, ks.chr), false);
}
int modifiers;
@@ -1062,7 +753,7 @@ bool ZRCola::DBSource::GetLanguage(const com_obj<ADORecordset>& rs, ZRCola::DBSo
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"entCode"), &f)));
wxCHECK(GetLanguage(f, lang.lang), false);
wxCHECK(GetLanguage(f, lang.id), false);
}
{
@@ -1106,7 +797,7 @@ bool ZRCola::DBSource::GetLanguageCharacter(const com_obj<ADORecordset>& rs, ZRC
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak"), &f)));
wxCHECK(GetUnicodeString(f, lc.chr), false);
wxCHECK(GetUnicodeCharacter(f, lc.chr), false);
}
{
@@ -1146,18 +837,18 @@ bool ZRCola::DBSource::GetCharacterGroup(const com_obj<ADORecordset>& rs, chrgrp
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring grp;
wstring id;
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"id"), &f)));
wxCHECK(GetValue(f, cg.grp), false);
wxCHECK(GetValue(f, cg.id), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Skupina"), &f)));
wxCHECK(GetValue(f, grp), false);
wxCHECK(GetValue(f, id), false);
}
{
@@ -1173,14 +864,14 @@ bool ZRCola::DBSource::GetCharacterGroup(const com_obj<ADORecordset>& rs, chrgrp
}
// Read character list from database.
wxVERIFY(SUCCEEDED(m_pCharacterGroup1->put_Value(variant(grp.c_str()))));
wxVERIFY(SUCCEEDED(m_pCharacterGroup1->put_Value(variant(id.c_str()))));
com_obj<ADORecordset> rs_chars;
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs_chars)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorLocation(adUseClient)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorType(adOpenForwardOnly)));
wxVERIFY(SUCCEEDED(rs_chars->put_LockType(adLockReadOnly)));
if (FAILED(rs_chars->Open(variant(m_comCharacterGroup), variant(DISP_E_PARAMNOTFOUND, VT_ERROR)))) {
_ftprintf(stderr, wxT("%s: error ZCC0140: Error loading character group characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
_ftprintf(stderr, wxT("%s: error ZCC0100: Error loading character group characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
@@ -1188,16 +879,16 @@ bool ZRCola::DBSource::GetCharacterGroup(const com_obj<ADORecordset>& rs, chrgrp
{
cg.chars.clear();
cg.show.clear();
com_obj<ADOFields> flds2;
wxVERIFY(SUCCEEDED(rs_chars->get_Fields(&flds2)));
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs_chars->get_Fields(&flds)));
com_obj<ADOField> f_char, f_show;
wxVERIFY(SUCCEEDED(flds2->get_Item(variant(L"Znak" ), &f_char)));
wxVERIFY(SUCCEEDED(flds2->get_Item(variant(L"pogost"), &f_show)));
size_t n = 0;
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext(), n++) {
wstring c;
wxCHECK(GetUnicodeString(f_char, c), false);
cg.chars.insert(cg.chars.end(), c.data(), c.data() + c.length() + 1);
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Znak" ), &f_char)));
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"pogost"), &f_show)));
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext()) {
wchar_t c;
wxCHECK(GetUnicodeCharacter(f_char, c), false);
size_t n = cg.chars.length();
cg.chars += c;
bool show;
wxCHECK(GetValue(f_show, show), false);
if ((n % 16) == 0)
@@ -1241,49 +932,42 @@ bool ZRCola::DBSource::GetCharacter(const com_obj<ADORecordset>& rs, character&
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring c;
chr.second.terms.clear();
chr.second.terms_rel.clear();
chr.second.rel.clear();
wchar_t c;
chr.rel.clear();
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak"), &f)));
wxCHECK(GetUnicodeString(f, chr.first), false);
wxCHECK(GetUnicodeCharacter(f, chr.chr), false);
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak_v"), &f)));
wxCHECK(GetUnicodeString(f, c), false);
if (!c.empty() && c != chr.first)
chr.second.rel.insert(chr.second.rel.end(), c.data(), c.data() + c.length() + 1);
wxCHECK(GetUnicodeCharacter(f, c), false);
if (c && c != chr.chr)
chr.rel += c;
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak_m"), &f)));
wxCHECK(GetUnicodeString(f, c), false);
if (!c.empty() && c != chr.first)
chr.second.rel.insert(chr.second.rel.end(), c.data(), c.data() + c.length() + 1);
wxCHECK(GetUnicodeCharacter(f, c), false);
if (c && c != chr.chr)
chr.rel += c;
}
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"opis_en"), &f)));
wxCHECK(GetValue(f, chr.second.desc), false);
ZRCola::DBSource::character_desc_idx::parse_keywords(chr.second.desc.c_str(), chr.second.terms);
for (auto term = chr.second.terms.cbegin(), term_end = chr.second.terms.cend(); term != term_end; ++term) {
if (m_terms_ignore.find(*term) != m_terms_ignore.cend())
continue;
chr.second.terms_rel.insert(*term);
}
wxCHECK(GetValue(f, chr.desc), false);
}
ZRCola::DBSource::character_desc_idx::parse_keywords(chr.desc.c_str(), chr.terms);
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"kat"), &f)));
wxCHECK(GetChrCat(f, chr.second.cat), false);
wxCHECK(GetChrCat(f, chr.cat), false);
}
return true;
@@ -1318,11 +1002,12 @@ bool ZRCola::DBSource::GetCharacterCategory(const com_obj<ADORecordset>& rs, chr
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring id;
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"kat"), &f)));
wxCHECK(GetChrCat(f, cc.cat), false);
wxCHECK(GetChrCat(f, cc.id), false);
}
{
@@ -1368,11 +1053,12 @@ bool ZRCola::DBSource::GetCharacterTag(const winstd::com_obj<ADORecordset>& rs,
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring id;
{
com_obj<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"znak"), &f)));
wxCHECK(GetUnicodeString(f, ct.chr), false);
wxCHECK(GetUnicodeCharacter(f, ct.chr), false);
}
{
@@ -1412,6 +1098,7 @@ bool ZRCola::DBSource::GetTagName(const winstd::com_obj<ADORecordset>& rs, tagna
com_obj<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring id;
tn.names.clear();
{

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -21,22 +21,11 @@
#include <zrcola/character.h>
#include <zrcola/common.h>
#include <zrcola/language.h>
#include <zrcola/tag.h>
#include <zrcola/translate.h>
#include <zrcolaui/chargroup.h>
#include <zrcolaui/keyboard.h>
#include <WinStd/COM.h>
#include <WinStd/Win.h>
#include <wx/debug.h>
#pragma warning(push)
#pragma warning(disable: 4091)
#include <adoint.h>
#pragma warning(pop)
#include <list>
#include <map>
#include <memory>
@@ -70,50 +59,18 @@ namespace ZRCola {
{
}
inline charseq(_In_ int _rank, _In_ const std::wstring &_str) :
rank(_rank),
str (_str)
{
}
inline charseq(_In_ int _rank, _Inout_ std::wstring &&_str) :
rank(_rank),
str (std::move(_str))
{
}
inline bool operator==(_In_ const charseq &other) const
{
return rank == other.rank && str == other.str;
}
inline bool operator!=(_In_ const charseq &other) const
{
return !operator==(other);
}
inline bool operator<(_In_ const charseq &other) const
{
if (rank < other.rank) return true;
else if (rank > other.rank) return false;
else if (str < other.str ) return true;
else return false;
}
inline bool operator<=(_In_ const charseq &other) const
{
return !operator>(other);
}
inline bool operator>(_In_ const charseq &other) const
{
return other.operator<(*this);
}
inline bool operator>=(_In_ const charseq &other) const
{
return !operator<(other);
}
///
/// Functor to compare two sequences by `rank`, and `str` members respectively
///
struct less_rank_str {
inline bool operator()(_In_ const charseq& a, _In_ const charseq& b) const
{
if (a.rank < b.rank) return true;
else if (a.rank > b.rank) return false;
else if (a.str < b.str ) return true;
else return false;
}
};
};
@@ -122,42 +79,11 @@ namespace ZRCola {
///
class translation {
public:
int set; ///< Translation set ID
charseq src; ///< Source sequence
std::string norm; ///< Normalization footprint
charseq dst; ///< Destination sequence
wchar_t chr; ///< Composed character
charseq decomp; ///< Decomposed sequence
};
///
/// Translation set
///
class transet {
public:
int set; ///< ID
std::wstring src; ///< Source name
std::wstring dst; ///< Destination name
};
///
/// Translation sequence
///
class transeq {
public:
int seq; ///< ID
int rank; ///< Rank
std::wstring name; ///< Name
std::vector<int> sets; ///< Sets
};
///
/// Normalization permutation set
///
typedef std::set<std::vector<size_t> > normperm;
///
/// Key sequence
///
@@ -188,7 +114,7 @@ namespace ZRCola {
};
public:
std::wstring chr; ///< Character
wchar_t chr; ///< Character
std::vector<keycode> seq; ///< Key sequence
};
@@ -198,8 +124,8 @@ namespace ZRCola {
///
class language {
public:
ZRCola::langid_t lang; ///< Language ID
std::wstring name; ///< Name
ZRCola::langid_t id; ///< Language ID
std::wstring name; ///< Language name
};
@@ -208,7 +134,7 @@ namespace ZRCola {
///
class langchar {
public:
std::wstring chr; ///> Character
wchar_t chr; ///> Character
ZRCola::langid_t lang; ///< Language ID
};
@@ -218,65 +144,76 @@ namespace ZRCola {
///
class chrgrp {
public:
int grp; ///< Character group ID
int rank; ///< Rank
std::wstring name; ///< Name
std::vector<wchar_t> chars; ///< Characters (zero-delimited)
std::vector<unsigned __int16> show; ///< Bit vector if particular character from \c chars is displayed initially
};
///
/// Character data
///
class character_data {
public:
inline character_data()
{
cat.data[0] = 0;
cat.data[1] = 0;
}
inline character_data(_In_ const character_data &othr) :
cat (othr.cat),
desc (othr.desc),
terms (othr.terms),
terms_rel(othr.terms_rel),
rel (othr.rel)
{
}
ZRCola::chrcatid_t cat; ///< Category ID
std::wstring desc; ///< Character description
std::set<std::wstring> terms; ///< Search terms
std::set<std::wstring> terms_rel; ///< Relevant terms for relating characters
std::vector<wchar_t> rel; ///< Related characters (zero-delimited)
int id; ///< Character group ID
int rank; ///< Character group rank
std::wstring name; ///< Character group name
std::wstring chars; ///< Character group characters
std::vector<unsigned __int16> show; ///< Bit vector if particular character is displayed initially
};
///
/// Character
///
typedef std::pair<std::wstring, character_data> character;
class character {
public:
inline character()
{
chr = 0;
cat.data[0] = 0;
cat.data[1] = 0;
}
inline character(_In_ const character &othr) :
chr (othr.chr),
cat (othr.cat),
desc (othr.desc),
terms(othr.terms),
rel (othr.rel)
{
}
inline bool operator==(_In_ const character &othr) const
{
return
chr == othr.chr &&
cat == othr.cat &&
desc == othr.desc &&
terms == othr.terms &&
rel == othr.rel;
}
inline bool operator!=(_In_ const character &othr) const
{
return !operator==(othr);
}
wchar_t chr; ///< Character
ZRCola::chrcatid_t cat; ///< Category ID
std::wstring desc; ///< Character description
std::set<std::wstring> terms; ///< Search terms
std::wstring rel; ///< Related characters
};
///
/// Character bank
///
class character_bank : public std::map<std::wstring, character_data>
class character_bank : public std::vector<std::unique_ptr<character> >
{
public:
character_bank();
void build_related();
protected:
class build_related_worker : public winstd::win_handle<INVALID_HANDLE_VALUE>
class build_related_worker : public winstd::win_handle
{
public:
build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to);
build_related_worker(_In_ const character_bank *cb, _In_ size_type from, _In_ size_type to);
inline void join()
{
if (m_h != invalid)
if (m_h)
WaitForSingleObject(m_h, INFINITE);
}
@@ -293,9 +230,12 @@ namespace ZRCola {
protected:
const character_bank *m_cb;
iterator m_from, m_to;
size_type m_from, m_to;
winstd::heap m_heap;
};
protected:
std::set<std::wstring> m_ignore;
};
@@ -326,8 +266,8 @@ namespace ZRCola {
{
public:
static void parse_keywords(const wchar_t *str, std::set<std::wstring> &terms);
void add_keywords(const std::set<std::wstring> &terms, const std::wstring &chr, size_t sub = 0);
inline void add_keywords(const wchar_t *str, const std::wstring &chr, size_t sub = 0)
void add_keywords(const std::set<std::wstring> &terms, wchar_t chr, size_t sub = 0);
inline void add_keywords(const wchar_t *str, wchar_t chr, size_t sub = 0)
{
std::set<std::wstring> terms;
parse_keywords(str, terms);
@@ -337,21 +277,21 @@ namespace ZRCola {
void save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const;
protected:
inline void add_keyword(const std::wstring &term, const std::wstring &chr)
inline void add_keyword(const std::wstring &term, wchar_t chr)
{
iterator idx = find(term);
if (idx == end()) {
// New keyword.
insert(std::make_pair(term, mapped_type(chr.data(), chr.data() + chr.length() + 1)));
insert(std::make_pair(term, std::vector<wchar_t>(1, chr)));
} else {
// Append to existing keyword.
auto &val = idx->second;
for (mapped_type::size_type i = 0, n = val.size(); ; i += wcsnlen(val.data() + i, n - i) + 1) {
if (i >= n) {
std::vector<wchar_t> &val = idx->second;
for (auto i = val.cbegin(), i_end = val.cend(); ; ++i) {
if (i == i_end) {
// End-of-values reached. Append character.
val.insert(val.end(), chr.data(), chr.data() + chr.length() + 1);
val.push_back(chr);
break;
} else if (chr.compare(val.data() + i) == 0) {
} else if (*i == chr) {
// Character already among the values.
break;
}
@@ -366,9 +306,9 @@ namespace ZRCola {
///
class chrcat {
public:
ZRCola::chrcatid_t cat; ///> Category ID
int rank; ///< Rank
std::wstring name; ///< Name
ZRCola::chrcatid_t id; ///> Category ID
int rank; ///< Character category rank
std::wstring name; ///< Character category name
};
@@ -377,7 +317,7 @@ namespace ZRCola {
///
class chrtag {
public:
std::wstring chr; ///> Character
wchar_t chr; ///> Character
int tag; ///< Tag ID
};
@@ -476,18 +416,6 @@ namespace ZRCola {
///
bool GetValue(const winstd::com_obj<ADOField>& f, int& val) const;
///
/// Gets string from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] val Output string value
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetValue(const winstd::com_obj<ADOField>& f, std::string& val) const;
///
/// Gets string from ZRCola.zrc database
///
@@ -524,18 +452,6 @@ namespace ZRCola {
///
bool GetUnicodeString(const winstd::com_obj<ADOField>& f, std::wstring& str) const;
///
/// Gets encoded normalization permutations from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] str Output normalization permutation set
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetNormPerm(const winstd::com_obj<ADOField>& f, normperm& np) const;
///
/// Gets language ID from ZRCola.zrc database
///
@@ -572,29 +488,6 @@ namespace ZRCola {
///
bool GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid, std::list<std::wstring>& names) const;
///
/// Returns normalization permutation sets
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectNormPermSets(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns normalization permutation set
///
/// \param[in] rs Recordset with results
/// \param[out] np Normalization permutation set
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetNormPerm(const winstd::com_obj<ADORecordset>& rs, std::string& norm, normperm& np) const;
///
/// Returns character translations
///
@@ -606,18 +499,6 @@ namespace ZRCola {
///
bool SelectTranslations(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character translations by set
///
/// \param[in ] set Translation set ID
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranslations(int set, winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns translation data
///
@@ -630,52 +511,6 @@ namespace ZRCola {
///
bool GetTranslation(const winstd::com_obj<ADORecordset>& rs, translation& t) const;
///
/// Returns translation sets
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranlationSets(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns translation set data
///
/// \param[in] rs Recordset with results
/// \param[out] lang Language
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetTranslationSet(const winstd::com_obj<ADORecordset>& rs, transet& ts) const;
///
/// Returns translation sequences
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranlationSeqs(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns translation sequence data
///
/// \param[in] rs Recordset with results
/// \param[out] lang Language
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetTranslationSeq(const winstd::com_obj<ADORecordset>& rs, transeq& ts) const;
///
/// Returns key sequences
///
@@ -862,241 +697,10 @@ namespace ZRCola {
protected:
std::basic_string<TCHAR> m_filename; ///< Database filename
winstd::com_obj<ADOConnection> m_db; ///< Database
winstd::com_obj<ADOConnection> m_db; ///< Database
_locale_t m_locale; ///< Database locale
winstd::com_obj<ADOCommand> m_comCharacterGroup; ///< ADO Command for GetCharacterGroup subquery
winstd::com_obj<ADOParameter> m_pCharacterGroup1; ///< \c m_comCharacterGroup parameter
winstd::com_obj<ADOCommand> m_comTranslation; ///< ADO Command for SelectTranslations subquery
winstd::com_obj<ADOParameter> m_pTranslation1; ///< \c m_comTranslations parameter
winstd::com_obj<ADOCommand> m_comTranslationSets; ///< ADO Command for GetTranslationSeq subquery
winstd::com_obj<ADOParameter> m_pTranslationSets1; ///< \c m_comTranslationSets parameter
std::set<std::wstring> m_terms_ignore; ///< Terms to ignore when comparing characters
winstd::com_obj<ADOCommand> m_comCharacterGroup; ///< ADO Command for GetCharacterGroup subquery
winstd::com_obj<ADOParameter> m_pCharacterGroup1; ///< \c m_comCharacterGroup parameter
};
};
inline ZRCola::translation_db& operator<<(_Inout_ ZRCola::translation_db &db, _In_ const ZRCola::DBSource::translation &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.set && rec.set <= (int)0x00007fff, wxT("translation set id out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
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();
wxASSERT_MSG(n <= 0xffff, wxT("destination overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.src.str.length();
wxASSERT_MSG(n <= 0xffff, wxT("source overflow"));
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.src.str.cbegin(), rec.src.str.cend());
db.idxSrc.push_back(idx);
db.idxDst.push_back(idx);
return db;
}
inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const ZRCola::DBSource::transet &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.set && rec.set <= (int)0x00007fff, wxT("translation set id out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
std::wstring::size_type n = rec.src.length();
wxASSERT_MSG(n <= 0xffff, wxT("translation set source name overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.dst.length();
wxASSERT_MSG(n <= 0xffff, wxT("translation set destination name overflow"));
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.dst.cbegin(), rec.dst.cend());
db.idxTranSet.push_back(idx);
return db;
}
inline ZRCola::transeq_db& operator<<(_Inout_ ZRCola::transeq_db &db, _In_ const ZRCola::DBSource::transeq &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.seq && rec.seq <= (int)0x00007fff, wxT("translation sequence id out of bounds"));
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();
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence name overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.sets.size();
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence sets overflow"));
db.data.push_back((unsigned __int16)n);
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) {
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.idxRank .push_back(idx);
return db;
}
inline ZRCola::keyseq_db& operator<<(_Inout_ ZRCola::keyseq_db &db, _In_ const ZRCola::DBSource::keyseq &rec)
{
unsigned __int32 idx = db.data.size();
std::wstring::size_type n = rec.chr.length();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.seq.size() * sizeof(ZRCola::keyseq_db::keyseq::key_t) / sizeof(wchar_t);
wxASSERT_MSG(n <= 0xffff, wxT("key sequence overflow"));
db.data.push_back((unsigned __int16)n);
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) {
db.data.push_back(kc->key);
db.data.push_back(
(kc->shift ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
(kc->ctrl ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
(kc->alt ? ZRCola::keyseq_db::keyseq::ALT : 0));
}
db.idxChr.push_back(idx);
db.idxKey.push_back(idx);
return db;
}
inline ZRCola::language_db& operator<<(_Inout_ ZRCola::language_db &db, _In_ const ZRCola::DBSource::language &rec)
{
unsigned __int32 idx = db.data.size();
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();
wxASSERT_MSG(n <= 0xffff, wxT("language name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
db.idxLang.push_back(idx);
return db;
}
inline ZRCola::langchar_db& operator<<(_Inout_ ZRCola::langchar_db &db, _In_ const ZRCola::DBSource::langchar &rec)
{
unsigned __int32 idx = db.data.size();
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();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
db.idxChr .push_back(idx);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLang.push_back(idx);
#endif
return db;
}
inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const ZRCola::DBSource::chrgrp &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.grp && rec.grp <= (int)0x00007fff, wxT("character group ID out of bounds"));
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();
wxASSERT_MSG(n <= 0xffff, wxT("character group name overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.chars.size();
wxASSERT_MSG(n <= 0xffff, wxT("character group characters overflow"));
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.chars.cbegin(), rec.chars.cend());
db.data.insert(db.data.end(), rec.show .cbegin(), rec.show .cend());
db.idxRank.push_back(idx);
return db;
}
inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ const ZRCola::DBSource::character &rec)
{
unsigned __int32 idx = db.data.size();
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();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.second.desc.length();
wxASSERT_MSG(n <= 0xffff, wxT("character description overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.second.rel.size();
wxASSERT_MSG(n <= 0xffff, wxT("related characters overflow"));
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.second.desc.cbegin(), rec.second.desc.cend());
db.data.insert(db.data.end(), rec.second.rel .cbegin(), rec.second.rel .cend());
db.idxChr.push_back(idx);
return db;
}
inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const ZRCola::DBSource::chrcat &rec)
{
unsigned __int32 idx = db.data.size();
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.cat), reinterpret_cast<const unsigned __int16*>(&rec.cat + 1));
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();
wxASSERT_MSG(n <= 0xffff, wxT("character category name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
db.idxChrCat.push_back(idx);
db.idxRank .push_back(idx);
return db;
}
inline ZRCola::chrtag_db& operator<<(_Inout_ ZRCola::chrtag_db &db, _In_ const ZRCola::DBSource::chrtag &rec)
{
unsigned __int32 idx = db.data.size();
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();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
db.idxChr.push_back(idx);
db.idxTag.push_back(idx);
return db;
}
inline ZRCola::tagname_db& operator<<(_Inout_ ZRCola::tagname_db &db, _In_ const ZRCola::DBSource::tagname &rec)
{
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) {
unsigned __int32 idx = db.data.size();
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(HIWORD(ln->first));
std::wstring::size_type n = nm->length();
wxASSERT_MSG(n <= 0xffff, wxT("tag name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), nm->cbegin(), nm->cend());
db.idxName.push_back(idx);
db.idxTag .push_back(idx);
}
}
return db;
}

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2018-09-19 09:00+0200\n"
"POT-Creation-Date: 2016-10-13 11:49+0200\n"
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
@@ -10,25 +10,26 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.1.1\n"
"X-Generator: Poedit 1.8.9\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-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: main.cpp:251
#: main.cpp:102
msgid "Show this help message"
msgstr ""
#: main.cpp:252
#: main.cpp:103
msgid "<input file>"
msgstr ""
#: main.cpp:253
#: main.cpp:104
msgid "<output file>"
msgstr ""
#: main.cpp:254
#: main.cpp:105
msgid "<output POT catalog>"
msgstr ""

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -24,198 +24,49 @@ using namespace stdex;
using namespace winstd;
///
/// (destination character rank, (source character rank, source character)) data holder
///
class com_translation
typedef map<wchar_t, set<ZRCola::DBSource::charseq, ZRCola::DBSource::charseq::less_rank_str> > translation_db;
static set<wstring> decompose(_In_ const translation_db &db, _In_z_ const wchar_t *str, _Inout_ set<wchar_t> &path)
{
public:
int rank_src; ///< Source sequence rank
int rank_dst; ///< Destination character rank
string norm; ///< Normalization footprint
set<wstring> res;
inline com_translation()
{
}
inline com_translation(int _rank_src, int _rank_dst) :
rank_src(_rank_src),
rank_dst(_rank_dst)
{
}
inline com_translation(int _rank_src, int _rank_dst, const char *_norm) :
rank_src(_rank_src),
rank_dst(_rank_dst),
norm (_norm )
{
}
inline com_translation(int _rank_src, int _rank_dst, string &&_norm) :
rank_src( _rank_src ),
rank_dst( _rank_dst ),
norm (std::move(_norm ))
{
}
inline com_translation(const com_translation &other) :
rank_src(other.rank_src),
rank_dst(other.rank_dst),
norm (other.norm )
{
}
inline com_translation(com_translation &&other) :
rank_src( other.rank_src ),
rank_dst( other.rank_dst ),
norm (std::move(other.norm ))
{
}
inline com_translation& operator=(const com_translation &other)
{
if (this != std::addressof(other)) {
rank_src = other.rank_src;
rank_dst = other.rank_dst;
norm = other.norm ;
}
return *this;
}
inline com_translation& operator=(com_translation &&other)
{
if (this != std::addressof(other)) {
rank_src = other.rank_src ;
rank_dst = other.rank_dst ;
norm = std::move(other.norm );
}
return *this;
}
inline bool operator==(_In_ const com_translation& other) const
{
return
rank_src == other.rank_src &&
rank_dst == other.rank_dst &&
norm == other.norm;
}
inline bool operator!=(_In_ const com_translation &other) const
{
return !operator==(other);
}
inline bool operator<(_In_ const com_translation& other) const
{
if (rank_src < other.rank_src) return true;
else if (rank_src > other.rank_src) return false;
else if (rank_dst < other.rank_dst) return true;
else if (rank_dst > other.rank_dst) return false;
else if (norm < other.norm ) return true;
else return false;
}
inline bool operator<=(_In_ const com_translation &other) const
{
return !operator>(other);
}
inline bool operator>(_In_ const com_translation &other) const
{
return other.operator<(*this);
}
inline bool operator>=(_In_ const com_translation &other) const
{
return !operator<(other);
}
};
typedef map<wstring, map<wstring, com_translation> > translation_db;
typedef map<string, ZRCola::DBSource::normperm> normperm_db;
static set<ZRCola::DBSource::charseq> translate_inv(_In_ const translation_db &db_trans, _In_ const normperm_db &db_np, _In_z_ const wchar_t *str, _Inout_ set<translation_db::key_type> &path);
static inline set<ZRCola::DBSource::charseq> permutate_and_translate_inv(_In_ const translation_db &db_trans, _In_ const normperm_db &db_np, _In_z_ const wchar_t *str, _In_z_ const char *norm, _Inout_ set<translation_db::key_type> &path);
static set<ZRCola::DBSource::charseq> translate_inv(_In_ const translation_db &db_trans, _In_ const normperm_db &db_np, _In_z_ const wchar_t *str, _Inout_ set<translation_db::key_type> &path)
{
set<ZRCola::DBSource::charseq> res;
if (!*str) {
// Empty string results in empty inverse translation.
res.insert(ZRCola::DBSource::charseq(0, L""));
return res;
}
// Prepare inverse translate of the remainder string (without the first character).
auto res_rem = translate_inv(db_trans, db_np, str + 1, path);
if (res_rem.empty())
return res;
// See if first character is inverse translatable.
translation_db::key_type chr(1, *str);
auto const hit_trans = db_trans.find(chr);
if (hit_trans != db_trans.end()) {
// Current character is inverse translatable.
// Add the current character to the path before recursing.
auto hit_path = path.insert(chr);
if (!hit_path.second) {
// Path already contains this character: Cycle detected!
if (*str) {
// Decompose remainder first.
auto rem = decompose(db, str + 1, path);
if (rem.empty())
return res;
}
// Iterate all possible character inverse translations and combine them with the remainder string inverse translations.
for (auto d = hit_trans->second.cbegin(), d_end = hit_trans->second.cend(); d != d_end; ++d) {
auto res_chr = d->second.norm.empty() ?
translate_inv(db_trans, db_np, d->first.c_str(), path) :
permutate_and_translate_inv(db_trans, db_np, d->first.c_str(), d->second.norm.c_str(), path);
if (!res_chr.empty()) {
for (auto r_chr = res_chr.cbegin(), r_chr_end = res_chr.cend(); r_chr != r_chr_end; ++r_chr) {
for (auto r_rem = res_rem.cbegin(), r_rem_end = res_rem.cend(); r_rem != r_rem_end; ++r_rem)
res.insert(ZRCola::DBSource::charseq(d->second.rank_src + r_chr->rank + r_rem->rank, r_chr->str + r_rem->str));
}
} else {
// Cycle detected. Do not continue inverse translation.
for (auto r_rem = res_rem.cbegin(), r_end = res_rem.cend(); r_rem != r_end; ++r_rem)
res.insert(ZRCola::DBSource::charseq(r_rem->rank, chr + r_rem->str));
auto const t = db.find(*str);
if (t != db.end()) {
// Current characted decomposed. Iterate all possible decompositions and combine them with the remainder.
auto p = path.insert(*str);
if (!p.second) {
// Path already contains this character: Cycle detected!
return res;
}
for (auto d = t->second.cbegin(), d_end = t->second.cend(); d != d_end; ++d) {
auto dec = decompose(db, d->str.c_str(), path);
if (!dec.empty()) {
for (auto dd = dec.cbegin(), dd_end = dec.cend(); dd != dd_end; ++dd) {
for (auto r = rem.cbegin(), r_end = rem.cend(); r != r_end; ++r)
res.insert(*dd + *r);
}
} else {
// Cycle detected. Do not continue decomposition.
for (auto r = rem.cbegin(), r_end = rem.cend(); r != r_end; ++r)
res.insert(wstring(1, *str) + *r);
}
}
path.erase(p.first);
} else {
// Current character is non-decomposable. Combine it with the remainder(s).
for (auto r = rem.cbegin(), r_end = rem.cend(); r != r_end; ++r)
res.insert(wstring(1, *str) + *r);
}
// Remove the current character from the path.
path.erase(hit_path.first);
} else {
// First character is non-inverse translatable. Combine it with the remainder(s).
for (auto r_rem = res_rem.cbegin(), r_end = res_rem.cend(); r_rem != r_end; ++r_rem)
res.insert(ZRCola::DBSource::charseq(r_rem->rank, chr + r_rem->str));
}
return res;
}
static inline set<ZRCola::DBSource::charseq> permutate_and_translate_inv(_In_ const translation_db &db_trans, _In_ const normperm_db &db_np, _In_z_ const wchar_t *str, _In_z_ const char *norm, _Inout_ set<translation_db::key_type> &path)
{
// Primary permutation inverse translate.
auto res = translate_inv(db_trans, db_np, str, path);
// Secondary permutation(s).
auto const hit_np = db_np.find(norm);
if (hit_np != db_np.end()) {
for (auto perm = hit_np->second.cbegin(), perm_end = hit_np->second.cend(); perm != perm_end; ++perm) {
// Prepare permutated string.
translation_db::mapped_type::key_type str_perm;
for (auto idx = perm->cbegin(), idx_end = perm->cend(); idx != idx_end; ++idx)
str_perm += str[*idx];
// Secondary permutation inverse translate.
auto res_perm = translate_inv(db_trans, db_np, str_perm.c_str(), path);
for (auto r = res_perm.begin(), r_end = res_perm.end(); r != r_end; ++r)
res.insert(ZRCola::DBSource::charseq(r->rank + 1, std::move(r->str)));
}
// Empty string results in empty decomposition.
res.insert(L"");
}
return res;
@@ -300,37 +151,6 @@ int _tmain(int argc, _TCHAR *argv[])
// Open file ID.
streamoff dst_start = idrec::open<ZRCola::recordid_t, ZRCola::recordsize_t>(dst, ZRCOLA_DB_ID);
ZRCola::translation_db db_trans;
normperm_db db_np;
{
// Get normalization permutation sets.
com_obj<ADORecordset> rs;
if (src.SelectNormPermSets(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
string norm;
ZRCola::DBSource::normperm np;
// Parse normalization permutation sets.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read normalization permutation set from the database.
if (src.GetNormPerm(rs, norm, np)) {
if (!np.empty())
db_np.insert(pair<string, ZRCola::DBSource::normperm>(norm, std::move(np)));
} else
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0009: Error getting translation set count from database or too many translation sets.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0008: Error getting translation sets from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
{
// Get translations.
com_obj<ADORecordset> rs;
@@ -344,63 +164,72 @@ int _tmain(int argc, _TCHAR *argv[])
ZRCola::DBSource::translation trans;
if (src.GetTranslation(rs, trans)) {
// Add translation to temporary database.
pair<translation_db::mapped_type::key_type, translation_db::mapped_type::mapped_type> ctp(std::move(trans.src.str), translation_db::mapped_type::mapped_type(trans.src.rank, trans.dst.rank, std::move(trans.norm)));
auto hit = db_temp1.find(trans.dst.str);
if (hit != db_temp1.end())
hit->second.insert(std::move(ctp));
auto const t = db_temp1.find(trans.chr);
if (t != db_temp1.end())
t->second.insert(std::move(trans.decomp));
else {
translation_db::mapped_type t;
t.insert(std::move(ctp));
db_temp1.insert(pair<translation_db::key_type, translation_db::mapped_type>(std::move(trans.dst.str), std::move(t)));
translation_db::mapped_type d;
d.insert(std::move(trans.decomp));
db_temp1.insert(std::move(pair<translation_db::key_type, translation_db::mapped_type>(trans.chr, std::move(d))));
}
} else
has_errors = true;
}
// Inverse translate source sequences down to non-inverse translatable characters.
// Decompose decompositions down to non-decomposable characters.
translation_db db_temp2;
for (auto t1 = db_temp1.cbegin(), t1_end = db_temp1.cend(); t1 != t1_end; ++t1) {
auto t2 = db_temp2.insert(pair<translation_db::key_type, translation_db::mapped_type>(t1->first, translation_db::mapped_type())).first;
for (auto d1 = t1->second.cbegin(), d1_end = t1->second.cend(); d1 != d1_end; ++d1) {
set<translation_db::key_type> path;
set<wchar_t> path;
path.insert(t1->first);
auto res = d1->second.norm.empty() ?
translate_inv(db_temp1, db_np, d1->first.c_str(), path) :
permutate_and_translate_inv(db_temp1, db_np, d1->first.c_str(), d1->second.norm.c_str(), path);
assert(!res.empty());
auto str = decompose(db_temp1, d1->str.c_str(), path);
assert(!str.empty());
// Add translation to temporary database.
for (auto r = res.begin(), r_end = res.end(); r != r_end; ++r) {
translation_db::mapped_type::mapped_type ct(d1->second.rank_src + r->rank, d1->second.rank_dst);
auto hit = t2->second.find(r->str);
if (hit != t2->second.end()) {
hit->second.rank_src = std::min<int>(hit->second.rank_src, ct.rank_src);
hit->second.rank_dst = std::max<int>(hit->second.rank_dst, ct.rank_dst);
} else
t2->second.insert(pair<translation_db::mapped_type::key_type, translation_db::mapped_type::mapped_type>(std::move(r->str), std::move(ct)));
auto const t2 = db_temp2.find(t1->first);
if (t2 != db_temp2.end()) {
for (auto s = str.cbegin(), s_end = str.cend(); s != s_end; ++s)
t2->second.insert(std::move(ZRCola::DBSource::charseq(d1->rank, s->c_str())));
} else {
translation_db::mapped_type d2;
for (auto s = str.cbegin(), s_end = str.cend(); s != s_end; ++s)
d2.insert(std::move(ZRCola::DBSource::charseq(d1->rank, s->c_str())));
db_temp2.insert(std::move(pair<translation_db::key_type, translation_db::mapped_type>(t1->first, std::move(d2))));
}
}
}
ZRCola::translation_db db;
// Preallocate memory.
db_trans.idxSrc.reserve(count);
db_trans.idxDst.reserve(count);
db_trans.data .reserve(count*5);
db.idxComp .reserve(count);
db.idxDecomp.reserve(count);
db.data .reserve(count*4);
// Parse translations and build index and data.
ZRCola::DBSource::translation trans;
trans.set = 0;
for (auto t = db_temp2.cbegin(), t_end = db_temp2.cend(); t != t_end; ++t) {
// Add translation to index and data.
trans.dst.str = std::move(t->first);
for (auto d = t->second.cbegin(), d_end = t->second.cend(); d != d_end; ++d) {
trans.dst.rank = d->second.rank_dst;
trans.src.rank = d->second.rank_src;
trans.src.str = std::move(d->first);
db_trans << trans;
unsigned __int32 idx = db.data.size();
db.data.push_back(t->first);
wxASSERT_MSG((int)0xffff8000 <= d->rank && d->rank <= (int)0x00007fff, wxT("transformation rank out of bounds"));
db.data.push_back((unsigned __int16)d->rank);
wstring::size_type n = d->str.length();
wxASSERT_MSG(n <= 0xffff, wxT("transformation string too long"));
db.data.push_back((unsigned __int16)n);
for (wstring::size_type i = 0; i < n; i++)
db.data.push_back(d->str[i]);
db.idxComp .push_back(idx);
db.idxDecomp.push_back(idx);
}
}
// Sort indices.
db.idxComp .sort();
db.idxDecomp.sort();
// Write translations to file.
dst << ZRCola::translation_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0004: Error getting translation count from database or too many translations.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
@@ -411,123 +240,6 @@ int _tmain(int argc, _TCHAR *argv[])
}
}
{
// Get translation sets.
com_obj<ADORecordset> rs;
if (src.SelectTranlationSets(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
ZRCola::transet_db db;
// Preallocate memory.
db.idxTranSet.reserve((count+1));
db.data .reserve((count+1)*4);
// Parse translation sets and build index and data.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read translation set from the database.
ZRCola::DBSource::transet ts;
if (src.GetTranslationSet(rs, ts)) {
if (build_pot) {
pot.insert(ts.src);
pot.insert(ts.dst);
}
// Add translation set to index and data.
db << ts;
// Get translations.
com_obj<ADORecordset> rs_tran;
if (src.SelectTranslations(ts.set, rs_tran)) {
if (src.GetRecordsetCount(rs_tran) < 0xffffffff) { // 4G check (-1 is reserved for error condition)
// Parse translations and build temporary database.
ZRCola::DBSource::translation trans;
trans.set = ts.set;
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 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 translations from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else
has_errors = true;
}
// Sort indices.
db.idxTranSet.sort();
// Write translation sets to file.
dst << ZRCola::transet_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0009: Error getting translation set count from database or too many translation sets.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0008: Error getting translation sets from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
// Sort indices.
db_trans.idxSrc.sort();
db_trans.idxDst.sort();
// Write translations to file.
dst << ZRCola::translation_rec(db_trans);
{
// Get translation sequences.
com_obj<ADORecordset> rs;
if (src.SelectTranlationSeqs(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
ZRCola::transeq_db db;
// Preallocate memory.
db.idxTranSeq.reserve((count+1));
db.idxRank .reserve((count+1));
db.data .reserve((count+1)*4);
// Parse translation sequences and build index and data.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read translation sequence from the database.
ZRCola::DBSource::transeq ts;
if (src.GetTranslationSeq(rs, ts)) {
if (build_pot)
pot.insert(ts.name);
// Add translation sequence to index and data.
db << ts;
} else
has_errors = true;
}
// Sort indices.
db.idxTranSeq.sort();
db.idxRank .sort();
// Write translation sequences to file.
dst << ZRCola::transeq_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0025: Error getting translation sequence count from database or too many translation sequences.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0024: Error getting translation sequences from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
{
// Get key sequences.
com_obj<ADORecordset> rs;
@@ -547,7 +259,21 @@ int _tmain(int argc, _TCHAR *argv[])
// Read key sequence from the database.
if (src.GetKeySequence(rs, ks)) {
// Add key sequence to index and data.
db << ks;
unsigned __int32 idx = db.data.size();
db.data.push_back(ks.chr);
vector<ZRCola::DBSource::keyseq::keycode>::size_type n = ks.seq.size();
wxASSERT_MSG(n <= 0xffff, wxT("key sequence too long"));
db.data.push_back((unsigned __int16)n);
for (vector<ZRCola::DBSource::keyseq::keycode>::size_type i = 0; i < n; i++) {
const ZRCola::DBSource::keyseq::keycode &kc = ks.seq[i];
db.data.push_back(kc.key);
db.data.push_back(
(kc.shift ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
(kc.ctrl ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
(kc.alt ? ZRCola::keyseq_db::keyseq::ALT : 0));
}
db.idxChr.push_back(idx);
db.idxKey.push_back(idx);
} else
has_errors = true;
}
@@ -562,14 +288,10 @@ int _tmain(int argc, _TCHAR *argv[])
&ks1 = db.idxKey[i - 1],
&ks2 = db.idxKey[i ];
if (ZRCola::keyseq_db::keyseq::CompareSequence(ks1.seq(), ks1.seq_len(), ks2.seq(), ks2.seq_len()) == 0) {
if (ZRCola::keyseq_db::keyseq::CompareSequence(ks1.seq, ks1.seq_len, ks2.seq, ks2.seq_len) == 0) {
wxString seq_str;
ZRCola::keyseq_db::GetSequenceAsText(ks1.seq(), ks1.seq_len(), seq_str);
_ftprintf(stderr, wxT("%s: warning ZCC0007: Duplicate key sequence (%s => %s or %s). The keyboard behaviour will be unpredictable.\n"),
(LPCTSTR)filenameIn.c_str(),
(LPCTSTR)seq_str.c_str(),
ZRCola::GetUnicodeDump(ks1.chr(), ks1.chr_len()).c_str(),
ZRCola::GetUnicodeDump(ks2.chr(), ks2.chr_len()).c_str());
ZRCola::keyseq_db::GetSequenceAsText(ks1.seq, ks1.seq_len, seq_str);
_ftprintf(stderr, wxT("%s: warning ZCC0007: Duplicate key sequence (%ls => %04X or %04X). The keyboard behaviour will be unpredictable.\n"), (LPCTSTR)filenameIn.c_str(), seq_str.c_str(), ks1.chr, ks2.chr);
}
}
@@ -595,8 +317,8 @@ int _tmain(int argc, _TCHAR *argv[])
ZRCola::language_db db;
// Preallocate memory.
db.idxLang.reserve(count);
db.data .reserve(count*4);
db.idxLng.reserve(count);
db.data .reserve(count*4);
// Parse languages and build index and data.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
@@ -606,13 +328,21 @@ int _tmain(int argc, _TCHAR *argv[])
pot.insert(lang.name);
// Add language to index and data.
db << lang;
unsigned __int32 idx = db.data.size();
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lang.id.data)[i]);
wstring::size_type n = lang.name.length();
wxASSERT_MSG(n <= 0xffff, wxT("language name too long"));
db.data.push_back((unsigned __int16)n);
for (wstring::size_type i = 0; i < n; i++)
db.data.push_back(lang.name[i]);
db.idxLng.push_back(idx);
} else
has_errors = true;
}
// Sort indices.
db.idxLang.sort();
db.idxLng.sort();
// Write languages to file.
dst << ZRCola::language_rec(db);
@@ -636,18 +366,25 @@ int _tmain(int argc, _TCHAR *argv[])
ZRCola::langchar_db db;
// Preallocate memory.
db.idxChr .reserve(count);
db.idxChr.reserve(count);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLang.reserve(count);
db.idxLng.reserve(count);
#endif
db.data .reserve(count*4);
db.data .reserve(count*4);
// Parse language characters and build index and data.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read language characters from the database.
if (src.GetLanguageCharacter(rs, lc)) {
// Add language characters to index and data.
db << lc;
unsigned __int32 idx = db.data.size();
db.data.push_back(lc.chr);
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lc.lang.data)[i]);
db.idxChr.push_back(idx);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLng.push_back(idx);
#endif
} else
has_errors = true;
}
@@ -655,7 +392,7 @@ int _tmain(int argc, _TCHAR *argv[])
// Sort indices.
db.idxChr .sort();
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLang.sort();
db.idxLng.sort();
#endif
// Write language characters to file.
@@ -680,8 +417,8 @@ int _tmain(int argc, _TCHAR *argv[])
ZRCola::chrgrp_db db;
// Preallocate memory.
db.idxRank.reserve(count);
db.data .reserve(count*4);
db.idxRnk.reserve(count);
db.data .reserve(count*4);
// Parse character groups and build index and data.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
@@ -696,13 +433,30 @@ int _tmain(int argc, _TCHAR *argv[])
}
// Add character group to index and data.
db << cg;
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= cg.id && cg.id <= (int)0x00007fff, wxT("character group ID out of bounds"));
db.data.push_back((unsigned __int16)cg.id);
wxASSERT_MSG((int)0xffff8000 <= cg.rank && cg.rank <= (int)0x00007fff, wxT("character group rank out of bounds"));
db.data.push_back((unsigned __int16)cg.rank);
wstring::size_type n_name = cg.name.length();
wxASSERT_MSG(n_name <= 0xffff, wxT("character group name too long"));
db.data.push_back((unsigned __int16)n_name);
wstring::size_type n_char = cg.chars.length();
wxASSERT_MSG(n_char <= 0xffff, wxT("too many character group characters"));
db.data.push_back((unsigned __int16)n_char);
for (wstring::size_type i = 0; i < n_name; i++)
db.data.push_back(cg.name[i]);
for (wstring::size_type i = 0; i < n_char; i++)
db.data.push_back(cg.chars[i]);
for (std::vector<unsigned __int16>::size_type i = 0, n = cg.show.size(); i < n; i++)
db.data.push_back(cg.show[i]);
db.idxRnk.push_back(idx);
} else
has_errors = true;
}
// Sort indices.
db.idxRank.sort();
db.idxRnk.sort();
// Write character groups to file.
dst << ZRCola::chrgrp_rec(db);
@@ -731,10 +485,11 @@ int _tmain(int argc, _TCHAR *argv[])
// Phase 1: Parse characters and build indexes.
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read character from the database.
ZRCola::DBSource::character chr;
if (src.GetCharacter(rs, chr))
chrs[chr.first] = std::move(chr.second);
else
unique_ptr<ZRCola::DBSource::character> c(new ZRCola::DBSource::character);
if (src.GetCharacter(rs, *c)) {
const auto &chr = *c.get();
chrs[chr.chr].swap(c);
} else
has_errors = true;
}
@@ -748,16 +503,33 @@ int _tmain(int argc, _TCHAR *argv[])
db.data .reserve(count*4);
// Phase 3: Parse characters and build index and data.
for (auto chr = chrs.cbegin(), chr_end = chrs.cend(); chr != chr_end; ++chr) {
for (size_t i = 0, i_end = chrs.size(); i < i_end; i++) {
const auto &chr = *(chrs[i].get());
if (&chr == NULL) continue;
// Add character to index and data.
db << *chr;
unsigned __int32 idx = db.data.size();
db.data.push_back((unsigned __int16)chr.chr);
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)chr.cat.data)[i]);
wstring::size_type n_desc = chr.desc.length();
wxASSERT_MSG(n_desc <= 0xffff, wxT("character description too long"));
db.data.push_back((unsigned __int16)n_desc);
wstring::size_type n_rel = chr.rel.length();
wxASSERT_MSG(n_rel <= 0xffff, wxT("too many related characters"));
db.data.push_back((unsigned __int16)n_rel);
for (wstring::size_type i = 0; i < n_desc; i++)
db.data.push_back(chr.desc[i]);
for (wstring::size_type i = 0; i < n_rel; i++)
db.data.push_back(chr.rel[i]);
db.idxChr.push_back(idx);
// Add description (and keywords) to index.
idxChrDsc .add_keywords(chr->second.terms, chr->first, 0);
idxChrDscSub.add_keywords(chr->second.terms, chr->first, 3);
idxChrDsc .add_keywords(chr.terms, chr.chr, 0);
idxChrDscSub.add_keywords(chr.terms, chr.chr, 3);
// Mark category used.
categories_used.insert(chr->second.cat);
categories_used.insert(chr.cat);
}
// Sort indices.
@@ -790,7 +562,7 @@ int _tmain(int argc, _TCHAR *argv[])
// Preallocate memory.
db.idxChrCat.reserve(count);
db.idxRank .reserve(count);
db.idxRnk .reserve(count);
db.data .reserve(count*4);
// Parse character categories and build index and data.
@@ -800,20 +572,31 @@ int _tmain(int argc, _TCHAR *argv[])
if (build_pot)
pot.insert(cc.name);
if (categories_used.find(cc.cat) == categories_used.end()) {
if (categories_used.find(cc.id) == categories_used.end()) {
// Skip empty character categories.
continue;
}
// Add character category to index and data.
db << cc;
unsigned __int32 idx = db.data.size();
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)cc.id.data)[i]);
wxASSERT_MSG((int)0xffff8000 <= cc.rank && cc.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
db.data.push_back((unsigned __int16)cc.rank);
wstring::size_type n_name = cc.name.length();
wxASSERT_MSG(n_name <= 0xffff, wxT("character category name too long"));
db.data.push_back((unsigned __int16)n_name);
for (wstring::size_type i = 0; i < n_name; i++)
db.data.push_back(cc.name[i]);
db.idxChrCat.push_back(idx);
db.idxRnk .push_back(idx);
} else
has_errors = true;
}
// Sort indices.
db.idxChrCat.sort();
db.idxRank .sort();
db.idxRnk .sort();
// Write character categories to file.
dst << ZRCola::chrcat_rec(db);
@@ -846,13 +629,18 @@ int _tmain(int argc, _TCHAR *argv[])
// Read characters tags from the database.
if (src.GetCharacterTag(rs, ct)) {
// Add characters tags to index and data.
db << ct;
unsigned __int32 idx = db.data.size();
db.data.push_back(ct.chr);
wxASSERT_MSG((int)0xffff8000 <= ct.tag && ct.tag <= (int)0x00007fff, wxT("tag out of bounds"));
db.data.push_back((unsigned __int16)ct.tag);
db.idxChr.push_back(idx);
db.idxTag.push_back(idx);
} else
has_errors = true;
}
// Sort indices.
db.idxChr.sort();
db.idxChr .sort();
db.idxTag.sort();
// Write characters tags to file.
@@ -886,7 +674,22 @@ int _tmain(int argc, _TCHAR *argv[])
// Read tag name from the database.
if (src.GetTagName(rs, tn)) {
// Add tag name to index and data.
db << tn;
for (auto ln = tn.names.cbegin(), ln_end = tn.names.cend(); ln != ln_end; ++ln) {
for (auto nm = ln->second.cbegin(), nm_end = ln->second.cend(); nm != nm_end; ++nm) {
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= tn.tag && tn.tag <= (int)0x00007fff, wxT("tag out of bounds"));
db.data.push_back((unsigned __int16)tn.tag);
db.data.push_back(LOWORD(ln->first));
db.data.push_back(HIWORD(ln->first));
wstring::size_type n = nm->length();
wxASSERT_MSG(n <= 0xffff, wxT("tag name too long"));
db.data.push_back((unsigned __int16)n);
for (wstring::size_type i = 0; i < n; i++)
db.data.push_back(nm->at(i));
db.idxName.push_back(idx);
db.idxTag .push_back(idx);
}
}
} else
has_errors = true;
}
@@ -916,9 +719,9 @@ int _tmain(int argc, _TCHAR *argv[])
if (!has_errors && build_pot) {
const wxString& filenamePot = parser.GetParam(2);
fstream dst_pot((LPCTSTR)filenamePot, ios_base::out | ios_base::trunc);
if (dst_pot.good()) {
dst_pot << "msgid \"\"" << endl
fstream dst((LPCTSTR)filenamePot, ios_base::out | ios_base::trunc);
if (dst.good()) {
dst << "msgid \"\"" << endl
<< "msgstr \"\"" << endl
<< "\"Project-Id-Version: ZRCola.zrcdb\\n\"" << endl
<< "\"Language: en\\n\"" << endl
@@ -928,9 +731,9 @@ int _tmain(int argc, _TCHAR *argv[])
<< "\"X-Generator: ZRColaCompile\\n\"" << endl;
wstring_convert<codecvt_utf8<wchar_t>> conv;
for (auto p = pot.cbegin(); p != pot.cend(); ++p) {
for (auto i = pot.cbegin(); i != pot.cend(); ++i) {
// Convert UTF-16 to UTF-8 and escape.
string t(conv.to_bytes(*p)), u;
string t(conv.to_bytes(*i)), u;
for (size_t i = 0, n = t.size(); i < n; i++) {
char c = t[i];
switch (c) {
@@ -941,17 +744,17 @@ int _tmain(int argc, _TCHAR *argv[])
default : u += c;
}
}
dst_pot << endl
dst << endl
<< "msgid \"" << u << "\"" << endl
<< "msgstr \"\"" << endl;
}
if (dst_pot.fail()) {
if (dst.fail()) {
_ftprintf(stderr, wxT("%s: error ZCC0013: Writing to POT catalog failed.\n"), (LPCTSTR)filenameOut.c_str());
has_errors = true;
}
dst_pot.close();
dst.close();
} else {
_ftprintf(stderr, wxT("%s: error ZCC0012: Error opening POT catalog.\n"), filenameOut.fn_str());
has_errors = true;

View File

@@ -1,212 +0,0 @@
/*
Copyright 2018 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
using namespace std;
using namespace stdex;
using namespace winstd;
//////////////////////////////////////////////////////////////////////////
// ZRCola::DecompParser
//////////////////////////////////////////////////////////////////////////
ZRCola::DecompParser::DecompParser(_In_ const std::wstring &decomposed) : m_decomposed(decomposed)
{
if (m_decomposed.empty()) {
m_sym = 0;
m_idx = 0;
} else {
m_sym = m_decomposed[0];
m_idx = 1;
}
}
void ZRCola::DecompParser::ParsePrefixes(_Inout_ std::vector<wchar_t> &prefix)
{
for (;;) {
if (
m_sym == 0x203F || // Undertie
0xE0F0 <= m_sym && m_sym <= 0xE0F3 || // 1st Set of Prefix Modifiers
m_sym == 0xE0F6 || // Above
m_sym == 0xE0F7 || // Below
0xE0F8 <= m_sym && m_sym <= 0xE0FC) // 2nd Set of Prefix Modifiers
{
// Prefix modifier
prefix.push_back(m_sym);
NextChar();
} else
break;
}
}
void ZRCola::DecompParser::ParseModifiers(_Inout_ std::vector<wchar_t> &mod)
{
for (;;) {
if (0xE000 <= m_sym && m_sym <= 0xE05B || // 1st Set of Modifiers
0xE063 <= m_sym && m_sym <= 0xE0BE || // 2nd Set of Modifiers
m_sym == 0x0023 || // Number Sign
m_sym == 0x003A || // Colon
m_sym == 0x02DE || // Rhotic Hook
m_sym == 0x2019 || // Right Single Quotation Mark
0x02B0 <= m_sym && m_sym <= 0x02FF || // Standard Unicode Modifiers
m_sym == 0xE0C0 || // Circle
m_sym == 0xE0C2 || // Square
m_sym == 0xE0CA || // Diamond
m_sym == 0xE0CD) // Not Circle
{
mod.push_back(m_sym);
NextChar();
} else
break;
}
}
ZRCola::DecompParser::Expression* ZRCola::DecompParser::ParseParentheses(_In_ wchar_t open, _In_ wchar_t close)
{
if (m_sym == open) {
// Parenthesis Start
NextChar();
if (m_sym == 0xE037) {
// EVA Parenthesis End
unique_ptr<Character> res(new Character(close));
NextChar();
return res.release();
} else {
unique_ptr<Parentheses> res(new Parentheses(open, close, ParseExpression()));
if (m_sym == close) {
// Parenthesis End
NextChar();
} else if (m_sym == open && m_idx < m_decomposed.length() && m_decomposed[m_idx] == 0xE037) {
// Decomposed Parenthesis End
NextChar();
NextChar();
} else
throw invalid_argument(string_printf("%lc is unexpected. Should end with %lc.", m_sym, close));
return res.release();
}
} else
return NULL;
}
ZRCola::DecompParser::Expression* ZRCola::DecompParser::ParseCharacter()
{
Expression *res_p;
if ((res_p = ParseParentheses(0xE0C5, 0xE0C6)) != NULL || // Superscript
(res_p = ParseParentheses(0xE0CE, 0xE0CF)) != NULL || // Subscript
(res_p = ParseParentheses(0xE2E0, 0xE2E1)) != NULL || // EVA Double
(res_p = ParseParentheses(0xE2E2, 0xE2E3)) != NULL || // EVA Condensed
(res_p = ParseParentheses(0xE2E4, 0xE2E5)) != NULL || // EVA Emphasis
(res_p = ParseParentheses(0xE2E6, 0xE2E7)) != NULL || // EVA Strike
(res_p = ParseParentheses(0xE2E8, 0xE2E9)) != NULL || // EVA Undeal
(res_p = ParseParentheses(0xE2EA, 0xE2EB)) != NULL || // EVA Italic
(res_p = ParseParentheses(0xE2EC, 0xE2ED)) != NULL || // EVA Superscript
(res_p = ParseParentheses(0xE2EE, 0xE2EF)) != NULL) // EVA Subscript
{
return res_p;
}
unique_ptr<Character> res(new Character());
ParsePrefixes(res->m_prefix);
if (m_sym < 0xE000 || 0xE0FC < m_sym ||
m_sym == 0xE0D6 || // Clockwise Top Semicircle Arrow
m_sym == 0xE0D7) // Anticlockwise Top Semicircle Arrow
{
// Base Character
res->m_char = m_sym;
NextChar();
}
ParseModifiers(res->m_mod);
return res.release();
}
ZRCola::DecompParser::Expression* ZRCola::DecompParser::ParseTerm()
{
unique_ptr<Ligature> res(new Ligature(ParseCharacter()));
while (m_sym == 0xE0C4) {
// Ligature
std::unique_ptr<Ligature::Element> res2(new Ligature::Element(m_sym));
NextChar();
ParseModifiers(res2->m_mod);
res2->m_el.reset(ParseCharacter());
res->m_rest.push_back(std::move(res2));
}
if (res->m_rest.empty()) {
// A ligature of, well one single character, is rather a character alone.
return res->m_first.release();
} else
return res.release();
}
ZRCola::DecompParser::Expression* ZRCola::DecompParser::ParseExpression()
{
unique_ptr<Expression> res(ParseTerm());
if (0xE05C <= m_sym && m_sym <= 0xE062 ||
m_sym == 0xE0C1 || // Two Characters in Circle
m_sym == 0xE0C3 || // Two Characters in Square
m_sym == 0xE0C7 || // Breved below
m_sym == 0xE0CB || // Inverse tilded
m_sym == 0xE0CC || // Diagonally Barred
0xE0D0 <= m_sym && m_sym <= 0xE0D5)
{
// Joiner of two terms
unique_ptr<Joined2> res_j(new Joined2(m_sym, res.release()));
NextChar();
ParseModifiers(res_j->m_mod);
res_j->m_second.reset(ParseTerm());
return res_j.release();
} else if (
m_sym == 0xE0C8 || // Inverse breved
m_sym == 0xE0C9) // Breved below
{
// Joiner of three terms
unique_ptr<Joined3> res_j(new Joined3(m_sym, res.release()));
NextChar();
ParseModifiers(res_j->m_mod);
res_j->m_second.reset(ParseTerm());
res_j->m_third.reset(ParseTerm());
return res_j.release();
} else
return res.release();
}
ZRCola::DecompParser::Expression* ZRCola::DecompParser::Parse()
{
unique_ptr<Expression> res(ParseExpression());
if (m_sym)
throw invalid_argument("Unexpected trailing character(s).");
return res.release();
}

View File

@@ -1,154 +0,0 @@
/*
Copyright 2018 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <sal.h>
#include <list>
#include <memory>
#include <string>
#include <vector>
namespace ZRCola {
///
/// Decomposed sequence parser
///
class DecompParser
{
public:
///
/// Base class for expressions
///
class Expression
{
};
///
/// Expression in "parentheses"
///
class Parentheses : public Expression
{
public:
inline Parentheses(_In_opt_ wchar_t open = 0, _In_opt_ wchar_t close = 0, _In_opt_ Expression *expr = NULL) : m_open(open), m_close(close), m_expr(expr) {}
public:
wchar_t m_open, m_close;
std::unique_ptr<Expression> m_expr;
};
///
/// Operator
///
class Operator : public Expression
{
public:
inline Operator(_In_opt_ wchar_t chr = 0) : m_char(chr) {}
wchar_t m_char;
std::vector<wchar_t> m_mod;
};
///
/// Character
///
class Character : public Operator
{
public:
inline Character(_In_opt_ wchar_t chr = 0) : Operator(chr) {}
std::vector<wchar_t> m_prefix;
};
///
/// Ligature
///
class Ligature : public Expression
{
public:
class Element : public Operator
{
public:
inline Element(_In_opt_ wchar_t chr = 0) : Operator(chr) {}
std::unique_ptr<Expression> m_el;
};
inline Ligature(_In_opt_ Expression *first = NULL) : m_first(first) {}
std::unique_ptr<Expression> m_first;
std::list<std::unique_ptr<Element> > m_rest;
};
///
/// Two joined terms
///
class Joined2 : public Operator
{
public:
Joined2(_In_opt_ wchar_t chr = 0, _In_opt_ Expression *first = NULL) : Operator(chr), m_first(first) {}
std::unique_ptr<Expression> m_first, m_second;
};
///
/// Three joined terms
///
class Joined3 : public Joined2
{
public:
Joined3(_In_opt_ wchar_t chr = 0, _In_opt_ Expression *first = NULL) : Joined2(chr, first) {}
std::unique_ptr<Expression> m_third;
};
public:
DecompParser(_In_ const std::wstring &decomposed);
protected:
inline void NextChar();
void ParsePrefixes(_Inout_ std::vector<wchar_t> &prefix);
void ParseModifiers(_Inout_ std::vector<wchar_t> &mod);
Expression* ParseParentheses(_In_ wchar_t open, _In_ wchar_t close);
Expression* ParseCharacter();
Expression* ParseTerm();
Expression* ParseExpression();
public:
Expression* Parse();
protected:
std::wstring::size_type m_idx; ///< Index of current character
const std::wstring &m_decomposed; ///< Decomposed character sequence to analyse
wchar_t m_sym; ///< Current character
};
}
inline void ZRCola::DecompParser::NextChar()
{
m_sym = m_idx < m_decomposed.length() ? m_decomposed[m_idx++] : 0;
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -21,7 +21,12 @@
#include "../include/version.h"
#include "dbsource.h"
#include "parse.h"
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <zrcola/tag.h>
#include <zrcolaui/chargroup.h>
#include <zrcolaui/keyboard.h>
#include <wx/app.h>
#include <wx/cmdline.h>
@@ -36,11 +41,8 @@
#include <WinStd/Common.h>
#include <initguid.h> // GUID helper to prevent LNK2001 errors (unresolved external symbol IID_IADO...)
#pragma warning(push)
#pragma warning(disable: 4091)
#include <adoint.h>
#include <adoid.h>
#pragma warning(pop)
#include <process.h>
#include <tchar.h>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -14,21 +14,18 @@
<ProjectGuid>{620D6AC0-C8FF-4185-B820-DB1503ACB95C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallDe</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -14,21 +14,18 @@
<ProjectGuid>{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallEn</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -14,21 +14,18 @@
<ProjectGuid>{2551B561-5E5B-497E-AE01-11519F91EF19}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallRu</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -14,21 +14,18 @@
<ProjectGuid>{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallSl</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,8 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2016
MinimumVisualStudioVersion = 10.0.40219.1
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRCola", "lib\libZRCola\build\libZRCola.vcxproj", "{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}"
@@ -14,9 +12,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaCompile", "ZRColaCompile\ZRColaCompile.vcxproj", "{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendLib-15.0.vcxproj", "{D3E29951-D9F5-486D-A167-20AE8E90B1FA}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendDll-10.0.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex-15.0.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex-10.0.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRColaUI\build\libZRColaUI.vcxproj", "{C0A84BD2-3870-4CD6-B281-0AB322E3C579}"
EndProject
@@ -30,70 +28,99 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaInstallEn", "ZRColaIn
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRColaInstallRu", "ZRColaInstall\ZRColaInstallRu.vcxproj", "{2551B561-5E5B-497E-AE01-11519F91EF19}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-15.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd-10.0.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x86.ActiveCfg = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x86.Build.0 = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x86.ActiveCfg = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x86.Build.0 = Release|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Debug|x86.ActiveCfg = Debug|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Debug|x86.Build.0 = Debug|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Release|x86.ActiveCfg = Release|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Release|x86.Build.0 = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x86.ActiveCfg = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Debug|x86.Build.0 = Debug|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x86.ActiveCfg = Release|Win32
{D3E29951-D9F5-486D-A167-20AE8E90B1FA}.Release|x86.Build.0 = Release|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|x86.ActiveCfg = Debug|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Debug|x86.Build.0 = Debug|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x86.ActiveCfg = Release|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x86.Build.0 = Release|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x86.ActiveCfg = Debug|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x86.Build.0 = Debug|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x86.ActiveCfg = Release|Win32
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|x86.Build.0 = Release|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Debug|x86.ActiveCfg = Debug|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Debug|x86.Build.0 = Debug|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Release|x86.ActiveCfg = Release|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Release|x86.Build.0 = Release|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Debug|x86.ActiveCfg = Debug|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Debug|x86.Build.0 = Debug|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Release|x86.ActiveCfg = Release|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Release|x86.Build.0 = Release|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|x86.ActiveCfg = Debug|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|x86.Build.0 = Debug|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|x86.ActiveCfg = Release|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Release|x86.Build.0 = Release|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Debug|x86.ActiveCfg = Debug|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Debug|x86.Build.0 = Debug|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Release|x86.ActiveCfg = Release|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Release|x86.Build.0 = Release|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x86.ActiveCfg = Debug|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x86.Build.0 = Debug|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x86.ActiveCfg = Release|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x86.Build.0 = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|Win32.ActiveCfg = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|Win32.Build.0 = Debug|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x64.ActiveCfg = Debug|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Debug|x64.Build.0 = Debug|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|Win32.ActiveCfg = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|Win32.Build.0 = Release|Win32
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x64.ActiveCfg = Release|x64
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}.Release|x64.Build.0 = Release|x64
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Debug|Win32.ActiveCfg = Debug|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Debug|Win32.Build.0 = Debug|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Debug|x64.ActiveCfg = Debug|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Release|Win32.ActiveCfg = Release|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Release|Win32.Build.0 = Release|Win32
{87A3ADEC-1BE4-42E4-92B8-B742F3D21BC4}.Release|x64.ActiveCfg = Release|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|Win32.ActiveCfg = Debug|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|Win32.Build.0 = Debug|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|x64.ActiveCfg = Debug|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Debug|x64.Build.0 = Debug|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|Win32.ActiveCfg = Release|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|Win32.Build.0 = Release|Win32
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|x64.ActiveCfg = Release|x64
{A3A36689-AC35-4026-93DA-A3BA0C0E767C}.Release|x64.Build.0 = Release|x64
{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|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
{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|x64.ActiveCfg = Debug|x64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Debug|x64.Build.0 = Debug|x64
{C0A84BD2-3870-4CD6-B281-0AB322E3C579}.Release|Win32.ActiveCfg = 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.Build.0 = Release|x64
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Debug|Win32.ActiveCfg = Debug|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Debug|Win32.Build.0 = Debug|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Debug|x64.ActiveCfg = Debug|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Release|Win32.ActiveCfg = Release|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Release|Win32.Build.0 = Release|Win32
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}.Release|x64.ActiveCfg = Release|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Debug|Win32.ActiveCfg = Debug|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Debug|Win32.Build.0 = Debug|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Debug|x64.ActiveCfg = Debug|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Release|Win32.ActiveCfg = Release|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Release|Win32.Build.0 = Release|Win32
{620D6AC0-C8FF-4185-B820-DB1503ACB95C}.Release|x64.ActiveCfg = Release|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|Win32.ActiveCfg = Debug|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|Win32.Build.0 = Debug|Win32
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}.Debug|x64.ActiveCfg = Debug|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|x64.ActiveCfg = Release|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Debug|Win32.ActiveCfg = Debug|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Debug|Win32.Build.0 = Debug|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Debug|x64.ActiveCfg = Debug|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Release|Win32.ActiveCfg = Release|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Release|Win32.Build.0 = Release|Win32
{2551B561-5E5B-497E-AE01-11519F91EF19}.Release|x64.ActiveCfg = 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}.Debug|x64.ActiveCfg = Debug|x64
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x64.Build.0 = Debug|x64
{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
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
{D3E29951-D9F5-486D-A167-20AE8E90B1FA} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
{A3A36689-AC35-4026-93DA-A3BA0C0E767C} = {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}
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A} = {7F5D45A3-B3D2-4B1D-B258-9B83395786E6}
{620D6AC0-C8FF-4185-B820-DB1503ACB95C} = {7F5D45A3-B3D2-4B1D-B258-9B83395786E6}
{5BD95B95-38B0-4C7D-9471-F99CA1203DF4} = {7F5D45A3-B3D2-4B1D-B258-9B83395786E6}
{2551B561-5E5B-497E-AE01-11519F91EF19} = {7F5D45A3-B3D2-4B1D-B258-9B83395786E6}
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {A7D28E0C-BB96-444D-AAB0-F22A6483FE5F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {22B0355E-423C-4ACC-81F8-DAD72A8BEC0E}
EndGlobalSection
EndGlobal

View File

@@ -1,320 +0,0 @@
<?xml version="1.0"?>
<!--
Copyright 2017 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
-->
<package>
<job id="CanoPerm">
<runtime>
<description>Generates character index permutations - Amebis, Copyright © 2017</description>
<unnamed name="&lt;Pattern&gt;" 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:
CanoPerm.wsf &quot;X01112&quot;
</example>
</runtime>
<script language="JScript"><![CDATA[
if (WScript.Arguments.Unnamed.Length < 1) {
WScript.Arguments.ShowUsage();
WScript.Quit(1);
}
var
pattern_src = WScript.Arguments.Unnamed(0),
pattern = new Array();
// Parse pattern.
for (var i = 0, n = pattern_src.length; i < n; i++) {
switch (pattern_src.charAt(i).toUpperCase()) {
case 'X': pattern.push(new Character(-1, i)); break;
case '0': pattern.push(new Character( 0, i)); break;
case '1': pattern.push(new Character( 1, i)); break;
case '2': pattern.push(new Character( 2, i)); break;
case '3': pattern.push(new Character( 3, i)); break;
case '4': pattern.push(new Character( 4, i)); break;
case '5': pattern.push(new Character( 5, i)); break;
case '6': pattern.push(new Character( 6, i)); break;
case '7': pattern.push(new Character( 7, i)); break;
case '8': pattern.push(new Character( 8, i)); break;
case '9': pattern.push(new Character( 9, i)); break;
default:
throw new Error("Character '" + pattern_src.charAt(i) + "' is not a valid pattern character. Only 0-9 and X are allowed.");
}
}
var output = "";
Permutate(pattern, "");
WScript.Echo(output);
function Character(grp, idx)
{
this.group = grp;
this.index = idx;
return this;
}
function Permutate(pattern, prefix)
{
var n = pattern.length;
if (n) {
if (pattern[0].group < 0) {
// Unmoveable character.
var c = pattern.shift();
Permutate(pattern, prefix + c.index);
} else {
var found = new Array();
for (var i = 0; i < n; i++) {
var c = pattern[i];
if (c.group < 0) {
// Unmoveable character.
break;
} else {
if (!(c.group in found)) {
var p = pattern.slice(0);
p.splice(i, 1);
Permutate(p, prefix + c.index);
found[c.group] = true;
}
}
}
}
} else {
// This is the end.
output += (output.length ? "," : "") + prefix;
}
}
WScript.Quit(0);
]]></script>
</job>
<signature>
** SIG ** MIIbHwYJKoZIhvcNAQcCoIIbEDCCGwwCAQExCzAJBgUr
** SIG ** DgMCGgUAMGcGCisGAQQBgjcCAQSgWTBXMDIGCisGAQQB
** SIG ** gjcCAR4wJAIBAQQQcAVhGs441BGiowAQS9NQkAIBAAIB
** SIG ** AAIBAAIBAAIBADAhMAkGBSsOAwIaBQAEFHAC354udFC3
** SIG ** lTRyP4Y74iqurVPyoIIKLzCCBM4wggO2oAMCAQICEDB6
** SIG ** NnqqPmiBpvlPCMs7OWQwDQYJKoZIhvcNAQELBQAwfzEL
** SIG ** MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENv
** SIG ** cnBvcmF0aW9uMR8wHQYDVQQLExZTeW1hbnRlYyBUcnVz
** SIG ** dCBOZXR3b3JrMTAwLgYDVQQDEydTeW1hbnRlYyBDbGFz
** SIG ** cyAzIFNIQTI1NiBDb2RlIFNpZ25pbmcgQ0EwHhcNMTUx
** SIG ** MDA5MDAwMDAwWhcNMTgxMTA3MjM1OTU5WjBhMQswCQYD
** SIG ** VQQGEwJTSTERMA8GA1UECBMIU2xvdmVuaWExDzANBgNV
** SIG ** BAcTBkthbW5pazEWMBQGA1UEChQNQW1lYmlzIGQuby5v
** SIG ** LjEWMBQGA1UEAxQNQW1lYmlzIGQuby5vLjCCASIwDQYJ
** SIG ** KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfy6Bdwx2kq
** SIG ** yGhtaYAZgcA8pWLe7EbyLqBHRq/8jIVfUX1CH7fsbEz1
** SIG ** UDgIq74BvilG3BNyjJxh/lbiu2Pr2M0ad3WEy4p0kM9T
** SIG ** SmABC8k3Vc5pmJlNy1++uMpNwAbUmbGcD6Igsvk1xPWb
** SIG ** ApLoAdnO0KfTfzvRI40A0cGZVGt5y6GPemN6jT8JAp9O
** SIG ** KaWIqj3iF00c/FwS7ODZf2w/cMphLjUle+b86GyewVGE
** SIG ** MEVO5ZjS9ksEWBDWn9A6XYshSwbDWnx4xmIl0B4DcWVA
** SIG ** aY+zqEQzQbzEGC/izPDq44RiCtbhi+QqgQ/6fNXm3hbA
** SIG ** GVcYPYa4J5D1UMO+1NC2cPMCAwEAAaOCAWIwggFeMAkG
** SIG ** A1UdEwQCMAAwDgYDVR0PAQH/BAQDAgeAMCsGA1UdHwQk
** SIG ** MCIwIKAeoByGGmh0dHA6Ly9zdi5zeW1jYi5jb20vc3Yu
** SIG ** Y3JsMGYGA1UdIARfMF0wWwYLYIZIAYb4RQEHFwMwTDAj
** SIG ** BggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9j
** SIG ** cHMwJQYIKwYBBQUHAgIwGQwXaHR0cHM6Ly9kLnN5bWNi
** SIG ** LmNvbS9ycGEwEwYDVR0lBAwwCgYIKwYBBQUHAwMwVwYI
** SIG ** KwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8v
** SIG ** c3Yuc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8v
** SIG ** c3Yuc3ltY2IuY29tL3N2LmNydDAfBgNVHSMEGDAWgBSW
** SIG ** O1PweTOXr32D7y4rzMq3hh5yZjAdBgNVHQ4EFgQU9we9
** SIG ** loCaLXTEfww9PSfd1JAKn8wwDQYJKoZIhvcNAQELBQAD
** SIG ** ggEBAIpxL0AvtcrbShLKgI7dmLn6WJbpdzkB9e2Cm1Mu
** SIG ** AAIiogLFF1n07l0VXZE+gqxGHB8ji2h33t+o1R8PLyyI
** SIG ** kdnMhHAd78HsqyZzabfmWuCP12TKBv77wiZkpbTo/Av+
** SIG ** z0SlpJRoMpzzXhyPPtHdby80bSu+4RXlewiDCH56aGE4
** SIG ** SSk0i8Xa9JJ/ozPKLX3Szdmg6J58XtDH/tq5K1/ABSCB
** SIG ** z6SF2Y9l9lRJpGXchSDYCPipSVUGP0WPQRTDNobSwCJD
** SIG ** XAz9UFcxWo4Rh8o/gvlLWUH+T3HhmLSRzXqt3JuqJo5x
** SIG ** H8s4vPzcGBZZFob8yRB98KD6ioFK2pjRRSw9FucwggVZ
** SIG ** MIIEQaADAgECAhA9eNf5dklgsmF99PAeyoYqMA0GCSqG
** SIG ** SIb3DQEBCwUAMIHKMQswCQYDVQQGEwJVUzEXMBUGA1UE
** SIG ** ChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
** SIG ** aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAy
** SIG ** MDA2IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6
** SIG ** ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENs
** SIG ** YXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlv
** SIG ** biBBdXRob3JpdHkgLSBHNTAeFw0xMzEyMTAwMDAwMDBa
** SIG ** Fw0yMzEyMDkyMzU5NTlaMH8xCzAJBgNVBAYTAlVTMR0w
** SIG ** GwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0G
** SIG ** A1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEwMC4G
** SIG ** A1UEAxMnU3ltYW50ZWMgQ2xhc3MgMyBTSEEyNTYgQ29k
** SIG ** ZSBTaWduaW5nIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
** SIG ** AQ8AMIIBCgKCAQEAl4MeABavLLHSCMTXaJNRYB5x9uJH
** SIG ** tNtYTSNiarS/WhtR96MNGHdou9g2qy8hUNqe8+dfJ04L
** SIG ** wpfICXCTqdpcDU6kDZGgtOwUzpFyVC7Oo9tE6VIbP0E8
** SIG ** ykrkqsDoOatTzCHQzM9/m+bCzFhqghXuPTbPHMWXBySO
** SIG ** 8Xu+MS09bty1mUKfS2GVXxxw7hd924vlYYl4x2gbrxF4
** SIG ** GpiuxFVHU9mzMtahDkZAxZeSitFTp5lbhTVX0+qTYmEg
** SIG ** CscwdyQRTWKDtrp7aIIx7mXK3/nVjbI13Iwrb2pyXGCE
** SIG ** nPIMlF7AVlIASMzT+KV93i/XE+Q4qITVRrgThsIbnepa
** SIG ** ON2b2wIDAQABo4IBgzCCAX8wLwYIKwYBBQUHAQEEIzAh
** SIG ** MB8GCCsGAQUFBzABhhNodHRwOi8vczIuc3ltY2IuY29t
** SIG ** MBIGA1UdEwEB/wQIMAYBAf8CAQAwbAYDVR0gBGUwYzBh
** SIG ** BgtghkgBhvhFAQcXAzBSMCYGCCsGAQUFBwIBFhpodHRw
** SIG ** Oi8vd3d3LnN5bWF1dGguY29tL2NwczAoBggrBgEFBQcC
** SIG ** AjAcGhpodHRwOi8vd3d3LnN5bWF1dGguY29tL3JwYTAw
** SIG ** BgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vczEuc3ltY2Iu
** SIG ** Y29tL3BjYTMtZzUuY3JsMB0GA1UdJQQWMBQGCCsGAQUF
** SIG ** BwMCBggrBgEFBQcDAzAOBgNVHQ8BAf8EBAMCAQYwKQYD
** SIG ** VR0RBCIwIKQeMBwxGjAYBgNVBAMTEVN5bWFudGVjUEtJ
** SIG ** LTEtNTY3MB0GA1UdDgQWBBSWO1PweTOXr32D7y4rzMq3
** SIG ** hh5yZjAfBgNVHSMEGDAWgBR/02Wnwt3su/AwCfNDOfoC
** SIG ** rzMxMzANBgkqhkiG9w0BAQsFAAOCAQEAE4UaHmmpN/eg
** SIG ** vaSvfh1hU/6djF4MpnUeeBcj3f3sGgNVOftxlcdlWqeO
** SIG ** MNJEWmHbcG/aIQXCLnO6SfHRk/5dyc1eA+CJnj90Htf3
** SIG ** OIup1s+7NS8zWKiSVtHITTuC5nmEFvwosLFH8x2iPu6H
** SIG ** 2aZ/pFalP62ELinefLyoqqM9BAHqupOiDlAiKRdMh+Q6
** SIG ** EV/WpCWJmwVrL7TJAUwnewusGQUioGAVP9rJ+01Mj/ty
** SIG ** Z3f9J5THujUOiEn+jf0or0oSvQ2zlwXeRAwV+jYrA9zB
** SIG ** UAHxoRFdFOXivSdLVL4rhF4PpsN0BQrvl8OJIrEfd/O9
** SIG ** zUPU8UypP7WLhK9k8tAUITGCEFwwghBYAgEBMIGTMH8x
** SIG ** CzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBD
** SIG ** b3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1
** SIG ** c3QgTmV0d29yazEwMC4GA1UEAxMnU3ltYW50ZWMgQ2xh
** SIG ** c3MgMyBTSEEyNTYgQ29kZSBTaWduaW5nIENBAhAwejZ6
** SIG ** qj5ogab5TwjLOzlkMAkGBSsOAwIaBQCgcDAQBgorBgEE
** SIG ** AYI3AgEMMQIwADAZBgkqhkiG9w0BCQMxDAYKKwYBBAGC
** SIG ** NwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIB
** SIG ** FTAjBgkqhkiG9w0BCQQxFgQUdlEhxAuBWm0MlKArFsW7
** SIG ** wUJuFFgwDQYJKoZIhvcNAQEBBQAEggEAOMbNA+eBRdXb
** SIG ** PwzUC3rlnPZpzU2U9GE4Px79FkQav1Ml8uAeyxtGA4Tr
** SIG ** 0e/f5AX4HS12RIwmd7yOOuUvbyJcNp8+F/ThfGouS/tl
** SIG ** UKUCJ4kHtF19H3MBUU2qdG1DAzFFwwzH/8ZT5ekodidY
** SIG ** yFW2K09+1hIm83WxsL9+61bdLRjzz6FNNhIX1UXvrMf2
** SIG ** IioYdJjA/nlL7ot3FOflIvvHRbxMCkaUWpb+AKI5jnB5
** SIG ** CBBMhYL6vKy6gv9d5Kgqtiwy9AJF8w8gxJWcQ0tAKkGT
** SIG ** AE4sUBjPrHzwjT66hscTWT5KAVkG8CT1JLiMKMxWKu7z
** SIG ** IrolLvLRlSDa5Vvep3mLY6GCDiswgg4nBgorBgEEAYI3
** SIG ** AwMBMYIOFzCCDhMGCSqGSIb3DQEHAqCCDgQwgg4AAgED
** SIG ** MQ0wCwYJYIZIAWUDBAIBMIH+BgsqhkiG9w0BCRABBKCB
** SIG ** 7gSB6zCB6AIBAQYLYIZIAYb4RQEHFwMwITAJBgUrDgMC
** SIG ** GgUABBREu5UsXoPHdh84kBIceHhZTKaw7QIUbmqb3qOo
** SIG ** cAbKtAp5GBBU4Yf8xy0YDzIwMTcwNzEyMTM0NTIzWjAD
** SIG ** AgEeoIGGpIGDMIGAMQswCQYDVQQGEwJVUzEdMBsGA1UE
** SIG ** ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsT
** SIG ** FlN5bWFudGVjIFRydXN0IE5ldHdvcmsxMTAvBgNVBAMT
** SIG ** KFN5bWFudGVjIFNIQTI1NiBUaW1lU3RhbXBpbmcgU2ln
** SIG ** bmVyIC0gRzKgggqLMIIFODCCBCCgAwIBAgIQewWx1Elo
** SIG ** UUT3yYnSnBmdEjANBgkqhkiG9w0BAQsFADCBvTELMAkG
** SIG ** A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMu
** SIG ** MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3Jr
** SIG ** MTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
** SIG ** LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYD
** SIG ** VQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0
** SIG ** aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNjAxMTIwMDAw
** SIG ** MDBaFw0zMTAxMTEyMzU5NTlaMHcxCzAJBgNVBAYTAlVT
** SIG ** MR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEf
** SIG ** MB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEo
** SIG ** MCYGA1UEAxMfU3ltYW50ZWMgU0hBMjU2IFRpbWVTdGFt
** SIG ** cGluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
** SIG ** AQoCggEBALtZnVlVT52Mcl0agaLrVfOwAa08cawyjwVr
** SIG ** hponADKXak3JZBRLKbvC2Sm5Luxjs+HPPwtWkPhiG37r
** SIG ** pgfi3n9ebUA41JEG50F8eRzLy60bv9iVkfPw7mz4rZY5
** SIG ** Ln/BJ7h4OcWEpe3tr4eOzo3HberSmLU6Hx45ncP0mqj0
** SIG ** hOHE0XxxxgYptD/kgw0mw3sIPk35CrczSf/KO9T1sptL
** SIG ** 4YiZGvXA6TMU1t/HgNuR7v68kldyd/TNqMz+CfWTN76V
** SIG ** iGrF3PSxS9TO6AmRX7WEeTWKeKwZMo8jwTJBG1kOqT6x
** SIG ** zPnWK++32OTVHW0ROpL2k8mc40juu1MO1DaXhnjFoTcC
** SIG ** AwEAAaOCAXcwggFzMA4GA1UdDwEB/wQEAwIBBjASBgNV
** SIG ** HRMBAf8ECDAGAQH/AgEAMGYGA1UdIARfMF0wWwYLYIZI
** SIG ** AYb4RQEHFwMwTDAjBggrBgEFBQcCARYXaHR0cHM6Ly9k
** SIG ** LnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoXaHR0
** SIG ** cHM6Ly9kLnN5bWNiLmNvbS9ycGEwLgYIKwYBBQUHAQEE
** SIG ** IjAgMB4GCCsGAQUFBzABhhJodHRwOi8vcy5zeW1jZC5j
** SIG ** b20wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3Muc3lt
** SIG ** Y2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUE
** SIG ** DDAKBggrBgEFBQcDCDAoBgNVHREEITAfpB0wGzEZMBcG
** SIG ** A1UEAxMQVGltZVN0YW1wLTIwNDgtMzAdBgNVHQ4EFgQU
** SIG ** r2PWyqNOhXLgp7xB8ymiOH+AdWIwHwYDVR0jBBgwFoAU
** SIG ** tnf6aUhHn1MS1cLqBzJ2B9GXBxkwDQYJKoZIhvcNAQEL
** SIG ** BQADggEBAHXqsC3VNBlcMkX+DuHUT6Z4wW/X6t3cT/Oh
** SIG ** yIGI96ePFeZAKa3mXfSi2VZkhHEwKt0eYRdmIFYGmBmN
** SIG ** XXHy+Je8Cf0ckUfJ4uiNA/vMkC/WCmxOM+zWtJPITJBj
** SIG ** SDlAIcTd1m6JmDy1mJfoqQa3CcmPU1dBkC/hHk1O3MoQ
** SIG ** eGxCbvC2xfhhXFL1TvZrjfdKer7zzf0D19n2A6gP41P3
** SIG ** CnXsxnUuqmaFBJm3+AZX4cYO9uiv2uybGB+queM6AL/O
** SIG ** ipTLAduexzi7D1Kr0eOUA2AKTaD+J20UMvw/l0Dhv5mJ
** SIG ** 2+Q5FL3a5NPD6itas5VYVQR9x5rsIwONhSrS/66pYYEw
** SIG ** ggVLMIIEM6ADAgECAhBUWPKq10HWRLyEqXugllLmMA0G
** SIG ** CSqGSIb3DQEBCwUAMHcxCzAJBgNVBAYTAlVTMR0wGwYD
** SIG ** VQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UE
** SIG ** CxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEoMCYGA1UE
** SIG ** AxMfU3ltYW50ZWMgU0hBMjU2IFRpbWVTdGFtcGluZyBD
** SIG ** QTAeFw0xNzAxMDIwMDAwMDBaFw0yODA0MDEyMzU5NTla
** SIG ** MIGAMQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50
** SIG ** ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVj
** SIG ** IFRydXN0IE5ldHdvcmsxMTAvBgNVBAMTKFN5bWFudGVj
** SIG ** IFNIQTI1NiBUaW1lU3RhbXBpbmcgU2lnbmVyIC0gRzIw
** SIG ** ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCZ
** SIG ** 8/zYBAkDhvnXXKaTwEJ86nxjz10A4o7zwJDfjyn1GOqU
** SIG ** t5Ll17Cgc4Ho6QqbSnwB/52PpDmnDupF9CIMOnDtOUWL
** SIG ** 5MUbXPBFaEYkBWN2mxz8nmwqsVblin9Sca7yNdVGIwYc
** SIG ** z0gtHbTNuNl2I44c/z6/uwZcaQemZQ74Xq59Lu1NrjXv
** SIG ** ydcAQv0olQ6fXXJCCbzD2kTS7cxHhOT8yi2sWL6u967Z
** SIG ** RA0It8J31hpDcNFuA95SksQQCHHZuiJV8h+87ZudO+Je
** SIG ** HUyD/5cPewvnVYNO0g3rvtfsrm5HuZ/fpdZRvARV7f8n
** SIG ** cEzJ7SpLE+GxuUwPyQHuVWVfaQJ4Zss/AgMBAAGjggHH
** SIG ** MIIBwzAMBgNVHRMBAf8EAjAAMGYGA1UdIARfMF0wWwYL
** SIG ** YIZIAYb4RQEHFwMwTDAjBggrBgEFBQcCARYXaHR0cHM6
** SIG ** Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoX
** SIG ** aHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwQAYDVR0fBDkw
** SIG ** NzA1oDOgMYYvaHR0cDovL3RzLWNybC53cy5zeW1hbnRl
** SIG ** Yy5jb20vc2hhMjU2LXRzcy1jYS5jcmwwFgYDVR0lAQH/
** SIG ** BAwwCgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQDAgeAMHcG
** SIG ** CCsGAQUFBwEBBGswaTAqBggrBgEFBQcwAYYeaHR0cDov
** SIG ** L3RzLW9jc3Aud3Muc3ltYW50ZWMuY29tMDsGCCsGAQUF
** SIG ** BzAChi9odHRwOi8vdHMtYWlhLndzLnN5bWFudGVjLmNv
** SIG ** bS9zaGEyNTYtdHNzLWNhLmNlcjAoBgNVHREEITAfpB0w
** SIG ** GzEZMBcGA1UEAxMQVGltZVN0YW1wLTIwNDgtNTAdBgNV
** SIG ** HQ4EFgQUCbXB/pZylylDmsngArqu+P0vuvYwHwYDVR0j
** SIG ** BBgwFoAUr2PWyqNOhXLgp7xB8ymiOH+AdWIwDQYJKoZI
** SIG ** hvcNAQELBQADggEBABezCojpXFpeIGs7ChWybMWpijKH
** SIG ** 07H0HFOuhb4/m//XvLeUhbTHUn6U6L3tYbLUp5nkw8mT
** SIG ** wTU9C+hoCl1WmL2xIjvRRHrXv/BtUTKK1SPfOAE39uJT
** SIG ** K3orEY+3TWx6MwMbfGsJlBe75NtY1CETZefs0SXKLHWa
** SIG ** nH/8ybsqaKvEfbTPo8lsp9nEAJyJCneR9E2i+zE7hm72
** SIG ** 5h9QA4abv8tCq+Z2m3JaEQGKxu+lb5Xn3a665iJl8BhZ
** SIG ** GxHJzYC32JdHH0II+KxxH7BGU7PUstWjq1B1SBIXgq3P
** SIG ** 4EFPMn7NlRy/kYoIPaSnZwKW3yRMpdBBwIJgo4oXMkvT
** SIG ** vM+ktIwxggJaMIICVgIBATCBizB3MQswCQYDVQQGEwJV
** SIG ** UzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24x
** SIG ** HzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsx
** SIG ** KDAmBgNVBAMTH1N5bWFudGVjIFNIQTI1NiBUaW1lU3Rh
** SIG ** bXBpbmcgQ0ECEFRY8qrXQdZEvISpe6CWUuYwCwYJYIZI
** SIG ** AWUDBAIBoIGkMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B
** SIG ** CRABBDAcBgkqhkiG9w0BCQUxDxcNMTcwNzEyMTM0NTIz
** SIG ** WjAvBgkqhkiG9w0BCQQxIgQg1xD52jg9/P8NO5ws2naf
** SIG ** wcu6an12O8ENVDquZNAiSfQwNwYLKoZIhvcNAQkQAi8x
** SIG ** KDAmMCQwIgQgz3rBetBH7NX9w2giAxsS1O8Hi28rTF5r
** SIG ** pB+P8s9LrWcwCwYJKoZIhvcNAQEBBIIBAJDHkzPZuNcj
** SIG ** mq2Pi6cZM4Iw79XCJn2IuBXYIYMA17dvZpkoqlhDJDZk
** SIG ** W1x1j+70vkAJNoOa4PnAaNVHii13rybX8UC37iZNoRBQ
** SIG ** CYpgptcOw9tPkNBOoZmysu8qbOe2qK1eSklI6l/v1J7t
** SIG ** 2560Y9bKvgPs3Pya5EKFFLs+gWA+2IjQp9/uvRVVg8ws
** SIG ** Wd0y2RLctd/y9+kQod3NYy4EinM3pcFA8jAON5PRTQOj
** SIG ** 1xM/I6pJHB7NmsRJKSZcI5QZndLc3Re/i2ZQdI6hT9fT
** SIG ** lh5ZH/C9TnTD9Hh0hgItpGSR93oX3PID12Cpf20q2Sda
** SIG ** RY05FX4dNVmF2nLM9y33rBY=
</signature>
</package>

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2018 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_PropertySheetDisplayName>ZRCola ARM64</_PropertySheetDisplayName>
<LibraryPath>$(WXWIN)\lib\vc$(PlatformToolsetVersion)_arm64_lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>wxNO_GL_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<TargetMachine>MachineARM64</TargetMachine>
</Lib>
<Link>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineARM64</TargetMachine>
<AdditionalDependencies>advapi32.lib;ole32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Some files were not shown because too many files have changed in this diff Show More