Compare commits

...

40 Commits

Author SHA1 Message Date
Simon Rozman
dbf3354a1a Set version to 2.5.1
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 16:12:50 +02:00
Simon Rozman
0891f44f33 Updater: bump 2021-04-02 16:12:49 +02:00
Simon Rozman
771dd9f1f7 MSICA: bump
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 16:12:49 +02:00
Simon Rozman
c4f2726256 Build Unicode Combining Characters evaluation CSV with ZRColaCompile
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 15:40:17 +02:00
Simon Rozman
bc4b6b30d1 Cleanup 2021-04-02 15:40:17 +02:00
Simon Rozman
34e409ef2f UI: Introduce PUA warning
Private-Use-Area characters are not correctly rendered unless ZRCola
font is used. The PUA characters are now displayed in blue.

This commit also required to upgrade (de)composition text box to use
RichEdit control.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 15:40:17 +02:00
Simon Rozman
e43a5a0ef0 Add support for ZRCola Composed to Unicode transliteration
The initial support compares characters in ZRCola font Private-Use-Area
to the characters obtained using Unicode combining characters. Those
which match sufficiently are arranged into a new transliteration.

As the ZRCola Composed to Unicode transliteration requires to be applied
_after_ ZRCola composition but UI applies additional transliterations
_before_ ZRCola composition, the ZRCola composition was reintroduced as
one of the transliterations. This allows configuring a custom
transliteration sequence.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 15:39:24 +02:00
Simon Rozman
ddc8b00416 UI: Swap translation drop-down and ZRCola (de)composition button
The order of controls now reflect the order transformations are applied
to the text.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 12:58:25 +02:00
Simon Rozman
9f128a96d1 UI: Update ZRCola.fbp
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-02 12:58:13 +02:00
Simon Rozman
74e95b95b5 Cleanup 2021-04-02 12:58:12 +02:00
Simon Rozman
f3bb513545 Cleanup
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-30 12:03:29 +02:00
Simon Rozman
72f8b179d7 Introduce Unicode Combining Characters evaluation script
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 14:43:46 +01:00
Simon Rozman
fa2fb03cf8 MSIBuild: Bump
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 08:39:37 +01:00
Simon Rozman
12c2889ea3 Copyright: Bump year
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 08:36:00 +01:00
Simon Rozman
2fce6f06bc Set version to 2.5
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 12:43:09 +01:00
Simon Rozman
89a33bc0ea Publish MSIs to <version> and _latest folders on the download server
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 12:30:25 +01:00
Simon Rozman
445e0663e1 Add copyright colophon to .h files
Resource Compiler has an issue with the first line of an UTF-8 .h file.
The workaround is not to begin UTF-8 .h files with anything important.
A blank line would do or a comment.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 11:21:39 +01:00
Simon Rozman
b837c5204c Add copyright colophon to .rc files
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 11:10:33 +01:00
Simon Rozman
4dd9461c48 Add UTF-8 BOM markers to documentation
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 11:00:17 +01:00
Simon Rozman
c7e29b1862 Add UTF-8 BOM markers
MSVC needs them to use correct charset when Language for non-Unicode
programs is set to Windows-1252 or anything different than UTF-8.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 10:59:54 +01:00
Simon Rozman
42daea5b5e Bump WinStd
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 10:00:46 +01:00
Simon Rozman
41ad9cd134 Specify .wsf files encoding
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 09:58:04 +01:00
Simon Rozman
435316eb79 Bump sub-modules
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-08-20 12:18:29 +02:00
Simon Rozman
aa7a8fa484 Re-add UTF-8 BOM markers where required
C files containing non-ASCII characters in strings require UTF-8 BOM for
the MSVC to encode them correctly to the UTF-16 string. (Or switch the
computer we are building on to use UTF-8 for non-Unicode programs.)

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-03-15 00:13:28 +01:00
Simon Rozman
59493b998e Enable Windows 10 ARM64 support
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-03-14 23:57:41 +01:00
Simon Rozman
0b586aa141 Upgrade to current MSIBuild
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-03-03 14:44:32 +01:00
Simon Rozman
04ffd649ec Clean-up
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-03-03 13:49:51 +01:00
Simon Rozman
0970997ab7 Publish updates to the new catalog file and switch to SHA-256 (phase 2)
Version 2.4 switched to the catalog-0001.xml file. The new catalog file
is using SHA-256 hashes and signatures.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:48:10 +01:00
Simon Rozman
1434c9a2d3 Change UpgradeCode and mark to perform major update from 2.4
Changing the component GUIDs and keeping the same file paths rendered
minor updating broken.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:32:48 +01:00
Simon Rozman
9ebdafa272 Reapply "Unify component GUIDs across platforms"
This reverts commit f0f3ce75d0.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:32:48 +01:00
Simon Rozman
ea76dc27b4 Reapply "Unify component GUIDs across languages"
This reverts commit 41c8cc01ed.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:32:48 +01:00
Simon Rozman
7d39d4756c Preset version to 2.4.1
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:32:48 +01:00
Simon Rozman
a6e337a2a1 Switch to new catalog update file and switch to SHA-256 (phase 1)
Versions 2.2 and 2.3 require to update to 2.4 first (to fix Active Setup
issue which works for minor updates only), before updating to 2.5
(requires major update).

The 2.5 and beyond updates will have to be visible to 2.4 version only.
Therefore, we switch the Updater in 2.4 to a new catalog file. While the
2.4 update itself needs to be published to the existing catalog file to
instruct pre-2.4 versions to update to 2.4.

In other words:
- include\UpdaterCfg.h is about checking for future releases
- Makefile publish is about upgrading the past releases

This is also an excellent opportunity to phase out SHA-1.

Updater will treat all hashes as SHA-256 when checking for updates in
the new catalog - the future releases.

While we keep hashing and signing the old catalog file using SHA-1 - for
past releases.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 13:32:48 +01:00
Simon Rozman
0e1a347b5f Preset version to 2.4
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 09:54:48 +01:00
Simon Rozman
e28a146a39 Sub-module update
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:45 +01:00
Simon Rozman
dfedfc419e Strip excessive custom action identifier prefixes
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:45 +01:00
Simon Rozman
9f9e5addcc Fix the Active Setup StubPath issue affected products
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:45 +01:00
Simon Rozman
f0f3ce75d0 Revert "Unify component GUIDs across platforms"
This reverts commit 2363016a76.

Due to Active Setup StubPath bug in already deployed MSI packages we can
fix automatically using minor update only, we cannot change the
component GUIDs just yet.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:44 +01:00
Simon Rozman
41c8cc01ed Revert "Unify component GUIDs across languages"
This reverts commit f8f20f3667.

Due to Active Setup StubPath bug in already deployed MSI packages we can
fix automatically using minor update only, we cannot change the
component GUIDs just yet.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:44 +01:00
Simon Rozman
64ef4f5921 Preset version to 2.3.2
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-25 08:53:44 +01:00
108 changed files with 3643 additions and 4444 deletions

View File

@@ -1,4 +1,4 @@
# Localization of ZRCola
# Localization of ZRCola
In order to get ZRCola experience in your language the following resources should be translated:

Binary file not shown.

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2020 Amebis
# Copyright © 1991-2021 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2020 Amebis
# Copyright © 1991-2021 Amebis
#
# This file is part of ZRCola.
#
@@ -18,7 +18,6 @@
#
OUTPUT_DIR=output
PUBLISH_DIR_LEGACY=\\amebis.doma\Splet\WWW\Apache2\www.amebis.si-prenos\ZRCola
PUBLISH_DIR=\\amebis.doma\Splet\WWW\IIS-ext\prenos.amebis.si\ZRCola
!IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
@@ -41,8 +40,13 @@ MSBUILDFLAGS=/v:m /m
All ::
Clean ::
cd "MSI\MSIBuild\Version"
Clean :: \
CleanSetup
CleanSetup ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean
cd "$(MAKEDIR)\MSI\MSIBuild\Version"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean
cd "$(MAKEDIR)"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
@@ -61,13 +65,11 @@ Register \
Unregister \
Localization \
PublishPre \
Publish :: "MSI\MSIBuild\Version\Version.mak"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) HAS_VERSION=1 $@
"MSI\MSIBuild\Version\Version.mak" ::
Publish ::
cd "MSI\MSIBuild\Version"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Version
cd "$(MAKEDIR)"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) HAS_VERSION=1 $@
!ELSE
@@ -79,7 +81,6 @@ Publish :: "MSI\MSIBuild\Version\Version.mak"
!INCLUDE "MSI\MSIBuild\Version\Version.mak"
!INCLUDE "include\MSIBuildCfg.mak"
PUBLISH_PACKAGE_DIR=$(PUBLISH_DIR)\$(MSIBUILD_VERSION_STR)
PUBLISH_PACKAGE_URL=http://prenos.amebis.si/ZRCola/$(MSIBUILD_VERSION_STR)
######################################################################
@@ -90,19 +91,29 @@ All :: \
Setup
######################################################################
# Setup
######################################################################
Setup :: \
Localization \
SetupCompile \
SetupPackage \
SetupDebug :: \
Localization \
SetupDebugCompile \
SetupDebugPackage \
######################################################################
# Publishing
######################################################################
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PUBLISH_DIR_LEGACY)" \
"$(PUBLISH_DIR)"
Publish :: \
PublishPre \
"$(PUBLISH_DIR_LEGACY)\catalog-0000.xml" \
"$(PUBLISH_DIR)\catalog-0000.xml"
"$(PUBLISH_DIR)" \
"$(PUBLISH_DIR)\catalog-0001.xml"
######################################################################
@@ -110,6 +121,8 @@ Publish :: \
######################################################################
Register :: \
Localization \
RegisterCompile \
RegisterSettings \
InstallFonts \
RegisterShortcuts
@@ -119,6 +132,9 @@ Unregister :: \
UninstallFonts \
UnregisterSettings
RegisterCompile ::
msbuild.exe $(MSBUILDFLAGS) "ZRCola.sln" /t:Build /p:Platform=$(PLAT) /p:Configuration=Debug
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
@@ -176,16 +192,17 @@ UnregisterShortcuts ::
"$(OUTPUT_DIR)" \
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\locale" \
"$(PUBLISH_DIR_LEGACY)" \
"$(PUBLISH_DIR)" \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PUBLISH_DIR)\_latest" \
"$(PUBLISH_DIR)\$(MSIBUILD_VERSION_STR)" \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" :
if not exist $@ md $@
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\locale" : "$(OUTPUT_DIR)"
"$(PUBLISH_PACKAGE_DIR)" : "$(PUBLISH_DIR)"
"$(PUBLISH_DIR)\_latest" \
"$(PUBLISH_DIR)\$(MSIBUILD_VERSION_STR)" : "$(PUBLISH_DIR)"
######################################################################
@@ -217,25 +234,29 @@ UnregisterShortcuts ::
# Building
######################################################################
"$(PUBLISH_DIR_LEGACY)\catalog-0000.xml" \
"$(PUBLISH_DIR)\catalog-0000.xml" : "$(OUTPUT_DIR)\catalog.xml"
"$(PUBLISH_DIR)\catalog-0001.xml" : "$(OUTPUT_DIR)\catalog.xml"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\catalog.xml" : \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
-if exist $@ del /f /q $@
copy /y "$(PUBLISH_DIR)\catalog-0000.xml" "$(@:"=).tmp" > NUL
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu32.msi" -f "$(OUTPUT_DIR)\ZRColaRu32.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu64.msi" -f "$(OUTPUT_DIR)\ZRColaRu64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.msi"
"$(OUTPUT_DIR)\ZRColaEn-x86.msi" \
"$(OUTPUT_DIR)\ZRColaEn-amd64.msi" \
"$(OUTPUT_DIR)\ZRColaEn-arm64.msi" \
"$(OUTPUT_DIR)\ZRColaRu-x86.msi" \
"$(OUTPUT_DIR)\ZRColaRu-amd64.msi" \
"$(OUTPUT_DIR)\ZRColaRu-arm64.msi" \
"$(OUTPUT_DIR)\ZRColaSl-x86.msi" \
"$(OUTPUT_DIR)\ZRColaSl-amd64.msi" \
"$(OUTPUT_DIR)\ZRColaSl-arm64.msi"
copy /y "$(PUBLISH_DIR)\catalog-0001.xml" "$(@:"=).tmp" > NUL
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-x86.msi" -f "$(OUTPUT_DIR)\ZRColaEn-x86.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaEn-amd64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaEn-arm64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-x86.msi" -f "$(OUTPUT_DIR)\ZRColaRu-x86.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaRu-amd64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaRu-arm64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-x86.msi" -f "$(OUTPUT_DIR)\ZRColaSl-x86.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaSl-amd64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaSl-arm64.msi"
"$(OUTPUT_DIR)\$(PLAT).Release\UpdSignXML.exe" "$(@:"=).tmp" $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
@@ -246,11 +267,15 @@ UnregisterShortcuts ::
######################################################################
PLAT=Win32
PLAT_SUFFIX=32
PLAT_SUFFIX=-x86
!INCLUDE "MakefilePlat.mak"
PLAT=x64
PLAT_SUFFIX=64
PLAT_SUFFIX=-amd64
!INCLUDE "MakefilePlat.mak"
PLAT=ARM64
PLAT_SUFFIX=-arm64
!INCLUDE "MakefilePlat.mak"

Binary file not shown.

BIN
MakefileLangPlat.mak Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2020 Amebis
# Copyright © 1991-2021 Amebis
#
# This file is part of ZRCola.
#
@@ -17,8 +17,6 @@
# 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)
!IF "$(PLAT)" == "Win32"
@@ -26,10 +24,10 @@ Clean ::
!ENDIF
msbuild.exe $(MSBUILDFLAGS) "MSI\MSICA\MSICA.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT)
msbuild.exe $(MSBUILDFLAGS) "Updater\Updater.sln" /t:Clean /p:Configuration=$(CFG) /p:Platform=$(PLAT)
-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"
-if exist "$(OUTPUT_DIR)\$(PLAT).$(CFG).ddf" del /f /q "$(OUTPUT_DIR)\$(PLAT).$(CFG).ddf"
-if exist "$(OUTPUT_DIR)\$(PLAT).$(CFG).cab" del /f /q "$(OUTPUT_DIR)\$(PLAT).$(CFG).cab"
-if exist "$(OUTPUT_DIR)\$(PLAT).$(CFG).inf" del /f /q "$(OUTPUT_DIR)\$(PLAT).$(CFG).inf"
-if exist "$(OUTPUT_DIR)\$(PLAT).$(CFG).rpt" del /f /q "$(OUTPUT_DIR)\$(PLAT).$(CFG).rpt"
!IFDEF HAS_VERSION
@@ -43,24 +41,18 @@ Clean ::
# 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)
"$(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 $@
"$(OUTPUT_DIR)\$(PLAT).$(CFG).ddf" : \
# "$(OUTPUT_DIR)\de_DE.$(PLAT).$(CFG).2.msi" \
"$(OUTPUT_DIR)\en_US.$(PLAT).$(CFG).2.msi" \
"$(OUTPUT_DIR)\ru_RU.$(PLAT).$(CFG).2.msi" \
"$(OUTPUT_DIR)\sl_SI.$(PLAT).$(CFG).2.msi"
-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
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\$(PLAT).$(CFG)" /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"
"$(OUTPUT_DIR)\$(PLAT).$(CFG).cab" \
"$(OUTPUT_DIR)\$(PLAT).$(CFG).inf" \
"$(OUTPUT_DIR)\$(PLAT).$(CFG).rpt" : "$(OUTPUT_DIR)\$(PLAT).$(CFG).ddf"
makecab.exe /F $**
!ENDIF

View File

@@ -1,4 +1,4 @@
# ZRCola
# ZRCola
A Microsoft Windows application for composing texts using a wide range of Slavic (and general) letters from or beyond Unicode.

