diff --git a/windows/src/developer/TIKE/Tike.dpr b/windows/src/developer/TIKE/Tike.dpr index 8d450cc924..26ea12b15c 100644 --- a/windows/src/developer/TIKE/Tike.dpr +++ b/windows/src/developer/TIKE/Tike.dpr @@ -183,14 +183,12 @@ uses CaptionPanel in '..\..\global\delphi\comp\CaptionPanel.pas', Glossary in '..\..\global\delphi\general\Glossary.pas', UframeTouchLayoutBuilder in 'oskbuilder\UframeTouchLayoutBuilder.pas' {frameTouchLayoutBuilder}, - TouchLayoutUtils in 'oskbuilder\TouchLayoutUtils.pas' {, - UfrmSelectTouchLayoutTemplate in 'oskbuilder\UfrmSelectTouchLayoutTemplate.pas' {frmSelectTouchLayoutTemplate}, + TouchLayoutUtils in 'oskbuilder\TouchLayoutUtils.pas', UfrmSelectTouchLayoutTemplate in 'oskbuilder\UfrmSelectTouchLayoutTemplate.pas' {frmSelectTouchLayoutTemplate}, OnScreenKeyboardData in '..\..\global\delphi\visualkeyboard\OnScreenKeyboardData.pas', TouchLayout in 'oskbuilder\TouchLayout.pas', TouchLayoutDefinitions in 'oskbuilder\TouchLayoutDefinitions.pas', CharMapDropTool_TntCustomEdit in 'main\CharMapDropTool_TntCustomEdit.pas', - keyman_msctf in '..\..\global\delphi\winapi\keyman_msctf.pas', Winapi.UxTheme, CheckboxGridHelper in '..\..\global\delphi\general\CheckboxGridHelper.pas', UfrmAddKeyboardFeature in 'dialogs\UfrmAddKeyboardFeature.pas' {frmAddKeyboardFeature}, diff --git a/windows/src/developer/TIKE/Tike.dproj b/windows/src/developer/TIKE/Tike.dproj index 369762b3ef..38649df54f 100644 --- a/windows/src/developer/TIKE/Tike.dproj +++ b/windows/src/developer/TIKE/Tike.dproj @@ -413,7 +413,6 @@ -
frmAddKeyboardFeature
diff --git a/windows/src/developer/TIKE/child/UfrmDebug.pas b/windows/src/developer/TIKE/child/UfrmDebug.pas index b490a48bdf..c092c87345 100644 --- a/windows/src/developer/TIKE/child/UfrmDebug.pas +++ b/windows/src/developer/TIKE/child/UfrmDebug.pas @@ -37,7 +37,6 @@ uses Keyman.System.Debug.DebugUIStatus, Keyman.System.KeymanCore, Keyman.System.KeymanCoreDebug, - msctf, UframeTextEditor, UfrmDebugStatus, UfrmMDIEditor, @@ -110,14 +109,13 @@ type procedure ResetEvents; procedure ExecuteEvent(n: Integer); - procedure WMUserDebugEnd(var Message: TMessage); message WM_USER_DebugEnd; procedure ExecuteEventAction(n: Integer); procedure ExecuteEventRule(n: Integer); procedure SetExecutionPointLine(ALine: Integer); procedure SetUIStatus(const Value: TDebugUIStatus); procedure DisableUI; procedure EnableUI; - procedure SetForceKeyboard(Value: Boolean); + procedure SetForceKeyboard(Value: Boolean); // TODO: refactor this away -- we should use only FUIStatus function GetStatusText: string; procedure SetStatusText(Value: string); procedure UpdateDebugStatusForm; // I4809 @@ -255,35 +253,18 @@ const - Form events - ------------------------------------------------------------------------------} -var - KeymanCoreLoaded: Boolean = False; - -procedure InitKeymanCore; -begin - if not KeymanCoreLoaded then - begin - // TODO: debugpath for this - _km_kbp_set_library_path(ExtractFilePath(ParamStr(0)) + '..\..\..\..\..\..\..\common\core\desktop\build\x86\debug\src\' + kmnkbp0); - KeymanCoreLoaded := True; - end; -end; procedure TfrmDebug.FormCreate(Sender: TObject); begin inherited; -// InitMSCTF; // I3655 - - InitKeymanCore; FBreakpoints := TDebugBreakpoints.Create; FExecutionPointLine := -1; - //InitControlCaptions; FUIStatus := duiInvalid; FEvents := TDebugEventList.Create; FDefaultFont := True; memo.Align := alClient; - //InitSystemKeyboard; UIStatus := duiReadyForInput; frmDebugStatus.SetDebugMemo(memo); @@ -871,38 +852,6 @@ begin end; end; -procedure TfrmDebug.WMUserDebugEnd(var Message: TMessage); -begin - if UIStatus = duiPaused then - begin - SetCurrentEvent(1); - ResetEvents; - frmDebugStatus.Key.ShowKey(nil); - Exit; - end; - - if FEvents.Count > 0 then - begin - if FSingleStepMode then - begin - UIStatus := duiDebugging; - SetCurrentEvent(1); - ExecuteEvent(0); - end - else - begin - FRunning := True; - UIStatus := duiDebugging; - SetCurrentEvent(0); - Run; - end; - end - else - if memo.Focused - then UIStatus := duiFocusedForInput - else UIStatus := duiReadyForInput; -end; - procedure TfrmDebug.HideDebugForm; begin frmKeymanDeveloper.ShowDebug(False); // I4796 @@ -916,18 +865,15 @@ begin frmKeymanDeveloper.ShowDebug(True); // I4796 FDebugVisible := True; -// FFileName := ChangeFileExt(DebugFileName, '.kmx'); //UpdateFont(nil); SetupDebug; - //Keyman_Initialise(Application.MainFormHandle, True); // I2801 // I3283 - remove // I3503 memo.SetFocus; end; procedure TfrmDebug.ResetDebug; begin - //SelectSystemLayout(False); ForceKeyboard := False; FreeAndNil(debugkeyboard); if (frmDebugStatus <> nil) then @@ -1034,8 +980,6 @@ begin FOnUpdateExecutionPoint(Self, ALine); end; - - procedure TfrmDebug.UpdateFont(FFont: TFont); begin if FFont = nil then diff --git a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas index 71d03655d5..643f6a6e98 100644 --- a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas +++ b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas @@ -147,7 +147,7 @@ uses Vcl.Grids, KeyboardFonts, TempFileManager, UfrmDebugStatus, - UKeymanTargets, msctf, Winapi.UxTheme, Vcl.Themes, + UKeymanTargets, Winapi.UxTheme, Vcl.Themes, System.Generics.Collections, LeftTabbedPageControl, Vcl.CheckLst; type diff --git a/windows/src/developer/TIKE/debug/Keyman.System.Debug.DebugCore.pas b/windows/src/developer/TIKE/debug/Keyman.System.Debug.DebugCore.pas index e21994acec..d5ce2ca727 100644 --- a/windows/src/developer/TIKE/debug/Keyman.System.Debug.DebugCore.pas +++ b/windows/src/developer/TIKE/debug/Keyman.System.Debug.DebugCore.pas @@ -18,7 +18,8 @@ type FKeyboard: pkm_kbp_keyboard; FState: pkm_kbp_state; FDeadkeys: TDebugDeadkeyInfoList; - + class var KeymanCoreLoaded: Boolean; + class procedure InitKeymanCore; static; public constructor Create(const Filename: string; EnableDebug: Boolean); destructor Destroy; override; @@ -30,7 +31,9 @@ type implementation uses - System.SysUtils; + System.SysUtils, + + KeymanPaths; { TDebugCore } @@ -40,6 +43,8 @@ var begin inherited Create; + InitKeymanCore; + FKeyboard := nil; FState := nil; FDeadkeys := TDebugDeadkeyInfoList.Create; @@ -72,4 +77,16 @@ begin inherited Destroy; end; +class procedure TDebugCore.InitKeymanCore; +var + path: string; +begin + if not KeymanCoreLoaded then + begin + path := TKeymanPaths.KeymanCoreLibraryPath(kmnkbp0); + _km_kbp_set_library_path(path); + KeymanCoreLoaded := True; + end; +end; + end. diff --git a/windows/src/developer/TIKE/debug/UfrmDebugStatus_Events.pas b/windows/src/developer/TIKE/debug/UfrmDebugStatus_Events.pas index 395c9e4df9..ae0b74b029 100644 --- a/windows/src/developer/TIKE/debug/UfrmDebugStatus_Events.pas +++ b/windows/src/developer/TIKE/debug/UfrmDebugStatus_Events.pas @@ -111,8 +111,6 @@ procedure TfrmDebugStatus_Events.AddActionEvent(action: TDebugEventActionData); begin lbCallStack.Items.AddObject(StringOfChar(' ', FIndent)+message, data); end; -var - s: string; begin case action.ActionType of KM_KBP_IT_EMIT_KEYSTROKE: AddItem('emit_keystroke', action); diff --git a/windows/src/global/delphi/general/KeymanPaths.pas b/windows/src/global/delphi/general/KeymanPaths.pas index d8d50cd3c8..8c131fda6c 100644 --- a/windows/src/global/delphi/general/KeymanPaths.pas +++ b/windows/src/global/delphi/general/KeymanPaths.pas @@ -34,6 +34,7 @@ type class function KeyboardsInstallPath(const filename: string = ''): string; static; class function KeyboardsInstallDir: string; static; class function KeymanConfigStaticHttpFilesPath(const filename: string = ''): string; static; + class function KeymanCoreLibraryPath(const Filename: string): string; static; class function CEFPath: string; static; // Chromium Embedded Framework class function CEFDataPath(const mode: string): string; static; class function CEFSubprocessPath: string; static; @@ -406,4 +407,24 @@ begin Result := (keyman_root <> '') and SameText(keyman_root, ParamStr(0).Substring(0, keyman_root.Length)); end; +class function TKeymanPaths.KeymanCoreLibraryPath(const Filename: string): string; +var + keyman_root: string; +begin + // Look up KEYMAN_ROOT development variable -- if found and executable + // within that path then use that as source path + if TKeymanPaths.RunningFromSource(keyman_root) then + begin + Exit(keyman_root + 'common\core\desktop\build\x86\debug\src\' + Filename); + end; + + Result := GetDebugPath('KeymanCoreLibraryPath', ''); + if Result = '' then + begin + Result := ExtractFilePath(ParamStr(0)); + end; + + Result := IncludeTrailingPathDelimiter(Result) + Filename; +end; + end.