mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-11 03:15:33 +00:00
Merge pull request #897 from keymanapp/developer-rename-touchlayout-files
[Developer] For new keyboard layouts, touch layout files will have .keyman-touch-layout extension
This commit is contained in:
commit
0bd6805095
9 changed files with 31 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -221,9 +221,9 @@
|
|||
<Component><File Id='xml_file_layoutbuilder_platform.js' Name='platform.js' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_skflag.png' Name='skflag.png' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_skflags.png' Name='skflags.png' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_basic.js' Name='template-basic.js' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_latin.js' Name='template-latin.js' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_traditional.js' Name='template-traditional.js' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_basic.keymantouchlayout' Name='template-basic.keyman-touch-layout' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_latin.keymantouchlayout' Name='template-latin.keyman-touch-layout' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_template_traditional.keymantouchlayout' Name='template-traditional.keyman-touch-layout' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_phone_iphone5_landscape.png' Name='phone-iphone5-landscape.png' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_phone_iphone5_portrait.png' Name='phone-iphone5-portrait.png' KeyPath="yes" /></Component>
|
||||
<Component><File Id='xml_file_layoutbuilder_tablet_ipad_landscape.png' Name='tablet-ipad-landscape.png' KeyPath="yes" /></Component>
|
||||
|
|
@ -450,9 +450,9 @@
|
|||
<ComponentRef Id='xml_file_layoutbuilder_platform.js'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_skflag.png'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_skflags.png'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_basic.js'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_latin.js'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_traditional.js'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_basic.keymantouchlayout'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_latin.keymantouchlayout'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_template_traditional.keymantouchlayout'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_phone_iphone5_landscape.png'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_phone_iphone5_portrait.png'/>
|
||||
<ComponentRef Id='xml_file_layoutbuilder_tablet_ipad_landscape.png'/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue