Compare commits

...

234 Commits

Author SHA1 Message Date
Simon Rozman
4aacc4abc5 Version set to 2.1-beta1 2017-04-03 12:38:54 +02:00
Simon Rozman
2f6c789fdf Support for multiple transformations 2017-04-03 12:36:14 +02:00
Simon Rozman
57ceeadbe7 Clean-up 2017-04-03 12:34:18 +02:00
Simon Rozman
3b297c8427 Missing translations added 2017-04-03 12:16:46 +02:00
Simon Rozman
92374e57a8 Loading of recent character list simplified by using wxStringTokenizer 2017-03-31 14:02:37 +02:00
Simon Rozman
ace7551281 Main frame no longer deletes child dialogues in destructor, causing after-death wxPersist saving of deleted dialogue states later. 2017-03-31 13:44:47 +02:00
Simon Rozman
15e5f2d9e2 Character select dialog saves history in legacy format too now 2017-03-31 13:17:25 +02:00
Simon Rozman
08397415c4 Clean-up 2017-03-30 14:54:15 +02:00
Simon Rozman
6dff6eed4f Translation set database and other translation sets added 2017-03-30 13:08:20 +02:00
Simon Rozman
acbae76737 Clean-up 2017-03-30 10:57:31 +02:00
Simon Rozman
cc4a150501 Translation set ID data-type introduced 2017-03-30 10:23:08 +02:00
Simon Rozman
186dbee443 Multiple translation sets support 2017-03-30 09:49:22 +02:00
Simon Rozman
716dde0a84 Clean-up 2017-03-29 09:46:33 +02:00
Simon Rozman
155642a3f9 "Composition" and "Decomposition" renamed to more general terms "Translation" and "Inverse translation" to extend its use for transliteration 2017-03-27 14:10:43 +02:00
Simon Rozman
7cb0317544 Translation update 2017-03-27 14:06:16 +02:00
Simon Rozman
87a2828ce0 Translation rank split to composed and decomposed character rank allowing asymmetric ranking 2017-03-27 12:39:36 +02:00
Simon Rozman
806aa550a5 Characters are represented as UTF-16 sequences instead of a single UTF-16 character 2017-03-21 09:09:07 +01:00
Simon Rozman
ca306345c2 Composed and decomposed strings of the ZRCola::translation_db::translation protected 2017-03-16 10:21:29 +01:00
Simon Rozman
03ff056898 ZRCola::translation_db::translation::com_start marked as const now 2017-03-16 09:44:43 +01:00
Simon Rozman
9f083bb521 Character-Language table extended to support multi-UTF-16 characters 2017-03-14 14:14:39 +01:00
Simon Rozman
a224454b3c ZRCola::translation::CompareString() >> ZRCola::CompareString() 2017-03-14 13:23:20 +01:00
Simon Rozman
bd0fdba435 Composed characters extended to support multiple UTF-16 character 2017-03-14 12:54:46 +01:00
Simon Rozman
87814981db ZRCola::translation_db::Compose fixed to honor inputMax==-1 correctly 2017-03-14 10:51:56 +01:00
Simon Rozman
acf86e2ce0 Reverted to SHA1 Authenticode signatures for Windows XP compatibility 2017-03-14 09:44:31 +01:00
Simon Rozman
1016d5f738 ZRCola tutorial is now displayed only if ZRCola feature was installed 2017-03-14 09:23:53 +01:00
Simon Rozman
4d53785af7 wxWidget RTL dependencies fixed 2017-03-14 09:00:16 +01:00
Simon Rozman
8e2a3860e3 Changed to RFC3161 time-stamping and forced SHA1 digest to support Vista 2017-03-10 13:49:07 +01:00
Simon Rozman
0c2e666d0f Russian translation update 2017-03-10 13:36:48 +01:00
Simon Rozman
d6075327ef Copy (de)composed and return feature introduced 2017-01-13 13:56:51 +01:00
Simon Rozman
14e665fdf2 Sub-module update 2017-01-13 13:55:18 +01:00
Simon Rozman
55e2ee8c4d Folder options added 2017-01-12 10:10:08 +01:00
Simon Rozman
f444355d6d 00ZRCOla fonts replaced with ZRCOla 2017-01-12 10:09:54 +01:00
Simon Rozman
feb3c7c150 Unicode apostrophe changed to ASCII version for simplicity 2017-01-03 11:52:36 +01:00
Simon Rozman
f65634e285 Sub-module update and version set to 2.0 2016-11-08 11:20:50 +01:00
Simon Rozman
62a67b6be7 German MSI building commented until translation is available 2016-11-08 11:05:08 +01:00
Simon Rozman
5304402ec5 Sub-module update 2016-10-18 14:26:57 +02:00
Simon Rozman
f14fa2911d Version set to 2.0-beta14 2016-10-18 13:50:13 +02:00
Simon Rozman
db391d7023 Incorrect frequent character information in Character Catalog fixed 2016-10-18 13:36:35 +02:00
Simon Rozman
0b5a6a7016 Required update package language determined correctly now 2016-10-18 12:56:34 +02:00
Simon Rozman
5cc72a6a96 wxAUI pane captions no longer persist to allow localization 2016-10-18 12:38:55 +02:00
Simon Rozman
4138f6a5a3 Language for product update matches UI language not OS Regional settings now 2016-10-18 11:14:55 +02:00
Simon Rozman
2b2b2656b3 Language of character tags in Character Search dialog resolved to match UI language 2016-10-18 11:00:40 +02:00
Simon Rozman
6253f2c267 About dialog text updated 2016-10-18 10:10:49 +02:00
Simon Rozman
c9779c3772 Version set to 2.0-beta13 2016-10-17 10:38:34 +02:00
Simon Rozman
f6019e361c Russian translation complete now 2016-10-17 10:35:22 +02:00
Simon Rozman
3fd0aef27d SRC SASA >> ZRC SAZU 2016-10-17 09:30:01 +02:00
Simon Rozman
49c9d33b97 Russian translations added 2016-10-17 09:21:16 +02:00
Simon Rozman
b01d1c5409 Sub-module update 2016-10-14 08:47:04 +02:00
Simon Rozman
b0b434fec2 Version set to 2.0-beta12 2016-10-13 12:56:08 +02:00
Simon Rozman
d46557a367 CompareString() flags simplified to work on Windows XP 2016-10-13 12:55:44 +02:00
Simon Rozman
0180cb6306 Updating task triggering adjusted to workaround Windows 10 Task Scheduler 0x800710e0 bug 2016-10-13 12:32:26 +02:00
Simon Rozman
4ce3213b1a Searching by character tags honors category selection now 2016-10-13 12:30:55 +02:00
Simon Rozman
75b2758797 Translation update 2016-10-13 11:55:46 +02:00
Simon Rozman
2e14bcf1ec Translation templates update 2016-10-13 11:53:04 +02:00
Simon Rozman
cf49e3e401 Merge branch 'master' of https://github.com/Amebis/ZRCola
# Conflicts:
#	ZRCola/zrcolacomppnl.cpp
2016-10-13 11:16:27 +02:00
Simon Rozman
0ed0cf8c49 Support for searchable character tags added 2016-10-13 11:13:46 +02:00
Simon Rozman
38a77ca51b Code clean-up 2016-10-13 10:34:45 +02:00
Simon Rozman
891bd624fc Code clean-up 2016-10-13 10:32:20 +02:00
Simon Rozman
affe7b06a2 Code clean-up 2016-10-13 09:01:23 +02:00
Simon Rozman
f51c4dbbec ZRCola::tagname_db::Search() added 2016-10-12 18:45:59 +02:00
Simon Rozman
650ad13a30 lang >> locale 2016-10-12 18:40:07 +02:00
Simon Rozman
f53779dbad Character tagging support added 2016-10-12 14:30:24 +02:00
Simon Rozman
a45115d5e7 Support for the [VRS_CharList].[klj_bes_en] has been discontinued 2016-10-12 14:28:15 +02:00
Simon Rozman
b5ba1290f9 Setup sub-folder abolished and final MSI output CAB embedding and signing re-established 2016-10-11 13:28:09 +02:00
Simon Rozman
52689653d0 Adaptation to Updater changes 2016-10-11 13:25:33 +02:00
Simon Rozman
8d9af61d5e ZRCOLA_ >> PRODUCT_ 2016-10-11 12:54:13 +02:00
Simon Rozman
5f339d0d51 Sub-module update 2016-10-11 12:49:35 +02:00
Simon Rozman
641d178248 include/zrcola.h >> include/version.h 2016-10-11 12:49:01 +02:00
Simon Rozman
67d3c6f3ac Output MSI file updated 2016-10-11 11:34:24 +02:00
Simon Rozman
060ed729b3 en_US localization fixed 2016-10-11 11:22:40 +02:00
Simon Rozman
f8eead6835 MSI building process revised
- Common cabinet file for all language variations
- Same practice applied as with GÉANTLink project
2016-10-11 11:08:36 +02:00
Simon Rozman
15693f643f MSI module Makefile simplified 2016-10-11 11:04:42 +02:00
Simon Rozman
916b466909 Revert "MSI files contain all localization files now"
This reverts commit a112a46755.
2016-10-11 10:06:59 +02:00
Simon Rozman
a112a46755 MSI files contain all localization files now 2016-10-11 10:03:18 +02:00
Simon Rozman
fba2181b32 REDIST_ variables removed for cleaner Makefile 2016-10-11 09:33:56 +02:00
Simon Rozman
d9bf31897e Sub-module update 2016-10-11 09:26:26 +02:00
Simon Rozman
65b92f017b Character tags updated 2016-10-07 12:19:16 +02:00
Simon Rozman
dddc2d5794 chrcatid_t_blank and langid_t_blank are static members of their respective structures now 2016-10-06 23:17:24 +02:00
Simon Rozman
e4e8609a00 Initial setup of character tags added 2016-10-06 23:15:30 +02:00
Simon Rozman
cee1ea7dbc Total decomposition of rule's decompositions added 2016-10-06 20:56:41 +02:00
Simon Rozman
87c41451ab ATL replaced by WinStd 2016-10-06 16:02:56 +02:00
Simon Rozman
ecefcecfd8 Event to detect secondary ZRCola launch implemented by winstd::win_handle now 2016-10-06 15:59:27 +02:00
Simon Rozman
ba8254c097 Auto C++ typing introduced where appropriate 2016-10-06 11:52:17 +02:00
Simon Rozman
dacca1409e Version set to 2.0-beta10 2016-10-05 19:39:28 +02:00
Simon Rozman
8a3a539d5b Texts and translations update 2016-10-05 14:00:42 +02:00
Simon Rozman
bb2e5e256b Stock "About" menu text replaced with custom one (the stock was missing ellipsis) 2016-10-05 13:39:33 +02:00
Simon Rozman
6828887308 Program title in About dialog box now limited in width to prevent excess dimensions when font is not installed 2016-10-05 13:33:22 +02:00
Simon Rozman
186bc61723 Locale is set using wxExtend's wxInitializeLocale() helper function now 2016-10-05 13:18:35 +02:00
Simon Rozman
19a9d9c26d Shortcuts in Russian translation revised 2016-10-05 13:18:26 +02:00
Simon Rozman
cca084be7d Missing shortcuts and ellipses added to Russian translation 2016-10-05 11:56:34 +02:00
Simon Rozman
6710e0a21c Font and database update 2016-10-05 11:43:25 +02:00
Simon Rozman
b5cc0b8f2c Slovenian translation update 2016-10-05 11:36:33 +02:00
Simon Rozman
ded987e4f8 Slovenian translations update 2016-10-05 11:07:54 +02:00
Simon Rozman
957d530801 Russian MSI files available now 2016-10-05 11:04:40 +02:00
Simon Rozman
4c716f2ba3 Translation update 2016-10-05 11:02:42 +02:00
Simon Rozman
7e3cf0bce7 HKLM\SOFTWARE\Amebis\ZRCola\Language is set using LANGUAGE property now to prevent accidental localization of registry key and/or value name 2016-10-05 11:02:23 +02:00
Simon Rozman
7f97a20ba0 MO files are dynamically generated as a part of build process now 2016-10-05 10:22:06 +02:00
Simon Rozman
4b4bc1b371 Revert "A system reboot is scheduled when "00 ZRCola" font substitute is registered"
This reverts commit 41aa04abad.
2016-10-04 13:19:48 +02:00
Simon Rozman
f0b573f1a8 Sub-module update 2016-10-04 13:15:52 +02:00
Simon Rozman
c2887f77b0 WinStd update 2016-09-19 10:52:04 +02:00
Simon Rozman
f056a4b0ec rcxgettext.exe dependency eliminated 2016-09-19 10:46:17 +02:00
Simon Rozman
181778c981 Adaptation to MSIBuild updates
- Source file English "en_US" instead of generic "En" now
- MSIBUILD_LANG_PO merged to LANG
- Language names in MSIBuild extended from two letter to ll_CC syntax
2016-09-19 10:04:42 +02:00
Simon Rozman
ffb887b306 Creation of localized folder added 2016-09-15 12:56:38 +02:00
Simon Rozman
515a994ece Switch to new version of MSIBuild 2016-09-14 00:20:07 +02:00
Simon Rozman
ab28678227 Generation of localized IDT files simplified 2016-09-06 16:40:56 +02:00
Simon Rozman
b90ff2977f Translations update 2016-08-12 13:42:58 +02:00
Simon Rozman
eab7bcb35f URL update 2016-08-03 08:38:16 +02:00
Simon Rozman
a7c6f2967f Version set to 2.0-beta9 2016-08-03 08:28:29 +02:00
Simon Rozman
2316e5906c Database update 2016-08-03 08:27:24 +02:00
Simon Rozman
1866ace76f Version tagging removed from POT file generation to make POT files version independent 2016-08-03 08:27:09 +02:00
Simon Rozman
48d97742b1 URL update 2016-08-02 17:47:52 +02:00
Simon Rozman
96bde4740f A reboot after "00 ZRCola" font substitute installation is explained now + Updater updated to version that should not reboot after an unattended update 2016-07-22 01:20:24 +02:00
Simon Rozman
333a415a66 Database and Slovenian translation update 2016-07-22 00:19:00 +02:00
Simon Rozman
26e81ac0a0 Sub-module update 2016-07-18 08:51:20 +02:00
Simon Rozman
2b610e2804 Version set to 2.0-beta8 2016-07-18 08:29:30 +02:00
Simon Rozman
ea4f85223c "ZRCola" font name mainstream now 2016-07-15 21:44:28 +02:00
Simon Rozman
aff96d1efe Russian MSI generation commented & some additional support for German added 2016-07-15 21:27:51 +02:00
Simon Rozman
f5eaf3c74b Internal and output folders now using $(MSBuildProjectName) instead of $(ProjectName), to distinguish project variations of essentially the same module 2016-07-15 12:48:07 +02:00
Simon Rozman
6e167b7344 Contact information updated 2016-07-15 10:32:26 +02:00
Simon Rozman
acaae141de ZRCola keyboard PDF updated 2016-07-15 10:28:29 +02:00
Simon Rozman
4a32a4b40c General package information moved from NMAKE macros to Property table, to allow translation to other scripts (than Windows-1252 and Windows-1250) 2016-07-15 09:52:22 +02:00
Simon Rozman
902fcf92a4 Support for Russian localization introduced 2016-07-14 18:08:15 +02:00
Simon Rozman
424a6762f7 Support for numeric keyboard with Ins+nnnn added 2016-07-14 13:59:50 +02:00
Simon Rozman
41aa04abad A system reboot is scheduled when "00 ZRCola" font substitute is registered 2016-07-14 13:44:32 +02:00
Simon Rozman
8ae98bfb12 The font components marked to use reference counter 2016-07-14 12:34:27 +02:00
Simon Rozman
41dfe0c892 Font update 2016-07-14 11:25:01 +02:00
Simon Rozman
5cd454a757 Version set to 2.0-beta7f 2016-07-14 10:56:38 +02:00
Simon Rozman
a75b649f8b Database and font update 2016-07-14 10:50:53 +02:00
Simon Rozman
174f117770 "00 ZRCola" font renamed to "ZRCola" 2016-07-14 10:25:54 +02:00
Simon Rozman
19d1daf099 Slovenian translations updated 2016-07-14 09:27:36 +02:00
Simon Rozman
c4fe7c4370 Some Russian translations added 2016-07-14 09:18:37 +02:00
Simon Rozman
7a7135ea81 Version set to 2.0-beta7 2016-06-17 13:04:29 +02:00
Simon Rozman
2d97afded3 Database update 2016-06-17 13:01:16 +02:00
Simon Rozman
01e8ca5338 Documentation update 2016-06-14 12:45:31 +02:00
Simon Rozman
02f69e332c Documentation update 2016-06-14 12:38:46 +02:00
Simon Rozman
5ce2d209d2 Update README.md 2016-06-14 12:29:38 +02:00
Simon Rozman
088abe062b Documentation update 2016-06-14 12:28:19 +02:00
Simon Rozman
f264fdb211 Version set to 2.0-beta6 2016-06-14 12:13:21 +02:00
Simon Rozman
0e9c6ab66e Support for more or less frequent characters in catalog added 2016-06-14 12:12:17 +02:00
Simon Rozman
040109c36f Version set to 2.0-beta5 2016-06-14 10:15:43 +02:00
Simon Rozman
d130888753 End-of-setup tutorial added 2016-06-14 10:14:45 +02:00
Simon Rozman
e81b0f772d Translation update 2016-06-14 10:02:21 +02:00
Simon Rozman
750cab5370 Add/Remove Programs icon reverted back to ZRCola's 2016-06-14 09:19:03 +02:00
Simon Rozman
213425fd11 Global hot-key registration moved as late as possible to avoid non-effective registration at auto start-up 2016-06-13 15:38:19 +02:00
Simon Rozman
689c72e7e7 Composing ə (and some other characters) combinations fixed 2016-06-13 15:35:52 +02:00
Simon Rozman
fbd60a53dc Categories are collapsible in Character Search dialog now 2016-06-13 13:25:05 +02:00
Simon Rozman
e3475ef48d Font and database update - fonts now OpenType 2016-06-13 11:02:55 +02:00
Simon Rozman
86d512e752 Empty character groups and categories are included in translation catalog too now 2016-06-13 10:57:00 +02:00
Simon Rozman
665b6c3564 Version set to 2.0-beta4 2016-06-02 21:24:13 +02:00
Simon Rozman
173d9c77af ZRCola keyboard PDF update 2016-06-02 21:23:21 +02:00
Simon Rozman
a6088c3028 Additional check for inactive/disabled characters in Character Catalog added 2016-06-02 21:06:36 +02:00
Simon Rozman
ff0354474e Character Selector >> Find Character 2016-06-02 20:54:52 +02:00
Simon Rozman
33f0cbea0d About dialog text change 2016-06-02 20:41:18 +02:00
Simon Rozman
c39aa9f97e Manual check for updates modified to use foreground thread: works always, but blocks UI while downloading 2016-06-02 20:33:49 +02:00
Simon Rozman
45530b23f3 WX_INSTALL_PATH >> WXWIN 2016-06-02 15:10:22 +02:00
Simon Rozman
cb17f06927 ZRCola keyboard shortcuts PDF and link to Instructions website added 2016-06-01 19:16:25 +02:00
Simon Rozman
ac3b44de2b Sub-module update 2016-06-01 17:52:57 +02:00
Simon Rozman
c839d5f50d Version set to 2.0-beta3 2016-05-31 14:55:43 +02:00
Simon Rozman
22be76bec5 New character request is now dialog based
(closes #13)
2016-05-31 14:54:15 +02:00
Simon Rozman
e5b246a4f0 Character search ranking and display is more sophisticated now 2016-05-31 11:50:12 +02:00
Simon Rozman
3f64aef58d Version set to 2.0-beta2 2016-05-31 10:41:15 +02:00
Simon Rozman
2dc6b2d4f5 ZRCola declaration instruction added 2016-05-31 10:39:10 +02:00
Simon Rozman
c938320c45 Character selector dialog upgrade: tool tips and keyboard shortcut display added 2016-05-31 08:32:32 +02:00
Simon Rozman
d7968f539c Related character detection is smarter and more accurate now 2016-05-30 12:11:16 +02:00
Simon Rozman
beabeb17aa Character preview grid control allows Tab traversal now 2016-05-30 11:55:22 +02:00
Simon Rozman
155f12f44e Backward/forward navigation in Character Selector introduced 2016-05-30 09:43:28 +02:00
Simon Rozman
d46a1d4041 Select All/None/Invert feature added to categories in Character Selector 2016-05-26 17:16:51 +02:00
Simon Rozman
c195a07982 Code simplified as the benefit did not outweigh complexity 2016-05-26 16:27:55 +02:00
Simon Rozman
6c82b6333f AEsthetic modifications 2016-05-26 16:02:44 +02:00
Simon Rozman
1178406aa9 Related character generation finished
(closes #26)
2016-05-26 15:57:49 +02:00
Simon Rozman
1e09407742 Related characters preparation multi-threaded now 2016-05-26 12:59:06 +02:00
Simon Rozman
a7b5e1a573 Related characters feature work continues... 2016-05-26 12:03:43 +02:00
Simon Rozman
d70b72b0c1 Inactive related characters removed 2016-05-26 08:53:38 +02:00
Simon Rozman
7bbe92d359 Version set to 2.0-beta1. 2016-05-26 07:22:00 +02:00
Simon Rozman
0e844cd5e4 Incorrect string reset in DBSource::GetValue() fixed 2016-05-25 15:49:56 +02:00
Simon Rozman
67a6fd18e4 Empty character categories removed from database 2016-05-25 13:57:33 +02:00
Simon Rozman
1fcd2d2689 std namespace omitted for code clarity 2016-05-25 13:24:37 +02:00
Simon Rozman
1becda5600 ZRColaInstall*.exe utility publishing added 2016-05-25 13:21:46 +02:00
Simon Rozman
9bccaefabb Other language variations of ZRColaInstallSl.exe utility added 2016-05-25 13:21:13 +02:00
Simon Rozman
7e3e24232d Key codes are translated to English U.S. keyboard correctly now 2016-05-25 12:44:00 +02:00
Simon Rozman
6733ef3cfc wxAuiManager persistence changed to resolve asserts in Win32 builds 2016-05-25 00:07:34 +02:00
Simon Rozman
38f47db6d6 Temporary modal dialogs moved to stack 2016-05-24 23:18:45 +02:00
Simon Rozman
5a26350153 Sub-module update 2016-05-24 23:18:26 +02:00
Simon Rozman
5570a73895 Log level for is now adjusted to allow display of Updater progress for release builds too 2016-05-24 23:17:09 +02:00
Simon Rozman
de98129893 Database update 2016-05-24 22:24:17 +02:00
Simon Rozman
4898492972 Sub-module update 2016-05-24 22:13:09 +02:00
Simon Rozman
73c2146fe2 Missing wxSocketBase::Shutdown() added 2016-05-24 21:47:34 +02:00
Simon Rozman
44c86e2886 Manual check for updates added
(closes #22)
2016-05-24 16:53:26 +02:00
Simon Rozman
3c2e689ae2 Index-out-of-bounds issue fixed 2016-05-24 12:18:49 +02:00
Simon Rozman
5d215f628b Icon for ZRColaInstall added 2016-05-24 11:40:39 +02:00
Simon Rozman
e055207cea Installer bootstrap utility introduced 2016-05-24 10:31:53 +02:00
Simon Rozman
8f10cff923 Digital signatures reverted to SHA-1 for Windows XP and Vista support 2016-05-24 10:31:11 +02:00
Simon Rozman
91c44c388f About dialog extended 2016-05-24 08:43:03 +02:00
Simon Rozman
79664972a3 Grid navigation to previous/next row using left and right arrow keys added 2016-05-23 18:59:12 +02:00
Simon Rozman
d36c47e8a6 Character not implemented in 00 ZRCola font removed 2016-05-23 18:41:36 +02:00
Simon Rozman
16a28cd011 Font and database update 2016-05-23 15:35:50 +02:00
Simon Rozman
73f1d4d2c9 Unicode control characters removed from the lists 2016-05-23 15:15:31 +02:00
Simon Rozman
26c899734b The character entered via Unicode in Character Selector is now looked up in search results, brought into view and selected. 2016-05-23 15:03:09 +02:00
Simon Rozman
ff6a551c50 Unicode code in Character Selector is four hexadecimal digits long now 2016-05-23 15:02:08 +02:00
Simon Rozman
72ba4377c8 Sub-module update 2016-05-23 15:01:01 +02:00
Simon Rozman
3f02306182 Font of character preview in character selector reduced for less clipping 2016-05-23 10:50:43 +02:00
Simon Rozman
9c03547378 ZRCola window is now brought front and focused when invoked from iconized state.
(fixes #25)
2016-05-23 10:41:32 +02:00
Simon Rozman
5271aca526 Double application launch prevention lock added
(fixes #24)
2016-05-23 10:40:07 +02:00
Simon Rozman
dbcf539616 Sub-module update 2016-05-23 10:32:25 +02:00
Simon Rozman
903c635b34 Sub-module update 2016-05-16 12:23:14 +02:00
Simon Rozman
6c13837398 Couple of compiler warnings resolved 2016-05-16 10:44:05 +02:00
Simon Rozman
3126091e0b Sub-module update 2016-05-13 20:05:34 +02:00
Simon Rozman
bb1b0e64d6 German and Russian translation stub added 2016-05-13 20:05:18 +02:00
Simon Rozman
78ccf1b2cf Version set to 2.0-beta 2016-05-13 18:54:11 +02:00
Simon Rozman
c921d533a9 Issue with non included term trailing in sub-word index fixed 2016-05-13 18:47:12 +02:00
Simon Rozman
e4fb91e305 Settings moved from menu(s) to configuration dialog
(closes #21)
2016-05-13 16:22:51 +02:00
Simon Rozman
a81dd7e250 Character request feature added
(closes #13)
2016-05-13 13:36:25 +02:00
Simon Rozman
a4fe4b6a26 Current character category display added to character selector 2016-05-13 13:24:18 +02:00
Simon Rozman
1198579963 Character category index fixed 2016-05-13 13:22:17 +02:00
Simon Rozman
5d732522fe wxZRColaCharGrid memory leak fixed
(fixes #23)
2016-05-13 13:21:39 +02:00
Simon Rozman
155fb03c5a Character search moved to separate thread for smoother experience 2016-05-13 12:11:38 +02:00
Simon Rozman
710937f8df Language ID type redeclaration for easier and safer work 2016-05-13 10:16:29 +02:00
Simon Rozman
4e435b044c Additional operators 2016-05-13 10:16:23 +02:00
Simon Rozman
4ec7dc3ca5 Search optimizations 2016-05-13 09:32:36 +02:00
Simon Rozman
9c3c1585d5 Character Select finished
(closes #11)
2016-05-13 03:44:28 +02:00
Simon Rozman
53ce3a2411 COMDAT Folding disabled for debug builds 2016-05-12 17:15:04 +02:00
Simon Rozman
643a8dcb82 Sub-module update 2016-05-12 14:12:09 +02:00
Simon Rozman
9337b660d2 Database update 2016-05-12 10:56:07 +02:00
Simon Rozman
44f2ef1ae1 Work on character selector continues 2016-05-11 14:39:57 +02:00
Simon Rozman
4aa0d9183e Support for Unicode character database added 2016-05-11 14:39:20 +02:00
Simon Rozman
e3c6a01722 ZRCola::index::compare_sort() reverts to compare() by default now 2016-05-11 12:40:14 +02:00
Simon Rozman
0d30a89d22 Character selector merged back to continue work
# Conflicts:
#	ZRCola/ZRCola.fbp
#	ZRCola/ZRCola.vcxproj
#	ZRCola/ZRCola.vcxproj.filters
#	ZRCola/locale/sl_SI.po
#	ZRCola/zrcolafrm.cpp
#	ZRCola/zrcolafrm.h
#	ZRCola/zrcolagui.cpp
#	ZRCola/zrcolagui.h
2016-05-11 09:00:59 +02:00
Simon Rozman
23ba447283 ZRCola now minimizes to system tray.
(closes #20)
2016-05-10 13:10:37 +02:00
Simon Rozman
a27f7f470d (De)Composition moved to idle processing & other optimizations
(fixes #19)
2016-05-10 09:41:35 +02:00
Simon Rozman
50790ad01d ZRCola no longer responds to Ctrl+Alt shortcuts when invoked with AltGr 2016-05-09 16:48:54 +02:00
Simon Rozman
ae3344d5eb Aesthetic modifications 2016-05-09 11:57:19 +02:00
Simon Rozman
79ae4855e3 Additional "text updated" event generation added to fix premature event receiving on EM_REPLACESEL
(fixes #19)
2016-05-09 11:57:02 +02:00
Simon Rozman
349bc34fa8 libZRColaUI extended to use wxWidgets and ZRColaApp::GetKeySequenceAsText() moved back to ZRCola::keyseq_db::GetSequenceAsText() for general accessibility 2016-05-09 11:05:21 +02:00
Simon Rozman
b7533d4b27 Character selector feature skeleton added 2016-04-26 16:05:42 +02:00
176 changed files with 46731 additions and 19326 deletions

27
.gitmodules vendored
View File

@@ -1,21 +1,24 @@
[submodule "lib/wxExtend"]
path = lib/wxExtend
url = https://github.com/Amebis/wxExtend.git
[submodule "lib/stdex"]
path = lib/stdex
url = https://github.com/Amebis/stdex.git
[submodule "MSI/MSIBuild"]
path = MSI/MSIBuild
url = https://github.com/Amebis/MSIBuild.git
[submodule "MSI/MSICA"]
path = MSI/MSICA
url = https://github.com/Amebis/MSICA.git
[submodule "lib/atlex"]
path = lib/atlex
url = https://github.com/Amebis/atlex.git
[submodule "lib/MSICALib"]
path = lib/MSICALib
url = https://github.com/Amebis/MSICALib.git
[submodule "lib/stdex"]
path = lib/stdex
url = https://github.com/Amebis/stdex.git
[submodule "lib/WinStd"]
path = lib/WinStd
url = https://github.com/Amebis/WinStd.git
[submodule "lib/wxExtend"]
path = lib/wxExtend
url = https://github.com/Amebis/wxExtend.git
[submodule "MSI/MSIBuild"]
path = MSI/MSIBuild
url = https://github.com/Amebis/MSIBuild.git
[submodule "MSI/MSICA"]
path = MSI/MSICA
url = https://github.com/Amebis/MSICA.git
[submodule "Updater"]
path = Updater
url = https://github.com/Amebis/Updater.git

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1558
MSI/ZRCola/locale/de_DE.po Normal file

File diff suppressed because one or more lines are too long

1566
MSI/ZRCola/locale/ru_RU.po Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
MSILocal.mak Normal file

Binary file not shown.

411
Makefile
View File

@@ -36,16 +36,6 @@ Clean ::
cd "MSI\MSIBuild\Version"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean
cd "$(MAKEDIR)"
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=Win32 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=Win32 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=x64 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=x64 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=Win32 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=Win32 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=x64 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
devenv.com "ZRCola.sln" /clean "Release|Win32"
devenv.com "ZRCola.sln" /clean "Debug|Win32"
devenv.com "ZRCola.sln" /clean "Release|x64"
@@ -60,15 +50,29 @@ Clean ::
devenv.com "Updater\Updater.sln" /clean "Debug|Win32"
devenv.com "Updater\Updater.sln" /clean "Release|x64"
devenv.com "Updater\Updater.sln" /clean "Debug|x64"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn32.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn64.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl32.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl64.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl64.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
-if exist "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\ZRCola32.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola32D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32D.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64D.rpt"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
!IFNDEF HAS_VERSION
@@ -82,6 +86,7 @@ Setup \
SetupDebug \
Register \
Unregister \
Localization \
PublishPre \
Publish :: "MSI\MSIBuild\Version\Version.mak"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) HAS_VERSION=1 $@
@@ -104,12 +109,6 @@ Publish :: "MSI\MSIBuild\Version\Version.mak"
PUBLISH_PACKAGE_DIR=$(PUBLISH_DIR)\$(MSIBUILD_VERSION_STR)
PUBLISH_PACKAGE_URL=http://www.amebis.si/prenos/ZRCola/$(MSIBUILD_VERSION_STR)
REDIST_EN_WIN32="$(PUBLISH_PACKAGE_DIR)\ZRColaEn32.msi"
REDIST_EN_X64="$(PUBLISH_PACKAGE_DIR)\ZRColaEn64.msi"
REDIST_SL_WIN32="$(PUBLISH_PACKAGE_DIR)\ZRColaSl32.msi"
REDIST_SL_X64="$(PUBLISH_PACKAGE_DIR)\ZRColaSl64.msi"
######################################################################
# Main targets
######################################################################
@@ -118,18 +117,54 @@ All :: \
Setup
Setup :: \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl64.msi"
# "$(OUTPUT_DIR)\ZRColaDe32.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64.msi" \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
SetupDebug :: \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi"
# "$(OUTPUT_DIR)\ZRColaDe32D.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64D.msi" \
"$(OUTPUT_DIR)\ZRColaEn32D.msi" \
"$(OUTPUT_DIR)\ZRColaEn64D.msi" \
"$(OUTPUT_DIR)\ZRColaRu32D.msi" \
"$(OUTPUT_DIR)\ZRColaRu64D.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.msi"
######################################################################
# Publishing
######################################################################
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe32.msi" \
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl64.msi" \
"$(PUBLISH_DIR)" \
# "$(PUBLISH_DIR)\ZRColaInstallDe.exe" \
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" \
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" \
"$(PUBLISH_DIR)\ZRColaInstallSl.exe"
Publish :: \
PublishPre \
"$(PUBLISH_DIR)\catalog-0000.xml"
######################################################################
# Registration
######################################################################
Register :: \
RegisterSettings \
@@ -158,24 +193,26 @@ UnregisterSettings ::
!ENDIF
InstallFonts :: \
"$(WINDIR)\Fonts\00_ZRCola_Re.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_It.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_BI.ttf"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola (TrueType)" /t REG_SZ /d "00_ZRCola_Re.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Italic (TrueType)" /t REG_SZ /d "00_ZRCola_It.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold (TrueType)" /t REG_SZ /d "00_ZRCola_Bd.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold Italic (TrueType)" /t REG_SZ /d "00_ZRCola_BI.ttf" $(REG_FLAGS) > NUL
"$(WINDIR)\Fonts\ZRCola_Re.otf" \
"$(WINDIR)\Fonts\ZRCola_It.otf" \
"$(WINDIR)\Fonts\ZRCola_Bd.otf" \
"$(WINDIR)\Fonts\ZRCola_BI.otf"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola (TrueType)" /t REG_SZ /d "ZRCola_Re.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Italic (TrueType)" /t REG_SZ /d "ZRCola_It.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold (TrueType)" /t REG_SZ /d "ZRCola_Bd.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold Italic (TrueType)" /t REG_SZ /d "ZRCola_BI.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" /v "00 ZRCola" /t REG_SZ /d "ZRCola" $(REG_FLAGS) > NUL
UninstallFonts::
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold Italic (TrueType)" $(REG_FLAGS) > NUL
-if exist "$(WINDIR)\Fonts\00_ZRCola_Re.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_Re.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_It.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_It.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_Bd.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_BI.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_BI.ttf"
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" /v "00 ZRCola" $(REG_FLAGS) > NUL
-if exist "$(WINDIR)\Fonts\ZRCola_Re.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_Re.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_It.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_It.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_Bd.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_Bd.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_BI.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_BI.otf"
RegisterShortcuts :: \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" \
@@ -184,16 +221,20 @@ RegisterShortcuts :: \
UnregisterShortcuts ::
-if exist "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" rd /s /q "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola"
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
$(REDIST_EN_WIN32) \
$(REDIST_EN_X64) \
$(REDIST_SL_WIN32) \
$(REDIST_SL_X64)
######################################################################
# Localization
######################################################################
Publish :: \
PublishPre \
"$(PUBLISH_DIR)\catalog-0000.xml"
Localization :: \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" \
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" \
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" \
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
######################################################################
@@ -202,14 +243,21 @@ Publish :: \
"$(OUTPUT_DIR)" \
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\locale" \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(PUBLISH_DIR)" \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" :
if not exist $@ md $@
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\Setup" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" : "$(OUTPUT_DIR)\locale"
"$(PUBLISH_PACKAGE_DIR)" : "$(PUBLISH_DIR)"
@@ -218,44 +266,16 @@ Publish :: \
# File copy
######################################################################
"$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" \
$(REDIST_EN_WIN32) : "$(OUTPUT_DIR)\ZRColaEn32.3.msi"
"$(WINDIR)\Fonts\ZRCola_Re.otf" : "$(OUTPUT_DIR)\ZRCola_Re.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" : "$(OUTPUT_DIR)\ZRColaEn32D.3.msi"
"$(WINDIR)\Fonts\ZRCola_It.otf" : "$(OUTPUT_DIR)\ZRCola_It.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" \
$(REDIST_EN_X64) : "$(OUTPUT_DIR)\ZRColaEn64.3.msi"
"$(WINDIR)\Fonts\ZRCola_Bd.otf" : "$(OUTPUT_DIR)\ZRCola_Bd.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" : "$(OUTPUT_DIR)\ZRColaEn64D.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" \
$(REDIST_SL_WIN32) : "$(OUTPUT_DIR)\ZRColaSl32.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" : "$(OUTPUT_DIR)\ZRColaSl32D.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl64.msi" \
$(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi" : "$(OUTPUT_DIR)\ZRColaSl64D.3.msi"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_Re.ttf" : "$(OUTPUT_DIR)\00_ZRCola_Re.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_It.ttf" : "$(OUTPUT_DIR)\00_ZRCola_It.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" : "$(OUTPUT_DIR)\00_ZRCola_Bd.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_BI.ttf" : "$(OUTPUT_DIR)\00_ZRCola_BI.ttf"
"$(WINDIR)\Fonts\ZRCola_BI.otf" : "$(OUTPUT_DIR)\ZRCola_BI.otf"
copy /y $** $@ > NUL
@@ -271,118 +291,177 @@ $(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# Building
######################################################################
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" : "$(WXWIN)\locale\de.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" : "$(WXWIN)\locale\ru.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" : "$(WXWIN)\locale\sl.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Release|x64"
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Debug|x64"
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Release|Win32"
devenv.com "Updater\Updater.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\ZRCola32.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Debug|Win32"
devenv.com "Updater\Updater.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\ZRCola32D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Release|x64"
devenv.com "Updater\Updater.sln" /build "Release|x64"
"$(OUTPUT_DIR)\ZRCola64.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Debug|x64"
devenv.com "Updater\Updater.sln" /build "Debug|x64"
"$(OUTPUT_DIR)\ZRCola64D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=Win32 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola32.cab" \
"$(OUTPUT_DIR)\ZRCola32.inf" \
"$(OUTPUT_DIR)\ZRCola32.rpt" : "$(OUTPUT_DIR)\ZRCola32.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=Win32 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola32D.cab" \
"$(OUTPUT_DIR)\ZRCola32D.inf" \
"$(OUTPUT_DIR)\ZRCola32D.rpt" : "$(OUTPUT_DIR)\ZRCola32D.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=x64 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola64.cab" \
"$(OUTPUT_DIR)\ZRCola64.inf" \
"$(OUTPUT_DIR)\ZRCola64.rpt" : "$(OUTPUT_DIR)\ZRCola64.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=Win32 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=Win32 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=x64 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola64D.cab" \
"$(OUTPUT_DIR)\ZRCola64D.inf" \
"$(OUTPUT_DIR)\ZRCola64D.rpt" : "$(OUTPUT_DIR)\ZRCola64D.ddf"
makecab.exe /F $**
"$(PUBLISH_DIR)\catalog-0000.xml" : "$(OUTPUT_DIR)\catalog.xml"
if exist $@ del /f /q $@
output\$(PLAT).Release\UpdSignXML.exe $** $@
"$(OUTPUT_DIR)\catalog.xml" : \
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# "$(OUTPUT_DIR)\ZRColaDe32.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64.msi" \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
copy /y "$(PUBLISH_DIR)\catalog-0000.xml" "$(@:"=).tmp" > NUL
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 de_DE "$(PUBLISH_PACKAGE_URL)/ZRColaDe32.msi" -f "$(OUTPUT_DIR)\ZRColaDe32.msi"
# output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 de_DE "$(PUBLISH_PACKAGE_URL)/ZRColaDe64.msi" -f "$(OUTPUT_DIR)\ZRColaDe64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu32.msi" -f "$(OUTPUT_DIR)\ZRColaRu32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu64.msi" -f "$(OUTPUT_DIR)\ZRColaRu64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.msi"
move /y "$(@:"=).tmp" $@ > NUL
!ENDIF
#LANG=de_DE
#LANG_OUT=De
#!INCLUDE "MSILocal.mak"
LANG=en_US
LANG_OUT=En
!INCLUDE "MSILocal.mak"
LANG=ru_RU
LANG_OUT=Ru
!INCLUDE "MSILocal.mak"
LANG=sl_SI
LANG_OUT=Sl
!INCLUDE "MSILocal.mak"

View File

@@ -1 +1,44 @@
# ZRCola
# ZRCola
A Microsoft Windows application for composing texts using a wide range of Slavic (and general) letters from or beyond Unicode.
## Project Website
http://zrcola.zrc-sazu.si/en/
## Binaries for Download
https://www.amebis.si/prenos/ZRCola/
## Building
### Building Environment Requirements
- Microsoft Windows Vista or later
- Microsoft Visual Studio 2010 SP1
- _sed.exe_ and _grep.exe_
- Command line utilities from Microsoft Windows SDK Bin folder: distributed with Visual Studio, add Bin folder to path manually.
- Additional command line utilities from project's bin folder: add bin folder to path. The source code is provided on request.
### Digital Signing of Build Outputs
In order to have the build process digitally sign output files, one should provide the following:
1. A signing certificate installed in the current user's certificate store.
2. The following variables in the environment:
- `ManifestCertificateThumbprint` - set the value to certificate's SHA1 thumbprint (hexadecimal, without spaces, i.e. `bc0d8da45f9eeefcbe4e334e1fc262804df88d7e`).
- `ManifestTimestampUrl` - set the value to URL used to perform timestamp signature (i.e. `http://timestamp.verisign.com/scripts/timstamp.dll`). In order to perform timestamp signing successfully, the computer running the build should be online and able to access this URL.
Please note that only Release builds are configured for timestamp signing. Debug configurations do not attempt to timestamp sign the resulting DLL and EXE files in order to speed up the building process and enable offline building.
### Building
Use Microsoft NMAKE to build the project. The resulting files can be found in output subfolder.
- `nmake Clean` Delete all intermediate and output files.
- `nmake Setup` Build a release version of project and release MSI setup files.
- `nmake SetupDebug` Build a debug version of project and debug MSI setup files.
- `nmake Register` Build a debug version of project, install fonts (reboot required), and Start Menu shortcuts. For development purposes only!
- `nmake Unregister` Remove Start Menu shortcuts, and fonts. For development purposes only!
The `/ls` flag can be appended to the commands above to reduce NMAKE's verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading.
## Contact Information
Please contact the following addressee for further information and help:
- ZRC SAZU, ZRCola@zrc-sazu.si
- Amebis, info@amebis.si

Submodule Updater updated: f1a3ae730a...5e6427ab00

View File

@@ -5,11 +5,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRCola", "ZRCola\ZRCola.vcx
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtend.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendDll.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFEBC17E-C840-4507-BDE6-1EF5B52DDCC5}"
ProjectSection(SolutionItems) = preProject
include\zrcola.h = include\zrcola.h
include\version.h = include\version.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRCola", "lib\libZRCola\build\libZRCola.vcxproj", "{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}"
@@ -18,6 +18,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRCol
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStd", "lib\WinStd\build\WinStd.vcxproj", "{47399D91-7EB9-41DE-B521-514BA5DB0C43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -66,6 +70,22 @@ Global
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.Build.0 = Release|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.ActiveCfg = Release|x64
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.Build.0 = Release|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.ActiveCfg = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.Build.0 = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.ActiveCfg = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.Build.0 = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.ActiveCfg = Release|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.Build.0 = Release|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.ActiveCfg = Release|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.Build.0 = Release|x64
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.ActiveCfg = Debug|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|Win32.Build.0 = Debug|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x64.ActiveCfg = Debug|x64
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Debug|x64.Build.0 = Debug|x64
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.ActiveCfg = Release|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|Win32.Build.0 = Release|Win32
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.ActiveCfg = Release|x64
{47399D91-7EB9-41DE-B521-514BA5DB0C43}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -75,5 +95,7 @@ Global
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{518777CC-0A59-4415-A12A-82751ED75343} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{990D8CF9-4457-4DC0-AA18-4968EF434741} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{47399D91-7EB9-41DE-B521-514BA5DB0C43} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
EndGlobalSection
EndGlobal

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -19,6 +19,10 @@
!INCLUDE "..\..\include\MSIBuildCfg.mak"
!IFNDEF MSIBUILD_LANGID
!ERROR Parameter MSIBUILD_LANGID is undefined.
!ENDIF
MSIBUILD_IS_LOCALIZEABLE=1
@@ -37,6 +41,36 @@ OLDZRCOLADIR clZRCola.exe.$(PLAT)
<<NOKEEP
######################################################################
# Binary
All :: \
"$(LANG).$(PLAT).$(CFG).Binary-1.idt" \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial1.bmp" \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial2.bmp" \
"$(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
Binary Name
bintutorial1.bmp tutorial1.bmp
bintutorial2.bmp tutorial2.bmp
bintutorial3.bmp tutorial3.bmp
<<NOKEEP
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial1.bmp" : "Binary\tutorial1.bmp"
copy /y $** $@ > NUL
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial2.bmp" : "Binary\tutorial2.bmp"
copy /y $** $@ > NUL
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial3.bmp" : "Binary\tutorial3.bmp"
copy /y $** $@ > NUL
######################################################################
# CompLocator
@@ -74,18 +108,110 @@ compZRCola.exe.Win32 {F30B6545-6203-4B7D-8575-85245A0F90E5} ZRCOLABINDIR 0 file
!IF "$(PLAT)" == "x64"
compZRCola.exe.x64 {D45B105D-2303-459A-AF4B-52AC3AAD5510} ZRCOLABINDIR 256 fileZRCola.exe.x64
!ENDIF
!IF "$(LANG)" == "Sl"
!IF "$(LANG)" == "ru_RU"
compZRCola.mo.ru_RU {DEA5D11C-2B0E-4B85-ACE3-D76334866F50} ZRCOLALOCRURUDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileZRCola.mo.ru_RU
!ENDIF
!IF "$(LANG)" == "sl_SI"
compZRCola.mo.sl_SI {7FF95C71-D8DE-4D2B-A26D-FEB5A1F54D63} ZRCOLALOCSLSIDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileZRCola.mo.sl_SI
!ENDIF
<<NOKEEP
######################################################################
# Control
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)
1252 Control Dialog_ Control
dlgTutorial1 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial1 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Starting ctlScreenshot
dlgTutorial1 ctlScreenshot Bitmap 154 60 92 54 5 bintutorial1.bmp ctlText1
dlgTutorial1 ctlText1 Text 15 119 370 24 196611 When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5. ctlText2
dlgTutorial1 ctlText2 Text 15 148 370 36 196611 IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters! ctlContinue
dlgTutorial1 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
dlgTutorial2 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial2 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Composition ctlScreenshot
dlgTutorial2 ctlScreenshot Bitmap 81 60 238 137 5 bintutorial2.bmp ctlText1
dlgTutorial2 ctlText1 Text 15 202 370 36 196611 The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used. ctlContinue
dlgTutorial2 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
dlgTutorial3 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial3 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Entering Characters ctlScreenshot
dlgTutorial3 ctlScreenshot Bitmap 147 60 106 112 5 bintutorial3.bmp ctlText1
dlgTutorial3 ctlText1 Text 15 177 370 24 196611 Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8). ctlContinue
dlgTutorial3 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
<<NOKEEP
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Control-2.idt" : "en_US.$(PLAT).$(CFG).Control-2.idtx"
copy /y $** $@ > NUL
!ELSE
"$(LANG).$(PLAT).$(CFG).Control-2.idt" : "en_US.$(PLAT).$(CFG).Control-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################
# ControlEvent
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
ControlEvent Dialog_ Control_ Event Argument Condition
dlgTutorial1 ctlContinue EndDialog Return 1 1000
dlgTutorial2 ctlContinue EndDialog Return 1 1000
dlgTutorial3 ctlContinue EndDialog Return 1 1000
<<NOKEEP
######################################################################
# Dialog
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
Dialog Dialog
dlgTutorial1 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
dlgTutorial2 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
dlgTutorial3 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
<<NOKEEP
######################################################################
# InstallUISequence
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
InstallUISequence Action
dlgTutorial1 NOT Installed AND &featZRCola>=3 1400
dlgTutorial2 NOT Installed AND &featZRCola>=3 1401
dlgTutorial3 NOT Installed AND &featZRCola>=3 1402
<<NOKEEP
######################################################################
# Feature
All :: "$(LANG).$(PLAT).$(CFG).Feature-2.idt"
"En.$(PLAT).$(CFG).Feature-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
"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
@@ -94,17 +220,13 @@ s$(MSIBUILD_LENGTH_ID) S$(MSIBUILD_LENGTH_ID) L64 L255 I2 i2 S$(MSIBUILD_LENGTH_
featZRCola ZRCola Input system for linguistic use 1 1 ZRCOLADIR 8
<<NOKEEP
"De.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\de_DE.po"
rcxgettext.exe idtp $@ $**
"En.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx"
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Feature-2.idt" : "en_US.$(PLAT).$(CFG).Feature-2.idtx"
copy /y $** $@ > NUL
"It.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\it_IT.po"
rcxgettext.exe idtp $@ $**
"Sl.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\sl_SI.po"
rcxgettext.exe idtp $@ $**
!ELSE
"$(LANG).$(PLAT).$(CFG).Feature-2.idt" : "en_US.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################
@@ -122,16 +244,19 @@ featZRCola compZRCola.exe.$(PLAT)
featZRCola complibZRCola.dll.$(PLAT)
featZRCola complibZRColaUI.dll.$(PLAT)
featZRCola compwxExtend.dll.$(PLAT)
featZRCola compUpdater.dll.$(PLAT)
featZRCola compLocalizationRepositoryPath
featZRCola compLanguage
featZRCola compDatabasePath
featZRCola compZRCola.zrcdb
featZRCola comp00_ZRCola_Re.ttf
!IF "$(LANG)" == "Sl"
featZRCola compZRCola.mo.sl_SI
featZRCola compZRCola.zrcdb.mo.sl_SI
featZRCola compwxExtend.mo.sl_SI
featZRCola compwxstd.mo.sl_SI
featZRCola compZRCola_Re.otf
!IF "$(LANG)" != "en_US"
featZRCola compZRCola.mo.$(LANG)
featZRCola compZRCola.zrcdb.mo.$(LANG)
featZRCola complibZRColaUI.mo.$(LANG)
featZRCola compwxExtend.mo.$(LANG)
featZRCola compUpdater.mo.$(LANG)
featZRCola compwxstd.mo.$(LANG)
!ENDIF
<<NOKEEP
@@ -148,8 +273,8 @@ File Component_ FileName FileSize Version Language Attributes Sequence
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l255 i4 S$(MSIBUILD_LENGTH_ID) S20 I2 i2
File File
fileZRCola.exe.$(PLAT) compZRCola.exe.$(PLAT) ZRCola.exe 0 0 1536 1
!IF "$(LANG)" == "Sl"
fileZRCola.mo.sl_SI compZRCola.mo.sl_SI ZRCola.mo 0 1060 0 1
!IF "$(LANG)" != "en_US"
fileZRCola.mo.$(LANG) compZRCola.mo.$(LANG) ZRCola.mo 0 $(MSIBUILD_LANGID) 0 1
!ENDIF
<<NOKEEP
@@ -194,7 +319,7 @@ rmfiZRCola compZRCola.exe.$(PLAT) ZRColaShortcutDir 2
All :: "$(LANG).$(PLAT).$(CFG).Shortcut-2.idt"
"En.$(PLAT).$(CFG).Shortcut-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
"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
@@ -203,17 +328,13 @@ s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l128 s$(MSIBUILD_LENGTH_ID) s$(MSI
shctZRCola ZRColaShortcutDir ZRCola compZRCola.exe.$(PLAT) featZRCola Input system for linguistic use iconZRCola.ico ZRCOLABINDIR
<<NOKEEP
"De.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\de_DE.po"
rcxgettext.exe idtp $@ $**
"En.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx"
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Shortcut-2.idt" : "en_US.$(PLAT).$(CFG).Shortcut-2.idtx"
copy /y $** $@ > NUL
"It.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\it_IT.po"
rcxgettext.exe idtp $@ $**
"Sl.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\sl_SI.po"
rcxgettext.exe idtp $@ $**
!ELSE
"$(LANG).$(PLAT).$(CFG).Shortcut-2.idt" : "en_US.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\Updater\Updater\include;..\lib\stdex\include;..\lib\WinStd\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />

Binary file not shown.

View File

@@ -80,23 +80,33 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="zrcolaabout.cpp" />
<ClCompile Include="zrcolaapp.cpp" />
<ClCompile Include="zrcolachrcatpnl.cpp" />
<ClCompile Include="zrcolachrgrid.cpp" />
<ClCompile Include="zrcolachrreq.cpp" />
<ClCompile Include="zrcolachrslct.cpp" />
<ClCompile Include="zrcolacomppnl.cpp" />
<ClCompile Include="zrcolafrm.cpp" />
<ClCompile Include="zrcolagui.cpp" />
<ClCompile Include="zrcolakeyhndlr.cpp" />
<ClCompile Include="zrcolasettings.cpp" />
<ClCompile Include="zrcolaupdater.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="zrcolaabout.h" />
<ClInclude Include="zrcolaapp.h" />
<ClInclude Include="zrcolachrcatpnl.h" />
<ClInclude Include="zrcolachrgrid.h" />
<ClInclude Include="zrcolachrreq.h" />
<ClInclude Include="zrcolachrslct.h" />
<ClInclude Include="zrcolacomppnl.h" />
<ClInclude Include="zrcolafrm.h" />
<ClInclude Include="zrcolagui.h" />
<ClInclude Include="zrcolakeyhndlr.h" />
<ClInclude Include="zrcolasettings.h" />
<ClInclude Include="zrcolaupdater.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\libZRColaUI\build\libZRColaUI.vcxproj">
@@ -105,14 +115,26 @@
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtend.vcxproj">
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendDll.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
<ProjectReference Include="..\Updater\Updater\build\Updater.vcxproj">
<Project>{990d8cf9-4457-4dc0-aa18-4968ef434741}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRCola.pot" />
<None Include="res\char_select.ico" />
<None Include="res\copy_composed_and_return.ico" />
<None Include="res\copy_decomposed_and_return.ico" />
<None Include="res\edit_copy.ico" />
<None Include="res\edit_cut.ico" />
<None Include="res\edit_paste.ico" />
<None Include="res\navigate_back.ico" />
<None Include="res\navigate_forward.ico" />
<None Include="res\send_abort.ico" />
<None Include="res\send_composed.ico" />
<None Include="res\send_decomposed.ico" />
@@ -123,6 +145,8 @@
<ResourceCompile Include="ZRCola.rc" />
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\de_DE.po" />
<POCompile Include="locale\ru_RU.po" />
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@@ -43,6 +43,21 @@
<ClCompile Include="zrcolachrcatpnl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolachrslct.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolasettings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolaabout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolaupdater.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolachrreq.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@@ -69,6 +84,21 @@
<ClInclude Include="zrcolachrcatpnl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolachrslct.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolasettings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolaabout.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolaupdater.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolachrreq.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\zrcola.ico">
@@ -95,6 +125,24 @@
<None Include="ZRCola.fbp">
<Filter>Resource Files</Filter>
</None>
<None Include="res\char_select.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="locale\ZRCola.pot">
<Filter>Resource Files\Localization</Filter>
</None>
<None Include="res\navigate_back.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\navigate_forward.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_composed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_decomposed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc">
@@ -105,5 +153,11 @@
<POCompile Include="locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\de_DE.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\ru_RU.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
</Project>

673
ZRCola/locale/ZRCola.pot Normal file
View File

@@ -0,0 +1,673 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2017-04-03 12:01+0200\n"
"PO-Revision-Date: 2016-05-13 15:52+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: zrcolaabout.cpp:31
#, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr ""
#: zrcolaapp.cpp:72 zrcolafrm.cpp:92 zrcolagui.cpp:980 zrcolagui.h:106
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "ZRCola"
msgstr ""
#: zrcolachrreq.cpp:49 zrcolagui.cpp:1110
msgid "Character"
msgstr ""
#: zrcolachrreq.cpp:58 zrcolagui.cpp:1131
msgid "Context"
msgstr ""
#: zrcolachrreq.cpp:64 zrcolagui.h:379
msgid "Request a New Character"
msgstr ""
#: zrcolachrslct.cpp:89
msgid "Too many digits in Unicode."
msgstr ""
#: zrcolachrslct.cpp:89 zrcolachrslct.cpp:107
msgid "Validation conflict"
msgstr ""
#: zrcolachrslct.cpp:107
#, c-format
msgid "Invalid character in Unicode found: %c"
msgstr ""
#: zrcolachrslct.cpp:214 zrcolachrslct.cpp:390 zrcolachrslct.cpp:869
msgid "▸ Search Options"
msgstr ""
#: zrcolachrslct.cpp:328
msgid ", "
msgstr ""
#: zrcolachrslct.cpp:393 zrcolachrslct.cpp:866
msgid "▾ Search Options"
msgstr ""
#: zrcolafrm.cpp:143
msgid "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:143 zrcolafrm.cpp:145
msgid "Warning"
msgstr ""
#: zrcolafrm.cpp:145
msgid "ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:362
msgid "http://zrcola.zrc-sazu.si/en/info/instructions/"
msgstr ""
#: zrcolafrm.cpp:386
msgid "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
msgstr ""
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr ""
#: zrcolagui.cpp:36
msgid "Quit this program"
msgstr ""
#: zrcolagui.cpp:39
msgid "&Program"
msgstr ""
#: zrcolagui.cpp:72
msgid "Select &All"
msgstr ""
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr ""
#: zrcolagui.cpp:78
msgid "Find C&haracter..."
msgstr ""
#: zrcolagui.cpp:78 zrcolagui.cpp:198
msgid "Display character search to select character to insert into text"
msgstr ""
#: zrcolagui.cpp:89
msgid "&Send Composed"
msgstr ""
#: zrcolagui.cpp:89 zrcolagui.cpp:200
msgid "Send composed text to source window"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy Composed and &Return"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy composed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:107
msgid "Send &Decomposed"
msgstr ""
#: zrcolagui.cpp:107 zrcolagui.cpp:202
msgid "Send decomposed text to source window"
msgstr ""
#: zrcolagui.cpp:116
msgid "Copy Decomposed and Re&turn"
msgstr ""
#: zrcolagui.cpp:116
msgid "Copy decomposed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:125
msgid "Abort (De)composition"
msgstr ""
#: zrcolagui.cpp:125
msgid "Abort composition and return focus to source window"
msgstr ""
#: zrcolagui.cpp:136
msgid "&Settings..."
msgstr ""
#: zrcolagui.cpp:136
msgid "Open program configuration dialog"
msgstr ""
#: zrcolagui.cpp:139
msgid "&Edit"
msgstr ""
#: zrcolagui.cpp:143
msgid "&Edit Toolbar"
msgstr ""
#: zrcolagui.cpp:143
msgid "Toggle edit toolbar"
msgstr ""
#: zrcolagui.cpp:147
msgid "&Compose Toolbar"
msgstr ""
#: zrcolagui.cpp:147
msgid "Toggle compose toolbar"
msgstr ""
#: zrcolagui.cpp:153
msgid "Character Catalo&g"
msgstr ""
#: zrcolagui.cpp:153
msgid "Toggle character catalog panel"
msgstr ""
#: zrcolagui.cpp:156
msgid "&View"
msgstr ""
#: zrcolagui.cpp:160
msgid "&Instructions..."
msgstr ""
#: zrcolagui.cpp:160
msgid "Open a web site with product instructions"
msgstr ""
#: zrcolagui.cpp:164
msgid "Keyboard &Shortcuts..."
msgstr ""
#: zrcolagui.cpp:164
msgid "Open a list of keyboard shortcuts"
msgstr ""
#: zrcolagui.cpp:170
msgid "&Request a new character..."
msgstr ""
#: zrcolagui.cpp:170
msgid "Submit a request to ZRC to add a new character"
msgstr ""
#: zrcolagui.cpp:174
msgid "Check for &Updates..."
msgstr ""
#: zrcolagui.cpp:174
msgid "Check online for product update"
msgstr ""
#: zrcolagui.cpp:180
msgid "&About..."
msgstr ""
#: zrcolagui.cpp:183
msgid "&Help"
msgstr ""
#: zrcolagui.cpp:188
msgid "Cut"
msgstr ""
#: zrcolagui.cpp:188
msgid "Cut selection"
msgstr ""
#: zrcolagui.cpp:190
msgid "Copy"
msgstr ""
#: zrcolagui.cpp:190
msgid "Copy selection"
msgstr ""
#: zrcolagui.cpp:192
msgid "Paste"
msgstr ""
#: zrcolagui.cpp:192
msgid "Paste selection"
msgstr ""
#: zrcolagui.cpp:195
msgid "Edit"
msgstr ""
#: zrcolagui.cpp:198
msgid "Find Character"
msgstr ""
#: zrcolagui.cpp:200
msgid "Send Composed"
msgstr ""
#: zrcolagui.cpp:202
msgid "Send Decomposed"
msgstr ""
#: zrcolagui.cpp:205
msgid "Compose"
msgstr ""
#: zrcolagui.cpp:209
msgid "Character Catalog"
msgstr ""
#: zrcolagui.cpp:213
msgid "(De)Composer"
msgstr ""
#: zrcolagui.cpp:252
msgid "Decomposed Text"
msgstr ""
#: zrcolagui.cpp:272
msgid "Decomposed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:299
msgid "Composed Text"
msgstr ""
#: zrcolagui.cpp:319
msgid "Composed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:373
msgid "Select category to display"
msgstr ""
#: zrcolagui.cpp:407
msgid "Show &All"
msgstr ""
#: zrcolagui.cpp:408
msgid "Toggle display of less frequent characters"
msgstr ""
#: zrcolagui.cpp:448
msgid "&Browse"
msgstr ""
#: zrcolagui.cpp:455
msgid "Full or partial terms from Unicode character description (in English) to search for"
msgstr ""
#: zrcolagui.cpp:459
msgid "Search Options"
msgstr ""
#: zrcolagui.cpp:460
msgid "Shows/hides additional search options"
msgstr ""
#: zrcolagui.cpp:472
msgid "List of Unicode character categories to search in"
msgstr ""
#: zrcolagui.cpp:479
msgid "All"
msgstr ""
#: zrcolagui.cpp:480
msgid "Select all categories"
msgstr ""
#: zrcolagui.cpp:484
msgid "None"
msgstr ""
#: zrcolagui.cpp:485
msgid "Clear category selection"
msgstr ""
#: zrcolagui.cpp:489
msgid "Invert"
msgstr ""
#: zrcolagui.cpp:490
msgid "Invert category selection"
msgstr ""
#: zrcolagui.cpp:529
msgid "Character search results"
msgstr ""
#: zrcolagui.cpp:539
msgid "Re&cently Used"
msgstr ""
#: zrcolagui.cpp:567
msgid "List of recently inserted characters"
msgstr ""
#: zrcolagui.cpp:581
msgid "Preview"
msgstr ""
#: zrcolagui.cpp:586
msgid "U+"
msgstr ""
#: zrcolagui.cpp:591
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:596
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:631
msgid "Character preview"
msgstr ""
#: zrcolagui.cpp:636
msgid "Unicode character description"
msgstr ""
#: zrcolagui.cpp:641
msgid "Character tags"
msgstr ""
#: zrcolagui.cpp:646
msgid "Unicode character category"
msgstr ""
#: zrcolagui.cpp:653
msgid "« Back"
msgstr ""
#: zrcolagui.cpp:655
msgid "To previously viewed character"
msgstr ""
#: zrcolagui.cpp:659
msgid "Forward »"
msgstr ""
#: zrcolagui.cpp:661
msgid "To following viewed character"
msgstr ""
#: zrcolagui.cpp:672
msgid "Re&lated"
msgstr ""
#: zrcolagui.cpp:699
msgid "List of related characters"
msgstr ""
#: zrcolagui.cpp:790
msgid ""
"Some character native to specific language you are working with should not decompose to primitives.\n"
"For optimal decomposition you should set the language correctly."
msgstr ""
#: zrcolagui.cpp:794
msgid "Select language &automatically according to selected keyboard"
msgstr ""
#: zrcolagui.cpp:797
msgid "&Manually select the language from the list below:"
msgstr ""
#: zrcolagui.cpp:809
msgid "Text Language"
msgstr ""
#: zrcolagui.cpp:816
msgid ""
"ZRCola offers multiple text transformations that can be arranged in a sequence.\n"
"Please select desired transformations and the order they are applied."
msgstr ""
#: zrcolagui.cpp:831
msgid "A&vailable:"
msgstr ""
#: zrcolagui.cpp:844
msgid ">"
msgstr ""
#: zrcolagui.cpp:847
msgid "<"
msgstr ""
#: zrcolagui.cpp:856
msgid "&Active:"
msgstr ""
#: zrcolagui.cpp:872
msgid "Up"
msgstr ""
#: zrcolagui.cpp:875
msgid "Down"
msgstr ""
#: zrcolagui.cpp:885
msgid "Transformation"
msgstr ""
#: zrcolagui.cpp:892
msgid ""
"ZRCola can be launched every time you log in to your computer.\n"
"It will be available on the system tray and via registered shortcuts Win+F5 and Win+F6."
msgstr ""
#: zrcolagui.cpp:896
msgid "Start ZRCola &automatically on logon"
msgstr ""
#: zrcolagui.cpp:903
msgid "Startup"
msgstr ""
#: zrcolagui.cpp:991
msgid ""
"Program and Website Editor: Janoš Ježovnik\n"
"Development: Amebis, d. o. o., Kamnik\n"
"Translation into English: Janoš Ježovnik\n"
"Translation into Russian language: Domen Krvina, Silvo Torkar, Anastasia Plotnikova\n"
"Development and maintenance of the original program (20042015): Peter Weiss"
msgstr ""
#: zrcolagui.cpp:999
msgid "zrcola.zrc-sazu.si"
msgstr ""
#: zrcolagui.cpp:1005
msgid "Texts made using ZRCola have to include in a footnote or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:1009
msgid "This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Peter Weiss."
msgstr ""
#: zrcolagui.cpp:1050
msgid "Log"
msgstr ""
#: zrcolagui.cpp:1066
msgid "Quit and &Update..."
msgstr ""
#: zrcolagui.cpp:1068
msgid "Exit this program and launch product update"
msgstr ""
#: zrcolagui.cpp:1072
msgid "&Close"
msgstr ""
#: zrcolagui.cpp:1073
msgid "Close this window"
msgstr ""
#: zrcolagui.cpp:1112
msgid "Enter the &character you would like to request:"
msgstr ""
#: zrcolagui.cpp:1119
msgid "Decomposed character to request"
msgstr ""
#: zrcolagui.cpp:1123
msgid ""
"Please, use the decomposed form.\n"
"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window."
msgstr ""
#: zrcolagui.cpp:1133
msgid "The &context, examples or description why and where the character is required:"
msgstr ""
#: zrcolagui.cpp:1139
msgid "Additional notes for character request"
msgstr ""
#: zrcolagui.cpp:1146
msgid ""
"After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\n"
"Your e-mail application might not display all the characters correctly, but the Editor will be able to read them correctly anyway."
msgstr ""
#: zrcolakeyhndlr.cpp:44
msgid "INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."
msgstr ""
#: zrcolasettings.cpp:90
#, c-format
msgid "Unknown transformation (%u)"
msgstr ""
#: zrcolasettings.cpp:181
msgid "Start ZRCola automatically on logon"
msgstr ""
#: zrcolaupdater.cpp:94
msgid ""
"This program will now close and the upgrade will be launched.\n"
"Are you sure?"
msgstr ""
#: zrcolaupdater.cpp:94 zrcolagui.h:350
msgid "Product Update"
msgstr ""
#: zrcolagui.h:248
msgid "Character Search"
msgstr ""
#: zrcolagui.h:299
msgid "Settings"
msgstr ""
#: zrcolagui.h:325
msgid "About ZRCola"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:15
#: MSIBuild/en_US.x64.Release.Control-2.idtx:4
#: MSIBuild/en_US.x64.Release.Control-2.idtx:10
#: MSIBuild/en_US.x64.Release.Control-2.idtx:15
msgid "binUIHeader.bmp"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:5
#: MSIBuild/en_US.x64.Release.Control-2.idtx:5
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Starting"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:6
#: MSIBuild/en_US.x64.Release.Control-2.idtx:6
msgid "bintutorial1.bmp"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:7
#: MSIBuild/en_US.x64.Release.Control-2.idtx:7
msgid "When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:8
#: MSIBuild/en_US.x64.Release.Control-2.idtx:8
msgid "IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters!"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:19
#: MSIBuild/en_US.x64.Release.Control-2.idtx:9
#: MSIBuild/en_US.x64.Release.Control-2.idtx:14
#: MSIBuild/en_US.x64.Release.Control-2.idtx:19
msgid "&Continue"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:11
#: MSIBuild/en_US.x64.Release.Control-2.idtx:11
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Composition"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:12
#: MSIBuild/en_US.x64.Release.Control-2.idtx:12
msgid "bintutorial2.bmp"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:13
#: MSIBuild/en_US.x64.Release.Control-2.idtx:13
msgid "The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:16
#: MSIBuild/en_US.x64.Release.Control-2.idtx:16
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Entering Characters"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:17
#: MSIBuild/en_US.x64.Release.Control-2.idtx:17
msgid "bintutorial3.bmp"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:18
#: MSIBuild/en_US.x64.Release.Control-2.idtx:18
msgid "Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8)."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "Input system for linguistic use"
msgstr ""

713
ZRCola/locale/de_DE.po Normal file
View File

@@ -0,0 +1,713 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2017-04-03 12:04+0200\n"
"PO-Revision-Date: 2017-04-03 12:05+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: zrcolaabout.cpp:31
#, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr ""
#: zrcolaapp.cpp:72 zrcolafrm.cpp:92 zrcolagui.cpp:980 zrcolagui.h:106
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "ZRCola"
msgstr "ZRCola"
#: zrcolachrreq.cpp:49 zrcolagui.cpp:1110
#, fuzzy
msgid "Character"
msgstr "Eingabe eines Zeichenstils"
#: zrcolachrreq.cpp:58 zrcolagui.cpp:1131
#, fuzzy
msgid "Context"
msgstr "Konnte den Kontext auf dem überlagerten Fenster nicht initialisieren."
#: zrcolachrreq.cpp:64 zrcolagui.h:379
msgid "Request a New Character"
msgstr ""
#: zrcolachrslct.cpp:89
msgid "Too many digits in Unicode."
msgstr ""
#: zrcolachrslct.cpp:89 zrcolachrslct.cpp:107
msgid "Validation conflict"
msgstr "Fehler bei der Validierung"
#: zrcolachrslct.cpp:107
#, c-format
msgid "Invalid character in Unicode found: %c"
msgstr ""
#: zrcolachrslct.cpp:214 zrcolachrslct.cpp:390 zrcolachrslct.cpp:869
msgid "▸ Search Options"
msgstr ""
# Recitation separator
#: zrcolachrslct.cpp:328
#, fuzzy
msgid ", "
msgstr ", "
#: zrcolachrslct.cpp:393 zrcolachrslct.cpp:866
msgid "▾ Search Options"
msgstr ""
#: zrcolafrm.cpp:143
msgid "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:143 zrcolafrm.cpp:145
#, fuzzy
msgid "Warning"
msgstr "Warnung: "
#: zrcolafrm.cpp:145
msgid "ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:362
msgid "http://zrcola.zrc-sazu.si/en/info/instructions/"
msgstr "http://zrcola.zrc-sazu.si/de/info/instructions/"
#: zrcolafrm.cpp:386
msgid "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
msgstr "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr ""
#: zrcolagui.cpp:36
#, fuzzy
msgid "Quit this program"
msgstr "Dieses Programm beenden"
#: zrcolagui.cpp:39
#, fuzzy
msgid "&Program"
msgstr "Samodejno zaženi ta program ob prijavi"
#: zrcolagui.cpp:72
#, fuzzy
msgid "Select &All"
msgstr "Alles auswählen"
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr ""
#: zrcolagui.cpp:78
#, fuzzy
msgid "Find C&haracter..."
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:78 zrcolagui.cpp:198
msgid "Display character search to select character to insert into text"
msgstr ""
#: zrcolagui.cpp:89
#, fuzzy
msgid "&Send Composed"
msgstr "Pošlji sestavljeno (F5)"
#: zrcolagui.cpp:89 zrcolagui.cpp:200
msgid "Send composed text to source window"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy Composed and &Return"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy composed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:107
#, fuzzy
msgid "Send &Decomposed"
msgstr "Pošlji razstavljeno (F6)"
#: zrcolagui.cpp:107 zrcolagui.cpp:202
msgid "Send decomposed text to source window"
msgstr ""
#: zrcolagui.cpp:116
msgid "Copy Decomposed and Re&turn"
msgstr ""
#: zrcolagui.cpp:116
msgid "Copy decomposed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:125
msgid "Abort (De)composition"
msgstr ""
#: zrcolagui.cpp:125
msgid "Abort composition and return focus to source window"
msgstr ""
#: zrcolagui.cpp:136
msgid "&Settings..."
msgstr ""
#: zrcolagui.cpp:136
msgid "Open program configuration dialog"
msgstr ""
#: zrcolagui.cpp:139
#, fuzzy
msgid "&Edit"
msgstr "&Bearbeiten"
#: zrcolagui.cpp:143
msgid "&Edit Toolbar"
msgstr ""
#: zrcolagui.cpp:143
msgid "Toggle edit toolbar"
msgstr ""
#: zrcolagui.cpp:147
msgid "&Compose Toolbar"
msgstr ""
#: zrcolagui.cpp:147
msgid "Toggle compose toolbar"
msgstr ""
#: zrcolagui.cpp:153
msgid "Character Catalo&g"
msgstr ""
#: zrcolagui.cpp:153
msgid "Toggle character catalog panel"
msgstr ""
#: zrcolagui.cpp:156
#, fuzzy
msgid "&View"
msgstr "&Ansicht..."
#: zrcolagui.cpp:160
msgid "&Instructions..."
msgstr ""
#: zrcolagui.cpp:160
msgid "Open a web site with product instructions"
msgstr ""
#: zrcolagui.cpp:164
msgid "Keyboard &Shortcuts..."
msgstr ""
#: zrcolagui.cpp:164
msgid "Open a list of keyboard shortcuts"
msgstr ""
#: zrcolagui.cpp:170
msgid "&Request a new character..."
msgstr ""
#: zrcolagui.cpp:170
msgid "Submit a request to ZRC to add a new character"
msgstr ""
#: zrcolagui.cpp:174
msgid "Check for &Updates..."
msgstr ""
#: zrcolagui.cpp:174
msgid "Check online for product update"
msgstr ""
#: zrcolagui.cpp:180
msgid "&About..."
msgstr ""
#: zrcolagui.cpp:183
#, fuzzy
msgid "&Help"
msgstr "&Hilfe"
#: zrcolagui.cpp:188
#, fuzzy
msgid "Cut"
msgstr "Ausschneiden"
#: zrcolagui.cpp:188
#, fuzzy
msgid "Cut selection"
msgstr "Auswahl ausschneiden"
#: zrcolagui.cpp:190
#, fuzzy
msgid "Copy"
msgstr "Kopieren"
#: zrcolagui.cpp:190
#, fuzzy
msgid "Copy selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:192
#, fuzzy
msgid "Paste"
msgstr "Einfügen"
#: zrcolagui.cpp:192
#, fuzzy
msgid "Paste selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:195
#, fuzzy
msgid "Edit"
msgstr "Bearbeiten"
#: zrcolagui.cpp:198
#, fuzzy
msgid "Find Character"
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:200
#, fuzzy
msgid "Send Composed"
msgstr "Pošlji sestavljeno (F5)"
#: zrcolagui.cpp:202
#, fuzzy
msgid "Send Decomposed"
msgstr "Pošlji razstavljeno (F6)"
#: zrcolagui.cpp:205
msgid "Compose"
msgstr ""
#: zrcolagui.cpp:209
msgid "Character Catalog"
msgstr ""
#: zrcolagui.cpp:213
msgid "(De)Composer"
msgstr ""
#: zrcolagui.cpp:252
msgid "Decomposed Text"
msgstr ""
#: zrcolagui.cpp:272
msgid "Decomposed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:299
msgid "Composed Text"
msgstr ""
#: zrcolagui.cpp:319
msgid "Composed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:373
msgid "Select category to display"
msgstr ""
#: zrcolagui.cpp:407
#, fuzzy
msgid "Show &All"
msgstr "Alles zeigen"
#: zrcolagui.cpp:408
msgid "Toggle display of less frequent characters"
msgstr ""
#: zrcolagui.cpp:448
#, fuzzy
msgid "&Browse"
msgstr "Durchsuchen"
#: zrcolagui.cpp:455
msgid "Full or partial terms from Unicode character description (in English) to search for"
msgstr ""
#: zrcolagui.cpp:459
msgid "Search Options"
msgstr ""
#: zrcolagui.cpp:460
msgid "Shows/hides additional search options"
msgstr ""
#: zrcolagui.cpp:472
msgid "List of Unicode character categories to search in"
msgstr ""
#: zrcolagui.cpp:479
#, fuzzy
msgid "All"
msgstr "Alle"
#: zrcolagui.cpp:480
msgid "Select all categories"
msgstr ""
#: zrcolagui.cpp:484
#, fuzzy
msgid "None"
msgstr "Kein"
#: zrcolagui.cpp:485
#, fuzzy
msgid "Clear category selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:489
msgid "Invert"
msgstr ""
#: zrcolagui.cpp:490
#, fuzzy
msgid "Invert category selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:529
#, fuzzy
msgid "Character search results"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:539
msgid "Re&cently Used"
msgstr ""
#: zrcolagui.cpp:567
msgid "List of recently inserted characters"
msgstr ""
#: zrcolagui.cpp:581
#, fuzzy
msgid "Preview"
msgstr " Vorschau"
#: zrcolagui.cpp:586
msgid "U+"
msgstr "U+"
#: zrcolagui.cpp:591
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:596
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:631
#, fuzzy
msgid "Character preview"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:636
msgid "Unicode character description"
msgstr ""
#: zrcolagui.cpp:641
#, fuzzy
msgid "Character tags"
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:646
msgid "Unicode character category"
msgstr ""
#: zrcolagui.cpp:653
#, fuzzy
msgid "« Back"
msgstr "< &Zurück"
#: zrcolagui.cpp:655
msgid "To previously viewed character"
msgstr ""
#: zrcolagui.cpp:659
#, fuzzy
msgid "Forward »"
msgstr "&Vorwärts"
#: zrcolagui.cpp:661
msgid "To following viewed character"
msgstr ""
#: zrcolagui.cpp:672
msgid "Re&lated"
msgstr ""
#: zrcolagui.cpp:699
msgid "List of related characters"
msgstr ""
#: zrcolagui.cpp:790
msgid ""
"Some character native to specific language you are working with should not decompose to primitives.\n"
"For optimal decomposition you should set the language correctly."
msgstr ""
#: zrcolagui.cpp:794
msgid "Select language &automatically according to selected keyboard"
msgstr ""
#: zrcolagui.cpp:797
msgid "&Manually select the language from the list below:"
msgstr ""
#: zrcolagui.cpp:809
msgid "Text Language"
msgstr ""
#: zrcolagui.cpp:816
msgid ""
"ZRCola offers multiple text transformations that can be arranged in a sequence.\n"
"Please select desired transformations and the order they are applied."
msgstr ""
#: zrcolagui.cpp:831
msgid "A&vailable:"
msgstr ""
#: zrcolagui.cpp:844
msgid ">"
msgstr ">"
#: zrcolagui.cpp:847
msgid "<"
msgstr "<"
#: zrcolagui.cpp:856
msgid "&Active:"
msgstr ""
#: zrcolagui.cpp:872
msgid "Up"
msgstr ""
#: zrcolagui.cpp:875
msgid "Down"
msgstr ""
#: zrcolagui.cpp:885
msgid "Transformation"
msgstr ""
#: zrcolagui.cpp:892
msgid ""
"ZRCola can be launched every time you log in to your computer.\n"
"It will be available on the system tray and via registered shortcuts Win+F5 and Win+F6."
msgstr ""
#: zrcolagui.cpp:896
msgid "Start ZRCola &automatically on logon"
msgstr ""
#: zrcolagui.cpp:903
msgid "Startup"
msgstr ""
#: zrcolagui.cpp:991
msgid ""
"Program and Website Editor: Janoš Ježovnik\n"
"Development: Amebis, d. o. o., Kamnik\n"
"Translation into English: Janoš Ježovnik\n"
"Translation into Russian language: Domen Krvina, Silvo Torkar, Anastasia Plotnikova\n"
"Development and maintenance of the original program (20042015): Peter Weiss"
msgstr ""
#: zrcolagui.cpp:999
msgid "zrcola.zrc-sazu.si"
msgstr ""
#: zrcolagui.cpp:1005
msgid "Texts made using ZRCola have to include in a footnote or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:1009
msgid "This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Peter Weiss."
msgstr ""
#: zrcolagui.cpp:1050
#, fuzzy
msgid "Log"
msgstr "&Log"
#: zrcolagui.cpp:1066
#, fuzzy
msgid "Quit and &Update..."
msgstr "Kann Benutzer-Konfigurationsdatei nicht aktualisieren."
#: zrcolagui.cpp:1068
msgid "Exit this program and launch product update"
msgstr ""
#: zrcolagui.cpp:1072
#, fuzzy
msgid "&Close"
msgstr "&Schließen"
#: zrcolagui.cpp:1073
#, fuzzy
msgid "Close this window"
msgstr "Fenster schließen"
#: zrcolagui.cpp:1112
msgid "Enter the &character you would like to request:"
msgstr ""
#: zrcolagui.cpp:1119
msgid "Decomposed character to request"
msgstr ""
#: zrcolagui.cpp:1123
msgid ""
"Please, use the decomposed form.\n"
"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window."
msgstr ""
#: zrcolagui.cpp:1133
msgid "The &context, examples or description why and where the character is required:"
msgstr ""
#: zrcolagui.cpp:1139
msgid "Additional notes for character request"
msgstr ""
#: zrcolagui.cpp:1146
msgid ""
"After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\n"
"Your e-mail application might not display all the characters correctly, but the Editor will be able to read them correctly anyway."
msgstr ""
#: zrcolakeyhndlr.cpp:44
msgid "INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."
msgstr ""
#: zrcolasettings.cpp:90
#, c-format
msgid "Unknown transformation (%u)"
msgstr ""
#: zrcolasettings.cpp:181
msgid "Start ZRCola automatically on logon"
msgstr ""
#: zrcolaupdater.cpp:94
msgid ""
"This program will now close and the upgrade will be launched.\n"
"Are you sure?"
msgstr ""
#: zrcolaupdater.cpp:94 zrcolagui.h:350
msgid "Product Update"
msgstr ""
#: zrcolagui.h:248
#, fuzzy
msgid "Character Search"
msgstr "Skupine &znakov"
#: zrcolagui.h:299
msgid "Settings"
msgstr ""
#: zrcolagui.h:325
msgid "About ZRCola"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:15
#: MSIBuild/en_US.x64.Release.Control-2.idtx:4
#: MSIBuild/en_US.x64.Release.Control-2.idtx:10
#: MSIBuild/en_US.x64.Release.Control-2.idtx:15
msgid "binUIHeader.bmp"
msgstr "binUIHeader.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:5
#: MSIBuild/en_US.x64.Release.Control-2.idtx:5
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Starting"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:6
#: MSIBuild/en_US.x64.Release.Control-2.idtx:6
msgid "bintutorial1.bmp"
msgstr "bintutorial1.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:7
#: MSIBuild/en_US.x64.Release.Control-2.idtx:7
msgid "When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:8
#: MSIBuild/en_US.x64.Release.Control-2.idtx:8
msgid "IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters!"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:19
#: MSIBuild/en_US.x64.Release.Control-2.idtx:9
#: MSIBuild/en_US.x64.Release.Control-2.idtx:14
#: MSIBuild/en_US.x64.Release.Control-2.idtx:19
#, fuzzy
msgid "&Continue"
msgstr "Konnte den Kontext auf dem überlagerten Fenster nicht initialisieren."
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:11
#: MSIBuild/en_US.x64.Release.Control-2.idtx:11
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Composition"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:12
#: MSIBuild/en_US.x64.Release.Control-2.idtx:12
msgid "bintutorial2.bmp"
msgstr "bintutorial2.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:13
#: MSIBuild/en_US.x64.Release.Control-2.idtx:13
msgid "The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:16
#: MSIBuild/en_US.x64.Release.Control-2.idtx:16
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Entering Characters"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:17
#: MSIBuild/en_US.x64.Release.Control-2.idtx:17
msgid "bintutorial3.bmp"
msgstr "bintutorial3.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:18
#: MSIBuild/en_US.x64.Release.Control-2.idtx:18
msgid "Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8)."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "Input system for linguistic use"
msgstr ""

935
ZRCola/locale/ru_RU.po Normal file
View File

@@ -0,0 +1,935 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2017-04-03 12:04+0200\n"
"PO-Revision-Date: 2017-04-03 12:04+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: zrcolaabout.cpp:31
#, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr "© 2004%s ZRC SAZU"
#: zrcolaapp.cpp:72 zrcolafrm.cpp:92 zrcolagui.cpp:980 zrcolagui.h:106
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "ZRCola"
msgstr "ZRCola"
#: zrcolachrreq.cpp:49 zrcolagui.cpp:1110
msgid "Character"
msgstr "Знак"
#: zrcolachrreq.cpp:58 zrcolagui.cpp:1131
msgid "Context"
msgstr "Контекст"
#: zrcolachrreq.cpp:64 zrcolagui.h:379
msgid "Request a New Character"
msgstr "Запрос нового знака"
#: zrcolachrslct.cpp:89
msgid "Too many digits in Unicode."
msgstr ""
#: zrcolachrslct.cpp:89 zrcolachrslct.cpp:107
msgid "Validation conflict"
msgstr ""
#: zrcolachrslct.cpp:107
#, c-format
msgid "Invalid character in Unicode found: %c"
msgstr ""
#: zrcolachrslct.cpp:214 zrcolachrslct.cpp:390 zrcolachrslct.cpp:869
msgid "▸ Search Options"
msgstr "▸ Опции поиска"
# Recitation separator
#: zrcolachrslct.cpp:328
msgid ", "
msgstr ", "
#: zrcolachrslct.cpp:393 zrcolachrslct.cpp:866
msgid "▾ Search Options"
msgstr "▾ Опции поиска"
#: zrcolafrm.cpp:143
msgid "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."
msgstr "Сочетание клавиш Win+F5 регистрировать. Некоторые функциональности не будут доступны."
#: zrcolafrm.cpp:143 zrcolafrm.cpp:145
msgid "Warning"
msgstr "Предупреждение"
#: zrcolafrm.cpp:145
msgid "ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."
msgstr "Сочетание клавиш Win+F6 невозможно регистрировать. Некоторые функциональности не будут доступны."
#: zrcolafrm.cpp:362
msgid "http://zrcola.zrc-sazu.si/en/info/instructions/"
msgstr "http://zrcola.zrc-sazu.si/ru/info/instructions/"
#: zrcolafrm.cpp:386
msgid "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
msgstr "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr "Вы&ход"
#: zrcolagui.cpp:36
msgid "Quit this program"
msgstr "Выйти из программы"
#: zrcolagui.cpp:39
msgid "&Program"
msgstr "П&рограмма"
#: zrcolagui.cpp:72
msgid "Select &All"
msgstr "Выделить в&се"
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr "Выделить весь текст"
#: zrcolagui.cpp:78
msgid "Find C&haracter..."
msgstr "Поиск &знака ..."
#: zrcolagui.cpp:78 zrcolagui.cpp:198
msgid "Display character search to select character to insert into text"
msgstr "Показать браузер знаков для вставления выбранного знака"
#: zrcolagui.cpp:89
msgid "&Send Composed"
msgstr "&Послать составленное"
#: zrcolagui.cpp:89 zrcolagui.cpp:200
msgid "Send composed text to source window"
msgstr "Послать составленный текст в исходное окно"
#: zrcolagui.cpp:98
msgid "Copy Composed and &Return"
msgstr "Копировать составленное и &возвратиться"
#: zrcolagui.cpp:98
msgid "Copy composed text to clipboard and return focus to source window"
msgstr "Копировать составленный текст в буфер обмена и возвратить фокус в исходное окно"
#: zrcolagui.cpp:107
msgid "Send &Decomposed"
msgstr "Послать &разобранное"
#: zrcolagui.cpp:107 zrcolagui.cpp:202
msgid "Send decomposed text to source window"
msgstr "Послать разобранный текст в исходное окно"
#: zrcolagui.cpp:116
msgid "Copy Decomposed and Re&turn"
msgstr "Копировать разобранное и возв&ратиться"
#: zrcolagui.cpp:116
msgid "Copy decomposed text to clipboard and return focus to source window"
msgstr "Копировать разобранный текст в буфер обмена и возвратить фокус в исходное окно"
#: zrcolagui.cpp:125
msgid "Abort (De)composition"
msgstr "Прервать составление/разборку"
#: zrcolagui.cpp:125
msgid "Abort composition and return focus to source window"
msgstr "Прервать составление и возвратить фокус в исходное окно"
#: zrcolagui.cpp:136
msgid "&Settings..."
msgstr "&Настройки ..."
#: zrcolagui.cpp:136
msgid "Open program configuration dialog"
msgstr "Открыть диалог конфигурации программы"
#: zrcolagui.cpp:139
msgid "&Edit"
msgstr "&Правка"
#: zrcolagui.cpp:143
msgid "&Edit Toolbar"
msgstr "Панель инструментов для &правки"
#: zrcolagui.cpp:143
msgid "Toggle edit toolbar"
msgstr "Переключить панель инструментов для правки"
#: zrcolagui.cpp:147
msgid "&Compose Toolbar"
msgstr "Панель инструментов для &составления"
#: zrcolagui.cpp:147
msgid "Toggle compose toolbar"
msgstr "Переключить панель инструментов для составления"
#: zrcolagui.cpp:153
msgid "Character Catalo&g"
msgstr "Список &знаков"
#: zrcolagui.cpp:153
msgid "Toggle character catalog panel"
msgstr "Переключить список знаков"
#: zrcolagui.cpp:156
msgid "&View"
msgstr "&Вид"
#: zrcolagui.cpp:160
msgid "&Instructions..."
msgstr "&Инструкции ..."
#: zrcolagui.cpp:160
msgid "Open a web site with product instructions"
msgstr "Открыть сайт с инструкциями по продукту"
#: zrcolagui.cpp:164
msgid "Keyboard &Shortcuts..."
msgstr "Сочетания &клавиш ..."
#: zrcolagui.cpp:164
msgid "Open a list of keyboard shortcuts"
msgstr "Открыть список сочетаний клавиш"
#: zrcolagui.cpp:170
msgid "&Request a new character..."
msgstr "&Запрос нового знака ..."
#: zrcolagui.cpp:170
msgid "Submit a request to ZRC to add a new character"
msgstr "Отправить запрос нового знака"
#: zrcolagui.cpp:174
msgid "Check for &Updates..."
msgstr "Проверить наличие &обновлений ..."
#: zrcolagui.cpp:174
msgid "Check online for product update"
msgstr "Проверить наличие обновлений онлайн"
#: zrcolagui.cpp:180
msgid "&About..."
msgstr "О прогр&амме ..."
#: zrcolagui.cpp:183
msgid "&Help"
msgstr "&Справка"
#: zrcolagui.cpp:188
msgid "Cut"
msgstr "Вырезать"
#: zrcolagui.cpp:188
msgid "Cut selection"
msgstr "Вырезать выбор"
#: zrcolagui.cpp:190
msgid "Copy"
msgstr "Копировать"
#: zrcolagui.cpp:190
msgid "Copy selection"
msgstr "Копировать выбор"
#: zrcolagui.cpp:192
msgid "Paste"
msgstr "Вставить"
#: zrcolagui.cpp:192
msgid "Paste selection"
msgstr "Вставить выбор"
#: zrcolagui.cpp:195
msgid "Edit"
msgstr "Правка"
#: zrcolagui.cpp:198
msgid "Find Character"
msgstr "Поиск знака"
#: zrcolagui.cpp:200
msgid "Send Composed"
msgstr "Послать составленное (F5)"
#: zrcolagui.cpp:202
msgid "Send Decomposed"
msgstr "Послать разобранное (F6)"
#: zrcolagui.cpp:205
msgid "Compose"
msgstr "Составить"
#: zrcolagui.cpp:209
msgid "Character Catalog"
msgstr "Список знаков"
#: zrcolagui.cpp:213
msgid "(De)Composer"
msgstr "(Де)Композитор"
#: zrcolagui.cpp:252
msgid "Decomposed Text"
msgstr "Разобранний текст"
#: zrcolagui.cpp:272
msgid "Decomposed Unicode Dump"
msgstr "Дамп разобранного Юнукода"
#: zrcolagui.cpp:299
msgid "Composed Text"
msgstr "Составленный текст"
#: zrcolagui.cpp:319
msgid "Composed Unicode Dump"
msgstr "Дамп составленного Юникода"
#: zrcolagui.cpp:373
msgid "Select category to display"
msgstr "Выделить категории для отображения"
#: zrcolagui.cpp:407
msgid "Show &All"
msgstr "Показать &все"
#: zrcolagui.cpp:408
msgid "Toggle display of less frequent characters"
msgstr "Переключить отображение редко использованных знаков"
#: zrcolagui.cpp:448
msgid "&Browse"
msgstr "&Обзор"
#: zrcolagui.cpp:455
msgid "Full or partial terms from Unicode character description (in English) to search for"
msgstr "Полное либо частичное описание знака Юникод (на английском) для поиска"
#: zrcolagui.cpp:459
msgid "Search Options"
msgstr "Опции поиска"
#: zrcolagui.cpp:460
msgid "Shows/hides additional search options"
msgstr "Показать/скрыть дополнительные опции поиска"
#: zrcolagui.cpp:472
msgid "List of Unicode character categories to search in"
msgstr "Список категории Юникод для проведения поиска"
#: zrcolagui.cpp:479
msgid "All"
msgstr "Все"
#: zrcolagui.cpp:480
msgid "Select all categories"
msgstr "Выбрать все категории"
#: zrcolagui.cpp:484
msgid "None"
msgstr "Ничего"
#: zrcolagui.cpp:485
msgid "Clear category selection"
msgstr "Очистить выбор категории"
#: zrcolagui.cpp:489
msgid "Invert"
msgstr "Обратить"
#: zrcolagui.cpp:490
msgid "Invert category selection"
msgstr "Обратить выбор категории"
#: zrcolagui.cpp:529
msgid "Character search results"
msgstr "Результаты поиска знаков"
#: zrcolagui.cpp:539
msgid "Re&cently Used"
msgstr "&Недавно использованное"
#: zrcolagui.cpp:567
msgid "List of recently inserted characters"
msgstr "Список недавно вставленных знаков"
#: zrcolagui.cpp:581
msgid "Preview"
msgstr "Просмотр"
#: zrcolagui.cpp:586
msgid "U+"
msgstr "U+"
#: zrcolagui.cpp:591
msgid "Unicode hexadecimal code"
msgstr "Шестнадцатеричный код Юникод"
#: zrcolagui.cpp:596
msgid "Keyboard shortcut in Composer window"
msgstr "Сочетание клавиш в окне композитора"
#: zrcolagui.cpp:631
msgid "Character preview"
msgstr "Просмотр знака"
#: zrcolagui.cpp:636
msgid "Unicode character description"
msgstr "Описание знака Юникод"
#: zrcolagui.cpp:641
msgid "Character tags"
msgstr "Ключевые слова"
#: zrcolagui.cpp:646
msgid "Unicode character category"
msgstr "Категория знака Юникод"
#: zrcolagui.cpp:653
msgid "« Back"
msgstr "« Назад"
#: zrcolagui.cpp:655
msgid "To previously viewed character"
msgstr "К предыдущему знаку"
#: zrcolagui.cpp:659
msgid "Forward »"
msgstr "Далее »"
#: zrcolagui.cpp:661
msgid "To following viewed character"
msgstr "К следующему знаку"
#: zrcolagui.cpp:672
msgid "Re&lated"
msgstr "&Связанное"
#: zrcolagui.cpp:699
msgid "List of related characters"
msgstr "Список связанных знаков"
#: zrcolagui.cpp:790
msgid ""
"Some character native to specific language you are working with should not decompose to primitives.\n"
"For optimal decomposition you should set the language correctly."
msgstr ""
"Некоторые знаки использованного языка нельзя разбирать.\n"
"Для оптимальной разборки вы должны настроить правильный язык."
#: zrcolagui.cpp:794
msgid "Select language &automatically according to selected keyboard"
msgstr "&Автоматически установить язык на основе выбранной клавиатуры"
#: zrcolagui.cpp:797
msgid "&Manually select the language from the list below:"
msgstr "&Вручную выбрать язык со списка:"
#: zrcolagui.cpp:809
msgid "Text Language"
msgstr "Язык текста"
#: zrcolagui.cpp:816
msgid ""
"ZRCola offers multiple text transformations that can be arranged in a sequence.\n"
"Please select desired transformations and the order they are applied."
msgstr ""
#: zrcolagui.cpp:831
msgid "A&vailable:"
msgstr ""
#: zrcolagui.cpp:844
msgid ">"
msgstr ">"
#: zrcolagui.cpp:847
msgid "<"
msgstr "<"
#: zrcolagui.cpp:856
msgid "&Active:"
msgstr ""
#: zrcolagui.cpp:872
msgid "Up"
msgstr "Up"
#: zrcolagui.cpp:875
msgid "Down"
msgstr "Down"
#: zrcolagui.cpp:885
msgid "Transformation"
msgstr ""
#: zrcolagui.cpp:892
msgid ""
"ZRCola can be launched every time you log in to your computer.\n"
"It will be available on the system tray and via registered shortcuts Win+F5 and Win+F6."
msgstr ""
"Запуск системы ZRCola возможен при каждом запуске компьютера.\n"
"После запуска система ZRCola доступна на панели задач либо через нажатие сочетания клавиш Win+F5 и Win+F6."
#: zrcolagui.cpp:896
msgid "Start ZRCola &automatically on logon"
msgstr "&Автоматически запустить систему ZRCola при запуске компьютера"
#: zrcolagui.cpp:903
msgid "Startup"
msgstr "Запуск"
#: zrcolagui.cpp:991
msgid ""
"Program and Website Editor: Janoš Ježovnik\n"
"Development: Amebis, d. o. o., Kamnik\n"
"Translation into English: Janoš Ježovnik\n"
"Translation into Russian language: Domen Krvina, Silvo Torkar, Anastasia Plotnikova\n"
"Development and maintenance of the original program (20042015): Peter Weiss"
msgstr ""
"Администратор программы и сайта: Янош Ежовник (Janoš Ježovnik)\n"
"Разработка: Amebis, d. o. o., Kamnik\n"
"Перевод на английский яазык: Янош Ежовник (Janoš Ježovnik)\n"
"Перевод на русский язык: Домен Крвина (Domen Krvina), Силво Торкар (Silvo Torkar), Анастасия Плотникова\n"
"Разработка in техническая поддержка первоначальной программы (20042015): Петер Вейсс (Peter Weiss)"
#: zrcolagui.cpp:999
msgid "zrcola.zrc-sazu.si"
msgstr "zrcola.zrc-sazu.si"
#: zrcolagui.cpp:1005
msgid "Texts made using ZRCola have to include in a footnote or some other appropriate part of the publication the note below:"
msgstr "Текст, созданный с помощью системы ZRCola, должен в примечании или другом соответствующем месте в публикации сопровождаться следующей записью:"
#: zrcolagui.cpp:1009
msgid "This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Peter Weiss."
msgstr "Текст подготовлен с помощью системы ввода ZRCola (http://zrcola.zrc-sazu.si), разработанной в Научно-исследовательском центре Словенской академии наук и искусств в Любляне (http://www.zrc-sazu.si) Петром Вейссoм."
#: zrcolagui.cpp:1050
msgid "Log"
msgstr "Журнал"
#: zrcolagui.cpp:1066
msgid "Quit and &Update..."
msgstr "Выйти и &обновить ..."
#: zrcolagui.cpp:1068
msgid "Exit this program and launch product update"
msgstr "Выйти из программы и запустить обновление"
#: zrcolagui.cpp:1072
msgid "&Close"
msgstr "&Закрыть"
#: zrcolagui.cpp:1073
msgid "Close this window"
msgstr "Закрыть это окно"
#: zrcolagui.cpp:1112
msgid "Enter the &character you would like to request:"
msgstr "Ввести запрашиваемый &знак:"
#: zrcolagui.cpp:1119
msgid "Decomposed character to request"
msgstr "Запрашиваемый разобранный знак"
#: zrcolagui.cpp:1123
msgid ""
"Please, use the decomposed form.\n"
"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window."
msgstr ""
"Пожалуйста, используйте разобранный формат.\n"
"Для ввода запрашиваемого знака можно использовать сочетания клавиш системы ZRCola либо копировать и вставить знаки из окна для разборки."
#: zrcolagui.cpp:1133
msgid "The &context, examples or description why and where the character is required:"
msgstr "&Контекст, примеры либо описание запрашиваемого знака или объяснение, зачем он нужен:"
#: zrcolagui.cpp:1139
msgid "Additional notes for character request"
msgstr "Дополнительные примечания"
#: zrcolagui.cpp:1146
msgid ""
"After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\n"
"Your e-mail application might not display all the characters correctly, but the Editor will be able to read them correctly anyway."
msgstr ""
"После нажатия на кнопку «OK» ваша почтовая программа должна открытся для отправки запроса нового знака администратору системы ZRCola.\n"
"Возможно, не все знаки будут отображены правильно, но все информации будут закодированны таким образом, что администратор сможет их правильно прочитать."
#: zrcolakeyhndlr.cpp:44
msgid "INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."
msgstr "Нажата клавиша INS. Введите код Юникод желаемого знака (максимум четыре шестнадцатеричныe цифры: 0-9, A-F), затем отпустите клавишу INS."
#: zrcolasettings.cpp:90
#, c-format
msgid "Unknown transformation (%u)"
msgstr ""
#: zrcolasettings.cpp:181
msgid "Start ZRCola automatically on logon"
msgstr "Автоматически запустить систему ZRCola при запуске компьютера"
#: zrcolaupdater.cpp:94
msgid ""
"This program will now close and the upgrade will be launched.\n"
"Are you sure?"
msgstr ""
"Программа будет закрыта и обновлена.\n"
"Вы уверены?"
#: zrcolaupdater.cpp:94 zrcolagui.h:350
msgid "Product Update"
msgstr "Обновление продукта"
#: zrcolagui.h:248
msgid "Character Search"
msgstr "Поиск знака"
#: zrcolagui.h:299
msgid "Settings"
msgstr "Настройки"
#: zrcolagui.h:325
msgid "About ZRCola"
msgstr "О системе ZRCola"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:15
#: MSIBuild/en_US.x64.Release.Control-2.idtx:4
#: MSIBuild/en_US.x64.Release.Control-2.idtx:10
#: MSIBuild/en_US.x64.Release.Control-2.idtx:15
msgid "binUIHeader.bmp"
msgstr "binUIHeader.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:5
#: MSIBuild/en_US.x64.Release.Control-2.idtx:5
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Starting"
msgstr "[DlgTitleFont][SimpleProductName] Руководство по запуску системы"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:6
#: MSIBuild/en_US.x64.Release.Control-2.idtx:6
msgid "bintutorial1.bmp"
msgstr "bintutorial1.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:7
#: MSIBuild/en_US.x64.Release.Control-2.idtx:7
msgid "When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5."
msgstr "Если так настроено, система ZRCola запускается при запуске компьютера и работает в фоновом режиме. Если потребуется, пользователь может вывести программу на экран, нажав на сочетание клавиш Win+F5."
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:8
#: MSIBuild/en_US.x64.Release.Control-2.idtx:8
msgid "IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters!"
msgstr "Внимание: При нажатии сочетание клавиш Win+F5 программа запомнить местонахождение курсора в тексте. Если система ZRCola выведена на экран без использования упомянутого сочетания клавиш, программа не знает, куда ввести желаемые знаки!"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:19
#: MSIBuild/en_US.x64.Release.Control-2.idtx:9
#: MSIBuild/en_US.x64.Release.Control-2.idtx:14
#: MSIBuild/en_US.x64.Release.Control-2.idtx:19
msgid "&Continue"
msgstr "&Продолжить"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:11
#: MSIBuild/en_US.x64.Release.Control-2.idtx:11
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Composition"
msgstr "[DlgTitleFont][SimpleProductName] Руководство по составлению"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:12
#: MSIBuild/en_US.x64.Release.Control-2.idtx:12
msgid "bintutorial2.bmp"
msgstr "bintutorial2.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:13
#: MSIBuild/en_US.x64.Release.Control-2.idtx:13
msgid "The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used."
msgstr "Строка основных и замещающих знаков вводится в верхнее окно для ввода. После того, в нижнем окне появляются соответствующие специальные знаки. Для их ввода в текст нужно нажать клавишу F5."
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:16
#: MSIBuild/en_US.x64.Release.Control-2.idtx:16
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Entering Characters"
msgstr "[DlgTitleFont][SimpleProductName] Руководство по вводу знаков"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:17
#: MSIBuild/en_US.x64.Release.Control-2.idtx:17
msgid "bintutorial3.bmp"
msgstr "bintutorial3.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:18
#: MSIBuild/en_US.x64.Release.Control-2.idtx:18
msgid "Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8)."
msgstr "Знак можно ввести, употребляя сочетания клавиш на клавиатуре, список знаков (F4) или функцию \"Поиск знака\" (F8)."
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "Input system for linguistic use"
msgstr "Система ввода ZRCola для лингвистического применения"
#~ msgid "http://zrcola-2.amebis.si/en/info/instructions/"
#~ msgstr "http://zrcola.zrc-sazu.si/ru/info/instructions/"
#~ msgid "http://zrcola-2.amebis.si/wp-content/uploads/2016/04/5_ZRCola-Tipkovnica_2009-06-21.pdf"
#~ msgstr "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/08/ZRCola_tipkovnica_20160801.pdf"
# Windows charset for this language (decimal)
#~ msgid "1252"
#~ msgstr "1251"
#~ msgid "Auto Start"
#~ msgstr "Samodejni zagon"
#~ msgid "Select %s language for decomposition"
#~ msgstr "Izberi jezik %s za razstavljanje"
#~ msgid "&Start on Logon"
#~ msgstr "Z&aženi ob prijavi"
#~ msgid "Start this program automatically on logon"
#~ msgstr "Samodejno zaženi ta program ob prijavi"
#~ msgid "Set language according to keyboard layout automatically"
#~ msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#~ msgid "&Unicode"
#~ msgstr "&Unicode"
#~ msgid "Esc"
#~ msgstr "Esc"
#~ msgid "F1"
#~ msgstr "F1"
#~ msgid "F2"
#~ msgstr "F2"
#~ msgid "F3"
#~ msgstr "F3"
#~ msgid "F4"
#~ msgstr "F4"
#~ msgid "F5"
#~ msgstr "F5"
#~ msgid "F6"
#~ msgstr "F6"
#~ msgid "F7"
#~ msgstr "F7"
#~ msgid "F8"
#~ msgstr "F8"
#~ msgid "F9"
#~ msgstr "F9"
#~ msgid "F10"
#~ msgstr "F10"
#~ msgid "F11"
#~ msgstr "F11"
#~ msgid "F12"
#~ msgstr "F12"
#~ msgid "Print Screen"
#~ msgstr "Print Screen"
#~ msgid "Scroll Lock"
#~ msgstr "Scroll Lock"
#~ msgid "Pause"
#~ msgstr "Pause"
#~ msgid "Backspace"
#~ msgstr "Backspace"
#~ msgid "Tab"
#~ msgstr "Tab"
#~ msgid "Caps Lock"
#~ msgstr "Caps Lock"
#~ msgid "Return"
#~ msgstr "Return"
#~ msgid "Space"
#~ msgstr "preslednica"
#~ msgid "Shift"
#~ msgstr "Shift"
#, fuzzy
#~ msgid "Alt"
#~ msgstr "Alt"
#~ msgid "Ctrl"
#~ msgstr "Ctrl"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Insert"
#~ msgstr "Insert"
#~ msgid "Delete"
#~ msgstr "Delete"
#~ msgid "Page Up"
#~ msgstr "Page Up"
#~ msgid "Page Down"
#~ msgstr "Page Down"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "End"
#~ msgstr "End"
#~ msgid "Left"
#~ msgstr "Left"
#~ msgid "Right"
#~ msgstr "Right"
#~ msgid "Num Lock"
#~ msgstr "Num Lock"
#~ msgid "`"
#~ msgstr "`"
#~ msgid "-"
#~ msgstr "-"
#~ msgid "["
#~ msgstr "["
#~ msgid "]"
#~ msgstr "]"
#~ msgid ":"
#~ msgstr ":"
#~ msgid "'"
#~ msgstr "'"
#~ msgid "\\"
#~ msgstr "\\"
#~ msgid "."
#~ msgstr "."
#~ msgid "/"
#~ msgstr "/"
#~ msgid "INS"
#~ msgstr "INS"
#, fuzzy
#~ msgid "Character &Groups"
#~ msgstr "Skupine &znakov"
#~ msgid "Language:"
#~ msgstr "Jezik:"
#~ msgid "Cuts selected text and puts it on the clipboard"
#~ msgstr "Izreže izbrano besedilo in ga shrani na odložišče"
#~ msgid "Copies selected text to the clipboard"
#~ msgstr "Kopira izbrano besedilo na odložišče"
#~ msgid "Inserts text from the clipboard"
#~ msgstr "Vstavi besedilo z odložišča"
#, fuzzy
#~ msgid "&Copy"
#~ msgstr "&Kopiraj"
#, fuzzy
#~ msgid "&Paste"
#~ msgstr "&Prilepi"
#~ msgid "&File"
#~ msgstr "&Datoteka"
#, fuzzy
#~ msgid "Send Decomposed (F6)"
#~ msgstr "Pošlji razstavljeno (F6)"
#, fuzzy
#~ msgid "Send Composed (F5)"
#~ msgstr "Pošlji sestavljeno (F5)"
#~ msgid "ZRCola keyboard shortcut Win+Shift+Z could not be registered. Some functionality will not be available."
#~ msgstr "ZRColine bližnjice na tipkovnici Win+Shift+Z ni mogoče registrirati. Nekaj funkcionalnosti ne bo na voljo."
#, fuzzy
#~ msgid "Authentication progress real time monitor"
#~ msgstr "Nadzira postopek overovljanja v realnem času"
#~ msgid "Grave\t&7"
#~ msgstr "Krativec\t&7"
#~ msgid "Acute\t&9"
#~ msgstr "Ostrivec\t&9"
#~ msgid "Circumflex\t&3"
#~ msgstr "Cirkumfleks\t&3"
#~ msgid "Inverted &breve"
#~ msgstr "O&brnjen polkrog"
#~ msgid "&Accents"
#~ msgstr "N&aglasi"
#~ msgid ""
#~ "There is already an auto hidden bar on this edge.\n"
#~ "Only one auto hidden bar is allowed on each edge.\n"
#~ "Auto-hide feature is now off."
#~ msgstr ""
#~ "Ob tem robu je že samodejno skrita pasica.\n"
#~ "Na vsakem robu je lahko samo ena samodejno skrita pasica.\n"
#~ "Samodejno skrivanje je zdaj izklopljeno."
#~ msgid "Hello World"
#~ msgstr "Zdravo svet"
#~ msgid "&Hello...\tCtrl+H"
#~ msgstr "&Pozdrav ...\tCtrl+H"
#~ msgid "Help string shown in status bar for this menu item"
#~ msgstr "Niz s pomočjo prikazan v statusni vrstici za to točko menija"
#~ msgid "This is a wxWidgets' Hello world sample"
#~ msgstr "To je primer Zdravo svet v wxWidgets"
#~ msgid "About Hello World"
#~ msgstr "O Zdravo svet"
#~ msgid "Hello world from wxWidgets!"
#~ msgstr "Zdravo svet iz wxWidgets!"
#~ msgid "Welcome to wxWidgets!"
#~ msgstr "Dobrodošli v wxWidgets!"

File diff suppressed because it is too large Load Diff

BIN
ZRCola/res/char_select.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

1794
ZRCola/res/char_select.pdf Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

4
ZRCola/res/desktop.ini Normal file
View File

@@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Pictures

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

1936
ZRCola/res/navigate_back.pdf Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

1891
ZRCola/res/send_source.pdf Normal file

File diff suppressed because one or more lines are too long

View File

@@ -19,15 +19,39 @@
#pragma once
#include "../include/version.h"
#include "zrcolaabout.h"
#include "zrcolaapp.h"
#include "zrcolachrcatpnl.h"
#include "zrcolachrgrid.h"
#include "zrcolachrreq.h"
#include "zrcolacomppnl.h"
#include "zrcolafrm.h"
#include "zrcolakeyhndlr.h"
#include "zrcolasettings.h"
#include "zrcolaupdater.h"
#include <Updater/chkthread.h>
#include <wxex/common.h>
#include <wxex/url.h>
#include <wxex/persist/auimanager.h>
#include <wx/clipbrd.h>
#include <wx/ffile.h>
#include <wx/msgdlg.h>
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
#include <wxex/common.h>
#include <wxex/persist/auimanager.h>
#include <wx/socket.h>
#include <wx/tokenzr.h>
#include <wx/utils.h>
#include <wx/valtext.h>
#include <WinStd/MSI.h>
#include <fstream>
#include <string>
#include <utility>
#include <vector>
#include <stdex/idrec.h>
@@ -37,11 +61,3 @@
#include <ShObjIdl.h>
#include <ShlGuid.h>
#endif
#include "../include/zrcola.h"
#include "zrcolaapp.h"
#include "zrcolachrgrid.h"
#include "zrcolachrcatpnl.h"
#include "zrcolacomppnl.h"
#include "zrcolafrm.h"
#include "zrcolakeyhndlr.h"

32
ZRCola/zrcolaabout.cpp Normal file
View File

@@ -0,0 +1,32 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaAbout
//////////////////////////////////////////////////////////////////////////
wxZRColaAbout::wxZRColaAbout(wxWindow* parent) : wxZRColaAboutBase(parent)
{
m_staticTextVersion->SetLabelText(wxT(PRODUCT_VERSION_STR));
m_staticTextCopyright->SetLabelText(wxString::Format(_("© 2004-%s ZRC SAZU"), wxT(PRODUCT_BUILD_YEAR_STR)));
}

38
ZRCola/zrcolaabout.h Normal file
View File

@@ -0,0 +1,38 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaAbout;
#pragma once
#include "zrcolagui.h"
///
/// About ZRCola dialog
///
class wxZRColaAbout : public wxZRColaAboutBase
{
public:
wxZRColaAbout(wxWindow* parent);
};

View File

@@ -32,6 +32,7 @@ wxIMPLEMENT_APP(ZRColaApp);
ZRColaApp::ZRColaApp() :
m_mainWnd(NULL),
m_lang_ui(wxLANGUAGE_DEFAULT),
wxApp()
{
}
@@ -43,29 +44,45 @@ bool ZRColaApp::OnInit()
// To compensate migration to non-advertised shortcut, do the Microsoft Installer's feature completeness check manually.
// If execution got this far in the first place (EXE and dependent DLLs are present and loadable).
// Furthermore, this increments program usage counter.
if (::MsiQueryFeatureState(_T(ZRCOLA_VERSION_GUID), _T("featZRCola")) != INSTALLSTATE_UNKNOWN)
::MsiUseFeature(_T(ZRCOLA_VERSION_GUID), _T("featZRCola"));
if (::MsiQueryFeatureState(_T(PRODUCT_VERSION_GUID), _T("featZRCola")) != INSTALLSTATE_UNKNOWN)
::MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featZRCola"));
#endif
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(ZRCOLA_CFG_APPLICATION), wxT(ZRCOLA_CFG_VENDOR)));
// Initialize configuration.
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(PRODUCT_CFG_APPLICATION), wxT(PRODUCT_CFG_VENDOR)));
if (cfgPrev) wxDELETE(cfgPrev);
if (!wxApp::OnInit())
return false;
// Set desired locale.
wxLanguage language = (wxLanguage)wxConfigBase::Get()->Read(wxT("Language"), wxLANGUAGE_DEFAULT);
if (wxLocale::IsAvailable(language)) {
wxString sPath;
if (wxConfigBase::Get()->Read(wxT("LocalizationRepositoryPath"), &sPath))
m_locale.AddCatalogLookupPathPrefix(sPath);
wxVERIFY(m_locale.Init(language));
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend")));
// Initialize locale.
if (wxInitializeLocale(m_locale, &m_lang_ui)) {
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("UpdaterZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("libZRColaUI")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola-zrcdb")));
}
std::fstream dat((LPCTSTR)GetDatabasePath(), std::ios_base::in | std::ios_base::binary);
#ifdef __WXMSW__
// Create global event.
m_running.attach(::CreateEvent(NULL, FALSE, FALSE, _T(PRODUCT_CFG_APPLICATION) _T("{BBDE7AAD-29B6-4B83-ADA1-92AFA81A0883}")));
if (::GetLastError() == ERROR_ALREADY_EXISTS) {
// ZRCola is already running. Find its window.
HWND okno = ::FindWindow(_T("wxWindowNR"), _("ZRCola"));
if (okno) {
if (::IsIconic(okno))
::SendMessage(okno, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(okno);
::SetForegroundWindow(okno);
// Not an error condition actually; Just nothing else to do...
return false;
}
}
#endif
std::fstream dat((LPCTSTR)GetDatabaseFilePath(), std::ios_base::in | std::ios_base::binary);
if (dat.good()) {
if (stdex::idrec::find<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat, ZRCOLA_DB_ID, sizeof(ZRCola::recordid_t))) {
ZRCola::recordsize_t size;
@@ -83,36 +100,58 @@ bool ZRColaApp::OnInit()
has_translation_data = true;
} else {
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
m_t_db.idxComp .clear();
m_t_db.idxDecomp.clear();
m_t_db.data .clear();
m_t_db.clear();
}
} else if (id == ZRCola::transet_rec::id) {
dat >> ZRCola::transet_rec(m_ts_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation set data from ZRCola.zrcdb."));
m_ts_db.clear();
}
} else if (id == ZRCola::langchar_rec::id) {
dat >> ZRCola::langchar_rec(m_lc_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
m_lc_db.idxChr.clear();
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
m_lc_db.idxLng.clear();
#endif
m_lc_db.data .clear();
m_lc_db.clear();
}
} else if (id == ZRCola::language_rec::id) {
dat >> ZRCola::language_rec(m_lang_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
m_lang_db.idxLng.clear();
m_lang_db.data .clear();
m_lang_db.clear();
}
} else if (id == ZRCola::keyseq_rec::id) {
dat >> ZRCola::keyseq_rec(m_ks_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading key sequences data from ZRCola.zrcdb."));
m_ks_db.idxChr.clear();
m_ks_db.idxKey.clear();
m_ks_db.data .clear();
m_ks_db.clear();
}
}
} else if (id == ZRCola::character_rec::id) {
dat >> ZRCola::character_rec(m_chr_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character data from ZRCola.zrcdb."));
m_chr_db.clear();
}
} else if (id == ZRCola::chrcat_rec::id) {
dat >> ZRCola::chrcat_rec(m_cc_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character category data from ZRCola.zrcdb."));
m_cc_db.clear();
}
} else if (id == ZRCola::chrtag_rec::id) {
dat >> ZRCola::chrtag_rec(m_ct_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character tag data from ZRCola.zrcdb."));
m_ct_db.clear();
}
} else if (id == ZRCola::tagname_rec::id) {
dat >> ZRCola::tagname_rec(m_tn_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading tag name data from ZRCola.zrcdb."));
m_tn_db.clear();
}
} else
stdex::idrec::ignore<ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
}
if (!has_translation_data)
@@ -122,6 +161,9 @@ bool ZRColaApp::OnInit()
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
// Initialize sockets. Otherwise Updater thread will not work.
wxSocketBase::Initialize();
m_mainWnd = new wxZRColaFrame();
wxPersistentRegisterAndRestore<wxZRColaFrame>(m_mainWnd);
m_mainWnd->Show();
@@ -130,79 +172,15 @@ bool ZRColaApp::OnInit()
}
bool ZRColaApp::GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ wxString& str)
int ZRColaApp::OnExit()
{
assert(seq || !seq_len);
wxSocketBase::Shutdown();
str.Clear();
for (size_t i = 0; i < seq_len; i++) {
if (i) str += L", ";
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::CTRL ) str += L"Ctrl+";
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::ALT ) str += L"Alt+";
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::SHIFT) str += L"Shift+";
wchar_t k = seq[i].key;
#if defined(__WXMSW__)
// Translate from U.S. Keyboard to scan code.
static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0);
k = ::MapVirtualKeyEx(k, MAPVK_VK_TO_VSC, s_hkl);
int res = wxApp::OnExit();
// Translate from scan code to local keyboard.
k = ::MapVirtualKey(k, MAPVK_VSC_TO_VK);
#ifdef __WXMSW__
m_running.free();
#endif
switch (k) {
case 0 : return false;
case WXK_ESCAPE : str += _("Esc" ); break;
case WXK_F1 : str += _("F1" ); break;
case WXK_F2 : str += _("F2" ); break;
case WXK_F3 : str += _("F3" ); break;
case WXK_F4 : str += _("F4" ); break;
case WXK_F5 : str += _("F5" ); break;
case WXK_F6 : str += _("F6" ); break;
case WXK_F7 : str += _("F7" ); break;
case WXK_F8 : str += _("F8" ); break;
case WXK_F9 : str += _("F9" ); break;
case WXK_F10 : str += _("F10" ); break;
case WXK_F11 : str += _("F11" ); break;
case WXK_F12 : str += _("F12" ); break;
case WXK_PRINT : str += _("Print Screen"); break;
case WXK_SCROLL : str += _("Scroll Lock" ); break;
case WXK_PAUSE : str += _("Pause" ); break;
case WXK_BACK : str += _("Backspace" ); break;
case WXK_TAB : str += _("Tab" ); break;
case WXK_CAPITAL : str += _("Caps Lock" ); break;
case WXK_RETURN : str += _("Return" ); break;
case WXK_SPACE : str += _("Space" ); break;
case WXK_SHIFT : str += _("Shift" ); break;
case WXK_ALT : str += _("Alt" ); break;
case WXK_CONTROL : str += _("Ctrl" ); break;
case WXK_MENU : str += _("Menu" ); break;
case WXK_INSERT : str += _("Insert" ); break;
case WXK_DELETE : str += _("Delete" ); break;
case WXK_PAGEUP : str += _("Page Up" ); break;
case WXK_PAGEDOWN : str += _("Page Down" ); break;
case WXK_HOME : str += _("Home" ); break;
case WXK_END : str += _("End" ); break;
case WXK_LEFT : str += _("Left" ); break;
case WXK_UP : str += _("Up" ); break;
case WXK_RIGHT : str += _("Right" ); break;
case WXK_DOWN : str += _("Down" ); break;
case WXK_NUMLOCK : str += _("Num Lock" ); break;
default:
#if defined(__WXMSW__)
k = ::MapVirtualKey(k, MAPVK_VK_TO_CHAR);
#endif
str += k;
}
}
return true;
return res;
}

