spiegel-keyman/developer/src/test/manual/multiprocess/Keyman.MultiProcess.UI.UfrmMultiProcess.dfm
Marc Durdin 39b7c882a3 feat(developer): Multi-process model for projects 🦕
This is a bit of an omnibus commit, apologies for that. This commit
moves Keyman Developer to a proper multi-process model, where editing
files from multiple projects is handled much more cleanly, with each
project loaded in a separate process.

Files that are edited outside of a project structure are loaded into a
'temporary project' in a single process, which provides a pathway for
existing users who may have legacy files outside the normal Keyman
Developer project model.

There are several components to this:

1. Inter-process communication (Multiprocess, CopyDataHelper units and
   multiprocess test project). These modules establish a method of
   enumerating running Keyman Developer instances (with EnumWindow),
   recording relevant metadata for each instance (by thread id) in the
   registry (registry used because it manages contention without
   additional effort from us), and communicating between processes with
   WM_COPYDATA.
2. Command-line parsing (TikeCommandLine). Determines project ownership
   (ProjectOwningFile) for each filename passed on the command-line, and
   passes these over to existing instances of Keyman Developer that have
   that project loaded, or starts new instances as needed.
3. Temporary project management. Mostly in ProjectUI.

Also, moved GlobalProjectStateWnd management out of ProjectFile.pas and
into Project.pas, alongside other global project variables.

A follow-up will add functionality to determine if a file opened within
the Keyman Developer UI should open in the same instance or in a
separate instance (see TfrmKeymanDeveloper.OpenFileInProject). This will
use the same methodology as TikeCommandLine does now, so may involve
further refactoring.

This commit establishes the idea of 'keyman.kpj' as a future default
filename for Keyman Developer projects, but does not enable it, in
ProjectOwningFile. It is planned to introduce this fixed filename in
version 18.0 (see #10113).
2023-12-01 11:48:09 +07:00

66 lines
1.2 KiB
Text

object frmMultiProcess: TfrmMultiProcess
Left = 0
Top = 0
Caption = 'frmMultiProcess'
ClientHeight = 333
ClientWidth = 608
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 240
Top = 11
Width = 31
Height = 13
Caption = 'Label1'
end
object Edit1: TEdit
Left = 296
Top = 8
Width = 121
Height = 21
TabOrder = 0
Text = 'Edit1'
OnChange = Edit1Change
end
object Button1: TButton
Left = 512
Top = 8
Width = 75
Height = 25
Caption = 'New Process'
TabOrder = 1
OnClick = Button1Click
end
object lbProcess: TListBox
Left = 8
Top = 8
Width = 209
Height = 289
ItemHeight = 13
TabOrder = 2
OnDblClick = lbProcessDblClick
end
object cmdFocus: TButton
Left = 8
Top = 300
Width = 75
Height = 25
Caption = 'Focus process'
TabOrder = 3
OnClick = cmdFocusClick
end
object tmrEnumerate: TTimer
Interval = 100
OnTimer = tmrEnumerateTimer
Left = 400
Top = 112
end
end