Submodule Updater updated: 349c42fe57...625549838e

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2020 Amebis
# Copyright © 1991-2021 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,10 @@
!INCLUDE "..\..\include\MSIBuildCfg.mak"
!IFNDEF MSIBUILD_PLAT_GUID
!ERROR Parameter MSIBUILD_PLAT_GUID is undefined.
!ENDIF
!IFNDEF MSIBUILD_LANGID
!ERROR Parameter MSIBUILD_LANGID is undefined.
!ENDIF
@@ -36,7 +40,6 @@ MSIBUILD_IS_LOCALIZEABLE=1
All :: "$(LANG).$(PLAT).$(CFG).AppSearch-1.idt"
"$(LANG).$(PLAT).$(CFG).AppSearch-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Property Signature_
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID)
@@ -55,7 +58,6 @@ All :: \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial3.bmp"
"$(LANG).$(PLAT).$(CFG).Binary-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak" "$(LANG).$(PLAT).$(CFG).Binary-1"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Name Data
s$(MSIBUILD_LENGTH_ID) v0
@@ -81,7 +83,6 @@ bintutorial3.bmp tutorial3.bmp
All :: "$(LANG).$(PLAT).$(CFG).CompLocator-1.idt"
"$(LANG).$(PLAT).$(CFG).CompLocator-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Signature_ ComponentId Type
s$(MSIBUILD_LENGTH_ID) s38 I2
@@ -96,7 +97,6 @@ clZRCola.exe.$(PLAT) {6DB513F9-BC90-4CE7-821$(MSIBUILD_PLAT_GUID)-AA50BF31F34E}
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)
@@ -114,7 +114,6 @@ compZRCola.mo.$(LANG) {4F59C403-D6DE-4B3F-$(MSIBUILD_LANG_GUID)-1190DB941EB3} ZR
All :: "$(LANG).$(PLAT).$(CFG).Control-2.idt"
"en_US.$(PLAT).$(CFG).Control-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog_ Control Type X Y Width Height Attributes Property Text Control_Next Help
s$(MSIBUILD_LENGTH_ID) s50 s20 i2 i2 i2 i2 I4 S50 L0 S50 L$(MSIBUILD_LENGTH_HELP)
@@ -152,7 +151,6 @@ dlgTutorial3 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
All :: "$(LANG).$(PLAT).$(CFG).ControlEvent-1.idt"
"$(LANG).$(PLAT).$(CFG).ControlEvent-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog_ Control_ Event Argument Condition Ordering
s$(MSIBUILD_LENGTH_ID) s50 s50 s255 S255 I2
@@ -169,7 +167,6 @@ dlgTutorial3 ctlContinue EndDialog Return 1 1000
All :: "$(LANG).$(PLAT).$(CFG).Dialog-1.idt"
"$(LANG).$(PLAT).$(CFG).Dialog-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog HCentering VCentering Width Height Attributes Title Control_First Control_Default Control_Cancel
s$(MSIBUILD_LENGTH_ID) i2 i2 i2 i2 I4 L128 s50 S50 S50
@@ -186,7 +183,6 @@ dlgTutorial3 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTit
All :: "$(LANG).$(PLAT).$(CFG).InstallUISequence-1.idt"
"$(LANG).$(PLAT).$(CFG).InstallUISequence-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Action Condition Sequence
s$(MSIBUILD_LENGTH_ID) S255 I2
@@ -203,7 +199,6 @@ dlgTutorial3 NOT Installed AND &featZRCola>=3 1402
All :: "$(LANG).$(PLAT).$(CFG).Feature-2.idt"
"en_US.$(PLAT).$(CFG).Feature-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Feature Feature_Parent Title Description Display Level Directory_ Attributes
s$(MSIBUILD_LENGTH_ID) S$(MSIBUILD_LENGTH_ID) L64 L255 I2 i2 S$(MSIBUILD_LENGTH_ID) i2
@@ -226,7 +221,6 @@ featZRCola ZRCola Input system for linguistic use 1 1 ZRCOLADIR 8
All :: "$(LANG).$(PLAT).$(CFG).FeatureComponents-1.idt"
"$(LANG).$(PLAT).$(CFG).FeatureComponents-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Feature_ Component_
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID)
@@ -254,7 +248,6 @@ featZRCola compwxstd.mo.$(LANG)
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
@@ -274,7 +267,6 @@ All :: \
"$(LANG).$(PLAT).$(CFG).Icon-1\ZRCola.ico"
"$(LANG).$(PLAT).$(CFG).Icon-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak" "$(LANG).$(PLAT).$(CFG).Icon-1"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Name Data
s$(MSIBUILD_LENGTH_ID) v0
@@ -292,7 +284,6 @@ iconZRCola.ico ZRCola.ico
All :: "$(LANG).$(PLAT).$(CFG).RemoveFile-1.idt"
"$(LANG).$(PLAT).$(CFG).RemoveFile-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
FileKey Component_ FileName DirProperty InstallMode
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) L255 s$(MSIBUILD_LENGTH_ID) i2
@@ -307,7 +298,6 @@ rmfiZRCola compZRCola.exe.$(PLAT) ZRColaShortcutDir 2
All :: "$(LANG).$(PLAT).$(CFG).Shortcut-2.idt"
"en_US.$(PLAT).$(CFG).Shortcut-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Shortcut Directory_ Name Component_ Target Arguments Description Hotkey Icon_ IconIndex ShowCmd WkDir
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l128 s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) S255 L255 I2 S$(MSIBUILD_LENGTH_ID) I2 I2 S$(MSIBUILD_LENGTH_ID)

Binary file not shown.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

File diff suppressed because it is too large Load Diff

BIN
ZRCola/res/warn_pua.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