View File

@@ -26,11 +26,14 @@ class ZRColaApp;
#pragma once
#include "zrcolafrm.h"
#include <WinStd/Win.h>
#include <wx/app.h>
#include <wx/config.h>
#include <wx/intl.h>
#include <zrcola/character.h>
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <zrcola/tag.h>
#include <zrcolaui/keyboard.h>
@@ -51,50 +54,43 @@ public:
///
virtual bool OnInit();
///
/// Called when application uninitializes.
///
/// \returns Result code to return to OS
///
virtual int OnExit();
///
/// \returns Path to database files
///
inline wxString GetDatabasePath() const;
///
/// \returns Path to ZRCola.zrcdb file
///
inline wxString GetDatabasePath() const;
///
/// Get text representation of a given key sequence
///
/// \param[in] seq Key sequence
/// \param[in] seq_len Number of elements in \p seq
/// \param[out] str Text representation of a \p seq key sequence
///
/// \returns
/// - \c true if conversion succeeded
/// - \c false otherwise
///
static bool GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ wxString& str);
///
/// Get text representation of a given key sequence
///
/// \param[in] seq Key sequence
/// \param[in] seq_len Number of elements in \p seq
///
/// \returns Text representation of a \p seq key sequence
///
static inline wxString GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len)
{
wxString str;
return GetKeySequenceAsText(seq, seq_len, str) ? str : wxEmptyString;
}
inline wxString GetDatabaseFilePath() const;
public:
ZRCola::translation_db m_t_db; ///< Translation database
ZRCola::transet_db m_ts_db; ///< Translation set database
ZRCola::langchar_db m_lc_db; ///< Language character database
ZRCola::language_db m_lang_db; ///< Language database
ZRCola::keyseq_db m_ks_db; ///< Key sequence database
ZRCola::character_db m_chr_db; ///< Character database
ZRCola::chrcat_db m_cc_db; ///< Characted category database
ZRCola::chrtag_db m_ct_db; ///< Character tag database
ZRCola::tagname_db m_tn_db; ///< Tag name database
wxZRColaFrame *m_mainWnd; ///< Main window
wxLocale m_locale; ///< Current locale
wxLanguage m_lang_ui; ///< Translation language (language of User Interface, wxLANGUAGE_DEFAULT = English)
protected:
wxLocale m_locale; ///< Current locale
#ifdef __WXMSW__
winstd::win_handle m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
#endif
};
@@ -106,12 +102,17 @@ inline wxString ZRColaApp::GetDatabasePath() const
wxString sPath;
if (wxConfigBase::Get()->Read(wxT("DatabasePath"), &sPath)) {
if (!wxEndsWithPathSeparator(sPath))
sPath << wxFILE_SEP_PATH;
sPath += wxFILE_SEP_PATH;
} else {
sPath = wxPathOnly(argv[0]);
sPath << wxT("\\..\\data\\");
sPath += wxT("\\..\\data\\");
}
sPath << wxT("ZRCola.zrcdb");
return sPath;
}
inline wxString ZRColaApp::GetDatabaseFilePath() const
{
return GetDatabasePath() + wxT("ZRCola.zrcdb");
}

