diff --git a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas index 5667d1aea8..429f9dec2f 100644 --- a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas +++ b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas @@ -3120,7 +3120,9 @@ begin begin if (FFeature[kfTouchLayout].FileName = '') then // I3909 begin - FFeature[kfTouchLayout].FileName := ChangeFileExt(FileName, '') + '-layout.js'; + FFeature[kfTouchLayout].FileName := + // See also TKeyboardParser_Features.GetDefaultFeatureFilename + Format(KeyboardFeatureFilename[kfTouchLayout], [ChangeFileExt(ExtractFileName(FileName), '')]); end; if pagesTouchLayout.ActivePage = pageTouchLayoutDesign // I4034 diff --git a/windows/src/developer/TIKE/main/KeyboardParser.pas b/windows/src/developer/TIKE/main/KeyboardParser.pas index ba188ed07e..02f4db9b3a 100644 --- a/windows/src/developer/TIKE/main/KeyboardParser.pas +++ b/windows/src/developer/TIKE/main/KeyboardParser.pas @@ -44,7 +44,8 @@ uses ExtShiftState, kmxfile, kmxfileconsts, - UKeymanTargets; + UKeymanTargets, + utilfiletypes; {$ASSERTIONS ON} @@ -317,7 +318,7 @@ const ssBitmap, ssVisualKeyboard, ssLayoutFile, ssKMW_EmbedJS, ssKMW_EmbedCSS, ssKMW_HelpFile, ssIncludeCodes); // I4369 KeyboardFeatureFilename: array[TKeyboardParser_FeatureID] of string = ( - '%s.ico', '%s.kvks', '%s-layout.js', + '%s.ico', '%s'+Ext_VisualKeyboardSource, '%s'+Ext_KeymanTouchLayout, '%s-code.js', '%s.css', '%s-help.htm', '%s-codes.txt'); // I4369 KeyboardFeatureTargets: array[TKeyboardParser_FeatureID] of TKeymanTargets = ( // I4504 // Due to Delphi compiler limitation, need to copy the target values, can't diff --git a/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas b/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas index 41ad431a64..73fa175fd3 100644 --- a/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas +++ b/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas @@ -143,6 +143,7 @@ uses UfrmMain, Unicode, utildir, + utilfiletypes, utilhttp, VisualKeyboard; @@ -184,7 +185,7 @@ procedure TframeTouchLayoutBuilder.FormCreate(Sender: TObject); begin inherited; FDisplayScriptErrors := True; // I4047 - FTemplateFileName := GetLayoutBuilderPath + 'template-basic.js'; // I4226 + FTemplateFileName := GetLayoutBuilderPath + 'template-basic' + Ext_KeymanTouchLayout; // I4226 end; procedure TframeTouchLayoutBuilder.FormDestroy(Sender: TObject); diff --git a/windows/src/developer/TIKE/oskbuilder/UfrmSelectTouchLayoutTemplate.pas b/windows/src/developer/TIKE/oskbuilder/UfrmSelectTouchLayoutTemplate.pas index 16f25bcdf8..1432010bbc 100644 --- a/windows/src/developer/TIKE/oskbuilder/UfrmSelectTouchLayoutTemplate.pas +++ b/windows/src/developer/TIKE/oskbuilder/UfrmSelectTouchLayoutTemplate.pas @@ -45,7 +45,8 @@ implementation uses RedistFiles, - TouchLayoutUtils; + TouchLayoutUtils, + utilfiletypes; {$R *.dfm} @@ -69,7 +70,7 @@ var Error, Root: string; begin Root := GetLayoutBuilderPath; - if FindFirst(Root + '*.js', 0, f) = 0 then + if FindFirst(Root + '*'+Ext_KeymanTouchLayout, 0, f) = 0 then begin repeat if IsValidTouchLayoutFile(Root + f.Name, Error) then diff --git a/windows/src/developer/TIKE/xml/layoutbuilder/template-basic.js b/windows/src/developer/TIKE/xml/layoutbuilder/template-basic.keyman-touch-layout similarity index 100% rename from windows/src/developer/TIKE/xml/layoutbuilder/template-basic.js rename to windows/src/developer/TIKE/xml/layoutbuilder/template-basic.keyman-touch-layout diff --git a/windows/src/developer/TIKE/xml/layoutbuilder/template-latin.js b/windows/src/developer/TIKE/xml/layoutbuilder/template-latin.keyman-touch-layout similarity index 100% rename from windows/src/developer/TIKE/xml/layoutbuilder/template-latin.js rename to windows/src/developer/TIKE/xml/layoutbuilder/template-latin.keyman-touch-layout diff --git a/windows/src/developer/TIKE/xml/layoutbuilder/template-traditional.js b/windows/src/developer/TIKE/xml/layoutbuilder/template-traditional.keyman-touch-layout similarity index 100% rename from windows/src/developer/TIKE/xml/layoutbuilder/template-traditional.js rename to windows/src/developer/TIKE/xml/layoutbuilder/template-traditional.keyman-touch-layout diff --git a/windows/src/developer/inst/kmdev.wxs b/windows/src/developer/inst/kmdev.wxs index f8f993aac3..0391a64f52 100644 --- a/windows/src/developer/inst/kmdev.wxs +++ b/windows/src/developer/inst/kmdev.wxs @@ -221,9 +221,9 @@ - - - + + + @@ -450,9 +450,9 @@ - - - + + + diff --git a/windows/src/global/delphi/general/utilfiletypes.pas b/windows/src/global/delphi/general/utilfiletypes.pas index 39c5dffce6..227a97080b 100644 --- a/windows/src/global/delphi/general/utilfiletypes.pas +++ b/windows/src/global/delphi/general/utilfiletypes.pas @@ -25,18 +25,14 @@ type TKMFileType = (ftKeymanSource, ftPackageSource, ftKeymanFile, ftPackageFile, ftFont, ftReadme, ftTextFile, ftKeymanWizard, ftOther, ftBitmap, - ftVisualKeyboard, ftXMLFile, ftHTMLFile, ftJavascript); + ftVisualKeyboard, ftXMLFile, ftHTMLFile, ftJavascript, + ftTouchLayout, ftVisualKeyboardSource); const - {FileTypes: array[TKMFileType] of string = ('ftKeymanSource', 'ftPackageSource', - 'ftKeymanFile', 'ftPackageFile', 'ftFont', 'ftReadme', 'ftTextFile', - 'ftKeymanWizard', 'ftOther', 'ftBitmap', - 'ftVirtualKeyboard', 'ftAddinFile', 'ftInstallerSource', 'ftBrandingSource', - 'ftEncryptedKeymanFile', 'ftEncryptedBranding');} - FileTypeNames: array[TKMFileType] of string = ('Keyman Source File', 'Package Source File', 'Keyman Keyboard File', 'Keyman Package File', 'Font', 'Readme File', 'Text File', 'Keyman Wizard File', 'Other File', 'Bitmap File', - 'Keyman Visual Keyboard File', 'XML File', 'HTML File', 'Javascript File'); + 'Keyman Visual Keyboard File', 'XML File', 'HTML File', 'Javascript File', + 'Keyman Touch Layout Source File', 'Keyman Visual Keyboard Source File'); type @@ -48,18 +44,24 @@ type const Ext_KeymanFile = '.kmx'; Ext_PackageFile = '.kmp'; + Ext_KeymanTouchLayout = '.keyman-touch-layout'; + Ext_VisualKeyboard = '.kvk'; + Ext_VisualKeyboardSource = '.kvks'; -const ExtFileTypes: array[0..10] of TKMFileTypeInfo = ( + +const ExtFileTypes: array[0..12] of TKMFileTypeInfo = ( (Ext: '.kmn'; FileType: ftKeymanSource), (Ext: '.kps'; FileType: ftPackageSource), - (Ext: '.kmx'; FileType: ftKeymanFile), - (Ext: '.kmp'; FileType: ftPackageFile), + (Ext: Ext_KeymanFile; FileType: ftKeymanFile), + (Ext: Ext_PackageFile; FileType: ftPackageFile), (Ext: '.ttf'; FileType: ftFont), (Ext: '.otf'; FileType: ftFont), (Ext: '.fon'; FileType: ftFont), (Ext: '.ttc'; FileType: ftFont), - (Ext: '.kvk'; FileType: ftVisualKeyboard), + (Ext: Ext_VisualKeyboard; FileType: ftVisualKeyboard), + (Ext: Ext_VisualKeyboardSource; FileType: ftVisualKeyboardSource), (Ext: '.js'; FileType: ftJavascript), + (Ext: Ext_KeymanTouchLayout; FileType: ftTouchLayout), (Ext: ''; FileType: ftOther)); function GetFileTypeFromFileName(const FileName: string): TKMFileType;