1690
ZRCola/res/warn_pua.pdf Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 8 2018)
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ZRCOLAGUI_H__
#define __ZRCOLAGUI_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -55,10 +54,10 @@ class wxZRColaComposerPanel;
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaFrameBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaFrameBase : public wxFrame
class wxZRColaFrameBase : public wxFrame
{
private:
protected:
enum
{
@@ -68,7 +67,8 @@ class wxZRColaFrameBase : public wxFrame
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_COMPOSITION_MENU,
wxID_COMPOSITION,
wxID_WARN_PUA,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_TRANSLATE,
@@ -76,60 +76,61 @@ class wxZRColaFrameBase : public wxFrame
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE,
wxID_COMPOSITION_TOOLBAR
wxID_HELP_UPDATE
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenuItem* m_menuItemComposition;
wxMenu* m_menuTranslationSeq;
wxMenuItem* m_menuItemComposition;
wxMenuItem* m_menuItemWarnPUA;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarTranslate;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxAuiToolBarItem* m_toolComposition;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxChoice* m_toolTranslationSeq;
wxAuiToolBarItem* m_toolComposition;
wxAuiToolBarItem* m_toolWarnPUA;
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
class wxZRColaComposerPanelBase : public wxPanel
{
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
@@ -139,7 +140,7 @@ class wxZRColaComposerPanelBase : public wxPanel
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(); }
@@ -148,62 +149,62 @@ class wxZRColaComposerPanelBase : public wxPanel
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( 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
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( 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
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
@@ -225,7 +226,7 @@ class wxZRColaCharSelectBase : public wxDialog
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxButton* m_buttonInsert;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
@@ -247,22 +248,22 @@ class wxZRColaCharSelectBase : public wxDialog
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnInsert( wxCommandEvent& event ) { event.Skip(); }
virtual void OnInsertUpdateUI( wxUpdateUIEvent& 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( 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
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
@@ -277,28 +278,28 @@ class wxZRColaSettingsBase : public wxDialog
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( 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
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
@@ -310,46 +311,46 @@ class wxZRColaAboutBase : public wxDialog
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( 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
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( 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
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
@@ -360,25 +361,25 @@ class wxZRColaCharRequestBase : public wxDialog
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( 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
class wxZRColaTranslationSeqBase : public wxDialog
{
private:
protected:
wxStaticText* m_transLbl;
wxStaticText* m_availableLbl;
@@ -392,7 +393,7 @@ class wxZRColaTranslationSeqBase : public wxDialog
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(); }
@@ -405,13 +406,12 @@ class wxZRColaTranslationSeqBase : public wxDialog
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( 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-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -19,6 +19,11 @@
#include "pch.h"
static inline bool is_pua(_In_ wchar_t c)
{
return L'\ue000' <= c && c <= L'\uf8ff';
}
//////////////////////////////////////////////////////////////////////////
// wxZRColaComposerPanel
@@ -27,10 +32,18 @@
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
m_sourceChanged(false),
m_destinationChanged(false),
m_sourceRestyled(false),
m_destinationRestyled(false),
m_styleNormal(*wxBLACK, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
m_stylePUA(*wxBLUE, *wxWHITE, wxFont(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("ZRCola"))),
m_selSource(0, 0),
m_selDestination(0, 0),
wxZRColaComposerPanelBase(parent)
{
// RichEdit control has no inner margins by default.
m_source->SetMargins(FromDIP(wxPoint(5, 2)));
m_destination->SetMargins(FromDIP(wxPoint(5, 2)));
m_source->PushEventHandler(&m_keyhandler);
// Restore the previously saved state (if exists).
@@ -88,8 +101,8 @@ void wxZRColaComposerPanel::SynchronizePanels()
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_source, src);
wxString src = m_source->GetValue();
size_t len = src.Length();
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
@@ -132,8 +145,8 @@ void wxZRColaComposerPanel::SynchronizePanels()
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_destination, src);
wxString src = m_destination->GetValue();
size_t len = src.Length();
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
@@ -185,6 +198,9 @@ void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
{
event.Skip();
if (m_sourceRestyled)
return;
long from, to;
m_source->GetSelection(&from, &to);
@@ -239,8 +255,15 @@ void wxZRColaComposerPanel::OnSourceText(wxCommandEvent& event)
{
event.Skip();
if (m_sourceRestyled)
return;
// Set the flag the source text changed to trigger idle-time translation.
m_sourceChanged = true;
m_sourceRestyled = true;
m_source->SetStyle(0, GetWindowTextLength(m_source->GetHWND()), m_styleNormal);
m_sourceRestyled = false;
}
@@ -248,6 +271,9 @@ void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event)
{
event.Skip();
if (m_destinationRestyled)
return;
long from, to;
m_destination->GetSelection(&from, &to);
@@ -302,8 +328,26 @@ void wxZRColaComposerPanel::OnDestinationText(wxCommandEvent& event)
{
event.Skip();
if (m_destinationRestyled)
return;
// Set the flag the destination text changed to trigger idle-time inverse translation.
m_destinationChanged = true;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_destinationRestyled = true;
if (app->m_mainWnd->m_warnPUA) {
wxString src = m_destination->GetValue();
size_t len = src.Length();
for (size_t i = 0, j; i < len;) {
bool pua_i = is_pua(src[i]);
for (j = i + 1; j < len && pua_i == is_pua(src[j]); j++);
m_destination->SetStyle((long)i, (long)j, pua_i ? m_stylePUA : m_styleNormal);
i = j;
}
} else
m_destination->SetStyle(0, GetWindowTextLength(m_destination->GetHWND()), m_styleNormal);
m_destinationRestyled = false;
}
@@ -312,18 +356,21 @@ void wxZRColaComposerPanel::OnSaveTimer(wxTimerEvent& event)
wxString fileName(GetStateFileName());
wxFFile file(fileName, wxT("wb"));
if (file.IsOpened()) {
wxString text;
size_t len;
{
// Save source text.
wxString text = m_source->GetValue();
size_t len = text.Length();
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
}
// Save source text.
len = GetValue(m_source, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
// Save destination text.
len = GetValue(m_destination, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
{
// Save destination text.
wxString text = m_destination->GetValue();
size_t len = text.Length();
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
}
}
event.Skip();
@@ -348,31 +395,6 @@ wxString wxZRColaComposerPanel::GetStateFileName()
}
size_t wxZRColaComposerPanel::GetValue(wxTextCtrl *wnd, wxString &text)
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = wnd->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
if (len < 0x100) {
WCHAR buf[0x100];
::GetWindowTextW(hWnd, buf, (int)(len + 1));
text.assign(buf, len);
} else {
LPWSTR buf = new WCHAR[len + 1];
::GetWindowTextW(hWnd, buf, (int)(len + 1));
text.assign(buf, len);
delete [] buf;
}
return len;
#else
text = wnd->GetValue();
return text.Length();
#endif
}
void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &range, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len, long from, long to)
{
wxString hex;
@@ -381,8 +403,8 @@ void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &
mapping.clear();
for (size_t i = 0; i < len && src[i]; i++) {
wchar_t c = src[i];
if (c == L'\n' || c == '\r') {
hex += c;
if (c == L'\n') {
hex += L"\r\n";
first = true;
} else {
hex += wxString::Format(first ? wxT("%04X") : wxT(" %04X"), src[i]);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -66,12 +66,17 @@ protected:
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
volatile bool
m_sourceRestyled, ///< Boolean flag to mark source text is being restyled
m_destinationRestyled; ///< Boolean flag to mark destination text is being restyled
wxTextAttr
m_styleNormal, ///< Normal text style
m_stylePUA; ///< PUA character text style
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
std::pair<long, long>
m_selSource, ///< Character index of selected text in source text control

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -42,8 +42,8 @@ wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_COMPOSITION_MENU , wxZRColaFrame::OnCompositionMenu )
EVT_MENU (wxID_COMPOSITION_TOOLBAR , wxZRColaFrame::OnCompositionToolbar )
EVT_MENU (wxID_COMPOSITION , wxZRColaFrame::OnComposition )
EVT_MENU (wxID_WARN_PUA , wxZRColaFrame::OnWarnPUA )
EVT_MENU_RANGE (wxID_TRANSLATION_SEQ_DEFAULT, wxID_TRANSLATION_SEQ_END, wxZRColaFrame::OnTranslationSeqMenu )
EVT_MENU (wxID_SETTINGS , wxZRColaFrame::OnSettings )
@@ -75,6 +75,7 @@ wxZRColaFrame::wxZRColaFrame() :
m_settings(NULL),
m_chrReq(NULL),
m_composition(true),
m_warnPUA(false),
m_transeq_id(ZRCOLA_TRANSEQID_DEFAULT),
m_transeq(NULL),
wxZRColaFrameBase(NULL)
@@ -195,6 +196,14 @@ wxZRColaFrame::wxZRColaFrame() :
m_toolComposition->SetState(m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED);
}
if (m_warnPUA) {
m_menuItemWarnPUA->Check(true);
m_toolWarnPUA->SetState(m_toolWarnPUA->GetState() | wxAUI_BUTTON_STATE_CHECKED);
} else {
m_menuItemWarnPUA->Check(false);
m_toolWarnPUA->SetState(m_toolWarnPUA->GetState() & ~wxAUI_BUTTON_STATE_CHECKED);
}
// Update translation sequence selection.
for (unsigned int i = 0, n = m_toolTranslationSeq->GetCount(); ; i++) {
if (i < n) {
@@ -343,9 +352,10 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
}
void wxZRColaFrame::OnCompositionMenu(wxCommandEvent& event)
void wxZRColaFrame::OnComposition(wxCommandEvent& event)
{
m_composition = m_menuItemComposition->IsChecked();
m_composition = !m_composition;
m_menuItemComposition->Check(m_composition);
m_toolComposition->SetState((m_toolComposition->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_composition ? wxAUI_BUTTON_STATE_CHECKED : 0));
m_toolbarTranslate->Refresh();
@@ -357,14 +367,16 @@ void wxZRColaFrame::OnCompositionMenu(wxCommandEvent& event)
}
void wxZRColaFrame::OnCompositionToolbar(wxCommandEvent& event)
void wxZRColaFrame::OnWarnPUA(wxCommandEvent& event)
{
m_composition = (m_toolComposition->GetState() & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
m_menuItemComposition->Check(m_composition);
m_warnPUA = !m_warnPUA;
m_menuItemWarnPUA->Check(m_warnPUA);
m_toolWarnPUA->SetState((m_toolWarnPUA->GetState() & ~wxAUI_BUTTON_STATE_CHECKED) | (m_warnPUA ? wxAUI_BUTTON_STATE_CHECKED : 0));
m_toolbarTranslate->Refresh();
// Notify source text something changed and should re-translate.
// Notify destination text something changed and should re-paint.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_source->ProcessWindowEvent(event2);
m_panel->m_destination->ProcessWindowEvent(event2);
event.Skip();
}
@@ -746,6 +758,7 @@ void wxPersistentZRColaFrame::Save() const
auto wnd = static_cast<const wxZRColaFrame*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("composition"), wnd->m_composition);
SaveValue(wxT("warnPUA"), wnd->m_warnPUA);
SaveValue(wxT("transeqId"), static_cast<int>(wnd->m_transeq_id));
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
@@ -769,6 +782,10 @@ bool wxPersistentZRColaFrame::Restore()
wnd->m_composition = b;
else
wnd->m_composition = wnd->m_transeq_id == ZRCOLA_TRANSEQID_DEFAULT;
if (RestoreValue(wxT("warnPUA"), &b))
wnd->m_warnPUA = b;
else
wnd->m_warnPUA = false;
int guiLevel;
return RestoreValue(wxT("guiLevel"), &guiLevel) && guiLevel == s_guiLevel ? wxPersistentTLWEx::Restore() : true;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -90,8 +90,8 @@ protected:
void OnSendSource(wxCommandEvent& event);
void OnCopySourceAndReturn(wxCommandEvent& event);
void OnSendAbort(wxCommandEvent& event);
void OnCompositionMenu(wxCommandEvent& event);
void OnCompositionToolbar(wxCommandEvent& event);
void OnComposition(wxCommandEvent& event);
void OnWarnPUA(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
virtual void OnIdle(wxIdleEvent& event);
void OnTaskbarIconClick(wxTaskBarIconEvent& event);
@@ -149,6 +149,7 @@ protected:
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
wxZRColaSettings *m_settings; ///< Configuration dialog
bool m_composition; ///< Is (de)composition enabled?
bool m_warnPUA; ///< Mark Private-Use-Area characters in destination text
ZRCola::transeqid_t m_transeq_id; ///< Translation sequence ID
wxZRColaTranslationSeq *m_transeq; ///< Custom translation sequence dialog
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 8 2018)
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ZRCOLAGUI_H__
#define __ZRCOLAGUI_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -55,10 +54,10 @@ class wxZRColaComposerPanel;
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaFrameBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaFrameBase : public wxFrame
class wxZRColaFrameBase : public wxFrame
{
private:
protected:
enum
{
@@ -68,7 +67,8 @@ class wxZRColaFrameBase : public wxFrame
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_COMPOSITION_MENU,
wxID_COMPOSITION,
wxID_WARN_PUA,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_TRANSLATE,
@@ -76,60 +76,61 @@ class wxZRColaFrameBase : public wxFrame
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE,
wxID_COMPOSITION_TOOLBAR
wxID_HELP_UPDATE
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenuItem* m_menuItemComposition;
wxMenu* m_menuTranslationSeq;
wxMenuItem* m_menuItemComposition;
wxMenuItem* m_menuItemWarnPUA;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarTranslate;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxAuiToolBarItem* m_toolComposition;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxChoice* m_toolTranslationSeq;
wxAuiToolBarItem* m_toolComposition;
wxAuiToolBarItem* m_toolWarnPUA;
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
class wxZRColaComposerPanelBase : public wxPanel
{
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
@@ -139,7 +140,7 @@ class wxZRColaComposerPanelBase : public wxPanel
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(); }
@@ -148,62 +149,62 @@ class wxZRColaComposerPanelBase : public wxPanel
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( 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( 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
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( 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
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
@@ -225,7 +226,7 @@ class wxZRColaCharSelectBase : public wxDialog
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxButton* m_buttonInsert;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
@@ -247,22 +248,22 @@ class wxZRColaCharSelectBase : public wxDialog
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnInsert( wxCommandEvent& event ) { event.Skip(); }
virtual void OnInsertUpdateUI( wxUpdateUIEvent& 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( 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
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
@@ -277,28 +278,28 @@ class wxZRColaSettingsBase : public wxDialog
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( 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
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
@@ -310,46 +311,46 @@ class wxZRColaAboutBase : public wxDialog
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( 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
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( 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
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
@@ -360,25 +361,25 @@ class wxZRColaCharRequestBase : public wxDialog
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( 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
class wxZRColaTranslationSeqBase : public wxDialog
{
private:
protected:
wxStaticText* m_transLbl;
wxStaticText* m_availableLbl;
@@ -392,7 +393,7 @@ class wxZRColaTranslationSeqBase : public wxDialog
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(); }
@@ -405,13 +406,12 @@ class wxZRColaTranslationSeqBase : public wxDialog
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( 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-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -729,6 +729,27 @@ bool ZRCola::DBSource::GetNormPerm(const winstd::com_obj<ADORecordset>& rs, std:
}
bool ZRCola::DBSource::SelectAllTranslations(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 [komb], [rang_komb], [Kano], [Kanoniziraj], [znak], [rang_znak] "
L"FROM [VRS_ReplChar] "
L"ORDER BY [rang_komb], LEN([komb]) DESC"), 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(com_obj<ADORecordset> &rs) const
{
// Create a new recordset.
@@ -1239,6 +1260,30 @@ bool ZRCola::DBSource::SelectCharacters(com_obj<ADORecordset>& rs) const
}
bool ZRCola::DBSource::SelectPUACharacters(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 [znak], [opis_en], [kat], [znak_v], [znak_m] "
L"FROM [VRS_CharList] "
L"WHERE "
L"[znak]>='E000' AND [znak]<='F8FF' AND " // Private-Use-Area
L"[aktiven]=1 " // Active characters only
L"ORDER BY [znak]"), variant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0120: Error loading characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetCharacter(const com_obj<ADORecordset>& rs, character& chr) const
{
wxASSERT_MSG(rs, wxT("recordset is empty"));

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -131,8 +131,12 @@ namespace ZRCola {
charseq src; ///< Source sequence
std::string norm; ///< Normalization footprint
charseq dst; ///< Destination sequence
double score; ///< Score
inline translation() : set(0) {}
inline translation() :
set((int)ZRCOLA_TRANSEQID_DEFAULT),
score(0)
{}
};
@@ -145,7 +149,7 @@ namespace ZRCola {
std::wstring src; ///< Source name
std::wstring dst; ///< Destination name
inline transet() : set(0) {}
inline transet() : set((int)ZRCOLA_TRANSEQID_DEFAULT) {}
};
@@ -621,6 +625,17 @@ namespace ZRCola {
///
bool GetNormPerm(const winstd::com_obj<ADORecordset>& rs, std::string& norm, normperm& np) const;
///
/// Returns all character translations
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectAllTranslations(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character translations
///
@@ -805,6 +820,17 @@ namespace ZRCola {
///
bool SelectCharacters(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns Private-Use-Area characters
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectPUACharacters(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character data
///
@@ -908,7 +934,7 @@ namespace ZRCola {
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"));
wxASSERT_MSG((int)0xffff0000 <= rec.set && rec.set <= (int)0x0000ffff, wxT("translation set id out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
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);
@@ -932,7 +958,7 @@ inline ZRCola::translation_db& operator<<(_Inout_ ZRCola::translation_db &db, _I
inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const ZRCola::DBSource::transet &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.set && rec.set <= (int)0x00007fff, wxT("translation set id out of bounds"));
wxASSERT_MSG((int)0xffff0000 <= rec.set && rec.set <= (int)0x0000ffff, wxT("translation set id out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
std::wstring::size_type n = rec.src.length();
wxASSERT_MSG(n <= 0xffff, wxT("translation set source name overflow"));

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -19,6 +19,10 @@
#include "pch.h"
#define FONT_MATCH_WIDTH 512 // must be a multiple of 8
#define FONT_MATCH_HEIGHT 512
#define FONT_MATCH_THRESHOLD 8e-2
using namespace std;
using namespace stdex;
using namespace winstd;
@@ -224,6 +228,56 @@ static inline set<ZRCola::DBSource::charseq> permutate_and_translate_inv(_In_ co
}
static bool contains_pua(_In_ const wstring &str)
{
for (auto p = str.c_str(), p_end = str.c_str() + str.size(); p < p_end; p++)
if (L'\ue000' <= *p && *p <= L'\uf8ff')
return true;
return false;
}
static void replace_all(_Inout_ wstring &str, _In_ const wstring &from, _In_ const wstring &to)
{
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != wstring::npos) {
str.replace(start_pos, from.length(), to);
start_pos += to.length();
}
}
static double compare_bitmaps(
_In_count_c_(FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8) const unsigned char *bits_orig,
_In_count_c_(FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8) const unsigned char *bits)
{
#define B2(n) n, n + 1, n + 1, n + 2
#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2)
#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2)
static const unsigned char number_of_bits[256] = { B6(0), B6(1), B6(1), B6(2) };
#undef B2
#undef B4
#undef B6
// Set divisors to 1 to prevent divide-by-zero.
size_t b_orig = 1, b = 1, x = 0;
for (size_t i = 0; i < FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8; ++i) {
b_orig += number_of_bits[bits_orig[i]];
b += number_of_bits[bits [i]];
x += number_of_bits[bits_orig[i] ^ bits[i]];
}
return (double)x/b_orig * (double)x/b;
}
static string make_unicode(_In_ const wstring &str)
{
string out;
for (size_t i = 0, n = str.length(); i < n; i++)
out += string_printf(i ? "+%04X" : "%04X", str[i]);
return out;
}
///
/// Main function
///
@@ -299,10 +353,14 @@ int _tmain(int argc, _TCHAR *argv[])
bool build_pot = parser.GetParamCount() > 2;
set<wstring> pot;
bool build_csv = parser.GetParamCount() > 3;
vector<ZRCola::DBSource::translation> csv;
// Open file ID.
streamoff dst_start = idrec::open<ZRCola::recordid_t, ZRCola::recordsize_t>(dst, ZRCOLA_DB_ID);
ZRCola::translation_db db_trans;
ZRCola::transet_db db_transset;
normperm_db db_np;
{
@@ -334,6 +392,19 @@ int _tmain(int argc, _TCHAR *argv[])
}
{
// Build ZRCola Decomposed to ZRCola Composed translation set.
ZRCola::DBSource::transet ts;
ts.set = (int)ZRCOLA_TRANSEQID_DEFAULT;
ts.src = L"ZRCola Decomposed";
ts.dst = L"ZRCola Composed";
if (build_pot) {
pot.insert(ts.src);
pot.insert(ts.dst);
}
// Add translation set to index and data.
db_transset << ts;
// Get translations.
com_obj<ADORecordset> rs;
if (src.SelectTranslations(rs)) {
@@ -413,30 +484,244 @@ int _tmain(int argc, _TCHAR *argv[])
}
}
{
// Build ZRCola to Unicode translation set.
ZRCola::DBSource::transet ts;
ts.set = (int)ZRCOLA_TRANSEQID_UNICODE;
ts.src = L"ZRCola Composed";
ts.dst = L"Unicode";
if (build_pot) {
pot.insert(ts.src);
pot.insert(ts.dst);
}
// Add translation set to index and data.
db_transset << ts;
// Get all translations.
com_obj<ADORecordset> rs;
if (src.SelectAllTranslations(rs)) {
// Parse translations and build temporary database.
vector<ZRCola::DBSource::translation> db_all, db_combining;
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
// Read translation from the database.
ZRCola::DBSource::translation trans;
if (src.GetTranslation(rs, trans)) {
// Add translation to temporary databases.
db_all.push_back(trans);
if (!trans.src.str.empty() && trans.src.str[0] == L'\u203f') {
trans.src.str.erase(0, 1);
db_combining.push_back(trans);
}
} else
has_errors = true;
}
com_obj<ADORecordset> rs2;
if (src.SelectPUACharacters(rs2)) {
// Parse characters and build translations.
static const LOGFONT lf_zrcola = {
-FONT_MATCH_HEIGHT/2, 0,
0, 0,
FW_NORMAL,
FALSE, FALSE, FALSE,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
TEXT("ZRCola")
};
gdi_handle<HFONT> fnt_zrcola(::CreateFontIndirect(&lf_zrcola));
gdi_handle<HBRUSH> brush_bg(::CreateSolidBrush(RGB(0x00, 0x00, 0x00)));
gdi_handle<HBITMAP>
bmp_orig(::CreateBitmap(FONT_MATCH_WIDTH, FONT_MATCH_HEIGHT, 1, 1, NULL)),
bmp_comb(::CreateBitmap(FONT_MATCH_WIDTH, FONT_MATCH_HEIGHT, 1, 1, NULL)),
bmp_pre (::CreateBitmap(FONT_MATCH_WIDTH, FONT_MATCH_HEIGHT, 1, 1, NULL));
dc
dc_orig(::CreateCompatibleDC(NULL)),
dc_comb(::CreateCompatibleDC(NULL)),
dc_pre (::CreateCompatibleDC(NULL));
SetBkColor(dc_orig, RGB(0x00, 0x00, 0x00));
SetBkColor(dc_comb, RGB(0x00, 0x00, 0x00));
SetBkColor(dc_pre , RGB(0x00, 0x00, 0x00));
SetBkMode (dc_orig, TRANSPARENT);
SetBkMode (dc_comb, TRANSPARENT);
SetBkMode (dc_pre , TRANSPARENT);
SetTextColor(dc_orig, RGB(0xff, 0xff, 0xff));
SetTextColor(dc_comb, RGB(0xff, 0xff, 0xff));
SetTextColor(dc_pre , RGB(0xff, 0xff, 0xff));
SetTextAlign(dc_orig, TA_BASELINE | TA_CENTER | TA_NOUPDATECP);
SetTextAlign(dc_comb, TA_BASELINE | TA_CENTER | TA_NOUPDATECP);
SetTextAlign(dc_pre , TA_BASELINE | TA_CENTER | TA_NOUPDATECP);
dc_selector
selector_font_orig(dc_orig, fnt_zrcola),
selector_font_comb(dc_comb, fnt_zrcola),
selector_font_pre (dc_pre , fnt_zrcola);
struct {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[2];
} bmi =
{
{
sizeof(BITMAPINFOHEADER),
FONT_MATCH_WIDTH,
FONT_MATCH_HEIGHT,
1,
1,
BI_RGB,
0,
3780, 3780,
2, 0
},
{
{ 0x00, 0x00, 0x00 },
{ 0xff, 0xff, 0xff },
}
};
vector<unsigned char>
bits_orig(FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8),
bits_comb(FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8),
bits_pre (FONT_MATCH_WIDTH * FONT_MATCH_HEIGHT / 8);
map<wstring, map<wstring, pair<double, int>>> trans;
for (; !ZRCola::DBSource::IsEOF(rs2); rs2->MoveNext()) {
// Read character from the database.
ZRCola::DBSource::character chr;
if (src.GetCharacter(rs2, chr)) {
for (auto t = db_all.cbegin(), t_end = db_all.cend(); t != t_end; ++t) {
if (t->dst.str != chr.first)
continue;
// Replace ZRCola decomposition with Unicode combining characters wherever possible.
const auto &comp_orig = chr.first;
const auto &decomp_orig = t->src.str;
wstring decomp = decomp_orig;
for (auto i = db_combining.cbegin(), i_end = db_combining.cend(); i != i_end; ++i)
replace_all(decomp, i->src.str, i->dst.str);
wstring comp = decomp;
for (auto i = db_all.cbegin(), i_end = db_all.cend(); i != i_end; ++i)
replace_all(comp, i->src.str, i->dst.str);
// Check if we got anything useful.
if (comp_orig == comp ||
contains_pua(comp))
continue;
// Do the Unicode C and D normalizations to get two variants:
// - Use precomposed characters as much as possible
// - Use combining characters only
wstring comp_comb, comp_pre;
NormalizeString(NormalizationC, comp , comp_pre );
NormalizeString(NormalizationD, comp_pre, comp_comb);
{
// Paint original character and Unicode precomposed/combining one.
dc_selector
selector_bmp_orig(dc_orig, bmp_orig),
selector_bmp_comb(dc_comb, bmp_comb),
selector_bmp_pre (dc_pre , bmp_pre );
static const RECT bounds = { 0, 0, FONT_MATCH_WIDTH, FONT_MATCH_HEIGHT };
FillRect(dc_orig, &bounds, brush_bg);
FillRect(dc_comb, &bounds, brush_bg);
FillRect(dc_pre , &bounds, brush_bg);
TextOutW(dc_orig, FONT_MATCH_WIDTH/2, FONT_MATCH_HEIGHT*5/8, comp_orig.c_str(), comp_orig.length());
TextOutW(dc_comb, FONT_MATCH_WIDTH/2, FONT_MATCH_HEIGHT*5/8, comp_comb.c_str(), comp_comb.length());
TextOutW(dc_pre , FONT_MATCH_WIDTH/2, FONT_MATCH_HEIGHT*5/8, comp_pre .c_str(), comp_pre .length());
}
// Compare bitmaps.
if (!GetDIBits(dc_orig, bmp_orig, 0, FONT_MATCH_HEIGHT, bits_orig.data(), (BITMAPINFO*)&bmi, DIB_PAL_COLORS) ||
!GetDIBits(dc_comb, bmp_comb, 0, FONT_MATCH_HEIGHT, bits_comb.data(), (BITMAPINFO*)&bmi, DIB_PAL_COLORS) ||
!GetDIBits(dc_pre , bmp_pre , 0, FONT_MATCH_HEIGHT, bits_pre .data(), (BITMAPINFO*)&bmi, DIB_PAL_COLORS))
continue;
double
score_comb = compare_bitmaps(bits_orig.data(), bits_comb.data()),
score_pre = compare_bitmaps(bits_orig.data(), bits_pre .data());
// Add results to a temporary database.
auto hit = trans.find(comp_orig);
if (hit != trans.end()) {
if (build_csv || score_pre <= FONT_MATCH_THRESHOLD) {
if (hit->second.find(comp_pre) == hit->second.end())
hit->second.insert(make_pair(comp_pre, make_pair(score_pre, 1)));
} if ((build_csv || score_comb <= FONT_MATCH_THRESHOLD) && comp_pre != comp_comb) {
if (hit->second.find(comp_comb) == hit->second.end())
hit->second.insert(make_pair(comp_comb, make_pair(score_comb, 100)));
}
} else {
map<wstring, pair<double, int>> v;
if (build_csv || score_pre <= FONT_MATCH_THRESHOLD)
v.insert(make_pair(comp_pre, make_pair(score_pre, 1)));
if ((build_csv || score_comb <= FONT_MATCH_THRESHOLD) && comp_pre != comp_comb)
v.insert(make_pair(comp_comb, make_pair(score_comb, 100)));
if (!v.empty())
trans.insert(make_pair(comp_orig, std::move(v)));
}
}
} else
has_errors = true;
}
// Preallocate memory.
size_t reserve = db_trans.idxSrc.size() + trans.size()*2;
db_trans.idxSrc.reserve(reserve);
db_trans.idxDst.reserve(reserve);
db_trans.data .reserve(reserve*5);
if (build_csv)
csv.reserve(trans.size()*2);
ZRCola::DBSource::translation t;
t.set = (int)ZRCOLA_TRANSEQID_UNICODE;
t.dst.rank = 1;
vector<pair<double, pair<wstring, int>>> results;
for (auto i = trans.cbegin(), i_end = trans.cend(); i != i_end; ++i) {
// Sort results by score.
results.clear();
results.reserve(i->second.size());
for (auto j = i->second.cbegin(), j_end = i->second.cend(); j != j_end; ++j)
results.push_back(make_pair(j->second.first, make_pair(j->first, j->second.second)));
sort(results.begin(), results.end(), [] (pair<double, pair<wstring, int>> const& a, pair<double, pair<wstring, int>> const& b) { return a.first < b.first; });
int rank_comb = 0, rank_pre = 0;
for (auto j = results.cbegin(), j_end = results.cend(); j != j_end; ++j) {
t.src.str = i->first;
t.src.rank = j->second.second + (j->second.second >= 100 ? rank_comb++ : rank_pre++);
t.dst.str = j->second.first;
t.score = j->first;
db_trans << t;
if (build_csv)
csv.push_back(t);
}
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0016: Error getting characters from database. Please make sure the file is ZRCola.zrc compatible.\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;
}
}
{
// 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);
db_transset.idxTranSet.reserve((count+2));
db_transset.data .reserve((count+2)*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 (ts.set <= (int)ZRCOLA_TRANSEQID_DEFAULT) {
_ftprintf(stderr, wxT("%s: error ZCC0008: Translation set is using reserved ID %i.\n"), (LPCTSTR)filenameIn.c_str(), ts.set);
has_errors = true;
continue;
}
if (build_pot) {
pot.insert(ts.src);
pot.insert(ts.dst);
}
// Add translation set to index and data.
db << ts;
db_transset << ts;
// Get translations.
com_obj<ADORecordset> rs_tran;
@@ -464,12 +749,6 @@ int _tmain(int argc, _TCHAR *argv[])
} 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;
@@ -480,6 +759,12 @@ int _tmain(int argc, _TCHAR *argv[])
}
}
// Sort indices.
db_transset.idxTranSet.sort();
// Write translation sets to file.
dst << ZRCola::transet_rec(db_transset);
// Sort indices.
db_trans.idxSrc.sort();
db_trans.idxDst.sort();
@@ -960,6 +1245,43 @@ int _tmain(int argc, _TCHAR *argv[])
}
}
if (!has_errors && build_csv) {
const wxString& filenameCsv = parser.GetParam(3);
fstream dst_csv((LPCTSTR)filenameCsv, ios_base::out | ios_base::trunc);
if (dst_csv.good()) {
dst_csv
<< "\xef\xbb\xbf" // UTF-8 BOM
<< "\"znak\";"
<< "\"znakZRCola\";"
<< "\"znakRank\";"
<< "\"komb\";"
<< "\"kombZRCola\";"
<< "\"kombRank\";"
<< "\"razlika\"" << endl;
wstring_convert<codecvt_utf8<wchar_t>> conv;
for (auto i = csv.cbegin(), i_end = csv.cend(); i != i_end; ++i) {
dst_csv
<< "\"" << make_unicode(i->src.str) << "\";"
<< "\"" << conv.to_bytes(i->src.str) << "\";"
<< i->src.rank << ";"
<< "\"" << make_unicode(i->dst.str) << "\";"
<< "\"" << conv.to_bytes(i->dst.str) << "\";"
<< i->dst.rank << ";"
<< i->score << endl;
}
if (dst_csv.fail()) {
_ftprintf(stderr, wxT("%s: error ZCC0013: Writing to CSV report failed.\n"), (LPCTSTR)filenameOut.c_str());
has_errors = true;
}
dst_csv.close();
} else {
_ftprintf(stderr, wxT("%s: error ZCC0012: Error opening CSV report.\n"), filenameOut.fn_str());
has_errors = true;
}
}
if (has_errors) {
dst.close();
wxRemoveFile(filenameOut);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018-2020 Amebis
/*
Copyright © 2018-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018-2020 Amebis
/*
Copyright © 2018-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -37,6 +37,7 @@
#include <stdex/idrec.h>
#include <WinStd/Common.h>
#include <WinStd/GDI.h>
#include <initguid.h> // GUID helper to prevent LNK2001 errors (unresolved external symbol IID_IADO...)
#pragma warning(push)
@@ -45,6 +46,7 @@
#include <adoid.h>
#pragma warning(pop)
#include <memory.h>
#include <process.h>
#include <tchar.h>
@@ -56,4 +58,5 @@
#include <fstream>
#include <memory>
#include <set>
#include <utility>
#include <vector>

View File

@@ -7,19 +7,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<CompileAsManaged>false</CompileAsManaged>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<SmallerTypeCheck>false</SmallerTypeCheck>
</ClCompile>
<Link>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

Binary file not shown.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -23,35 +23,47 @@
///
/// Main function
///
extern "C" void WinMainCRTStartup()
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
{
// Load "KERNEL32.DLL".
HMODULE hKernel32 = LoadLibrary(TEXT("KERNEL32.DLL"));
if (!hKernel32)
ExitProcess(1);
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
// Get IsWow64Process() address.
BOOL (WINAPI *_IsWow64Process)(__in HANDLE hProcess, __out PBOOL Wow64Process) = (BOOL(WINAPI*)(__in HANDLE, __out PBOOL))::GetProcAddress(hKernel32, "IsWow64Process");
TCHAR szArchProc[MAX_PATH];
if (!GetEnvironmentVariable(TEXT("PROCESSOR_ARCHITECTURE"), szArchProc, _countof(szArchProc)))
szArchProc[0] = 0;
szArchProc[_countof(szArchProc) - 1] = 0;
BOOL bIs64Bit;
#ifndef _WIN64
// Determine if this is a 32-bit process under Windows-over-Windows64.
if (_IsWow64Process) {
// See what IsWow64Process() says.
if (!_IsWow64Process(::GetCurrentProcess(), &bIs64Bit)) {
// IsWow64Process() returned an error. Assume not 64-bit Windows.
bIs64Bit = FALSE;
}
} else {
// This platform does not have IsWow64Process(). Therefore, this is definitely not 64-bit Windows.
bIs64Bit = FALSE;
TCHAR szArchWin[MAX_PATH];
if (!GetEnvironmentVariable(TEXT("PROCESSOR_ARCHITEW6432"), szArchWin, _countof(szArchWin)))
szArchWin[0] = 0;
szArchWin[_countof(szArchWin) - 1] = 0;
// If PROCESSOR_ARCHITEW6432 is defined, this is a Windows-on-Windows
// guest of some kind. szArchWin is the host's architecture and szArchProc
// is the current process' architecture.
// If PROCESSOR_ARCHITEW6432 is not defined, then PROCESSOR_ARCHITECTURE
// is both the process and OS architecture.
if (szArchWin[0] == 0)
memcpy_s(szArchWin, sizeof(szArchWin), szArchProc, sizeof(szArchProc));
// If PROCESSOR_ARCHITECTURE is not defined, then either we're running on
// Windows 9x or something is messing with the environment. Make the
// Windows 9x assumption.
if (szArchProc[0] == 0) {
memcpy_s(szArchProc, sizeof(szArchProc), TEXT("x86"), sizeof(TEXT("x86")));
memcpy_s(szArchWin , sizeof(szArchWin ), TEXT("x86"), sizeof(TEXT("x86")));
}
#else
// This is a running 64-bit process. The Windows must be 64 bit then.
bIs64Bit = TRUE;
#endif
FreeLibrary(hKernel32);
LPCTSTR pszPlatSuffix;
if (_tcsicmp(szArchWin, TEXT("amd64")) == 0)
pszPlatSuffix = TEXT("-amd64");
else if (_tcsicmp(szArchWin, TEXT("arm64")) == 0)
pszPlatSuffix = TEXT("-arm64");
else
pszPlatSuffix = TEXT("-x86");
// Get temporary folder path.
static const LPTSTR pszTempFolderDefault = TEXT("");
@@ -74,7 +86,7 @@ extern "C" void WinMainCRTStartup()
LPTSTR pszParams;
DWORD_PTR aArgs[] = {
(DWORD_PTR)TEXT(ZRCOLA_INSTALL_LANG),
(DWORD_PTR)(bIs64Bit ? TEXT("64") : TEXT("32")),
(DWORD_PTR)pszPlatSuffix,
(DWORD_PTR)pszTempFolder,
};
FormatMessage(

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -20,3 +20,4 @@
#pragma once
#include <Windows.h>
#include <tchar.h>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017-2020 Amebis
Copyright © 2017-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of InstFont.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 1991-2015-2020 Amebis
Copyright © 1991-2015-2021 Amebis
This file is part of MkLink.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,3 +1,22 @@
/*
Copyright © 2015-2021 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 "version.h"
//
@@ -14,4 +33,22 @@
//
// Update server catalog location
//
#define UPDATER_HTTP_PATH "/ZRCola/catalog-0000.xml"
#define UPDATER_HTTP_PATH "/ZRCola/catalog-0001.xml"
//
// Hash for publishing packages and signing catalog
//
#define wxUpdaterHashGen wxCryptoHashSHA256
//
// Hash for verifying catalog signature and packages
//
#define wxUpdaterHashChk wxCryptoHashSHA256
//
// When changing the hash algorithm:
//
// 1. Bump UPDATER_HTTP_PATH and set wxUpdaterHashChk to new hash class.
// 2. Publish the updated product using the old catalog and old wxUpdaterHashGen hash.
// 3. Set wxUpdaterHashGen to new hash class, update Makefile to publish future updates to the new catalog.
//

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.
@@ -37,7 +37,7 @@
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>NTDDI_VERSION=NTDDI_WINXP;_WIN32_WINNT=_WIN32_WINNT_WINXP;wxMSVC_VERSION=$(PlatformToolsetVersion);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NTDDI_VERSION=NTDDI_VISTA;_WIN32_WINNT=_WIN32_WINNT_VISTA;wxMSVC_VERSION=$(PlatformToolsetVersion);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -52,7 +52,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>WINVER=0x0501;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x0600;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<POCompile>
<CheckAccel>Amperstand</CheckAccel>

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -23,7 +23,7 @@
// Product version as a single DWORD
// Note: Used for version comparison within C/C++ code.
//
#define PRODUCT_VERSION 0x02030100
#define PRODUCT_VERSION 0x02050100
//
// Product version by components
@@ -32,27 +32,27 @@
// separately.
//
#define PRODUCT_VERSION_MAJ 2
#define PRODUCT_VERSION_MIN 3
#define PRODUCT_VERSION_MIN 5
#define PRODUCT_VERSION_REV 1
#define PRODUCT_VERSION_BUILD 0
//
// Human readable product version and build year for UI
//
#define PRODUCT_VERSION_STR "2.3.1"
#define PRODUCT_BUILD_YEAR_STR "2019"
#define PRODUCT_VERSION_STR "2.5.1"
#define PRODUCT_BUILD_YEAR_STR "2021"
//
// Numerical version presentation for ProductVersion propery in
// MSI packages (syntax: N.N[.N[.N]])
//
#define PRODUCT_VERSION_INST "2.3.1"
#define PRODUCT_VERSION_INST "2.5.1"
//
// The product code for ProductCode property in MSI packages
// Replace with new on every version change, regardless how minor it is.
//
#define PRODUCT_VERSION_GUID "{23327D39-E8F0-437B-8161-362E20F8DCA5}"
#define PRODUCT_VERSION_GUID "{A0B4DD52-8EDF-48D1-BC01-5055353E7DF8}"
//
// The product vendor and application name for configuration keeping.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2020 Amebis
Copyright © 2016-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 1991-2020 Amebis
Copyright © 1991-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 1991-2020 Amebis
Copyright © 1991-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 1991-2020 Amebis
Copyright © 1991-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -22,6 +22,7 @@
#include "common.h"
#include <stdex/idrec.h>
#include <assert.h>
#include <algorithm>
#include <istream>
#include <map>
@@ -48,7 +49,7 @@ namespace ZRCola {
/// Character category ID type
/// Two letter abbreviation, non-terminated
///
struct ZRCOLA_API chrcatid_t {
struct chrcatid_t {
char data[2];
inline chrcatid_t& operator=(const chrcatid_t &src)
@@ -176,7 +177,7 @@ namespace ZRCola {
///
/// Character Database
///
class ZRCOLA_API character_db {
class character_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -334,13 +335,13 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<character_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> character_rec;
typedef stdex::idrec::record<character_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> character_rec;
///
/// Character category database
///
class ZRCOLA_API chrcat_db {
class chrcat_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -502,7 +503,7 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<chrcat_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrcat_rec;
typedef stdex::idrec::record<chrcat_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrcat_rec;
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -29,11 +29,6 @@
#endif
///
/// Public function calling convention
///
#define ZRCOLA_API
#define ZRCOLA_NOVTABLE __declspec(novtable)
#pragma warning(push)
#pragma warning(disable: 4251)
#pragma warning(disable: 4512)
@@ -75,7 +70,7 @@ namespace ZRCola {
/// Language ID type
/// Three letter abbreviation, zero terminated
///
struct ZRCOLA_API langid_t {
struct langid_t {
char data[4];
inline langid_t& operator=(const langid_t &src)
@@ -221,7 +216,7 @@ namespace ZRCola {
/// \param[in] lang_win Windows language ID
/// \param[in,out] lang ZRCola language ID
///
void ZRCOLA_API LangConvert(_In_ LANGID lang_win, _Inout_ langid_t &lang);
void LangConvert(_In_ LANGID lang_win, _Inout_ langid_t &lang);
#endif
@@ -505,7 +500,7 @@ namespace ZRCola {
///
/// Source-destination index transformation mapping
///
class ZRCOLA_NOVTABLE ZRCOLA_API mapping {
class __declspec(novtable) mapping {
public:
size_t src; ///< Character index in source string
size_t dst; ///< Character index in destination string
@@ -523,7 +518,7 @@ namespace ZRCola {
///
/// A vector for destination-source index transformation mapping
///
class ZRCOLA_API mapping_vector : public std::vector<mapping> {
class mapping_vector : public std::vector<mapping> {
public:
///
/// Transforms character index of destination to source

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -37,7 +37,7 @@ namespace ZRCola {
///
/// Language Character Database
///
class ZRCOLA_API langchar_db {
class langchar_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -195,13 +195,13 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<langchar_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> langchar_rec;
typedef stdex::idrec::record<langchar_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> langchar_rec;
///
/// Language database
///
class ZRCOLA_API language_db {
class language_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -298,7 +298,7 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<language_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> language_rec;
typedef stdex::idrec::record<language_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> language_rec;
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -22,6 +22,7 @@
#include "common.h"
#include <stdex/idrec.h>
#include <assert.h>
#include <istream>
#include <ostream>
#include <vector>
@@ -39,7 +40,7 @@ namespace ZRCola {
///
/// Character Tag Database
///
class ZRCOLA_API chrtag_db {
class chrtag_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -227,13 +228,13 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<chrtag_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrtag_rec;
typedef stdex::idrec::record<chrtag_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrtag_rec;
///
/// Tag name database
///
class ZRCOLA_API tagname_db {
class tagname_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -440,7 +441,7 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<tagname_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> tagname_rec;
typedef stdex::idrec::record<tagname_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> tagname_rec;
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -37,12 +37,17 @@
///
/// Translation disabled/ZRCola (De)Composition
///
#define ZRCOLA_TRANSEQID_DEFAULT ((ZRCola::transeqid_t)0)
#define ZRCOLA_TRANSEQID_DEFAULT ((ZRCola::transeqid_t)0x0000)
///
/// Custom translation sequence ID
///
#define ZRCOLA_TRANSEQID_CUSTOM ((ZRCola::transeqid_t)-1)
#define ZRCOLA_TRANSEQID_CUSTOM ((ZRCola::transeqid_t)0xffff)
///
/// ZRCola to Unicode translation sequence ID
///
#define ZRCOLA_TRANSEQID_UNICODE ((ZRCola::transeqid_t)0xfffe)
namespace ZRCola {
@@ -59,7 +64,7 @@ namespace ZRCola {
///
/// Translation database
///
class ZRCOLA_API translation_db {
class translation_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -324,13 +329,13 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<translation_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> translation_rec;
typedef stdex::idrec::record<translation_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> translation_rec;
///
/// Translation set database
///
class ZRCOLA_API transet_db {
class transet_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -440,13 +445,13 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<transet_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> transet_rec;
typedef stdex::idrec::record<transet_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> transet_rec;
///
/// Translation sequence database
///
class ZRCOLA_API transeq_db {
class transeq_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -621,7 +626,7 @@ namespace ZRCola {
};
typedef ZRCOLA_API stdex::idrec::record<transeq_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> transeq_rec;
typedef stdex::idrec::record<transeq_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> transeq_rec;
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2020 Amebis
# Copyright © 1991-2021 Amebis
#
# This file is part of ZRCola.
#
@@ -34,7 +34,6 @@
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)
@@ -51,7 +50,6 @@ complibZRColaUI.mo.$(LANG) {1CEF160E-B56C-4636-$(MSIBUILD_LANG_GUID)-D6BAEB0A6EF
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

View File

@@ -39,7 +39,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\zrcolaui\chargroup.h" />
<ClInclude Include="..\include\zrcolaui\common.h" />
<ClInclude Include="..\include\zrcolaui\keyboard.h" />
<ClInclude Include="..\src\pch.h" />
</ItemGroup>

View File

@@ -29,9 +29,6 @@
<ClInclude Include="..\src\pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\zrcolaui\common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\zrcolaui\keyboard.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -19,7 +19,6 @@
#pragma once
#include "common.h"
#include <zrcola/common.h>
#include <stdex/idrec.h>
@@ -45,7 +44,7 @@ namespace ZRCola {
///
/// Character group database
///
class ZRCOLAUI_API chrgrp_db {
class chrgrp_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -184,7 +183,7 @@ namespace ZRCola {
};
typedef ZRCOLAUI_API stdex::idrec::record<chrgrp_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrgrp_rec;
typedef stdex::idrec::record<chrgrp_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> chrgrp_rec;
};

View File

@@ -1,27 +0,0 @@
/*
Copyright 2015-2020 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
///
/// Public function calling convention
///
#define ZRCOLAUI_API
#define ZRCOLA_NOVTABLE __declspec(novtable)

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.
@@ -19,7 +19,6 @@
#pragma once
#include "common.h"
#include <zrcola/common.h>
#include <stdex/idrec.h>
@@ -44,7 +43,7 @@ namespace ZRCola {
///
/// Key sequence database
///
class ZRCOLAUI_API keyseq_db {
class keyseq_db {
public:
#pragma pack(push)
#pragma pack(2)
@@ -288,7 +287,7 @@ namespace ZRCola {
};
typedef ZRCOLAUI_API stdex::idrec::record<keyseq_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> keyseq_rec;
typedef stdex::idrec::record<keyseq_db, recordid_t, recordsize_t, ZRCOLA_RECORD_ALIGN> keyseq_rec;
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2020 Amebis
/*
Copyright © 2015-2021 Amebis
This file is part of ZRCola.

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