View File

@@ -25,13 +25,13 @@
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaCharacterCatalogPanel, wxZRColaCharacterCatalogPanelBase)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_DECOMPOSED, wxZRColaCharacterCatalogPanel::OnFocusDecomposed)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_SOURCE, wxZRColaCharacterCatalogPanel::OnFocusSource)
END_EVENT_TABLE()
wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : wxZRColaCharacterCatalogPanelBase(parent)
{
std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabasePath(), std::ios_base::in | std::ios_base::binary);
std::fstream dat((LPCTSTR)dynamic_cast<ZRColaApp*>(wxTheApp)->GetDatabaseFilePath(), std::ios_base::in | std::ios_base::binary);
if (dat.good()) {
if (stdex::idrec::find<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat, ZRCOLA_DB_ID, sizeof(ZRCola::recordid_t))) {
ZRCola::recordsize_t size;
@@ -42,8 +42,8 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
dat >> rec;
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character group data from ZRCola.zrcdb."));
m_cg_db.idxRnk.clear();
m_cg_db.data .clear();
m_cg_db.idxRank.clear();
m_cg_db.data .clear();
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb has no character group data."));
@@ -52,28 +52,25 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
if (!m_cg_db.idxRnk.empty()) {
if (!m_cg_db.idxRank.empty()) {
// Populate character group list.
for (size_t i = 0, n = m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[i];
for (size_t i = 0, n = m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[i];
wxString
label(cg.data, cg.name_len),
label(cg.name(), cg.name_len()),
label_tran2(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_choice->Insert(label_tran2, i);
}
m_cg_id = m_cg_db.idxRnk[0].id;
m_cg_id = m_cg_db.idxRank[0].grp;
m_choice->Select(0);
// Update grid by simulating wxEVT_COMMAND_CHOICE_SELECTED event.
wxCommandEvent e(wxEVT_COMMAND_CHOICE_SELECTED, m_grid->GetId());
e.SetInt(0);
OnChoice(e);
Update();
}
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_DECOMPOSED);
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_SOURCE);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
}
@@ -86,13 +83,12 @@ wxZRColaCharacterCatalogPanel::~wxZRColaCharacterCatalogPanel()
void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
{
ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[event.GetSelection()];
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[event.GetSelection()];
m_cg_id = cg.id;
m_grid->SetCharacters(wxString(cg.data + cg.name_len, cg.char_len));
// As size of the grid might have changed, relayout the panel.
Layout();
if (m_cg_id != cg.grp) {
m_cg_id = cg.grp;
Update();
}
event.Skip();
}
@@ -100,10 +96,10 @@ void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_source->SetFocus();
}
event.Skip();
@@ -112,11 +108,13 @@ void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
{
if (event.GetKeyCode() == WXK_RETURN) {
ZRColaApp *app = (ZRColaApp*)wxTheApp;
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
app->m_mainWnd->m_panel->m_source->SetFocus();
event.StopPropagation();
return;
@@ -127,11 +125,21 @@ void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
}
void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::OnShowAll(wxCommandEvent& event)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
UNREFERENCED_PARAMETER(event);
Update();
event.Skip();
}
void wxZRColaCharacterCatalogPanel::OnFocusSource(wxCommandEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->SetFocus();
event.StopPropagation();
return;
@@ -141,6 +149,35 @@ void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
}
void wxZRColaCharacterCatalogPanel::Update()
{
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[m_choice->GetSelection()];
if (m_show_all->GetValue()) {
m_grid->SetCharacters(
wxString(cg.chrlst(), cg.chrlst_end()),
wxArrayShort(reinterpret_cast<const short*>(cg.chrshow()), reinterpret_cast<const short*>(cg.chrshow_end())));
} else {
// Select frequently used characters only.
const wchar_t *src = cg.chrlst();
const unsigned __int16 *shown = cg.chrshow();
wxArrayString chars;
for (size_t i = 0, i_end = cg.chrlst_len(), j = 0; i < i_end; j++) {
for (unsigned __int16 k = 0, mask = shown[j]; k < 16 && i < i_end; k++, mask >>= 1) {
size_t len = wcsnlen(src + i, i_end - i);
if (mask & 1)
chars.Add(wxString(src + i, len));
i += len + 1;
}
}
m_grid->SetCharacters(chars);
}
// As size of the grid might have changed, relayout the panel.
Layout();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharacterCatalogPanel
//////////////////////////////////////////////////////////////////////////
@@ -158,34 +195,45 @@ wxString wxPersistentZRColaCharacterCatalogPanel::GetKind() const
void wxPersistentZRColaCharacterCatalogPanel::Save() const
{
const wxZRColaCharacterCatalogPanel * const wnd = static_cast<const wxZRColaCharacterCatalogPanel*>(GetWindow());
auto wnd = static_cast<const wxZRColaCharacterCatalogPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("charGroup"), wnd->m_cg_id);
SaveValue(wxT("showAll" ), wnd->m_show_all->GetValue());
}
bool wxPersistentZRColaCharacterCatalogPanel::Restore()
{
wxZRColaCharacterCatalogPanel * const wnd = static_cast<wxZRColaCharacterCatalogPanel*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaCharacterCatalogPanel*>(GetWindow());
bool update = false;
// Restore selected character group.
int cg_id;
if (RestoreValue(wxT("charGroup"), &cg_id)) {
for (size_t i = 0, n = wnd->m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRnk[i];
if (cg.id == cg_id) {
wnd->m_cg_id = cg.id;
wnd->m_choice->Select(i);
// Update grid by simulating wxEVT_COMMAND_CHOICE_SELECTED event.
wxCommandEvent e(wxEVT_COMMAND_CHOICE_SELECTED, wnd->m_grid->GetId());
e.SetInt(i);
wnd->OnChoice(e);
for (size_t i = 0, n = wnd->m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRank[i];
if (cg.grp == cg_id) {
if (wnd->m_cg_id != cg.grp) {
wnd->m_cg_id = cg.grp;
wnd->m_choice->Select(i);
update = true;
}
break;
}
}
}
bool show_all;
if (RestoreValue(wxT("showAll"), &show_all)) {
if (wnd->m_show_all->GetValue() != show_all) {
wnd->m_show_all->SetValue(show_all);
update = true;
}
}
if (update)
wnd->Update();
return true;
}

View File

@@ -38,7 +38,7 @@ class wxZRColaCharacterCatalogPanel : public wxZRColaCharacterCatalogPanelBase
public:
enum
{
wxID_FOCUS_DECOMPOSED = 6000,
wxID_FOCUS_SOURCE = 6000,
};
wxZRColaCharacterCatalogPanel(wxWindow* parent);
@@ -50,9 +50,12 @@ protected:
virtual void OnChoice(wxCommandEvent& event);
virtual void OnGridClick(wxGridEvent& event);
virtual void OnGridKeyDown(wxKeyEvent& event);
void OnFocusDecomposed(wxCommandEvent& event);
virtual void OnShowAll(wxCommandEvent& event);
void OnFocusSource(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
void Update();
protected:
ZRCola::chrgrp_db m_cg_db; ///< Character group database
int m_cg_id; ///< Selected character group ID

View File

@@ -44,7 +44,7 @@ wxZRColaCharGrid::wxZRColaCharGrid(wxWindow *parent, wxWindowID id, const wxPoin
SetDefaultRowSize(wxZRColaCharacterGridRowHeight);
// Create timer for saving the state.
m_toolTipTimer = new wxTimer(this, wxID_TOOLTIP_TIMER);
m_timerToolTip.SetOwner(this, wxID_TOOLTIP_TIMER);
// wxEVT_MOTION event must be connected to the wxGridWindow, not wxGrid itself.
wxWindow *gridWnd = GetGridWindow();
@@ -56,58 +56,85 @@ wxZRColaCharGrid::~wxZRColaCharGrid()
{
wxWindow *gridWnd = GetGridWindow();
gridWnd->Disconnect(gridWnd->GetId(), wxEVT_MOTION, wxMouseEventHandler(wxZRColaCharGrid::OnMotion), NULL, this);
if (m_toolTipTimer)
delete m_toolTipTimer;
}
void wxZRColaCharGrid::Init()
{
m_isResizing = false;
m_toolTipTimer = NULL;
m_toolTipIdx = (size_t)-1;
m_regenerate = false;
m_isResizing = false;
m_toolTipIdx = (size_t)-1;
}
void wxZRColaCharGrid::SetCharacters(const wxString &chars)
{
m_chars = chars;
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_relevance.Clear();
m_regenerate = true;
// Build and set new grid data.
size_t char_len = m_chars.Length();
int rows = std::max<int>((char_len + m_numCols - 1) / m_numCols, 1);
wxGridStringTable *table = new wxGridStringTable(rows, m_numCols);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < m_numCols; c++, i++)
table->SetValue(r, c, i < char_len ? wxString(1, m_chars[i]) : wxEmptyString);
SetTable(table, true);
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
void wxZRColaCharGrid::SetCharacters(const wxArrayString &chars)
{
m_chars = chars;
m_relevance.Clear();
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
void wxZRColaCharGrid::SetCharacters(const wxString &chars, const wxArrayShort &relevance)
{
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_relevance = relevance;
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
wxString wxZRColaCharGrid::GetToolTipText(int idx)
{
wxASSERT_MSG(idx < m_chars.Length(), wxT("index out of bounds"));
wxASSERT_MSG(idx < (int)m_chars.GetCount(), wxT("index out of bounds"));
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &chr = m_chars[idx];
// See if this character has a key sequence registered.
ZRCola::keyseq_db::indexKey::size_type start, end;
bool found;
ZRCola::keyseq_db::keyseq *ks = (ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq)];
ks->chr = m_chars[idx];
ks->seq_len = 0;
found = app->m_ks_db.idxChr.find(*ks, start, end);
delete ks;
if (found) {
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*chr.length()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, chr.data(), chr.length());
ZRCola::keyseq_db::indexKey::size_type start;
if (app->m_ks_db.idxChr.find(*ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRColaApp::GetKeySequenceAsText(seq.seq, seq.seq_len, ks_str))
return wxString::Format(wxT("U+%04X (%s)"), (int)m_chars[idx], ks_str.c_str());
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
return wxString::Format(wxT("U+%s (%s)"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str(), ks_str.c_str());
}
return wxString::Format(wxT("U+%04X"), (int)m_chars[idx]);
return wxString::Format(wxT("U+%s"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str());
}
@@ -123,36 +150,51 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
// Calculate initial estimate of columns and rows.
wxSize size(event.GetSize());
size_t
char_len = m_chars.Length();
char_count = m_chars.GetCount();
int
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1),
rows = std::max<int>((char_len + cols - 1) / cols, 1);
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1),
rows = std::max<int>((char_count + cols - 1) / cols, 1);
if (m_colLabelHeight + rows*wxZRColaCharacterGridRowHeight + m_extraHeight > size.GetHeight()) {
// Vertical scrollbar will be shown. Adjust the width and recalculate layout to avoid horizontal scrollbar.
width = std::max<int>(width - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this), 0);
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1);
rows = std::max<int>((char_len + cols - 1) / cols, 1);
rows = std::max<int>((char_count + cols - 1) / cols, 1);
}
BeginBatch();
if (cols != m_numCols) {
if (m_regenerate || cols != m_numCols) {
// Build and set new grid data.
wxGridStringTable *table = new wxGridStringTable(rows, cols);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
table->SetValue(r, c, i < char_len ? wxString(1, m_chars[i]) : wxEmptyString);
table->SetValue(r, c, i < (int)char_count ? m_chars[i] : wxEmptyString);
SetTable(table, true);
if (!m_relevance.IsEmpty()) {
const wxColour colour_def;
const wxColour colour_irr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
SetCellBackgroundColour(r, c, i >= (int)char_count || ((unsigned short)(m_relevance[i/16]) & (1<<(i%16))) ? colour_def : colour_irr);
} else {
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
SetAttr(r, c, NULL);
}
m_regenerate = false;
}
// Set column widths to stretch to full width.
for (int c = 0, x_l = 0; c < cols; c++) {
int x_r = (c + 1)*width/cols;
SetColSize(c, x_r - x_l);
x_l = x_r;
}
for (int c = 0; c < cols; c++)
SetColSize(c, wxZRColaCharacterGridColumnWidth);
//// Set column widths to stretch to full width.
//for (int c = 0, x_l = 0; c < cols; c++) {
// int x_r = (c + 1)*width/cols;
// SetColSize(c, x_r - x_l);
// x_l = x_r;
//}
EndBatch();
m_isResizing = false;
@@ -163,7 +205,8 @@ void wxZRColaCharGrid::OnKeyDown(wxKeyEvent& event)
{
wxWindow *parentWnd;
if (event.GetKeyCode() == WXK_TAB && (parentWnd = GetParent()) != NULL) {
int key_code = event.GetKeyCode();
if (key_code == WXK_TAB && (parentWnd = GetParent()) != NULL) {
wxNavigationKeyEvent eventNav;
eventNav.SetDirection(!event.ShiftDown());
eventNav.SetWindowChange(event.ControlDown());
@@ -171,6 +214,14 @@ void wxZRColaCharGrid::OnKeyDown(wxKeyEvent& event)
if (parentWnd->HandleWindowEvent(eventNav))
return;
} else if (key_code == WXK_LEFT && m_currentCellCoords.GetCol() == 0 && m_currentCellCoords.GetRow()) {
GoToCell(m_currentCellCoords.GetRow() - 1, m_numCols - 1);
event.StopPropagation();
return;
} else if (key_code == WXK_RIGHT && m_currentCellCoords.GetCol() == m_numCols - 1 && m_currentCellCoords.GetRow() < m_numRows - 1) {
GoToCell(m_currentCellCoords.GetRow() + 1, 0);
event.StopPropagation();
return;
}
event.Skip();
@@ -190,10 +241,10 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event)
return;
size_t toolTipIdx = row*m_numCols + col;
if (toolTipIdx >= m_chars.Length()) {
if (toolTipIdx >= m_chars.GetCount()) {
// Index out of range.
m_toolTipIdx = (size_t)-1;
m_toolTipTimer->Stop();
m_timerToolTip.Stop();
return;
} else if (toolTipIdx != m_toolTipIdx) {
// Cell changed.
@@ -204,7 +255,7 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event)
gridWnd->SetToolTip(GetToolTipText(m_toolTipIdx));
} else {
// This must be our initial entry. Schedule tooltip display after 1s.
m_toolTipTimer->Start(1000, true);
m_timerToolTip.Start(1000, true);
}
}
}
@@ -214,7 +265,7 @@ void wxZRColaCharGrid::OnTooltipTimer(wxTimerEvent& event)
{
event.Skip();
if (m_toolTipIdx >= m_chars.Length())
if (m_toolTipIdx >= m_chars.GetCount())
return;
GetGridWindow()->SetToolTip(GetToolTipText(m_toolTipIdx));

View File

@@ -54,10 +54,52 @@ public:
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display
/// \param[in] chars The string containing characters to display (zero delimited)
///
void SetCharacters(const wxString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The array of characters to display
///
void SetCharacters(const wxArrayString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display (zero delimited)
/// \param[in] relevance Bit-array of \p chars relevance (1=more relevant, 0=less relevant)
///
void SetCharacters(const wxString &chars, const wxArrayShort &relevance);
///
/// Returns displayed characters
///
/// \returns The string containing displayed characters
///
inline const wxArrayString& GetCharacters() const
{
return m_chars;
}
///
/// Returns given character coordinates
///
/// \param[in] c Character
///
/// \returns Grid coordinates of selected character or (-1, -1) if character not found.
///
inline wxGridCellCoords GetCharacterCoords(const wxString &c) const
{
for (size_t i = 0, n = m_chars.GetCount(); ; i++) {
if (i >= n)
return wxGridCellCoords(-1, -1);
else if (m_chars[i] == c)
return wxGridCellCoords(i / m_numCols, i % m_numCols);
}
}
protected:
virtual wxString GetToolTipText(int idx);
@@ -68,13 +110,15 @@ protected:
DECLARE_EVENT_TABLE()
private:
void Init(); // common part of all ctors
void Init(); // common part of all ctors
protected:
wxString m_chars; ///< Array of Unicode characters to display in the grid
wxArrayString m_chars; ///< Array of Unicode characters to display in the grid
wxArrayShort m_relevance; ///< Bit-array of `m_chars` relevance
private:
bool m_isResizing; ///< Prevents nesting of OnSize() method.
wxTimer *m_toolTipTimer;///< Timer for displaying tooltip
size_t m_toolTipIdx; ///< Index of cell for tooltip display
bool m_regenerate; ///< Force regenerate grid table
bool m_isResizing; ///< Prevents nesting of OnSize() method.
wxTimer m_timerToolTip; ///< Timer for displaying tooltip
size_t m_toolTipIdx; ///< Index of cell for tooltip display
};

101
ZRCola/zrcolachrreq.cpp Normal file
View File

@@ -0,0 +1,101 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharRequest
//////////////////////////////////////////////////////////////////////////
wxZRColaCharRequest::wxZRColaCharRequest(wxWindow* parent) : wxZRColaCharRequestBase(parent)
{
m_character->PushEventHandler(new wxZRColaKeyHandler());
m_context->PushEventHandler(new wxZRColaKeyHandler());
}
wxZRColaCharRequest::~wxZRColaCharRequest()
{
m_context->PopEventHandler(true);
m_character->PopEventHandler(true);
}
void wxZRColaCharRequest::OnOKButtonClick(wxCommandEvent& event)
{
event.Skip();
const wxString chr = m_character->GetValue();
const wxString ctx = m_context->GetValue();
wxString body;
body += _("Character") + wxT(": ");
for (size_t i = 0, i_end = chr.Length(); i < i_end; i++) {
if (chr[i] < 0x7f)
body += chr[i];
else
body += wxString::Format(wxT("(U+%04X)"), chr[i]);
}
body += wxT('\n');
if (!ctx.IsEmpty()) {
body += _("Context") + wxT(": ");
body += ctx;
body += wxT('\n');
}
wxLaunchDefaultBrowser(wxString::Format(wxT("mailto:janos.jezovnik@zrc-sazu.si&subject=%s&body=%s"),
wxURLEncode(wxString((wxString(wxT("[ZRCola] ")) + _("Request a New Character")).ToUTF8())),
wxURLEncode(body.ToUTF8())
));
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharRequest
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaCharRequest::wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaCharRequest::Save() const
{
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaCharRequest*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("character"), wnd->m_character->GetValue());
SaveValue(wxT("context"), wnd->m_context->GetValue());
}
bool wxPersistentZRColaCharRequest::Restore()
{
auto wnd = dynamic_cast<wxZRColaCharRequest*>(GetWindow());
wxString str;
if (RestoreValue(wxT("character"), &str))
wnd->m_character->SetValue(str);
if (RestoreValue(wxT("context"), &str))
wnd->m_context->SetValue(str);
return wxPersistentDialog::Restore();
}

65
ZRCola/zrcolachrreq.h Normal file
View File

@@ -0,0 +1,65 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaCharRequest;
#pragma once
#include "zrcolagui.h"
#include "zrcolakeyhndlr.h"
///
/// ZRCola New Character Request dialog
///
class wxZRColaCharRequest : public wxZRColaCharRequestBase
{
public:
wxZRColaCharRequest(wxWindow* parent);
virtual ~wxZRColaCharRequest();
friend class wxPersistentZRColaCharRequest; // Allow saving/restoring window state.
protected:
virtual void OnOKButtonClick(wxCommandEvent& event);
};
///
/// Supports saving/restoring wxZRColaCharRequest state
///
class wxPersistentZRColaCharRequest : public wxPersistentDialog
{
public:
wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaCharRequest *wnd)
{
return new wxPersistentZRColaCharRequest(wnd);
}

876
ZRCola/zrcolachrslct.cpp Normal file
View File

@@ -0,0 +1,876 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////
// wxZRColaUTF16CharValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUTF16CharValidator, wxValidator);
wxZRColaUTF16CharValidator::wxZRColaUTF16CharValidator(wchar_t *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUTF16CharValidator::Clone() const
{
return new wxZRColaUTF16CharValidator(*this);
}
bool wxZRColaUTF16CharValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUTF16CharValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(wxString::Format(wxT("%04X"), *m_val));
return true;
}
bool wxZRColaUTF16CharValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out)
{
const wxStringCharType *buf = val_in;
wchar_t chr = 0;
for (size_t i = i_start;;) {
if (i >= i_end) {
// End of Unicode found.
if (val_out) *val_out = chr;
return true;
} else if (i >= i_start + 4) {
// Maximum characters exceeded.
ctrl->SetFocus();
ctrl->SetSelection(i, i_end);
wxMessageBox(_("Too many digits in Unicode."), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
} else if (_T('0') <= buf[i] && buf[i] <= _T('9')) {
// Digit found.
chr = (chr << 4) | (buf[i] - _T('0'));
i++;
} else if (_T('A') <= buf[i] && buf[i] <= _T('F')) {
// Capital letter found.
chr = (chr << 4) | (buf[i] - _T('A') + 10);
i++;
} else if (_T('a') <= buf[i] && buf[i] <= _T('f')) {
// Lower letter found.
chr = (chr << 4) | (buf[i] - _T('a') + 10);
i++;
} else {
// Invalid character found.
ctrl->SetFocus();
ctrl->SetSelection(i, i + 1);
wxMessageBox(wxString::Format(_("Invalid character in Unicode found: %c"), buf[i]), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
}
}
}
//////////////////////////////////////////////////////////////////////
// wxZRColaUnicodeDumpValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator, wxValidator);
wxZRColaUnicodeDumpValidator::wxZRColaUnicodeDumpValidator(wxString *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUnicodeDumpValidator::Clone() const
{
return new wxZRColaUnicodeDumpValidator(*this);
}
bool wxZRColaUnicodeDumpValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUnicodeDumpValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(ZRCola::GetUnicodeDumpW(m_val->c_str(), m_val->length(), L"+"));
return true;
}
bool wxZRColaUnicodeDumpValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
bool wxZRColaUnicodeDumpValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out)
{
const wxStringCharType *buf = val_in;
wxString str;
for (size_t i = i_start;;) {
const wxStringCharType *buf_next;
wchar_t chr;
if ((buf_next = wmemchr(buf + i, L'+', i_end - i)) != NULL) {
// Unicode dump separator found.
if (!wxZRColaUTF16CharValidator::Parse(val_in, i, buf_next - buf, ctrl, parent, &chr))
return false;
str += chr;
i = buf_next - buf + 1;
} else if (wxZRColaUTF16CharValidator::Parse(val_in, i, i_end, ctrl, parent, &chr)) {
// The rest of the FQDN parsed succesfully.
if (chr) str += chr;
if (val_out) *val_out = str;
return true;
} else
return false;
}
}
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
wxDEFINE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
m_searchChanged(false),
m_unicodeChanged(false),
m_searchThread(NULL),
wxZRColaCharSelectBase(parent)
{
// Set tag lookup locale.
wxLanguage language = dynamic_cast<ZRColaApp*>(wxTheApp)->m_lang_ui;
if (wxLANGUAGE_DEFAULT == language ||
wxLANGUAGE_ENGLISH <= language && language <= wxLANGUAGE_ENGLISH_ZIMBABWE) m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_RUSSIAN <= language && language <= wxLANGUAGE_RUSSIAN_UKRAINE ) m_locale = MAKELCID(MAKELANGID(LANG_RUSSIAN , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_SLOVENIAN == language ) m_locale = MAKELCID(MAKELANGID(LANG_SLOVENIAN, SUBLANG_DEFAULT), SORT_DEFAULT);
else m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
Connect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this);
m_search_more->SetLabel(_(L"▸ Search Options"));
m_unicode->SetValidator(wxZRColaUnicodeDumpValidator(&m_char));
// Fill categories.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), i);
m_categories->Check(idx);
m_ccOrder.insert(std::make_pair(cc.cat, idx));
}
ResetResults();
NavigationState state;
state.m_char = m_char;
state.m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
state.m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
m_historyCursor = m_history.insert(m_history.end(), state);
}
wxZRColaCharSelect::~wxZRColaCharSelect()
{
if (m_searchThread)
m_searchThread->Delete();
Disconnect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this);
}
void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
{
event.Skip();
if (m_unicodeChanged) {
if (m_unicode->GetValidator()->TransferFromWindow()) {
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_gridPreview->SetCellValue(m_char, 0, 0);
std::unique_ptr<ZRCola::character_db::character> chr((ZRCola::character_db::character*)new char[sizeof(ZRCola::character_db::character) + sizeof(wchar_t)*m_char.length()]);
chr->ZRCola::character_db::character::character(m_char.data(), m_char.length());
size_t start;
if (app->m_chr_db.idxChr.find(*chr, start)) {
const auto &chr = app->m_chr_db.idxChr[start];
// Update character description.
m_description->SetValue(wxString(chr.desc(), chr.desc_len()));
{
// See if this character has a key sequence registered.
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*m_char.length()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, m_char.data(), m_char.length());
ZRCola::keyseq_db::indexKey::size_type start;
if (app->m_ks_db.idxChr.find(*ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
m_shortcut->SetValue(ks_str);
else
m_shortcut->SetValue(wxEmptyString);
} else
m_shortcut->SetValue(wxEmptyString);
}
{
size_t start;
// Update character category.
if (app->m_cc_db.idxChrCat.find(ZRCola::chrcat_db::chrcat(chr.cat), start)) {
const auto &cat = app->m_cc_db.idxChrCat[start];
m_category->SetValue(wxGetTranslation(wxString(cat.name(), cat.name_len()), wxT("ZRCola-zrcdb")));
} else
m_category->SetValue(wxEmptyString);
}
// Update related characters.
m_gridRelated->SetCharacters(wxString(chr.rel(), chr.rel_end()));
} else {
m_description->SetValue(wxEmptyString);
m_shortcut->SetValue(wxEmptyString);
m_category->SetValue(wxEmptyString);
m_gridRelated->ClearGrid();
}
// Find character tags.
std::list<std::wstring> tag_names;
std::unique_ptr<ZRCola::chrtag_db::chrtag> ct((ZRCola::chrtag_db::chrtag*)new char[sizeof(ZRCola::chrtag_db::chrtag) + sizeof(wchar_t)*m_char.length()]);
ct->ZRCola::chrtag_db::chrtag::chrtag(m_char.data(), m_char.length());
size_t end;
if (app->m_ct_db.idxChr.find(*ct, start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::chrtag_db::chrtag &ct = app->m_ct_db.idxChr[i];
// Find tag names.
size_t start, end;
if (app->m_tn_db.idxTag.find(ZRCola::tagname_db::tagname(ct.tag, m_locale), start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::tagname_db::tagname &tn = app->m_tn_db.idxTag[i];
// Add tag name to the list (prevent duplicates).
for (auto name = tag_names.cbegin(), name_end = tag_names.cend();; ++name) {
if (name == name_end) {
// Add name to the list.
tag_names.push_back(std::wstring(tn.name(), tn.name_end()));
break;
} else if (ZRCola::tagname_db::tagname::CompareName(m_locale, name->data(), (unsigned __int16)name->length(), tn.name(), tn.name_len()) == 0)
// Name is already on the list.
break;
}
}
}
}
}
wxString tags;
for (auto name = tag_names.cbegin(), name_end = tag_names.cend(); name != name_end; ++name) {
if (!tags.empty())
tags += _(", ");
tags += *name;
}
m_tags->SetValue(tags);
m_gridRelated->GoToCell(m_historyCursor->m_related.m_selected);
wxGridCellCoords coord(m_gridResults->GetCharacterCoords(m_char));
if (coord.GetRow() != -1 && coord.GetCol() != -1) {
m_gridResults->GoToCell(coord);
m_gridResults->SetGridCursor(coord);
} else
m_gridResults->ClearSelection();
}
m_unicodeChanged = false;
} else if (m_searchChanged) {
if (m_searchThread)
m_searchThread->Delete();
wxString val(m_search->GetValue());
if (!val.IsEmpty()) {
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_searchThread = new SearchThread(this);
m_searchThread->m_search.assign(val.c_str(), val.Length());
// Select categories.
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
if (m_categories->IsChecked(i))
m_searchThread->m_cats.insert(cc.cat);
}
if (m_searchThread->Run() != wxTHREAD_NO_ERROR) {
wxFAIL_MSG("Can't create the thread!");
delete m_searchThread;
m_searchThread = NULL;
}
} else
ResetResults();
m_searchChanged = false;
}
}
void wxZRColaCharSelect::OnSearchText(wxCommandEvent& event)
{
event.Skip();
m_searchChanged = true;
}
void wxZRColaCharSelect::OnSearchMore(wxHyperlinkEvent& event)
{
event.StopPropagation();
if (m_search_panel->IsShown()) {
m_search_panel->Show(false);
m_search_more->SetLabel(_(L"▸ Search Options"));
} else {
m_search_panel->Show(true);
m_search_more->SetLabel(_(L"▾ Search Options"));
}
this->Layout();
}
void wxZRColaCharSelect::OnCategoriesAll(wxHyperlinkEvent& event)
{
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, true);
m_searchChanged = true;
}
void wxZRColaCharSelect::OnCategoriesNone(wxHyperlinkEvent& event)
{
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, false);
m_searchChanged = true;
}
void wxZRColaCharSelect::OnCategoriesInvert(wxHyperlinkEvent& event)
{
event.StopPropagation();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, !m_categories->IsChecked(i));
m_searchChanged = true;
}
void wxZRColaCharSelect::OnCategoriesToggle(wxCommandEvent& event)
{
event.Skip();
m_searchChanged = true;
}
void wxZRColaCharSelect::OnSearchComplete(wxThreadEvent& event)
{
event.Skip();
if (m_searchThread) {
// Display results.
wxArrayString chars;
chars.reserve(m_searchThread->m_hits.size());
for (auto i = m_searchThread->m_hits.cbegin(), i_end = m_searchThread->m_hits.cend(); i != i_end; ++i)
chars.Add(i->second);
m_gridResults->SetCharacters(chars);
m_searchThread->Delete();
m_searchThread = NULL;
m_gridResults->Scroll(0, 0);
}
}
void wxZRColaCharSelect::OnResultSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
}
void wxZRColaCharSelect::OnResultCellDClick(wxGridEvent& event)
{
event.Skip();
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
}
void wxZRColaCharSelect::OnResultsKeyDown(wxKeyEvent& event)
{
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
wxString val(m_gridResults->GetCellValue(m_gridResults->GetCursorRow(), m_gridResults->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
event.StopPropagation();
return;
}
}
event.Skip();
}
void wxZRColaCharSelect::OnRecentSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
}
void wxZRColaCharSelect::OnRecentCellDClick(wxGridEvent& event)
{
event.Skip();
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
}
void wxZRColaCharSelect::OnRecentKeyDown(wxKeyEvent& event)
{
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
wxString val(m_gridRecent->GetCellValue(m_gridRecent->GetCursorRow(), m_gridRecent->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
event.StopPropagation();
return;
}
}
event.Skip();
}
void wxZRColaCharSelect::OnUnicodeText(wxCommandEvent& event)
{
event.Skip();
m_unicodeChanged = true;
}
void wxZRColaCharSelect::OnPreviewKeyDown(wxKeyEvent& event)
{
int key_code = event.GetKeyCode();
if (key_code == WXK_TAB != NULL) {
wxNavigationKeyEvent eventNav;
eventNav.SetDirection(!event.ShiftDown());
eventNav.SetWindowChange(event.ControlDown());
eventNav.SetEventObject(this);
if (HandleWindowEvent(eventNav))
return;
}
event.Skip();
}
void wxZRColaCharSelect::OnNavigateBack(wxHyperlinkEvent& event)
{
event.StopPropagation();
NavigateBy(-1);
}
void wxZRColaCharSelect::OnNavigateForward(wxHyperlinkEvent& event)
{
event.StopPropagation();
NavigateBy(+1);
}
void wxZRColaCharSelect::OnRelatedSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridRelated->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val);
}
void wxZRColaCharSelect::OnOKButtonClick(wxCommandEvent& event)
{
event.Skip();
const wxArrayString &recent = m_gridRecent->GetCharacters();
wxArrayString val;
val.reserve(recent.GetCount() + 1);
val.Add(m_char);
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
const wxString &c = recent[i];
if (c != m_char)
val.Add(c);
}
m_gridRecent->SetCharacters(val);
}
void wxZRColaCharSelect::ResetResults()
{
// Fill the results.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
size_t i, n = app->m_chr_db.idxChr.size();
wxArrayString val;
val.reserve(n);
for (i = 0; i < n; i++) {
const auto &chr = app->m_chr_db.idxChr[i];
auto idx = m_ccOrder.find(chr.cat);
if (idx == m_ccOrder.end() || m_categories->IsChecked(idx->second))
val.Add(wxString(chr.chr(), chr.chr_len()));
}
m_gridResults->SetCharacters(val);
}
void wxZRColaCharSelect::NavigateBy(int offset)
{
if (offset != 0) {
// Update history state
m_historyCursor->m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
m_historyCursor->m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
if (offset < 0) {
while (m_historyCursor != m_history.begin() && offset) {
--m_historyCursor; offset++;
m_char = m_historyCursor->m_char;
m_unicodeChanged = true;
}
} else {
while (offset) {
++m_historyCursor;
if (m_historyCursor == m_history.end()) {
// We're past the last history entry.
--m_historyCursor;
break;
}
offset--;
m_char = m_historyCursor->m_char;
m_unicodeChanged = true;
}
}
m_navigateBack->Enable(m_historyCursor != m_history.begin());
auto cursor_next = m_historyCursor;
++cursor_next;
m_navigateForward->Enable(cursor_next != m_history.end());
if (m_unicodeChanged)
m_unicode->GetValidator()->TransferToWindow();
}
}
void wxZRColaCharSelect::NavigateTo(const wxString &c)
{
if (m_char != c) {
// Update history state
m_historyCursor->m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
m_historyCursor->m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
++m_historyCursor;
// Create new state.
NavigationState state;
state.m_char = m_char = c;
state.m_related.m_selected.SetCol(0);
state.m_related.m_selected.SetRow(0);
m_historyCursor = m_history.insert(m_historyCursor, state);
// Purge the history's tail.
auto cursor_next = m_historyCursor;
++cursor_next;
m_history.erase(cursor_next, m_history.end());
m_unicode->GetValidator()->TransferToWindow();
m_navigateBack->Enable(true);
m_navigateForward->Enable(false);
}
}
wxZRColaCharSelect::SearchThread::SearchThread(wxZRColaCharSelect *parent) :
m_parent(parent),
wxThread(wxTHREAD_JOINABLE)
{
//// This is a worker thread. Set priority between minimal and normal.
//SetPriority((wxPRIORITY_MIN + wxPRIORITY_DEFAULT) / 2);
}
wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
std::map<std::wstring, ZRCola::charrank_t> hits;
if (TestDestroy()) return (wxThread::ExitCode)1;
{
// Search by tags: Get tags with given names. Then, get characters of found tags.
std::map<ZRCola::tagid_t, unsigned __int16> hits_tag;
if (!app->m_tn_db.Search(m_search.c_str(), m_parent->m_locale, hits_tag, TestDestroyS, this)) return (wxThread::ExitCode)1;
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_cats, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
}
{
// Search by description and merge results.
std::map<std::wstring, ZRCola::charrank_t> hits_sub;
if (!app->m_chr_db.Search(m_search.c_str(), m_cats, hits, hits_sub, TestDestroyS, this)) return (wxThread::ExitCode)1;
for (auto i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
auto idx = hits.find(i->first);
if (idx == hits.end())
hits.insert(std::make_pair(i->first, i->second / 4));
else
idx->second += i->second / 4;
}
}
// Get best rank.
ZRCola::charrank_t rank_ref = 0;
for (auto i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
if (i->second > rank_ref)
rank_ref = i->second;
}
// Now sort the characters by rank (taking only top 3/4 by rank).
ZRCola::charrank_t rank_threshold = rank_ref*3/4;
m_hits.reserve(hits.size());
for (auto i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
if (i->second > rank_threshold)
m_hits.push_back(std::make_pair(i->second, i->first));
}
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<ZRCola::charrank_t, std::wstring>), CompareHits);
// Signal the event handler that this thread is going to be destroyed.
// NOTE: here we assume that using the m_parent pointer is safe,
// (in this case this is assured by the wxZRColaCharSelect destructor)
wxQueueEvent(m_parent, new wxThreadEvent(wxEVT_SEARCH_COMPLETE));
return 0;
}
int __cdecl wxZRColaCharSelect::SearchThread::CompareHits(const void *a, const void *b)
{
const std::pair<ZRCola::charrank_t, wchar_t> *_a = (const std::pair<ZRCola::charrank_t, wchar_t>*)a;
const std::pair<ZRCola::charrank_t, wchar_t> *_b = (const std::pair<ZRCola::charrank_t, wchar_t>*)b;
if (_a->first > _b->first) return -1;
else if (_a->first < _b->first) return 1;
if (_a->second < _b->second) return -1;
else if (_a->second > _b->second) return 1;
return 0;
}
bool __cdecl wxZRColaCharSelect::SearchThread::TestDestroyS(void *cookie)
{
return static_cast<wxZRColaCharSelect::SearchThread*>(cookie)->TestDestroy();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaCharSelect::wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaCharSelect::Save() const
{
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaCharSelect*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str, str2;
auto &recent = wnd->m_gridRecent->GetCharacters();
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
if (i) str2 += wxT('|');
auto &chr = recent[i];
for (size_t j = 0, m = chr.Length(); j < m; j++) {
if (j) str2 += wxT('+');
str2 += wxString::Format(wxT("%04X"), chr[j]);
}
if (chr.Length() == 1)
str += chr[0];
}
SaveValue(wxT("recentChars" ), str ); // Save in legacy format for backward compatibility.
SaveValue(wxT("recentChars2"), str2); // Save in native format
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
wxString name(wxT("category"));
name.Append(cc.cat.data, _countof(cc.cat.data));
SaveValue(name, wnd->m_categories->IsChecked(i));
}
SaveValue(wxT("searchPanel"), wnd->m_search_panel->IsShown());
}
bool wxPersistentZRColaCharSelect::Restore()
{
auto wnd = dynamic_cast<wxZRColaCharSelect*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str;
if (RestoreValue(wxT("recentChars2"), &str)) {
// Native format found.
wxArrayString val;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
wxString chr;
for (wxStringTokenizer tok_chr(tok.GetNextToken(), wxT("+")); tok_chr.HasMoreTokens(); )
chr += (wchar_t)_tcstoul(tok_chr.GetNextToken().c_str(), NULL, 16);
val.Add(chr);
}
wnd->m_gridRecent->SetCharacters(val);
} else if (RestoreValue(wxT("recentChars"), &str)) {
// Legacy value found.
wxArrayString val;
for (size_t i = 0, n = str.Length(); i < n; i++)
val.Add(wxString(1, str[i]));
wnd->m_gridRecent->SetCharacters(val);
}
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
wxString name(wxT("category"));
name.Append(cc.cat.data, _countof(cc.cat.data));
bool val;
if (RestoreValue(name, &val))
wnd->m_categories->Check(i, val);
}
bool search_panel;
if (RestoreValue(wxT("searchPanel"), &search_panel)) {
if (search_panel) {
wnd->m_search_panel->Show(true);
wnd->m_search_more->SetLabel(_(L"▾ Search Options"));
} else {
wnd->m_search_panel->Show(false);
wnd->m_search_more->SetLabel(_(L"▸ Search Options"));
}
}
wnd->ResetResults();
return wxPersistentDialog::Restore();
}

