From 4d945d478feb4bb3f6f02fc2b40433b4ac71b953 Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 24 Jan 2023 14:59:33 +0100 Subject: [PATCH] chore(developer): rename Functions, version rc-files, set flag_use_new_kmcomp to use (old) kmcmpdll --- core/tests/unit/kmx/kmx_imsample.kmx | Bin 0 -> 888 bytes core/tests/unit/kmx/kmx_key_list.kmx | Bin 0 -> 806 bytes developer/src/kmcmpdll/Compiler.cpp | 2 +- developer/src/kmcmpdll/kmcmpdll.h | 2 +- developer/src/kmcmpdll/versioning.cpp | 2 +- developer/src/kmcmplib/Compiler.rc | 252 ++++++++++++++++++++++++ developer/src/kmcmplib/src/version.rc | 32 +++ developer/src/kmcmplib/version.rc | 32 +++ windows/src/desktop/kmshell/kmshell.res | Bin 7036 -> 7036 bytes 9 files changed, 319 insertions(+), 3 deletions(-) create mode 100644 core/tests/unit/kmx/kmx_imsample.kmx create mode 100644 core/tests/unit/kmx/kmx_key_list.kmx create mode 100644 developer/src/kmcmplib/Compiler.rc create mode 100644 developer/src/kmcmplib/src/version.rc create mode 100644 developer/src/kmcmplib/version.rc diff --git a/core/tests/unit/kmx/kmx_imsample.kmx b/core/tests/unit/kmx/kmx_imsample.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1d6090c8993ec6124771b395bf4d6dc666e260cd GIT binary patch literal 888 zcmaiz%}PR15Xb*!Ul3*VxoAR%R~|K1S;nJwXr9 z!?d^GoO>$?tdalBf99MyXU^O)n>#sHzto!;niUc;g$x1XDbVVX+6eSpn$dtxV&>WS zhMfY7@C7gp-@?YhAl$=lgJF0Rn+y3XwiWUZ?0d+Q+&Kb9*?)vR2zd#60Vaq)VVhuA zzKY804qeck9#n>3!LmdiRb}l4FN4$Q)`4-8KzE*J z(Y0`W{?|F;yeg;W(RJ=Cvaf)xXp<^DGBY~h=jonXFR3=T|F67KxHs7~+g9wQHTQaZ z*UznA*~?wCZRNl0m9E*glHe!p(W^Pv^D?za8z8Myc$t^h=tI%%?d-GlJLvE;-}420 z$p9n*>>CE>*)-V{DaAxFg&vr}9SLLm_=mu1iG{Hv{4-!3vWc?XbNm9>!5y<0Qo_Fm sY52H{NEQ4#*u}T0Gx6~opxutC&qa*!H$seA)d90=d4Vgg$LXlkpPdGynW^&e>sib6bUV4M_K?&9;b;Ed-Xr;KDOzhd};D z%$md)MCm`0$H75Q!vs1`o`rt&3ONZ8bb-9)>s@li*XQKAuUq7%ukXk=Fv{5{@&ja4 z)3%DLvsUEjL{;<-Du;8XeR>B}t5glx)1i*YH9V_pI_AWow$T0OQl|B3e%@J*WE>Ga8TaC&JFN3K+()qo`Bknf#R zHz7?u42~6DlUluQ%Y(pCD{b#Q9O8o}* r6#L(V_fGu*c2D=_pf2G>y$-kV=ozrnQ{cMHPCW-jW-5F8>`O@BSWZ #include "compfile.h" -BOOL AddCompileWarning(LPSTR buf); +BOOL AddCompileString(LPSTR buf); BOOL AddCompileMessage(DWORD msg); // TODO: These macros can return FALSE in functions that expect a DWORD CERR_x diff --git a/developer/src/kmcmpdll/versioning.cpp b/developer/src/kmcmpdll/versioning.cpp index 2064563838..7604fb11b3 100644 --- a/developer/src/kmcmpdll/versioning.cpp +++ b/developer/src/kmcmpdll/versioning.cpp @@ -12,7 +12,7 @@ BOOL CheckKeyboardFinalVersion(PFILE_KEYBOARD fk) { } wsprintf(buf, "The compiler has assigned a minimum engine version of %d.%d based on features used in this keyboard", (int)((fk->version & 0xFF00) >> 8), (int)(fk->version & 0xFF)); - AddCompileWarning(buf); + AddCompileString(buf); } return TRUE; diff --git a/developer/src/kmcmplib/Compiler.rc b/developer/src/kmcmplib/Compiler.rc new file mode 100644 index 0000000000..b1922ac9b4 --- /dev/null +++ b/developer/src/kmcmplib/Compiler.rc @@ -0,0 +1,252 @@ +#include +#include "comperr.h" + +#include "version.rc" + +///////////////////////////////////////////////////////////////////////////// +// English (Australia) resources + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + CERR_InvalidLayoutLine "Invalid 'layout' command" + CERR_NoVersionLine "No version line found for file" + CERR_InvalidGroupLine "Invalid 'group' command" + CERR_InvalidStoreLine "Invalid 'store' command" + CERR_InvalidCodeInKeyPartOfRule + "Invalid command or code found in key part of rule" + CERR_InvalidDeadkey "Invalid 'deadkey' or 'dk' command" + CERR_InvalidValue "Invalid value in extended string" + CERR_ZeroLengthString "A string of zero characters was found" + CERR_TooManyIndexToKeyRefs + "Too many index commands refering to key string" + CERR_UnterminatedString "Unterminated string in line" + CERR_StringInVirtualKeySection + "extended string illegal in virtual key section" + CERR_AnyInVirtualKeySection + "'any' command is illegal in virtual key section" + CERR_InvalidAny "Invalid 'any' command" + CERR_StoreDoesNotExist "Store referenced does not exist" + CERR_BeepInVirtualKeySection + "'beep' command is illegal in virtual key section" + CERR_IndexInVirtualKeySection + "'index' command is illegal in virtual key section" +END + +STRINGTABLE +BEGIN + CERR_BadCallParams "CompileKeyboardFile was called with bad parameters" + CERR_InfileNotExist "Cannot find the input file" + CERR_CannotCreateOutfile "Cannot open output file for writing" + CERR_UnableToWriteFully "Unable to write the file completely" + CERR_CannotReadInfile "Cannot read the input file - possible disk error" + CERR_SomewhereIGotItWrong "Internal error: contact Tavultesoft" +END + +STRINGTABLE +BEGIN + CERR_BufferOverflow "The compiler memory buffer overflowed" + CERR_Break "Compiler interrupted by user" +END + +STRINGTABLE +BEGIN + CERR_CannotAllocateMemory "Out of memory" +END + +STRINGTABLE +BEGIN + CERR_InvalidBitmapLine "Invalid 'bitmaps' command" + CERR_CannotReadBitmapFile "Cannot open the bitmap file for reading" + CERR_IndexDoesNotPointToAny + "An index() in the output does not have a corresponding any() statement" + CERR_ReservedCharacter "A reserved character was found" + CERR_InvalidCharacter "A character was found that is outside the valid Unicode range (U+0000 - U+10FFFF)" + CERR_InvalidCall "The 'call' command is invalid" + CERR_CallInVirtualKeySection + "'call' command is illegal in virtual key section" + CERR_CodeInvalidInKeyStore + "The command is invalid inside a store that is used in a key part of the rule" + CERR_CannotLoadIncludeFile + "Cannot load the included file: it is either invalid or does not exist" + CERR_60FeatureOnly_EthnologueCode + "EthnologueCode system store requires VERSION 6.0" + CERR_60FeatureOnly_MnemonicLayout + "MnemonicLayout functionality requires VERSION 6.0" + CERR_60FeatureOnly_OldCharPosMatching + "OldCharPosMatching system store requires VERSION 6.0" + CERR_60FeatureOnly_NamedCodes + "Named character constants requires VERSION 6.0" + CERR_60FeatureOnly_Contextn "Context(n) requires VERSION 6.0" + CERR_501FeatureOnly_Call "Call() requires VERSION 5.01" + CERR_InvalidNamedCode "Invalid named code constant" +END + +STRINGTABLE +BEGIN + CERR_InvalidSystemStore "Invalid system store name found" + CERR_60FeatureOnly_VirtualCharKey + "Virtual character keys require VERSION 6.0" + CERR_VersionAlreadyIncluded + "Only one VERSION or store(&version) line allowed in a source file." + CERR_70FeatureOnly "This feature requires store(&version) '7.0'" + CERR_80FeatureOnly "This feature requires store(&version) '8.0'" + CERR_InvalidInVirtualKeySection + "This statement is not valid in a virtual key section" + CERR_InvalidIf "The if() statement is not valid" + CERR_InvalidReset "The reset() statement is not valid" + CERR_InvalidSet "The set() statement is not valid" + CERR_InvalidSave "The save() statement is not valid" + CERR_InvalidEthnologueCode "Invalid ðnologuecode format" + CERR_90FeatureOnly_IfSystemStores + "if(&store) requires store(&version) '9.0'" + CERR_IfSystemStore_NotFound "System store in if() not found" + CERR_90FeatureOnly_SetSystemStores "set(&store) requires store(&version) '9.0'" + CERR_SetSystemStore_NotFound "System store in set() not found" + CERR_90FeatureOnlyVirtualKeyDictionary "Custom virtual key names require store(&version) '9.0'" +END + +STRINGTABLE +BEGIN + CERR_InvalidIndex "Invalid 'index' command" + CERR_OutsInVirtualKeySection + "'outs' command is illegal in virtual key section" + CERR_InvalidOuts "Invalid 'outs' command" + CERR_ContextInVirtualKeySection + "'context' command is illegal in virtual key section" + CERR_InvalidUse "Invalid 'use' command" + CERR_GroupDoesNotExist "Group does not exist" + CERR_VirtualKeyNotAllowedHere "Virtual key is not allowed here" + CERR_InvalidSwitch "Invalid 'switch' command" + CERR_NoTokensFound "No tokens found in line" + CERR_InvalidLineContinuation "Invalid line continuation" + CERR_LineTooLong "Line too long" + CERR_InvalidCopyright "Invalid 'copyright' command" + CERR_CodeInvalidInThisSection + "This line is invalid in this section of the file" + CERR_InvalidMessage "Invalid 'message' command" + CERR_InvalidLanguageName "Invalid 'languagename' command" +END + +STRINGTABLE +BEGIN + CWARN_TooManyWarnings "Too many warnings or errors" + CWARN_OldVersion "The keyboard file is an old version" + CWARN_BitmapNotUsed "The 'bitmaps' statement is obsolete and only the first bitmap referred to will be used, you should use 'bitmap'." + CWARN_CustomLanguagesNotSupported + "Languages over 0x1FF, 0x1F are not supported correctly by Windows. You should use no LANGUAGE line instead." + CWARN_KeyBadLength "There are too many characters in the keystroke part of the rule." + CWARN_IndexStoreShort "The store referenced in index() is shorter than the store referenced in any()" + CWARN_UnicodeInANSIGroup "A Unicode character was found in an ANSI group" + CWARN_ANSIInUnicodeGroup "An ANSI character was found in a Unicode group" + CWARN_UnicodeSurrogateUsed + "A Unicode surrogate character was found. You should use Unicode scalar values to represent values > U+FFFF" + CWARN_ReservedCharacter "A Unicode character was found that should not be used" + CWARN_Info "Information" + CWARN_VirtualKeyWithMnemonicLayout + "Virtual key used instead of virtual character key with a mnemonic layout" + CWARN_VirtualCharKeyWithPositionalLayout + "Virtual character key used with a positional layout instead of mnemonic layout" + CWARN_StoreAlreadyUsedAsOptionOrCall + "Store already used as an option or in a call statement and should not be used as a normal store" + CWARN_StoreAlreadyUsedAsStoreOrCall + "Store already used as a normal store or in a call statement and should not be used as an option" + CWARN_StoreAlreadyUsedAsStoreOrOption + "Store already used as a normal store or as an option and should not be used in a call statement" +END + +STRINGTABLE +BEGIN + CERR_None "(no error)" + CERR_EndOfFile "(no error - reserved code)" +END + +STRINGTABLE +BEGIN + CERR_InvalidToken "Invalid token found" + CERR_InvalidBegin "Invalid 'begin' command" + CERR_InvalidName "Invalid 'name' command" + CERR_InvalidVersion "Invalid 'version' command" + CERR_InvalidLanguageLine "Invalid 'language' command" + CERR_LayoutButNoLanguage "Layout command found but no language command" +END + +STRINGTABLE +BEGIN + CWARN_PunctuationInEthnologueCode + "Punctuation should not be used to separate Ethnologue codes; instead use spaces" +END + +STRINGTABLE +BEGIN + CERR_CannotCreateTempfile "Cannot create temp file" +END + +STRINGTABLE +BEGIN + CERR_90FeatureOnlyLayoutFile "Touch layout file reference requires store(&version) '9.0'" + CERR_90FeatureOnlyKeyboardVersion "KeyboardVersion system store requires store(&version) '9.0'" + CERR_KeyboardVersionFormatInvalid "KeyboardVersion format is invalid, expecting dot-separated integers" + CERR_ContextExHasInvalidOffset "context() statement has offset out of range" + CERR_90FeatureOnlyEmbedCSS "Embedding CSS requires store(&version) '9.0'" + CERR_90FeatureOnlyTargets "&TARGETS system store requires store(&version) '9.0'" + CERR_ContextAndIndexInvalidInMatchNomatch "context and index statements cannot be used in a match or nomatch statement" + CERR_140FeatureOnlyContextAndNotAnyWeb "For web and touch platforms, context() statement referring to notany() requires store(&version) '14.0'" + CWARN_PlatformNotInTargets "The specified platform is not a target platform" +END + +STRINGTABLE +BEGIN + CWARN_HeaderStatementIsDeprecated "Header statements are deprecated; use instead the equivalent system store" + CWARN_UseNotLastStatementInRule "A rule with use() statements in the output should not have other content following the use() statements" + CWARN_KVKFileIsInSourceFormat ".kvk file should be binary but is an XML file" +END + +STRINGTABLE +BEGIN + CWARN_DontMixChiralAndNonChiralModifiers "Don't mix the use of left/right modifiers with non-left/right modifiers in the same platform" + CWARN_MixingLeftAndRightModifiers "Left and right modifiers should not both be used in the same rule" +END + +STRINGTABLE +BEGIN + CWARN_LanguageHeadersDeprecatedInKeyman10 "This language header has been deprecated in Keyman 10. Instead, add language metadata in the package file" + CWARN_HotkeyHasInvalidModifier "Hotkey has modifiers that are not supported. Use only SHIFT, CTRL and ALT" + CHINT_NonUnicodeFile "Keyman Developer has detected that the file has ANSI encoding. Consider converting this file to UTF-8" + CWARN_NulNotFirstStatementInContext "nul must be the first statement in the context" + CWARN_IfShouldBeAtStartOfContext "if, platform and baselayout should be at start of context (after nul, if present)" + CWARN_KeyShouldIncludeNCaps "Other rules which reference this key include CAPS or NCAPS modifiers, so this rule must include NCAPS modifier to avoid inconsistent matches" + CHINT_UnreachableRule "This rule will never be matched as another rule takes precedence" + CHINT_FilenameHasDifferingCase "Casing differences may fail on some platforms:" + CWARN_MissingFile "The referenced file could not be found" +END + +STRINGTABLE +BEGIN + CERR_ExpansionMustFollowCharacterOrVKey "An expansion must follow a character or a virtual key" + CERR_VKeyExpansionMustBeFollowedByVKey "A virtual key expansion must be terminated by a virtual key" + CERR_CharacterExpansionMustBeFollowedByCharacter "A character expansion must be terminated by a character key" + CERR_VKeyExpansionMustUseConsistentShift "A virtual key expansion must use the same shift state for both terminators" + CERR_ExpansionMustBePositive "An expansion must have positive difference (i.e. A-Z, not Z-A)" +END + +STRINGTABLE +BEGIN + CERR_CasedKeysMustContainOnlyVirtualKeys "The &CasedKeys system store must contain only virtual keys or characters found on a US English keyboard" + CERR_CasedKeysMustNotIncludeShiftStates "The &CasedKeys system store must not include shift states" + CERR_CasedKeysNotSupportedWithMnemonicLayout "The &CasedKeys system store is not supported with mnemonic layouts" + CERR_CannotUseReadWriteGroupFromReadonlyGroup "Group used from a readonly group must also be readonly" + CERR_StatementNotPermittedInReadonlyGroup "Statement is not permitted in output of readonly group" + CERR_OutputInReadonlyGroup "Output is not permitted in a readonly group" + CERR_NewContextGroupMustBeReadonly "Group used in begin newContext must be readonly" + CERR_PostKeystrokeGroupMustBeReadonly "Group used in begin postKeystroke must be readonly" + CERR_DuplicateGroup "A group with this name has already been defined." + CERR_DuplicateStore "A store with this name has already been defined." + CERR_RepeatedBegin "This begin statement has already been defined." +END diff --git a/developer/src/kmcmplib/src/version.rc b/developer/src/kmcmplib/src/version.rc new file mode 100644 index 0000000000..685b3ff8e4 --- /dev/null +++ b/developer/src/kmcmplib/src/version.rc @@ -0,0 +1,32 @@ +#include "../../../../common/windows/cpp/include/keymanversion.h" + +1 VERSIONINFO + FILEVERSION KV_FILEVERSION + PRODUCTVERSION KV_PRODUCTVERSION + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0904E4" + BEGIN + VALUE "CompanyName", KV_COMPANY_NAME + VALUE "FileDescription", "Keyman compiler library\0" + VALUE "FileVersion", KV_VERSION_STRING + VALUE "InternalName", "KMCOMP\0" + VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT + VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS + VALUE "OriginalFilename", "KMCOMP.DLL\0" + VALUE "ProductName", "Keyman Developer\0" + VALUE "ProductVersion", KV_VERSION_STRING + VALUE "Comments", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0xc09, 1252 + END + END diff --git a/developer/src/kmcmplib/version.rc b/developer/src/kmcmplib/version.rc new file mode 100644 index 0000000000..b963c10ddb --- /dev/null +++ b/developer/src/kmcmplib/version.rc @@ -0,0 +1,32 @@ +#include "../../../common/windows/cpp/include/keymanversion.h" + +1 VERSIONINFO + FILEVERSION KV_FILEVERSION + PRODUCTVERSION KV_PRODUCTVERSION + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0904E4" + BEGIN + VALUE "CompanyName", KV_COMPANY_NAME + VALUE "FileDescription", "Keyman compiler library\0" + VALUE "FileVersion", KV_VERSION_STRING + VALUE "InternalName", "KMCOMP\0" + VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT + VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS + VALUE "OriginalFilename", "KMCOMP.DLL\0" + VALUE "ProductName", "Keyman Developer\0" + VALUE "ProductVersion", KV_VERSION_STRING + VALUE "Comments", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0xc09, 1252 + END + END diff --git a/windows/src/desktop/kmshell/kmshell.res b/windows/src/desktop/kmshell/kmshell.res index d1da4f0dc81a6eaccbd40b44f73fc727cd8a11f6..cfcbd309f137d6a5f5221aba48a1c759c0d56682 100644 GIT binary patch delta 14 Wcmexk_Qz~O3G?&)4>y*xN&^5q00%n& delta 14 Vcmexk_Qz~O3A4^zfsN&?(f~371&sgz