237
ZRCola/zrcolachrslct.h Normal file
View File

@@ -0,0 +1,237 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaCharSelect;
class wxPersistentZRColaCharSelect;
#pragma once
#include "zrcolagui.h"
#include <zrcola/character.h>
#include <wx/validate.h>
#include <wxex/persist/dialog.h>
#include <wx/event.h>
#include <wx/thread.h>
#include <list>
#include <map>
#include <string>
#include <vector>
///
/// Validator for Unicode character
///
class WXEXTEND_API wxZRColaUTF16CharValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUTF16CharValidator(wchar_t *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses FQDN value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out = NULL);
protected:
wchar_t *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUTF16CharValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUTF16CharValidator);
};
///
/// Validator for Unicode dump
///
class wxZRColaUnicodeDumpValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUnicodeDumpValidator(wxString *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses Unicode dump value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out = NULL);
protected:
wxString *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUnicodeDumpValidator);
};
wxDECLARE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
///
/// ZRCola character select dialog
///
class wxZRColaCharSelect : public wxZRColaCharSelectBase
{
public:
wxZRColaCharSelect(wxWindow* parent);
virtual ~wxZRColaCharSelect();
friend class wxPersistentZRColaCharSelect; // Allow saving/restoring window state.
friend class SearchThread; // For search thread back-notifications
protected:
virtual void OnIdle(wxIdleEvent& event);
virtual void OnSearchText(wxCommandEvent& event);
virtual void OnSearchMore(wxHyperlinkEvent& event);
virtual void OnCategoriesAll(wxHyperlinkEvent& event);
virtual void OnCategoriesNone(wxHyperlinkEvent& event);
virtual void OnCategoriesInvert(wxHyperlinkEvent& event);
virtual void OnCategoriesToggle(wxCommandEvent& event);
void OnSearchComplete(wxThreadEvent& event);
virtual void OnResultSelectCell(wxGridEvent& event);
virtual void OnResultCellDClick(wxGridEvent& event);
virtual void OnResultsKeyDown(wxKeyEvent& event);
virtual void OnRecentSelectCell(wxGridEvent& event);
virtual void OnRecentCellDClick(wxGridEvent& event);
virtual void OnRecentKeyDown(wxKeyEvent& event);
virtual void OnNavigateBack(wxHyperlinkEvent& event);
virtual void OnNavigateForward(wxHyperlinkEvent& event);
virtual void OnUnicodeText(wxCommandEvent& event);
virtual void OnPreviewKeyDown(wxKeyEvent& event);
virtual void OnRelatedSelectCell(wxGridEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
void ResetResults();
void NavigateBy(int offset);
void NavigateTo(const wxString &c);
public:
wxString m_char; ///< Currently selected character (empty when none)
protected:
LCID m_locale; ///< Locale for tag lookup
bool m_searchChanged; ///< Did Search field or category selection change?
std::map<ZRCola::chrcatid_t, int> m_ccOrder; ///< Character category order
bool m_unicodeChanged; ///< Did Unicode field change?
///
/// Search worker thread
///
class SearchThread : public wxThread
{
public:
SearchThread(wxZRColaCharSelect *parent);
protected:
virtual ExitCode Entry();
static int __cdecl CompareHits(const void *a, const void *b);
static bool __cdecl TestDestroyS(void *cookie);
public:
std::wstring m_search; ///< Search phrase
std::set<ZRCola::chrcatid_t> m_cats; ///< Search categories
std::vector<std::pair<ZRCola::charrank_t, std::wstring> > m_hits; ///< Search results
protected:
wxZRColaCharSelect *m_parent; ///< Thread owner
} *m_searchThread; ///< Search thread
///
/// Navigation state
///
struct NavigationState
{
std::wstring m_char;
struct {
wxGridCellCoords m_selected;
} m_related;
};
std::list<NavigationState> m_history; ///< Navigation history
std::list<NavigationState>::iterator m_historyCursor; ///< Navigation history cursor
};
///
/// Supports saving/restoring wxZRColaCharSelect state
///
class wxPersistentZRColaCharSelect : public wxPersistentDialog
{
public:
wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaCharSelect *wnd)
{
return new wxPersistentZRColaCharSelect(wnd);
}

View File

@@ -24,45 +24,43 @@
// wxZRColaComposerPanel
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaComposerPanel, wxZRColaComposerPanelBase)
EVT_TIMER(wxZRColaComposerPanel::wxID_CHECKPOINT_TIMER, wxZRColaComposerPanel::OnTimerTimeout)
END_EVENT_TABLE()
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
m_progress(false),
m_selDecomposed(0, 0),
m_selComposed(0, 0),
m_sourceChanged(false),
m_destinationChanged(false),
m_selSource(0, 0),
m_selDestination(0, 0),
wxZRColaComposerPanelBase(parent)
{
m_decomposed->PushEventHandler(&m_keyhandler);
// Create timer for saving the state.
m_timer = new wxTimer(this, wxID_CHECKPOINT_TIMER);
m_source->PushEventHandler(&m_keyhandler);
// Restore the previously saved state (if exists).
wxString fileName(GetStateFileName());
if (wxFileExists(fileName)) {
wxFFile file(fileName, wxT("rb"));
if (file.IsOpened()) {
// Load decomposed text.
// Load source text.
unsigned __int64 n;
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString decomposed;
file.Read(wxStringBuffer(decomposed, n), sizeof(wchar_t)*n);
wxString source;
file.Read(wxStringBuffer(source, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Load composed text.
// Load destination text.
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString composed;
file.Read(wxStringBuffer(composed, n), sizeof(wchar_t)*n);
wxString destination;
file.Read(wxStringBuffer(destination, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Restore state.
m_progress = true;
m_decomposed->SetValue(decomposed);
m_composed->SetValue(composed);
m_progress = false;
m_source->SetValue(source);
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, source.GetData(), source.Length(), m_selSource.first, m_selSource.second);
m_sourceChanged = false;
m_destination->SetValue(destination);
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, destination.GetData(), destination.Length(), m_selDestination.first, m_selDestination.second);
m_destinationChanged = false;
}
}
}
@@ -74,10 +72,7 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
wxZRColaComposerPanel::~wxZRColaComposerPanel()
{
if (m_timer)
delete m_timer;
m_decomposed->PopEventHandler();
m_source->PopEventHandler();
// This is a controlled exit. Purge saved state.
wxString fileName(GetStateFileName());
@@ -86,225 +81,243 @@ wxZRColaComposerPanel::~wxZRColaComposerPanel()
}
void wxZRColaComposerPanel::OnDecomposedPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::SynchronizePanels()
{
event.Skip();
if (m_sourceChanged) {
m_timerSave.Stop();
long from, to;
m_decomposed->GetSelection(&from, &to);
if (m_selDecomposed.first != from || m_selDecomposed.second != to) {
// Save new selection first, to avoid loop.
m_selDecomposed.first = from;
m_selDecomposed.second = to;
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
}
}
void wxZRColaComposerPanel::OnDecomposedHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_decomposedHex->GetSelection(&from, &to);
if (m_selDecomposedHex.first != from || m_selDecomposedHex.second != to) {
// Save new selection first, to avoid loop.
m_selDecomposedHex.first = from;
m_selDecomposedHex.second = to;
m_decomposed->SetSelection(from = m_mappingDecomposedHex.to_src(from), to = m_mappingDecomposedHex.to_src(to));
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
}
}
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
{
if (m_progress) {
// We are being updated by wxZRColaComposerPanel::OnComposedText()
event.Skip();
} else {
m_timer->Stop();
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_decomposed->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> src(len + 1);
::GetWindowTextW(hWnd, src.data(), src.size());
#else
wxString src(m_decomposed->GetValue());
size_t len = src.Length();
#endif
std::wstring norm;
((ZRColaApp*)wxTheApp)->m_t_db.Decompose(src.data(), len, norm, &m_mapping1);
std::wstring dst;
((ZRColaApp*)wxTheApp)->m_t_db.Compose(norm.data(), norm.size(), dst, &m_mapping2);
long from, to;
m_decomposed->GetSelection(&from, &to);
// Update decomposed HEX dump.
wxString hex;
GetHex(hex, m_mappingDecomposedHex, src.data(), len);
m_decomposedHex->SetValue(hex);
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
// Update composed text.
m_progress = true;
m_composed->SetValue(dst);
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
// Update composed HEX dump.
GetHex(hex, m_mappingComposedHex, dst.data(), dst.length());
m_composedHex->SetValue(hex);
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
event.Skip();
m_progress = false;
// Schedule state save after 3s.
m_timer->Start(3000, true);
}
}
void wxZRColaComposerPanel::OnComposedPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_composed->GetSelection(&from, &to);
if (m_selComposed.first != from || m_selComposed.second != to) {
// Save new selection first, to avoid loop.
m_selComposed.first = from;
m_selComposed.second = to;
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
}
}
void wxZRColaComposerPanel::OnComposedHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_composedHex->GetSelection(&from, &to);
if (m_selComposedHex.first != from || m_selComposedHex.second != to) {
// Save new selection first, to avoid loop.
m_selComposedHex.first = from;
m_selComposedHex.second = to;
m_composed->SetSelection(from = m_mappingComposedHex.to_src(from), to = m_mappingComposedHex.to_src(to));
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
}
}
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
{
if (m_progress) {
// We are being updated by wxZRColaComposerPanel::OnDecomposedText()
event.Skip();
} else {
m_timer->Stop();
#ifdef __WINDOWS__
// Use Windows GetWindowTextLength() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_composed->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> src(len + 1);
::GetWindowTextW(hWnd, src.data(), src.size());
#else
wxString src(m_composed->GetValue());
size_t len = src.Length();
#endif
ZRColaApp *app = (ZRColaApp*)wxTheApp;
std::wstring dst;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxZRColaFrame *mainWnd = dynamic_cast<wxZRColaFrame*>(wxGetActiveWindow());
if (mainWnd)
app->m_t_db.Decompose(src.data(), len, &app->m_lc_db, mainWnd->m_lang, dst, &m_mapping2);
else
app->m_t_db.Decompose(src.data(), len, dst, &m_mapping2);
wxASSERT_MSG(mainWnd, "main window missing");
m_mapping1.clear();
m_mapping2.invert();
wxString src;
size_t len = GetValue(m_source, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
long from, to;
m_composed->GetSelection(&from, &to);
m_mapping.clear();
for (auto s = mainWnd->m_settings->m_transeq.cbegin(), s_end = mainWnd->m_settings->m_transeq.cend(); s != s_end; ++s) {
if (*s == 0) {
// ZRCola Decomposed => ZRCola Composed should decompose first.
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
// Update composed HEX dump.
wxString hex;
GetHex(hex, m_mappingComposedHex, src.data(), len);
m_composedHex->SetValue(hex);
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
app->m_t_db.Translate(*s, dst2.data(), dst2.size(), dst, &map);
m_mapping.push_back(std::move(map));
} else {
// Other transforms
app->m_t_db.Translate(*s, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
dst = std::move(dst2);
}
}
// Update decomposed text.
m_progress = true;
m_decomposed->SetValue(dst);
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
// Update decomposed HEX dump.
GetHex(hex, m_mappingDecomposedHex, dst.data(), dst.length());
m_decomposedHex->SetValue(hex);
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
// Update source HEX dump.
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, src.data(), len, m_selSource.first, m_selSource.second);
event.Skip();
m_progress = false;
// Update destination text, and its HEX dump.
m_destination->SetValue(dst);
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, dst.data(), dst.length(), m_selDestination.first, m_selDestination.second);
// Schedule state save after 3s.
m_timer->Start(3000, true);
m_timerSave.Start(3000, true);
} else if (m_destinationChanged) {
m_timerSave.Stop();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxZRColaFrame *mainWnd = dynamic_cast<wxZRColaFrame*>(wxGetActiveWindow());
wxASSERT_MSG(mainWnd, "main window missing");
wxString src;
size_t len = GetValue(m_destination, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
m_mapping.clear();
for (auto s = mainWnd->m_settings->m_transeq.crbegin(), s_end = mainWnd->m_settings->m_transeq.crend(); s != s_end; ++s) {
if (*s) {
// ZRCola Decomposed => ZRCola Composed
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), &app->m_lc_db, mainWnd->m_settings->m_lang, dst2, &map);
} else {
// Other transforms
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
}
dst = std::move(dst2);
map.invert();
m_mapping.push_back(std::move(map));
}
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
// Update destination HEX dump.
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, src.data(), len, m_selDestination.first, m_selDestination.second);
// Update source text, and its HEX dump.
m_source->SetValue(dst);
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, dst.data(), dst.length(), m_selSource.first, m_selSource.second);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
}
m_sourceChanged = false;
m_destinationChanged = false;
}
void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_source->GetSelection(&from, &to);
if (m_selSource.first != from || m_selSource.second != to) {
// Save new selection first, to avoid loop.
m_selSource.first = from;
m_selSource.second = to;
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(from),
m_selSourceHex.second = m_mappingSourceHex.to_dst(to ));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(from),
m_selDestination.second = MapToDestination(to ));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
}
}
void wxZRColaComposerPanel::OnTimerTimeout(wxTimerEvent& event)
void wxZRColaComposerPanel::OnSourceHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_sourceHex->GetSelection(&from, &to);
if (m_selSourceHex.first != from || m_selSourceHex.second != to) {
// Save new selection first, to avoid loop.
m_selSourceHex.first = from;
m_selSourceHex.second = to;
m_source->SetSelection(
m_selSource.first = m_mappingSourceHex.to_src(from),
m_selSource.second = m_mappingSourceHex.to_src(to ));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
}
}
void wxZRColaComposerPanel::OnSourceText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the source text changed to trigger idle-time transformation.
m_sourceChanged = true;
}
void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_destination->GetSelection(&from, &to);
if (m_selDestination.first != from || m_selDestination.second != to) {
// Save new selection first, to avoid loop.
m_selDestination.first = from;
m_selDestination.second = to;
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(from),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(to ));
m_source->SetSelection(
m_selSource.first = MapToSource(from),
m_selSource.second = MapToSource(to ));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
}
}
void wxZRColaComposerPanel::OnDestinationHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_destinationHex->GetSelection(&from, &to);
if (m_selDestinationHex.first != from || m_selDestinationHex.second != to) {
// Save new selection first, to avoid loop.
m_selDestinationHex.first = from;
m_selDestinationHex.second = to;
m_destination->SetSelection(
m_selDestination.first = m_mappingDestinationHex.to_src(from),
m_selDestination.second = m_mappingDestinationHex.to_src(to ));
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
}
}
void wxZRColaComposerPanel::OnDestinationText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the destination text changed to trigger idle-time inverse transformation.
m_destinationChanged = true;
}
void wxZRColaComposerPanel::OnSaveTimer(wxTimerEvent& event)
{
wxString fileName(GetStateFileName());
wxFFile file(fileName, wxT("wb"));
if (file.IsOpened()) {
// Save decomposed text.
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_decomposed->GetHWND();
unsigned __int64 len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> text(len + 1);
::GetWindowTextW(hWnd, text.data(), text.size());
#else
wxString text(m_decomposed->GetValue());
unsigned __int64 len = text.Length();
#endif
file.Write(&len, sizeof(len));
file.Write(text.data(), sizeof(wchar_t)*len);
}
wxString text;
size_t len;
// Save composed text.
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_composed->GetHWND();
unsigned __int64 len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> text(len + 1);
::GetWindowTextW(hWnd, text.data(), text.size());
#else
wxString text(m_composed->GetValue());
unsigned __int64 len = text.Length();
#endif
file.Write(&len, sizeof(len));
file.Write(text.data(), 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);
}
event.Skip();
@@ -329,10 +342,36 @@ wxString wxZRColaComposerPanel::GetStateFileName()
}
void wxZRColaComposerPanel::GetHex(wxString &hex, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len)
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, len + 1);
text.assign(buf, len);
} else {
LPWSTR buf = new WCHAR[len + 1];
::GetWindowTextW(hWnd, buf, 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;
bool first = true;
hex.clear();
mapping.clear();
for (size_t i = 0; i < len && src[i]; i++) {
wchar_t c = src[i];
@@ -345,6 +384,11 @@ void wxZRColaComposerPanel::GetHex(wxString &hex, ZRCola::mapping_vector &mappin
first = false;
}
}
wnd->SetValue(hex);
wnd->SetSelection(
range.first = mapping.to_dst(from),
range.second = mapping.to_dst(to ));
}
@@ -365,29 +409,29 @@ wxString wxPersistentZRColaComposerPanel::GetKind() const
void wxPersistentZRColaComposerPanel::Save() const
{
const wxZRColaComposerPanel * const wnd = static_cast<const wxZRColaComposerPanel*>(GetWindow());
auto const wnd = static_cast<const wxZRColaComposerPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("splitDecomposed"), wnd->m_splitterDecomposed->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterComposed ->GetSashPosition());
SaveValue(wxT("splitDecomposed"), wnd->m_splitterSource->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterDestination ->GetSashPosition());
}
bool wxPersistentZRColaComposerPanel::Restore()
{
wxZRColaComposerPanel * const wnd = static_cast<wxZRColaComposerPanel*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaComposerPanel*>(GetWindow());
int sashVal;
if (RestoreValue(wxT("splitDecomposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, wnd );
wnd->m_splitterDecomposed->SetSashPosition(sashVal);
wnd->m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, wnd );
wnd->m_splitterSource->SetSashPosition(sashVal);
}
if (RestoreValue(wxT("splitComposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, wnd );
wnd->m_splitterComposed->SetSashPosition(sashVal);
wnd->m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, wnd );
wnd->m_splitterDestination->SetSashPosition(sashVal);
}
return true;

View File

@@ -30,6 +30,7 @@ class wxZRColaComposerPanel;
#include <wx/persist/window.h>
#include <wx/timer.h>
#include <utility>
#include <vector>
///
@@ -38,42 +39,40 @@ class wxZRColaComposerPanel;
class wxZRColaComposerPanel : public wxZRColaComposerPanelBase
{
public:
enum
{
wxID_CHECKPOINT_TIMER = 2000,
};
wxZRColaComposerPanel(wxWindow* parent);
virtual ~wxZRColaComposerPanel();
void SynchronizePanels();
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
protected:
virtual void OnDecomposedPaint(wxPaintEvent& event);
virtual void OnDecomposedHexPaint(wxPaintEvent& event);
virtual void OnDecomposedText(wxCommandEvent& event);
virtual void OnComposedPaint(wxPaintEvent& event);
virtual void OnComposedHexPaint(wxPaintEvent& event);
virtual void OnComposedText(wxCommandEvent& event);
virtual void OnTimerTimeout(wxTimerEvent& event);
DECLARE_EVENT_TABLE()
virtual void OnSourcePaint(wxPaintEvent& event);
virtual void OnSourceHexPaint(wxPaintEvent& event);
virtual void OnSourceText(wxCommandEvent& event);
virtual void OnDestinationPaint(wxPaintEvent& event);
virtual void OnDestinationHexPaint(wxPaintEvent& event);
virtual void OnDestinationText(wxCommandEvent& event);
virtual void OnSaveTimer(wxTimerEvent& event);
inline size_t MapToDestination(_In_ size_t src) const;
inline size_t MapToSource(_In_ size_t dst) const;
static wxString GetStateFileName();
static void GetHex(wxString &hex, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len);
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_progress; ///< Boolean flag to avoid recursive updates of composed and decomposed text controls
ZRCola::mapping_vector m_mapping1; ///< Character index mapping vector between decomposed and normalized text
ZRCola::mapping_vector m_mapping2; ///< Character index mapping vector between normalized and composed text
bool m_sourceChanged; ///< Boolean flag to mark source text "dirty" to trigger transformation
bool m_destinationChanged; ///< Boolean flag to mark destination text "dirty" to trigger inverse transformation
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
std::pair<long, long>
m_selDecomposed, ///< Character index of selected text in decomposed text control
m_selDecomposedHex, ///< Character index of selected text in decomposed HEX dump text control
m_selComposed, ///< Character index of selected text in composed text control
m_selComposedHex; ///< Character index of selected text in composed HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for decomposed window
wxTimer *m_timer; ///< Timer to trigger the state save
ZRCola::mapping_vector m_mappingDecomposedHex; ///< Character index mapping vector between decomposed text and its HEX dump
ZRCola::mapping_vector m_mappingComposedHex; ///< Character index mapping vector between composed text and its HEX dump
m_selSource, ///< Character index of selected text in source text control
m_selSourceHex, ///< Character index of selected text in source HEX dump text control
m_selDestination, ///< Character index of selected text in destination text control
m_selDestinationHex; ///< Character index of selected text in destination HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for source window
ZRCola::mapping_vector m_mappingSourceHex; ///< Character index mapping vector between source text and its HEX dump
ZRCola::mapping_vector m_mappingDestinationHex; ///< Character index mapping vector between destination text and its HEX dump
};
@@ -91,6 +90,24 @@ public:
};
inline size_t wxZRColaComposerPanel::MapToDestination(_In_ size_t src) const
{
for (auto m = m_mapping.cbegin(), m_end = m_mapping.cend(); m != m_end; ++m)
src = m->to_dst(src);
return src;
}
inline size_t wxZRColaComposerPanel::MapToSource(_In_ size_t dst) const
{
for (auto m = m_mapping.crbegin(), m_end = m_mapping.crend(); m != m_end; ++m)
dst = m->to_src(dst);
return dst;
}
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaComposerPanel *wnd)
{
return new wxPersistentZRColaComposerPanel(wnd);

View File

@@ -25,91 +25,88 @@
//////////////////////////////////////////////////////////////////////////
wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
EVT_UPDATE_UI (wxID_AUTOSTART , wxZRColaFrame::OnAutostartUpdate )
EVT_MENU (wxID_AUTOSTART , wxZRColaFrame::OnAutostart )
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_UPDATE_UI_RANGE(wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI_RANGE(wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI_RANGE(wxID_SEND_COMPOSED , wxID_SEND_ABORT , wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_SEND_COMPOSED , wxZRColaFrame::OnSendComposed )
EVT_MENU (wxID_SEND_DECOMPOSED , wxZRColaFrame::OnSendDecomposed )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_CHARACTER_SELECTOR , wxZRColaFrame::OnInsertCharacter )
EVT_UPDATE_UI (wxID_DECOMP_LANG_AUTO , wxZRColaFrame::OnDecomposedLanguageAutoUpdate)
EVT_MENU (wxID_DECOMP_LANG_AUTO , wxZRColaFrame::OnDecomposedLanguageAuto )
EVT_UPDATE_UI_RANGE(wxID_DECOMP_LANGUAGE_START, wxID_DECOMP_LANGUAGE_END, wxZRColaFrame::OnDecomposedLanguageUpdate )
EVT_MENU_RANGE (wxID_DECOMP_LANGUAGE_START, wxID_DECOMP_LANGUAGE_END, wxZRColaFrame::OnDecomposedLanguage )
EVT_UPDATE_UI_RANGE(wxID_SEND_DESTINATION , wxID_SEND_ABORT, wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_COPY_DESTINATION_AND_RETURN , wxZRColaFrame::OnCopyDestinationAndReturn )
EVT_MENU (wxID_SEND_DESTINATION , wxZRColaFrame::OnSendDestination )
EVT_MENU (wxID_COPY_SOURCE_AND_RETURN , wxZRColaFrame::OnCopySourceAndReturn )
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_UPDATE_UI (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEditUpdate )
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
EVT_UPDATE_UI (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarComposeUpdate )
EVT_MENU (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarCompose )
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate )
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
EVT_MENU (wxID_SETTINGS , wxZRColaFrame::OnSettings )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnAbout )
EVT_UPDATE_UI (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEditUpdate )
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
EVT_UPDATE_UI (wxID_TOOLBAR_TRANSFORM , wxZRColaFrame::OnToolbarTransformUpdate )
EVT_MENU (wxID_TOOLBAR_TRANSFORM , wxZRColaFrame::OnToolbarTransform )
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
EVT_MENU (wxID_HELP_INSTRUCTIONS , wxZRColaFrame::OnHelpInstructions )
EVT_MENU (wxID_HELP_SHORTCUTS , wxZRColaFrame::OnHelpShortcuts )
EVT_MENU (wxID_HELP_REQCHAR , wxZRColaFrame::OnHelpReqChar )
EVT_MENU (wxID_HELP_UPDATE , wxZRColaFrame::OnHelpUpdate )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnHelpAbout )
wxEND_EVENT_TABLE()
wxZRColaFrame::wxZRColaFrame() :
m_lang_auto(true),
m_hWndSource(NULL),
m_chrSelect(NULL),
m_settings(NULL),
m_chrReq(NULL),
wxZRColaFrameBase(NULL)
{
{
// wxFrameBuilder 3.5 does not support wxAUI_TB_HORIZONTAL flag. Add it manually.
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTransform);
paneInfo.LeftDockable(false);
paneInfo.RightDockable(false);
m_toolbarCompose->SetWindowStyleFlag(m_toolbarCompose->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
m_toolbarTransform->SetWindowStyleFlag(m_toolbarTransform->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Restore the wxAuiManager's state here to keep symmetric with save in the destructor below.
// See the comment in destructor why.
wxPersistentAuiManager(&m_mgr).Restore();
// Load main window icons.
#ifdef __WINDOWS__
wxIcon icon_small(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
wxIconBundle icons;
icons.AddIcon(wxIcon(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
icons.AddIcon(icon_small);
icons.AddIcon(wxIcon(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
SetIcons(icons);
#else
SetIcon(wxICON(00_zrcola.ico));
wxIcon icon_small(wxICON(00_zrcola.ico));
SetIcon(icon_small);
#endif
{
// Populate language lists.
memcpy(m_lang, ZRCOLA_LANG_VOID, sizeof(m_lang));
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
m_toolDecompLanguage->Clear();
wxString label1_tran(_("Select %s language for decomposition"));
for (size_t i = 0, n = app->m_lang_db.idxLng.size(); i < n; i++) {
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
wxString
label(lang.name, lang.name_len),
label_tran2(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
if (i < wxID_DECOMP_LANGUAGE_END - wxID_DECOMP_LANGUAGE_START + 1)
m_menuDecompLanguage->AppendRadioItem(wxID_DECOMP_LANGUAGE_START + i, label_tran2, wxString::Format(label1_tran, (const wxStringCharType*)label_tran2));
m_toolDecompLanguage->Insert(label_tran2, i);
if (memcmp(m_lang, lang.id, sizeof(m_lang)) == 0)
m_toolDecompLanguage->Select(i);
}
m_taskBarIcon = new wxTaskBarIcon();
if (m_taskBarIcon->IsOk()) {
m_taskBarIcon->SetIcon(icon_small, _("ZRCola"));
m_taskBarIcon->Connect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
} else {
// Taskbar icon creation failed. Not the end of the world. No taskbar icon then.
delete m_taskBarIcon;
}
// Set focus.
m_panel->m_decomposed->SetFocus();
m_settings = new wxZRColaSettings(this);
wxPersistentRegisterAndRestore<wxZRColaSettings>(m_settings);
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
m_chrSelect = new wxZRColaCharSelect(this);
wxPersistentRegisterAndRestore<wxZRColaCharSelect>(m_chrSelect);
m_chrReq = new wxZRColaCharRequest(this);
wxPersistentRegisterAndRestore<wxZRColaCharRequest>(m_chrReq);
// Set focus.
m_panel->m_source->SetFocus();
#if defined(__WXMSW__)
// Register notification sink for language detection.
@@ -137,11 +134,24 @@ wxZRColaFrame::wxZRColaFrame() :
entries[0].Set(wxACCEL_NORMAL, WXK_F4, wxID_FOCUS_CHARACTER_CATALOG);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSFORM, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSFORM_INV, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
}
wxZRColaFrame::~wxZRColaFrame()
{
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSFORM_INV);
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSFORM );
#if defined(__WXMSW__)
if (m_tfSource) {
m_tfSource->UnadviseSink(m_dwCookie);
@@ -149,58 +159,20 @@ wxZRColaFrame::~wxZRColaFrame()
}
#endif
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE);
UnregisterHotKey(wxZRColaHKID_INVOKE_COMPOSE);
// Save wxAuiManager's state before return to parent's destructor.
// Since the later calls m_mgr.UnInit() the regular persistence mechanism is useless to save wxAuiManager's state.
wxPersistentAuiManager((wxAuiManager*)&m_mgr).Save();
}
void wxZRColaFrame::OnAutostartUpdate(wxUpdateUIEvent& event)
{
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
event.Check(wxFileExists(linkName));
#else
event.Enable(false);
#endif
}
void wxZRColaFrame::OnAutostart(wxCommandEvent& event)
{
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
if (wxFileExists(linkName)) {
// The shortcut already exists. Remove it.
wxRemoveFile(linkName);
} else {
// Create the shortcut.
IShellLink *sl;
HRESULT hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&sl);
if (SUCCEEDED(hr)) {
// Setup ZRCola shortcut.
sl->SetPath(wxTheApp->argv[0]);
sl->SetDescription(_("Start ZRCola automatically on logon"));
sl->SetShowCmd(SW_SHOWMINNOACTIVE);
// Query IShellLink for the IPersistFile interface, used for saving the
// shortcut in persistent storage.
IPersistFile *pf;
hr = sl->QueryInterface(IID_IPersistFile, (LPVOID*)&pf);
if (SUCCEEDED(hr)) {
// Save the link by calling IPersistFile::Save.
hr = pf->Save(linkName, TRUE);
pf->Release();
}
sl->Release();
}
if (m_taskBarIcon) {
m_taskBarIcon->Disconnect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
delete m_taskBarIcon;
}
#endif
}
void wxZRColaFrame::OnClose(wxCloseEvent& event)
{
event.Skip();
// Save wxAuiManager's state before destructor.
// Since the destructor calls m_mgr.UnInit() the regular persistence mechanism is useless to save wxAuiManager's state.
wxPersistentAuiManager(&m_mgr).Save();
}
@@ -230,25 +202,52 @@ void wxZRColaFrame::OnForwardEvent(wxCommandEvent& event)
}
void wxZRColaFrame::OnInsertCharacter(wxCommandEvent& event)
{
if (m_chrSelect->ShowModal() == wxID_OK && !m_chrSelect->m_char.empty()) {
m_panel->m_source->WriteText(m_chrSelect->m_char);
m_panel->m_source->SetFocus();
}
}
void wxZRColaFrame::OnSendUpdate(wxUpdateUIEvent& event)
{
event.Enable(m_hWndSource ? true : false);
}
void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
void wxZRColaFrame::OnSendDestination(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_composed->GetValue());
DoSend(m_panel->m_destination->GetValue());
event.Skip();
}
void wxZRColaFrame::OnSendDecomposed(wxCommandEvent& event)
void wxZRColaFrame::OnCopyDestinationAndReturn(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_decomposed->GetValue());
DoCopyAndReturn(m_panel->m_destination->GetValue());
event.Skip();
}
void wxZRColaFrame::OnSendSource(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_source->GetValue());
event.Skip();
}
void wxZRColaFrame::OnCopySourceAndReturn(wxCommandEvent& event)
{
if (m_hWndSource)
DoCopyAndReturn(m_panel->m_source->GetValue());
event.Skip();
}
@@ -264,79 +263,43 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
}
// Select all input in composer to prepare for the overwrite next time.
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
event.Skip();
}
void wxZRColaFrame::OnDecomposedLanguageAutoUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnSettings(wxCommandEvent& event)
{
#if defined(__WXMSW__)
event.Check(m_lang_auto);
#else
event.Enable(false);
#endif
m_settings->ShowModal();
}
void wxZRColaFrame::OnDecomposedLanguageAuto(wxCommandEvent& event)
void wxZRColaFrame::OnIdle(wxIdleEvent& event)
{
// Toggle auto language flag.
m_lang_auto = !m_lang_auto;
m_panel->SynchronizePanels();
if (m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
UpdateDecomposedLanguage();
#endif
}
event.Skip();
}
void wxZRColaFrame::OnDecomposedLanguageUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnTaskbarIconClick(wxTaskBarIconEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[event.GetId() - wxID_DECOMP_LANGUAGE_START];
event.Check(memcmp(m_lang, lang.id, sizeof(m_lang)) == 0);
Iconize(false);
Show(true);
Raise();
event.Skip();
}
void wxZRColaFrame::OnDecomposedLanguage(wxCommandEvent& event)
void wxZRColaFrame::OnIconize(wxIconizeEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
size_t i = event.GetId() - wxID_DECOMP_LANGUAGE_START;
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
if (m_taskBarIcon)
Show(!event.IsIconized());
if (memcmp(m_lang, lang.id, sizeof(m_lang)) != 0) {
memcpy(m_lang, lang.id, sizeof(m_lang));
m_toolDecompLanguage->Select(i);
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_composed->ProcessWindowEvent(event2);
m_lang_auto = false;
}
}
void wxZRColaFrame::OnDecompLanguageChoice(wxCommandEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
size_t i = event.GetSelection();
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
if (memcmp(m_lang, lang.id, sizeof(m_lang)) != 0) {
memcpy(m_lang, lang.id, sizeof(m_lang));
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_composed->ProcessWindowEvent(event2);
m_lang_auto = false;
}
event.Skip();
}
@@ -354,15 +317,15 @@ void wxZRColaFrame::OnToolbarEdit(wxCommandEvent& event)
}
void wxZRColaFrame::OnToolbarComposeUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnToolbarTransformUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_toolbarCompose).IsShown());
event.Check(m_mgr.GetPane(m_toolbarTransform).IsShown());
}
void wxZRColaFrame::OnToolbarCompose(wxCommandEvent& event)
void wxZRColaFrame::OnToolbarTransform(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTransform);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
@@ -394,9 +357,53 @@ void wxZRColaFrame::OnPanelCharacterCatalogFocus(wxCommandEvent& event)
}
void wxZRColaFrame::OnAbout(wxCommandEvent& event)
void wxZRColaFrame::OnHelpInstructions(wxCommandEvent& event)
{
wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2015-%s Amebis"), wxT(ZRCOLA_VERSION_STR), wxT(ZRCOLA_BUILD_YEAR_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION);
wxLaunchDefaultBrowser(_("http://zrcola.zrc-sazu.si/en/info/instructions/"));
}
void wxZRColaFrame::OnHelpShortcuts(wxCommandEvent& event)
{
winstd::tstring pdf_path;
#ifdef __WXMSW__
// Search and try to launch installed PDF.
INSTALLSTATE pdf_is = ::MsiGetComponentPath(_T(PRODUCT_VERSION_GUID), _T("{68AC2C38-10E2-41A3-B92C-844C03FFDF6A}"), pdf_path);
if ((pdf_is == INSTALLSTATE_LOCAL || pdf_is == INSTALLSTATE_SOURCE) &&
wxFileExists(pdf_path) &&
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
#endif
// Search and try to launch local PDF copy.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
pdf_path = app->GetDatabasePath();
pdf_path += _T("ZRCola_keyboard.pdf");
if (wxFileExists(pdf_path) &&
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
// When everything else fail, try the online version.
wxLaunchDefaultBrowser(_("http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"));
}
void wxZRColaFrame::OnHelpReqChar(wxCommandEvent& event)
{
m_chrReq->ShowModal();
}
void wxZRColaFrame::OnHelpUpdate(wxCommandEvent& event)
{
wxZRColaUpdater dlg(this);
dlg.ShowModal();
}
void wxZRColaFrame::OnHelpAbout(wxCommandEvent& event)
{
wxZRColaAbout dlg(this);
dlg.ShowModal();
}
@@ -411,11 +418,10 @@ HRESULT STDMETHODCALLTYPE wxZRColaFrame::OnLanguageChange(LANGID langid, __RPC__
HRESULT STDMETHODCALLTYPE wxZRColaFrame::OnLanguageChanged()
{
if (m_lang_auto) {
if (m_settings->m_lang_auto) {
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
UpdateDecomposedLanguage();
ZRCola::LangConvert(LOWORD(hkl), m_settings->m_lang);
}
return S_OK;
@@ -464,7 +470,7 @@ void wxZRColaFrame::DoSend(const wxString& str)
{
// Prepare the INPUT table.
wxString::size_type n = str.length();
wxString::const_iterator i_str = str.begin();
auto i_str = str.begin();
std::vector<INPUT> input;
input.reserve(n*2);
for (std::vector<INPUT>::size_type i = 0; i < n; i++, i_str++) {
@@ -488,23 +494,27 @@ void wxZRColaFrame::DoSend(const wxString& str)
::SendInput(input.size(), input.data(), sizeof(INPUT));
m_hWndSource = NULL;
// Select all input in composer and decomposed to prepare for the overwrite next time.
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
// Select all input in source and destination to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
}
void wxZRColaFrame::UpdateDecomposedLanguage()
void wxZRColaFrame::DoCopyAndReturn(const wxString& str)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
if (wxTheClipboard->Open()) {
wxTheClipboard->SetData(new wxTextDataObject(str));
wxTheClipboard->Close();
}
// Find language on the language list.
ZRCola::language_db::language *l = new ZRCola::language_db::language;
memcpy(l->id, m_lang, sizeof(l->id));
l->name_len = 0;
ZRCola::language_db::indexLang::size_type start, end;
m_toolDecompLanguage->SetSelection(app->m_lang_db.idxLng.find(*l, start, end) ? start : -1);
delete l;
// Return focus to the source window.
::SetActiveWindow(m_hWndSource);
::SetForegroundWindow(m_hWndSource);
m_hWndSource = NULL;
// Select all input in composer and source to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
}
@@ -517,8 +527,8 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
WXHWND hWndSource = ::GetForegroundWindow();
switch (wParam) {
case wxZRColaHKID_INVOKE_COMPOSE : m_panel->m_decomposed->SetFocus(); break;
case wxZRColaHKID_INVOKE_DECOMPOSE: m_panel->m_composed ->SetFocus(); break;
case wxZRColaHKID_INVOKE_TRANSFORM : m_panel->m_source ->SetFocus(); break;
case wxZRColaHKID_INVOKE_TRANSFORM_INV: m_panel->m_destination->SetFocus(); break;
default:
wxFAIL_MSG(wxT("not our registered shortcut"));
return wxZRColaFrameBase::MSWWindowProc(message, wParam, lParam);
@@ -532,12 +542,10 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
m_hWndSource = hWndSource;
//if (m_state == wxABS_FLOAT) {
if (IsIconized()) {
if (IsIconized())
::SendMessage(m_hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
} else {
::SetActiveWindow(m_hWnd);
::SetForegroundWindow(m_hWnd);
}
::SetActiveWindow(m_hWnd);
::SetForegroundWindow(m_hWnd);
//} else if (wxAppBarIsDocked(m_state)) {
// // ZRCola window is currently docked.
@@ -570,46 +578,21 @@ wxPersistentZRColaFrame::wxPersistentZRColaFrame(wxZRColaFrame *wnd) : wxPersist
void wxPersistentZRColaFrame::Save() const
{
const wxZRColaFrame * const wnd = static_cast<const wxZRColaFrame*>(GetWindow());
wxPersistentTLW::Save();
auto wnd = static_cast<const wxZRColaFrame*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
SaveValue(wxT("langAuto" ), wnd->m_lang_auto);
SaveValue(wxT("lang" ), wxString::FromAscii(wnd->m_lang, sizeof(wnd->m_lang)));
wxPersistentTLW::Save();
}
bool wxPersistentZRColaFrame::Restore()
{
const bool r = wxPersistentTLW::Restore();
wxZRColaFrame * const wnd = static_cast<wxZRColaFrame*>(GetWindow());
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
wxString lang;
// Restore automatic language detection setting first.
RestoreValue(wxT("langAuto"), &(wnd->m_lang_auto));
if (wnd->m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), wnd->m_lang);
#endif
} else if (RestoreValue(wxT("lang"), &lang) && lang.Length() == 3) {
// The language was read from configuration.
memcpy(wnd->m_lang, (const char*)lang.c_str(), sizeof(wnd->m_lang));
} else if (!app->m_lang_db.idxLng.empty()) {
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[0];
memcpy(wnd->m_lang, lang.id, sizeof(wnd->m_lang));
} else
memcpy(wnd->m_lang, ZRCOLA_LANG_VOID, sizeof(wnd->m_lang));
wnd->UpdateDecomposedLanguage();
auto wnd = dynamic_cast<wxZRColaFrame*>(GetWindow());
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Restore();
wxPersistentZRColaComposerPanel(wnd->m_panel).Restore();
return r;
return wxPersistentTLW::Restore();
}

View File

@@ -26,7 +26,11 @@ class wxZRColaFrame;
#pragma once
#include "zrcolagui.h"
#include "zrcolachrslct.h"
#include "zrcolachrreq.h"
#include "zrcolasettings.h"
#include <zrcola/language.h>
#include <wx/taskbar.h>
#include <wx/persist/toplevel.h>
#if defined(__WXMSW__)
#include <msctf.h>
@@ -36,8 +40,8 @@ class wxZRColaFrame;
///
/// Global hotkey message identifiers
///
#define wxZRColaHKID_INVOKE_COMPOSE 0
#define wxZRColaHKID_INVOKE_DECOMPOSE 1
#define wxZRColaHKID_INVOKE_TRANSFORM 0
#define wxZRColaHKID_INVOKE_TRANSFORM_INV 1
///
@@ -52,9 +56,7 @@ class wxZRColaFrame :
public:
enum
{
wxID_DECOMP_LANGUAGE_START = 6000,
wxID_DECOMP_LANGUAGE_END = 6099,
wxID_FOCUS_CHARACTER_CATALOG,
wxID_FOCUS_CHARACTER_CATALOG = 2000,
};
wxZRColaFrame();
@@ -64,28 +66,33 @@ public:
friend class wxZRColaComposerPanel;
protected:
void OnAutostartUpdate(wxUpdateUIEvent& event);
void OnAutostart(wxCommandEvent& event);
virtual void OnClose(wxCloseEvent& event);
void OnExit(wxCommandEvent& event);
void OnForwardEventUpdate(wxUpdateUIEvent& event);
void OnForwardEvent(wxCommandEvent& event);
void OnInsertCharacter(wxCommandEvent& event);
void OnSendUpdate(wxUpdateUIEvent& event);
void OnSendComposed(wxCommandEvent& event);
void OnSendDecomposed(wxCommandEvent& event);
void OnSendDestination(wxCommandEvent& event);
void OnCopyDestinationAndReturn(wxCommandEvent& event);
void OnSendSource(wxCommandEvent& event);
void OnCopySourceAndReturn(wxCommandEvent& event);
void OnSendAbort(wxCommandEvent& event);
void OnDecomposedLanguageAutoUpdate(wxUpdateUIEvent& event);
void OnDecomposedLanguageAuto(wxCommandEvent& event);
void OnDecomposedLanguageUpdate(wxUpdateUIEvent& event);
void OnDecomposedLanguage(wxCommandEvent& event);
virtual void OnDecompLanguageChoice(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
virtual void OnIdle(wxIdleEvent& event);
void OnTaskbarIconClick(wxTaskBarIconEvent& event);
virtual void OnIconize(wxIconizeEvent& event);
void OnToolbarEditUpdate(wxUpdateUIEvent& event);
void OnToolbarEdit(wxCommandEvent& event);
void OnToolbarComposeUpdate(wxUpdateUIEvent& event);
void OnToolbarCompose(wxCommandEvent& event);
void OnToolbarTransformUpdate(wxUpdateUIEvent& event);
void OnToolbarTransform(wxCommandEvent& event);
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
void OnPanelCharacterCatalog(wxCommandEvent& event);
void OnPanelCharacterCatalogFocus(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnHelpInstructions(wxCommandEvent& event);
void OnHelpShortcuts(wxCommandEvent& event);
void OnHelpReqChar(wxCommandEvent& event);
void OnHelpUpdate(wxCommandEvent& event);
void OnHelpAbout(wxCommandEvent& event);
wxDECLARE_EVENT_TABLE();
protected:
@@ -106,7 +113,7 @@ protected:
private:
void DoSend(const wxString& str);
void UpdateDecomposedLanguage();
void DoCopyAndReturn(const wxString& str);
protected:
#ifdef __WXMSW__
@@ -114,9 +121,11 @@ protected:
#endif
protected:
bool m_lang_auto; ///< Automatic language selection according to keyboard layout
ZRCola::langid_t m_lang; ///< Language for decomposing
WXHWND m_hWndSource; ///< handle of the active window, when the ZRCola hotkey was pressed
WXHWND m_hWndSource; ///< Handle of the active window, when the ZRCola hotkey was pressed
wxTaskBarIcon *m_taskBarIcon; ///< Taskbar icon
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
wxZRColaSettings *m_settings; ///< Configuration dialog
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
@@ -25,7 +25,6 @@ class wxZRColaCharGrid;
#include <wx/settings.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
#include <wx/choice.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
@@ -35,7 +34,21 @@ class wxZRColaComposerPanel;
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/choice.h>
#include <wx/grid.h>
#include <wx/checkbox.h>
#include <wx/srchctrl.h>
#include <wx/hyperlink.h>
#include <wx/checklst.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/listbox.h>
#include <wx/listbook.h>
#include <wx/listctrl.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
@@ -49,35 +62,42 @@ class wxZRColaFrameBase : public wxFrame
protected:
enum
{
wxID_AUTOSTART = 1000,
wxID_SEND_COMPOSED,
wxID_SEND_DECOMPOSED,
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_DESTINATION,
wxID_COPY_DESTINATION_AND_RETURN,
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_DECOMP_LANG_AUTO,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_COMPOSE,
wxID_PANEL_CHRGRPS
wxID_TOOLBAR_TRANSFORM,
wxID_PANEL_CHRGRPS,
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenu* m_menuDecompLanguage;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarCompose;
wxAuiToolBarItem* m_toolSendComposed;
wxAuiToolBarItem* m_toolSendDecomposed;
wxChoice* m_toolDecompLanguage;
wxAuiToolBar* m_toolbarTransform;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
virtual void OnDecompLanguageChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
public:
@@ -98,41 +118,48 @@ class wxZRColaComposerPanelBase : public wxPanel
private:
protected:
wxSplitterWindow* m_splitterDecomposed;
wxPanel* m_panelDecomposedEdit;
wxPanel* m_panelDecomposedHex;
wxTextCtrl* m_decomposedHex;
wxSplitterWindow* m_splitterComposed;
wxPanel* m_panelComposedEdit;
wxPanel* m_panelComposedHex;
wxTextCtrl* m_composedHex;
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
wxTextCtrl* m_sourceHex;
wxSplitterWindow* m_splitterDestination;
wxPanel* m_panelDestinationEdit;
wxPanel* m_panelDestinationHex;
wxTextCtrl* m_destinationHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnDecomposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDecomposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDecomposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnComposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourcePaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourceText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSourceHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDestinationHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_decomposed;
wxTextCtrl* m_composed;
wxTextCtrl* m_source;
wxTextCtrl* m_destination;
wxZRColaComposerPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaComposerPanel") );
~wxZRColaComposerPanelBase();
void m_splitterDecomposedOnIdle( wxIdleEvent& )
void m_splitterSourceOnIdle( wxIdleEvent& )
{
m_splitterDecomposed->SetSashPosition( -5 );
m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, this );
m_splitterSource->SetSashPosition( -5 );
m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, this );
}
void m_splitterComposedOnIdle( wxIdleEvent& )
void m_splitterDestinationOnIdle( wxIdleEvent& )
{
m_splitterComposed->SetSashPosition( -5 );
m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, this );
m_splitterDestination->SetSashPosition( -5 );
m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, this );
}
};
@@ -147,11 +174,13 @@ class wxZRColaCharacterCatalogPanelBase : public wxPanel
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:
@@ -161,4 +190,195 @@ class wxZRColaCharacterCatalogPanelBase : public wxPanel
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharSelectBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
wxPanel* m_search_panel;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
wxHyperlinkCtrl* m_categoriesInvert;
wxZRColaCharGrid* m_gridResults;
wxZRColaCharGrid* m_gridRecent;
wxStaticText* m_labelUnicode;
wxTextCtrl* m_unicode;
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_tags;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnRecentCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnUnicodeText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPreviewKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnNavigateBack( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnNavigateForward( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Character Search"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharSelect") );
~wxZRColaCharSelectBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaSettingsBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
wxStaticText* m_langLabel;
wxRadioButton* m_langAuto;
wxRadioButton* m_langManual;
wxListBox* m_languages;
wxPanel* m_panelTransformation;
wxStaticText* m_transLabel;
wxStaticText* m_transAvailableLabel;
wxListBox* m_transAvailable;
wxButton* m_transActivate;
wxButton* m_transDeactivate;
wxStaticText* m_transActiveLabel;
wxListBox* m_transActive;
wxButton* m_transActiveUp;
wxButton* m_transActiveDown;
wxPanel* m_panelAutoStart;
wxStaticText* m_autoStartLabel;
wxCheckBox* m_autoStart;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsApply;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnLanguageUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnTransformationUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnTransActivate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransDeactivate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransActiveUp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransActiveDown( wxCommandEvent& event ) { event.Skip(); }
virtual void OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaSettingsBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaSettings") );
~wxZRColaSettingsBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaAboutBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
wxStaticText* m_staticTextVersion;
wxStaticText* m_staticTextColophone;
wxStaticText* m_staticTextCopyright;
wxHyperlinkCtrl* m_hyperlink;
wxStaticText* m_staticTextDeclaration;
wxTextCtrl* m_declaration;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
public:
wxZRColaAboutBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaAbout") );
~wxZRColaAboutBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaUpdaterBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaUpdaterBase : public wxDialog
{
private:
protected:
wxTextCtrl* m_log;
wxButton* m_buttonUpdate;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Product Update"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaUpdater") );
~wxZRColaUpdaterBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharRequestBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharRequestBase : public wxDialog
{
private:
protected:
wxStaticText* m_characterLbl;
wxTextCtrl* m_character;
wxStaticText* m_characterNote;
wxStaticText* m_contextLbl;
wxTextCtrl* m_context;
wxStaticText* m_note;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharRequestBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Request a New Character"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharRequest") );
~wxZRColaCharRequestBase();
};
#endif //__ZRCOLAGUI_H__

View File

@@ -39,12 +39,17 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
if (e.GetKeyCode() == WXK_INSERT) {
// Insert key has been pressed.
m_is_insert = true;
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(_("INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."));
} else if (m_is_insert) {
wxChar chr = e.GetUnicodeKey();
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
if (!chr) {
int key = e.GetKeyCode();
if (WXK_NUMPAD0 <= key && key <= WXK_NUMPAD9)
chr = '0' + (key - WXK_NUMPAD0);
}
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (('0' <= chr && chr <= '9' || 'A' <= chr && chr <= 'F') && m_insert_seq.size() < 4) {
// A hex-digit pressed. Save it.
m_insert_seq.push_back((char)chr);
@@ -62,9 +67,14 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxEmptyString);
}
} else if (e.GetUnicodeKey() || !e.HasAnyModifiers()) {
ZRColaApp *app = (ZRColaApp*)wxTheApp;
ZRCola::keyseq_db::indexKey::size_type start, end;
} else if ((e.GetUnicodeKey() || !e.HasAnyModifiers())
#if defined(__WXMSW__)
&& ::GetKeyState(VK_RMENU) >= 0
#endif
)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
ZRCola::keyseq_db::indexKey::size_type start;
bool found;
wxFrame *pFrame = wxDynamicCast(app->m_mainWnd, wxFrame);
@@ -86,13 +96,9 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
(e.AltDown() ? ZRCola::keyseq_db::keyseq::ALT : 0);
m_seq.push_back(key);
std::vector<ZRCola::keyseq_db::keyseq::key_t>::size_type n = m_seq.size();
ZRCola::keyseq_db::keyseq *ks = (ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*n];
ks->chr = 0;
ks->seq_len = n;
memcpy(ks->seq, m_seq.data(), sizeof(ZRCola::keyseq_db::keyseq::key_t)*n);
found = app->m_ks_db.idxKey.find(*ks, start, end);
delete ks;
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*m_seq.size()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(m_seq.data(), m_seq.size());
found = app->m_ks_db.idxKey.find(*ks, start);
}
if (found) {
@@ -106,18 +112,18 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
wxObject *obj = event.GetEventObject();
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
// Push text to source control.
((wxTextCtrl*)obj)->WriteText(ks.chr);
((wxTextCtrl*)obj)->WriteText(wxString(ks.chr(), ks.chr_len()));
// Event is fully processed now.
event.StopPropagation();
return true;
}
} else if (start < app->m_ks_db.idxKey.size() &&
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq, std::min<unsigned __int16>(app->m_ks_db.idxKey[start].seq_len, m_seq.size())) == 0)
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq(), std::min<size_t>(app->m_ks_db.idxKey[start].seq_len(), m_seq.size())) == 0)
{
// The sequence is a partial match. Continue watching.
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(ZRColaApp::GetKeySequenceAsText(m_seq.data(), m_seq.size()));
pFrame->SetStatusText(ZRCola::keyseq_db::GetSequenceAsText(m_seq.data(), m_seq.size()));
event.StopPropagation();
return true;
@@ -131,13 +137,13 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
}
} else if (event.GetEventType() == wxEVT_KEY_UP) {
wxKeyEvent &e = (wxKeyEvent&)event;
if (e.GetKeyCode() == WXK_INSERT && m_is_insert) {
if (m_is_insert && e.GetKeyCode() == WXK_INSERT) {
// Insert key has been depressed.
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxEmptyString);
std::vector<char>::size_type count = m_insert_seq.size();
auto count = m_insert_seq.size();
if (count) {
// Zero terminate sequence and parse the Unicode value.
m_insert_seq.push_back(0);

View File

@@ -25,6 +25,8 @@ class wxZRColaKeyHandler;
#pragma once
#include <zrcolaui/keyboard.h>
#include <wx/event.h>
#include <vector>

304
ZRCola/zrcolasettings.cpp Normal file
View File

@@ -0,0 +1,304 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaSettings
//////////////////////////////////////////////////////////////////////////
wxZRColaSettings::wxZRColaSettings(wxWindow* parent) :
m_lang_auto(true),
m_lang(ZRCola::langid_t::blank),
m_transeq(1, 0), // By default use translation set 0 (ZRCola Decomposed >> ZRCola Composed)
wxZRColaSettingsBase(parent)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_languages->Clear();
for (size_t i = 0, n = app->m_lang_db.idxLang.size(); i < n; i++) {
const auto &lang = app->m_lang_db.idxLang[i];
wxString
label(lang.name(), lang.name_len()),
label_tran(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_languages->Insert(label_tran, i);
}
m_transAvailable->Clear();
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[i];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_transAvailable->Append(label_tran, (void*)ts.set);
}
}
void wxZRColaSettings::OnInitDialog(wxInitDialogEvent& event)
{
event.Skip();
// Set state of auto-start according to Startup folder shortcut presence.
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
m_autoStart->SetValue(wxFileExists(linkName));
#else
m_autoStart->SetValue(false);
m_panelAutoStart->Enable(false);
#endif
m_languages->Enable(!m_lang_auto);
(m_lang_auto ? m_langAuto : m_langManual)->SetValue(true);
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
ZRCola::language_db::indexLang::size_type start;
m_languages->Select(app->m_lang_db.idxLang.find(ZRCola::language_db::language(m_lang), start) ? start : -1);
m_transActive->Clear();
for (auto s = m_transeq.cbegin(), s_end = m_transeq.cend(); s != s_end; ++s) {
ZRCola::transet_db::indexTranSet::size_type start;
if (app->m_ts_db.idxTranSet.find(ZRCola::transet_db::transet(*s), start)) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[start];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_transActive->Append(label_tran, (void*)ts.set);
} else {
wxString label_tran(wxString::Format(_("Unknown transformation (%u)"), (unsigned int)*s));
m_transActive->Append(label_tran, (void*)*s);
}
}
}
void wxZRColaSettings::OnLanguageUpdate(wxUpdateUIEvent& event)
{
m_languages->Enable(m_langManual->GetValue());
wxZRColaSettingsBase::OnLanguageUpdate(event);
}
void wxZRColaSettings::OnTransformationUpdate(wxUpdateUIEvent& event)
{
m_transActivate->Enable(m_transAvailable->GetSelection() != wxNOT_FOUND);
int idx = m_transActive->GetSelection();
m_transDeactivate->Enable(idx != wxNOT_FOUND);
m_transActiveUp ->Enable(idx != wxNOT_FOUND && (unsigned int)idx > 0);
m_transActiveDown->Enable(idx != wxNOT_FOUND && (unsigned int)idx < m_transActive->GetCount() - 1);
wxZRColaSettingsBase::OnTransformationUpdate(event);
}
void wxZRColaSettings::OnTransActivate(wxCommandEvent& event)
{
int idx = m_transAvailable->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no available transformation selected"));
m_transActive->Append(
m_transAvailable->GetString(idx),
m_transAvailable->GetClientData(idx));
wxZRColaSettingsBase::OnTransActivate(event);
}
void wxZRColaSettings::OnTransDeactivate(wxCommandEvent& event)
{
int idx = m_transActive->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no active transformation selected"));
m_transActive->Delete(idx);
wxZRColaSettingsBase::OnTransDeactivate(event);
}
void wxZRColaSettings::OnTransActiveUp(wxCommandEvent& event)
{
int idx = m_transActive->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx > 0, wxT("no or first active transformation selected"));
wxString label = m_transActive->GetString(idx);
void *data = m_transActive->GetClientData(idx);
m_transActive->Delete(idx);
m_transActive->Insert(label, idx - 1, data);
m_transActive->Select(idx - 1);
wxZRColaSettingsBase::OnTransActiveUp(event);
}
void wxZRColaSettings::OnTransActiveDown(wxCommandEvent& event)
{
int idx = m_transActive->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx < m_transActive->GetCount() - 1, wxT("no or last active transformation selected"));
wxString label = m_transActive->GetString(idx);
void *data = m_transActive->GetClientData(idx);
m_transActive->Delete(idx);
m_transActive->Insert(label, idx + 1, data);
m_transActive->Select(idx + 1);
wxZRColaSettingsBase::OnTransActiveDown(event);
}
void wxZRColaSettings::OnApplyButtonClick(wxCommandEvent& event)
{
event.Skip();
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
if (m_autoStart->IsChecked()) {
// Create the shortcut.
IShellLink *sl;
HRESULT hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&sl);
if (SUCCEEDED(hr)) {
// Setup ZRCola shortcut.
sl->SetPath(wxTheApp->argv[0]);
sl->SetDescription(_("Start ZRCola automatically on logon"));
sl->SetShowCmd(SW_SHOWMINNOACTIVE);
// Query IShellLink for the IPersistFile interface, used for saving the
// shortcut in persistent storage.
IPersistFile *pf;
hr = sl->QueryInterface(IID_IPersistFile, (LPVOID*)&pf);
if (SUCCEEDED(hr)) {
// Save the link by calling IPersistFile::Save.
hr = pf->Save(linkName, TRUE);
pf->Release();
}
sl->Release();
}
} else if (wxFileExists(linkName)) {
// The shortcut already exists. Remove it.
wxRemoveFile(linkName);
}
#endif
if (m_langAuto->GetValue()) {
m_lang_auto = true;
#if defined(__WXMSW__)
// Set update keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
#endif
} else {
m_lang_auto = false;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &lang = app->m_lang_db.idxLang[m_languages->GetSelection()];
if (m_lang != lang.lang) {
m_lang = lang.lang;
// Notify destination text something changed and should re-inverse transform.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_destination->ProcessWindowEvent(event2);
}
}
m_transeq.clear();
for (unsigned int i = 0, n = m_transActive->GetCount(); i < n; i++)
m_transeq.push_back((ZRCola::transetid_t)m_transActive->GetClientData(i));
}
void wxZRColaSettings::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaSettings::OnApplyButtonClick(event);
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaSettings
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaSettings::wxPersistentZRColaSettings(wxZRColaSettings *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaSettings::Save() const
{
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaSettings*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("langAuto"), wnd->m_lang_auto);
SaveValue(wxT("lang" ), wxString::FromAscii(wnd->m_lang.data, _countof(wnd->m_lang.data)));
wxString str;
bool first = true;
for (auto s = wnd->m_transeq.cbegin(), s_end = wnd->m_transeq.cend(); s != s_end; ++s, first = false)
str += wxString::Format(first ? wxT("%u") : wxT("|%u"), *s);
SaveValue(wxT("transeq"), str);
}
bool wxPersistentZRColaSettings::Restore()
{
auto wnd = dynamic_cast<wxZRColaSettings*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString lang;
// Restore automatic language detection setting first.
RestoreValue(wxT("langAuto"), &(wnd->m_lang_auto));
if (wnd->m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), wnd->m_lang);
#endif
} else if (RestoreValue(wxT("lang"), &lang) && lang.Length() == 3) {
// The language was read from configuration.
wnd->m_lang = lang.c_str();
} else if (!app->m_lang_db.idxLang.empty()) {
const auto &lang = app->m_lang_db.idxLang[0];
wnd->m_lang = lang.lang;
} else
wnd->m_lang = ZRCola::langid_t::blank;
wxString str;
if (RestoreValue(wxT("transeq"), &str)) {
std::vector<ZRCola::transetid_t> transeq;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
unsigned long val = _tcstoul(tok.GetNextToken().c_str(), NULL, 10);
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &cg = app->m_ts_db.idxTranSet[i];
if (cg.set == val) {
transeq.push_back(val);
break;
}
}
}
if (!transeq.empty())
wnd->m_transeq = std::move(transeq);
}
return wxPersistentDialog::Restore();
}

79
ZRCola/zrcolasettings.h Normal file
View File

@@ -0,0 +1,79 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaSettings;
class wxPersistentZRColaSettings;
#pragma once
#include "zrcolagui.h"
#include <zrcola/translate.h>
#include <wxex/persist/dialog.h>
#include <vector>
///
/// Configuration dialog
///
class wxZRColaSettings : public wxZRColaSettingsBase
{
public:
wxZRColaSettings(wxWindow* parent);
friend class wxPersistentZRColaSettings; // Allow saving/restoring window state.
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnLanguageUpdate(wxUpdateUIEvent& event);
virtual void OnTransformationUpdate(wxUpdateUIEvent& event);
virtual void OnTransActivate(wxCommandEvent& event);
virtual void OnTransDeactivate(wxCommandEvent& event);
virtual void OnTransActiveUp(wxCommandEvent& event);
virtual void OnTransActiveDown(wxCommandEvent& event);
virtual void OnApplyButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
public:
bool m_lang_auto; ///< Is language for inverse translation resolved using currently selected keyboard
ZRCola::langid_t m_lang; ///< Language for inverse translation
std::vector<ZRCola::transetid_t> m_transeq; ///< Transformation set sequence
};
///
/// Supports saving/restoring wxZRColaSettings state
///
class wxPersistentZRColaSettings : public wxPersistentDialog
{
public:
wxPersistentZRColaSettings(wxZRColaSettings *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaSettings *wnd)
{
return new wxPersistentZRColaSettings(wnd);
}

110
ZRCola/zrcolaupdater.cpp Normal file
View File

@@ -0,0 +1,110 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaUpdater
//////////////////////////////////////////////////////////////////////////
wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) :
m_logLevelOrig(wxLOG_Warning),
m_logOrig(NULL),
m_updater(NULL),
m_finished(false),
wxZRColaUpdaterBase(parent)
{
// Setup logging.
m_logOrig = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
m_logLevelOrig = wxLog::GetLogLevel();
wxLog::SetLogLevel(wxLOG_Info);
//// Connect events.
//Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
// Prepare Updater.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_updater = new wxUpdCheckThread(app->m_lang_ui == wxLANGUAGE_DEFAULT ? wxT("en_US") : wxLocale::GetLanguageCanonicalName(app->m_lang_ui), this);
//if (m_updater->Run() != wxTHREAD_NO_ERROR) {
// wxFAIL_MSG(wxT("Can't create the thread!"));
// delete m_updater;
// m_updater = NULL;
//}
}
wxZRColaUpdater::~wxZRColaUpdater()
{
if (m_updater) {
// Terminate the Updater thread.
//m_updater->Delete();
delete m_updater;
}
//// Disconnect events.
//Disconnect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
wxLog::SetLogLevel(m_logLevelOrig);
if (m_logOrig) {
// Return logging to previous state.
delete wxLog::SetActiveTarget(m_logOrig);
}
}
//void wxZRColaUpdater::OnCheckComplete(wxThreadEvent& event)
//{
// event.Skip();
//
// m_buttonUpdate->Enable(event.GetInt() == wxUpdCheckThread::wxUpdUpdateAvailable);
//}
void wxZRColaUpdater::OnIdle(wxIdleEvent& event)
{
if (!m_finished) {
m_buttonUpdate->Enable(m_updater->CheckForUpdate() == wxUpdCheckThread::wxUpdUpdateAvailable);
m_finished = true;
}
}
void wxZRColaUpdater::OnUpdate(wxCommandEvent& event)
{
event.Skip();
if (m_updater) {
if (wxMessageBox(_("This program will now close and the upgrade will be launched.\nAre you sure?"), _("Product Update"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this) == wxYES) {
m_updater->LaunchUpdate();
Close(true);
dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd->Close();
}
}
}
void wxZRColaUpdater::OnClose(wxCommandEvent& event)
{
if (m_updater)
m_updater->Abort();
event.Skip();
}

55
ZRCola/zrcolaupdater.h Normal file
View File

@@ -0,0 +1,55 @@
/*
Copyright 2015-2016 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaUpdater;
#pragma once
#include "zrcolagui.h"
#include <Updater/chkthread.h>
#include <wx/log.h>
///
/// ZRCola updater dialog
///
class wxZRColaUpdater : public wxZRColaUpdaterBase
{
public:
wxZRColaUpdater(wxWindow* parent);
virtual ~wxZRColaUpdater();
protected:
//void OnCheckComplete(wxThreadEvent& event);
virtual void OnIdle(wxIdleEvent& event);
virtual void OnUpdate(wxCommandEvent& event);
virtual void OnClose(wxCommandEvent& event);
protected:
wxLogLevel m_logLevelOrig; ///< Original log level
wxLog *m_logOrig; ///< Original log
wxUpdCheckThread *m_updater; ///< Updater thread
bool m_finished; ///< Is Updater finished?
};

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\WinStd\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>

Binary file not shown.

View File

@@ -19,14 +19,12 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Dynamic</UseOfAtl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Dynamic</UseOfAtl>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -63,7 +61,10 @@
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtend.vcxproj">
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendDll.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
</ItemGroup>
@@ -71,8 +72,13 @@
<ResourceCompile Include="ZRColaCompile.rc" />
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\de_DE.po" />
<POCompile Include="locale\ru_RU.po" />
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRColaCompile.pot" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\include\xgettext.targets" />

View File

@@ -46,5 +46,16 @@
<POCompile Include="locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\de_DE.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\ru_RU.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRColaCompile.pot">
<Filter>Resource Files\Localization</Filter>
</None>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -19,10 +19,25 @@
#pragma once
#include <zrcola/character.h>
#include <zrcola/common.h>
#include <zrcola/language.h>
#include <zrcola/tag.h>
#include <zrcola/translate.h>
#include <zrcolaui/chargroup.h>
#include <zrcolaui/keyboard.h>
#include <WinStd/COM.h>
#include <WinStd/Win.h>
#include <wx/debug.h>
#include <atlbase.h>
#include <adoint.h>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -34,14 +49,45 @@ namespace ZRCola {
class DBSource
{
public:
///
/// Character sequence
///
class charseq {
public:
int rank; ///< Sequence rank
std::wstring str; ///< Sequence string
inline charseq()
{
}
inline charseq(_In_ int _rank, _In_z_ const wchar_t *_str) :
rank(_rank),
str (_str)
{
}
};
///
/// Translation
///
class translation {
public:
wchar_t chr; ///< Composed character
std::wstring str; ///< Decomposed string
int rank; ///< Decomposition rank
int set; ///< Translation set ID
charseq src; ///< Source sequence
charseq dst; ///< Destination sequence
};
///
/// Translation set
///
class transet {
public:
int set; ///< ID
std::wstring src; ///< Source name
std::wstring dst; ///< Destination name
};
@@ -58,10 +104,24 @@ namespace ZRCola {
bool shift; ///< Shift modifier
bool ctrl; ///< Ctrl modifier
bool alt; ///< Alt modifier
///
/// Translates keycode from Slovenian to English keyboard
///
inline static wchar_t translate_slen(_In_ wchar_t key)
{
switch (key) {
case L'Z': return L'Y';
case L'Y': return L'Z';
case 191: return 189;
case 189: return 191;
default : return key;
}
}
};
public:
wchar_t chr; ///< Character
std::wstring chr; ///< Character
std::vector<keycode> seq; ///< Key sequence
};
@@ -71,8 +131,8 @@ namespace ZRCola {
///
class language {
public:
ZRCola::langid_t id; ///< Language ID
std::wstring name; ///< Language name
ZRCola::langid_t lang; ///< Language ID
std::wstring name; ///< Name
};
@@ -81,7 +141,7 @@ namespace ZRCola {
///
class langchar {
public:
wchar_t chr; ///> Character
std::wstring chr; ///> Character
ZRCola::langid_t lang; ///< Language ID
};
@@ -91,10 +151,177 @@ namespace ZRCola {
///
class chrgrp {
public:
int id; ///< Character group ID
int rank; ///< Character group rank
std::wstring name; ///< Character group name
std::wstring chars; ///< Character group characters
int grp; ///< Character group ID
int rank; ///< Rank
std::wstring name; ///< Name
std::vector<wchar_t> chars; ///< Characters (zero-delimited)
std::vector<unsigned __int16> show; ///< Bit vector if particular character from \c chars is displayed initially
};
///
/// Character data
///
class character_data {
public:
inline character_data()
{
cat.data[0] = 0;
cat.data[1] = 0;
}
inline character_data(_In_ const character_data &othr) :
cat (othr.cat),
desc (othr.desc),
terms (othr.terms),
terms_rel(othr.terms_rel),
rel (othr.rel)
{
}
ZRCola::chrcatid_t cat; ///< Category ID
std::wstring desc; ///< Character description
std::set<std::wstring> terms; ///< Search terms
std::set<std::wstring> terms_rel; ///< Relevant terms for relating characters
std::vector<wchar_t> rel; ///< Related characters (zero-delimited)
};
///
/// Character
///
typedef std::pair<std::wstring, character_data> character;
///
/// Character bank
///
class character_bank : public std::map<std::wstring, character_data>
{
public:
void build_related();
protected:
class build_related_worker : public winstd::win_handle
{
public:
build_related_worker(_In_ const character_bank *cb, _In_ iterator from, _In_ iterator to);
inline void join()
{
if (m_h)
WaitForSingleObject(m_h, INFINITE);
}
private:
// This class is non-copyable AND non-movable
build_related_worker(_Inout_ build_related_worker &othr);
build_related_worker(_Inout_ build_related_worker &&othr);
build_related_worker& operator=(_Inout_ build_related_worker &othr);
build_related_worker& operator=(_Inout_ build_related_worker &&othr);
protected:
unsigned int process();
static unsigned int __stdcall process(_In_ void *param);
protected:
const character_bank *m_cb;
iterator m_from, m_to;
winstd::heap m_heap;
};
};
///
/// Character description index key comparator
///
struct character_desc_idx_less : public std::binary_function<std::wstring, std::wstring, bool>
{
inline bool operator()(const std::wstring& _Left, const std::wstring& _Right) const
{
size_t
_Left_len = _Left .size(),
_Right_len = _Right.size();
int r = _wcsncoll(_Left.c_str(), _Right.c_str(), std::min<size_t>(_Left_len, _Right_len));
if (r != 0 ) return r < 0;
else if (_Left_len < _Right_len) return true;
return false;
}
};
///
/// Character description index
///
class character_desc_idx : public std::map<std::wstring, std::vector<wchar_t>, character_desc_idx_less>
{
public:
static void parse_keywords(const wchar_t *str, std::set<std::wstring> &terms);
void add_keywords(const std::set<std::wstring> &terms, const std::wstring &chr, size_t sub = 0);
inline void add_keywords(const wchar_t *str, const std::wstring &chr, size_t sub = 0)
{
std::set<std::wstring> terms;
parse_keywords(str, terms);
add_keywords(terms, chr, sub);
}
void save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const;
protected:
inline void add_keyword(const std::wstring &term, const std::wstring &chr)
{
iterator idx = find(term);
if (idx == end()) {
// New keyword.
insert(std::make_pair(term, mapped_type(chr.data(), chr.data() + chr.length() + 1)));
} else {
// Append to existing keyword.
auto &val = idx->second;
for (mapped_type::size_type i = 0, n = val.size(); ; i += wcsnlen(val.data() + i, n - i) + 1) {
if (i >= n) {
// End-of-values reached. Append character.
val.insert(val.end(), chr.data(), chr.data() + chr.length() + 1);
break;
} else if (chr.compare(val.data() + i) == 0) {
// Character already among the values.
break;
}
}
}
}
};
///
/// Character category
///
class chrcat {
public:
ZRCola::chrcatid_t cat; ///> Category ID
int rank; ///< Rank
std::wstring name; ///< Name
};
///
/// Character tag
///
class chrtag {
public:
std::wstring chr; ///> Character
int tag; ///< Tag ID
};
///
/// Tag name
///
class tagname {
public:
int tag; ///< Tag ID
std::map<LCID, std::list<std::wstring> > names; ///< Names
};
@@ -102,7 +329,6 @@ namespace ZRCola {
DBSource();
virtual ~DBSource();
///
/// Opens the database
///
@@ -114,13 +340,11 @@ namespace ZRCola {
///
bool Open(LPCTSTR filename);
///
/// Logs errors in database connections
///
void LogErrors() const;
///
/// Is recordset at end
///
@@ -130,13 +354,12 @@ namespace ZRCola {
/// - true when at end
/// - false otherwise
///
static inline bool IsEOF(const ATL::CComPtr<ADORecordset>& rs)
static inline bool IsEOF(const winstd::com_obj<ADORecordset>& rs)
{
VARIANT_BOOL eof = VARIANT_TRUE;
return FAILED(rs->get_EOF(&eof)) || eof ? true : false;
}
///
/// Gets number of records in a recordset
///
@@ -144,12 +367,23 @@ namespace ZRCola {
///
/// \returns Number of records
///
static inline size_t GetRecordsetCount(const ATL::CComPtr<ADORecordset>& rs)
static inline size_t GetRecordsetCount(const winstd::com_obj<ADORecordset>& rs)
{
ADO_LONGPTR count;
return SUCCEEDED(rs->get_RecordCount(&count)) ? count : (size_t)-1;
}
///
/// Splits string to individual keywords
///
/// \param[in ] str String
/// \param[out] keywords Array of keywords
///
/// \returns
/// - true when successful
/// - false otherwise
///
static bool GetKeywords(const wchar_t *str, std::vector< std::wstring > &keywords);
///
/// Gets boolean from ZRCola.zrc database
@@ -161,8 +395,7 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetValue(const ATL::CComPtr<ADOField>& f, bool& val) const;
bool GetValue(const winstd::com_obj<ADOField>& f, bool& val) const;
///
/// Gets integer from ZRCola.zrc database
@@ -174,8 +407,7 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetValue(const ATL::CComPtr<ADOField>& f, int& val) const;
bool GetValue(const winstd::com_obj<ADOField>& f, int& val) const;
///
/// Gets string from ZRCola.zrc database
@@ -187,8 +419,7 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetValue(const ATL::CComPtr<ADOField>& f, std::wstring& val) const;
bool GetValue(const winstd::com_obj<ADOField>& f, std::wstring& val) const;
///
/// Gets encoded Unicode character from ZRCola.zrc database
@@ -200,8 +431,7 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetUnicodeCharacter(const ATL::CComPtr<ADOField>& f, wchar_t& chr) const;
bool GetUnicodeCharacter(const winstd::com_obj<ADOField>& f, wchar_t& chr) const;
///
/// Gets encoded Unicode string from ZRCola.zrc database
@@ -213,21 +443,7 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetUnicodeString(const ATL::CComPtr<ADOField>& f, std::wstring& str) const;
///
/// Gets encoded key from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] kc Output key code
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetKeyCode(const ATL::CComPtr<ADOField>& f, keyseq::keycode& kc) const;
bool GetUnicodeString(const winstd::com_obj<ADOField>& f, std::wstring& str) const;
///
/// Gets language ID from ZRCola.zrc database
@@ -239,8 +455,31 @@ namespace ZRCola {
/// - true when successful
/// - false otherwise
///
bool GetLanguage(const ATL::CComPtr<ADOField>& f, langid_t& lang) const;
bool GetLanguage(const winstd::com_obj<ADOField>& f, langid_t& lang) const;
///
/// Gets character category ID from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] cc Character category
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetChrCat(const winstd::com_obj<ADOField>& f, chrcatid_t& cc) const;
///
/// Gets tag names from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] names Output names
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid, std::list<std::wstring>& names) const;
///
/// Returns character translations
@@ -251,8 +490,19 @@ namespace ZRCola {
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranslations(ATL::CComPtr<ADORecordset>& rs) const;
bool SelectTranslations(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character translations by set
///
/// \param[in ] set Translation set ID
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranslations(int set, winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns translation data
@@ -264,8 +514,30 @@ namespace ZRCola {
/// - true when succeeded
/// - false otherwise
///
bool GetTranslation(const ATL::CComPtr<ADORecordset>& rs, translation& t) const;
bool GetTranslation(const winstd::com_obj<ADORecordset>& rs, translation& t) const;
///
/// Returns translation sets
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTranlationSets(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns translation set data
///
/// \param[in] rs Recordset with results
/// \param[out] lang Language
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetTranslationSet(const winstd::com_obj<ADORecordset>& rs, transet& ts) const;
///
/// Returns key sequences
@@ -276,8 +548,7 @@ namespace ZRCola {
/// - true when query succeeds
/// - false otherwise
///
bool SelectKeySequences(ATL::CComPtr<ADORecordset>& rs) const;
bool SelectKeySequences(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns key sequence data
@@ -289,8 +560,7 @@ namespace ZRCola {
/// - true when succeeded
/// - false otherwise
///
bool GetKeySequence(const ATL::CComPtr<ADORecordset>& rs, keyseq& ks) const;
bool GetKeySequence(const winstd::com_obj<ADORecordset>& rs, keyseq& ks) const;
///
/// Returns languages
@@ -301,8 +571,7 @@ namespace ZRCola {
/// - true when query succeeds
/// - false otherwise
///
bool SelectLanguages(ATL::CComPtr<ADORecordset>& rs) const;
bool SelectLanguages(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns language data
@@ -314,8 +583,7 @@ namespace ZRCola {
/// - true when succeeded
/// - false otherwise
///
bool GetLanguage(const ATL::CComPtr<ADORecordset>& rs, language& lang) const;
bool GetLanguage(const winstd::com_obj<ADORecordset>& rs, language& lang) const;
///
/// Returns language character
@@ -326,8 +594,7 @@ namespace ZRCola {
/// - true when query succeeds
/// - false otherwise
///
bool SelectLanguageCharacters(ATL::CComPtr<ADORecordset>& rs) const;
bool SelectLanguageCharacters(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns language character data
@@ -339,8 +606,7 @@ namespace ZRCola {
/// - true when succeeded
/// - false otherwise
///
bool GetLanguageCharacter(const ATL::CComPtr<ADORecordset>& rs, langchar& lc) const;
bool GetLanguageCharacter(const winstd::com_obj<ADORecordset>& rs, langchar& lc) const;
///
/// Returns character groups
@@ -351,8 +617,7 @@ namespace ZRCola {
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacterGroups(ATL::CComPtr<ADORecordset>& rs) const;
bool SelectCharacterGroups(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character group data
@@ -364,14 +629,308 @@ namespace ZRCola {
/// - true when succeeded
/// - false otherwise
///
bool GetCharacterGroup(const ATL::CComPtr<ADORecordset>& rs, chrgrp& cg) const;
bool GetCharacterGroup(const winstd::com_obj<ADORecordset>& rs, chrgrp& cg) const;
///
/// Returns characters
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacters(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character data
///
/// \param[in] rs Recordset with results
/// \param[out] chr Character
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacter(const winstd::com_obj<ADORecordset>& rs, character& chr) const;
///
/// Returns character categories
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacterCategories(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character category data
///
/// \param[in] rs Recordset with results
/// \param[out] cc Character category
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacterCategory(const winstd::com_obj<ADORecordset>& rs, chrcat& cc) const;
///
/// Returns character tags
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacterTags(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns character tag data
///
/// \param[in] rs Recordset with results
/// \param[out] cc Character tag
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacterTag(const winstd::com_obj<ADORecordset>& rs, chrtag& tc) const;
///
/// Returns tag names
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectTagNames(winstd::com_obj<ADORecordset>& rs) const;
///
/// Returns tag name data
///
/// \param[in] rs Recordset with results
/// \param[out] tn Tag name
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetTagName(const winstd::com_obj<ADORecordset>& rs, tagname& tn) const;
protected:
std::basic_string<TCHAR> m_filename; ///< Database filename
ATL::CComPtr<ADOConnection> m_db; ///< Database
winstd::com_obj<ADOConnection> m_db; ///< Database
_locale_t m_locale; ///< Database locale
ATL::CComPtr<ADOCommand> m_comCharacterGroup; ///< ADO Command for GetCharacterGroup subquery
ATL::CComPtr<ADOParameter> m_pCharacterGroup1; ///< \c m_comCharacterGroup parameter
winstd::com_obj<ADOCommand> m_comCharacterGroup; ///< ADO Command for GetCharacterGroup subquery
winstd::com_obj<ADOParameter> m_pCharacterGroup1; ///< \c m_comCharacterGroup parameter
winstd::com_obj<ADOCommand> m_comTranslation; ///< ADO Command for SelectTranslations subquery
winstd::com_obj<ADOParameter> m_pTranslation1; ///< \c m_comTranslations parameter
std::set<std::wstring> m_terms_ignore; ///< Terms to ignore when comparing characters
};
};
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 index out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
wxASSERT_MSG((int)0xffff8000 <= rec.dst.rank && rec.dst.rank <= (int)0x00007fff, wxT("destination character rank out of bounds"));
db.data.push_back((unsigned __int16)rec.dst.rank);
wxASSERT_MSG((int)0xffff8000 <= rec.src.rank && rec.src.rank <= (int)0x00007fff, wxT("source character rank out of bounds"));
db.data.push_back((unsigned __int16)rec.src.rank);
std::wstring::size_type n = rec.dst.str.length();
wxASSERT_MSG(n <= 0xffff, wxT("destination overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.src.str.length();
wxASSERT_MSG(n <= 0xffff, wxT("source overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.dst.str.cbegin(), rec.dst.str.cend());
db.data.insert(db.data.end(), rec.src.str.cbegin(), rec.src.str.cend());
db.idxSrc.push_back(idx);
db.idxDst.push_back(idx);
return db;
}
inline ZRCola::transet_db& operator<<(_Inout_ ZRCola::transet_db &db, _In_ const ZRCola::DBSource::transet &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.set && rec.set <= (int)0x00007fff, wxT("translation set index out of bounds"));
db.data.push_back((unsigned __int16)rec.set);
std::wstring::size_type n = rec.src.length();
wxASSERT_MSG(n <= 0xffff, wxT("translation set source name overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.dst.length();
wxASSERT_MSG(n <= 0xffff, wxT("translation set destination name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.src.cbegin(), rec.src.cend());
db.data.insert(db.data.end(), rec.dst.cbegin(), rec.dst.cend());
db.idxTranSet.push_back(idx);
return db;
}
inline ZRCola::keyseq_db& operator<<(_Inout_ ZRCola::keyseq_db &db, _In_ const ZRCola::DBSource::keyseq &rec)
{
unsigned __int32 idx = db.data.size();
std::wstring::size_type n = rec.chr.length();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.seq.size() * sizeof(ZRCola::keyseq_db::keyseq::key_t) / sizeof(wchar_t);
wxASSERT_MSG(n <= 0xffff, wxT("key sequence overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
for (auto kc = rec.seq.cbegin(), kc_end = rec.seq.cend(); kc != kc_end; ++kc) {
db.data.push_back(kc->key);
db.data.push_back(
(kc->shift ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
(kc->ctrl ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
(kc->alt ? ZRCola::keyseq_db::keyseq::ALT : 0));
}
db.idxChr.push_back(idx);
db.idxKey.push_back(idx);
return db;
}
inline ZRCola::language_db& operator<<(_Inout_ ZRCola::language_db &db, _In_ const ZRCola::DBSource::language &rec)
{
unsigned __int32 idx = db.data.size();
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.lang), reinterpret_cast<const unsigned __int16*>(&rec.lang + 1));
std::wstring::size_type n = rec.name.length();
wxASSERT_MSG(n <= 0xffff, wxT("language name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
db.idxLang.push_back(idx);
return db;
}
inline ZRCola::langchar_db& operator<<(_Inout_ ZRCola::langchar_db &db, _In_ const ZRCola::DBSource::langchar &rec)
{
unsigned __int32 idx = db.data.size();
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.lang), reinterpret_cast<const unsigned __int16*>(&rec.lang + 1));
std::wstring::size_type n = rec.chr.length();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
db.idxChr .push_back(idx);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLang.push_back(idx);
#endif
return db;
}
inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const ZRCola::DBSource::chrgrp &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.grp && rec.grp <= (int)0x00007fff, wxT("character group ID out of bounds"));
db.data.push_back((unsigned __int16)rec.grp);
wxASSERT_MSG((int)0xffff8000 <= rec.rank && rec.rank <= (int)0x00007fff, wxT("character group rank out of bounds"));
db.data.push_back((unsigned __int16)rec.rank);
std::wstring::size_type n = rec.name.length();
wxASSERT_MSG(n <= 0xffff, wxT("character group name overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.chars.size();
wxASSERT_MSG(n <= 0xffff, wxT("character group characters overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name .cbegin(), rec.name .cend());
db.data.insert(db.data.end(), rec.chars.cbegin(), rec.chars.cend());
db.data.insert(db.data.end(), rec.show .cbegin(), rec.show .cend());
db.idxRank.push_back(idx);
return db;
}
inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ const ZRCola::DBSource::character &rec)
{
unsigned __int32 idx = db.data.size();
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.second.cat), reinterpret_cast<const unsigned __int16*>(&rec.second.cat + 1));
std::wstring::size_type n = rec.first.length();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.second.desc.length();
wxASSERT_MSG(n <= 0xffff, wxT("character description overflow"));
db.data.push_back((unsigned __int16)n);
n += rec.second.rel.size();
wxASSERT_MSG(n <= 0xffff, wxT("related characters overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.first .cbegin(), rec.first .cend());
db.data.insert(db.data.end(), rec.second.desc.cbegin(), rec.second.desc.cend());
db.data.insert(db.data.end(), rec.second.rel .cbegin(), rec.second.rel .cend());
db.idxChr.push_back(idx);
return db;
}
inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const ZRCola::DBSource::chrcat &rec)
{
unsigned __int32 idx = db.data.size();
db.data.insert(db.data.end(), reinterpret_cast<const unsigned __int16*>(&rec.cat), reinterpret_cast<const unsigned __int16*>(&rec.cat + 1));
wxASSERT_MSG((int)0xffff8000 <= rec.rank && rec.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
db.data.push_back((unsigned __int16)rec.rank);
std::wstring::size_type n = rec.name.length();
wxASSERT_MSG(n <= 0xffff, wxT("character category name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
db.idxChrCat.push_back(idx);
db.idxRank .push_back(idx);
return db;
}
inline ZRCola::chrtag_db& operator<<(_Inout_ ZRCola::chrtag_db &db, _In_ const ZRCola::DBSource::chrtag &rec)
{
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.tag && rec.tag <= (int)0x00007fff, wxT("tag out of bounds"));
db.data.push_back((unsigned __int16)rec.tag);
std::wstring::size_type n = rec.chr.length();
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.chr.cbegin(), rec.chr.cend());
db.idxChr.push_back(idx);
db.idxTag.push_back(idx);
return db;
}
inline ZRCola::tagname_db& operator<<(_Inout_ ZRCola::tagname_db &db, _In_ const ZRCola::DBSource::tagname &rec)
{
for (auto ln = rec.names.cbegin(), ln_end = rec.names.cend(); ln != ln_end; ++ln) {
for (auto nm = ln->second.cbegin(), nm_end = ln->second.cend(); nm != nm_end; ++nm) {
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= rec.tag && rec.tag <= (int)0x00007fff, wxT("tag out of bounds"));
db.data.push_back((unsigned __int16)rec.tag);
db.data.push_back(LOWORD(ln->first));
db.data.push_back(HIWORD(ln->first));
std::wstring::size_type n = nm->length();
wxASSERT_MSG(n <= 0xffff, wxT("tag name overflow"));
db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), nm->cbegin(), nm->cend());
db.idxName.push_back(idx);
db.idxTag .push_back(idx);
}
}
return db;
}

View File

@@ -0,0 +1,35 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-10-13 11:49+0200\n"
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: main.cpp:102
msgid "Show this help message"
msgstr ""
#: main.cpp:103
msgid "<input file>"
msgstr ""
#: main.cpp:104
msgid "<output file>"
msgstr ""
#: main.cpp:105
msgid "<output POT catalog>"
msgstr ""

View File

@@ -0,0 +1,32 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-10-05 10:59+0200\n"
"PO-Revision-Date: 2016-10-05 10:59+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: main.cpp:56
msgid "Show this help message"
msgstr "Zeige diesen Hilfstext"
#: main.cpp:57
msgid "<input file>"
msgstr ""
#: main.cpp:58
msgid "<output file>"
msgstr ""
#: main.cpp:59
msgid "<output POT catalog>"
msgstr ""

View File

@@ -0,0 +1,33 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-10-05 11:00+0200\n"
"PO-Revision-Date: 2016-10-05 11:00+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.9\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: main.cpp:56
msgid "Show this help message"
msgstr ""
#: main.cpp:57
msgid "<input file>"
msgstr ""
#: main.cpp:58
msgid "<output file>"
msgstr ""
#: main.cpp:59
msgid "<output POT catalog>"
msgstr ""

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