mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 06:09:30 +02:00
* WASI webassembly options
This commit is contained in:
parent
b82a00a7bc
commit
e0a5700238
@ -1,22 +1,22 @@
|
||||
object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
Left = 431
|
||||
Height = 383
|
||||
Height = 430
|
||||
Top = 310
|
||||
Width = 491
|
||||
Width = 508
|
||||
Caption = 'Pas2JS Browser project options'
|
||||
ClientHeight = 383
|
||||
ClientWidth = 491
|
||||
ClientHeight = 430
|
||||
ClientWidth = 508
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.1.0.0'
|
||||
LCLVersion = '2.3.0.0'
|
||||
object CBCreateHTML: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 6
|
||||
Width = 164
|
||||
Width = 173
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Create initial HTML page'
|
||||
@ -32,28 +32,29 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 122
|
||||
Width = 200
|
||||
Width = 213
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Use Browser Application object'
|
||||
OnChange = CBUseBrowserAppChange
|
||||
TabOrder = 1
|
||||
end
|
||||
object CBUseBrowserConsole: TCheckBox
|
||||
AnchorSideLeft.Control = CBCreateHTML
|
||||
AnchorSideTop.Control = CBUseBrowserApp
|
||||
AnchorSideTop.Control = CBUseWASI
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 151
|
||||
Width = 314
|
||||
Top = 180
|
||||
Width = 341
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Use Browser Console unit to display writeln() output'
|
||||
TabOrder = 2
|
||||
end
|
||||
object BPHelpOptions: TButtonPanel
|
||||
Left = 6
|
||||
Height = 39
|
||||
Top = 338
|
||||
Width = 479
|
||||
Height = 38
|
||||
Top = 386
|
||||
Width = 496
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
HelpButton.Name = 'HelpButton'
|
||||
@ -70,8 +71,8 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
AnchorSideTop.Control = RBStartServerAt
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 70
|
||||
Height = 29
|
||||
Top = 234
|
||||
Height = 27
|
||||
Top = 263
|
||||
Width = 75
|
||||
BorderSpacing.Left = 32
|
||||
BorderSpacing.Top = 2
|
||||
@ -86,8 +87,8 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 180
|
||||
Width = 185
|
||||
Top = 209
|
||||
Width = 194
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Project needs a HTTP Server'
|
||||
OnChange = CBUseHTTPServerChange
|
||||
@ -99,8 +100,8 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 23
|
||||
Top = 209
|
||||
Width = 169
|
||||
Top = 238
|
||||
Width = 180
|
||||
BorderSpacing.Left = 32
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Start HTTP Server on port'
|
||||
@ -114,8 +115,8 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 23
|
||||
Top = 265
|
||||
Width = 163
|
||||
Top = 292
|
||||
Width = 173
|
||||
BorderSpacing.Top = 2
|
||||
Caption = 'Use this URL to start app'
|
||||
TabOrder = 7
|
||||
@ -127,9 +128,9 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 70
|
||||
Height = 29
|
||||
Top = 290
|
||||
Width = 409
|
||||
Height = 27
|
||||
Top = 317
|
||||
Width = 426
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Right = 12
|
||||
@ -143,7 +144,7 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 35
|
||||
Width = 142
|
||||
Width = 151
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Maintain HTML Page'
|
||||
TabOrder = 9
|
||||
@ -155,7 +156,7 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 64
|
||||
Width = 290
|
||||
Width = 313
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Run rtl when all page resources are fully loaded'
|
||||
TabOrder = 10
|
||||
@ -167,9 +168,36 @@ object WebBrowserProjectOptionsForm: TWebBrowserProjectOptionsForm
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 93
|
||||
Width = 208
|
||||
Width = 226
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Let rtl show uncaught exceptions'
|
||||
TabOrder = 11
|
||||
end
|
||||
object CBUseWASI: TCheckBox
|
||||
AnchorSideLeft.Control = CBCreateHTML
|
||||
AnchorSideTop.Control = CBUseBrowserApp
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 23
|
||||
Top = 151
|
||||
Width = 193
|
||||
BorderSpacing.Left = 32
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Host webassembly program'
|
||||
Enabled = False
|
||||
TabOrder = 12
|
||||
end
|
||||
object edtWasmProgram: TEdit
|
||||
AnchorSideLeft.Control = CBUseWASI
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 247
|
||||
Height = 27
|
||||
Top = 150
|
||||
Width = 248
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 16
|
||||
Enabled = False
|
||||
TabOrder = 13
|
||||
TextHint = 'Name of your webassembly file'
|
||||
end
|
||||
end
|
||||
|
@ -16,26 +16,32 @@ type
|
||||
BPHelpOptions: TButtonPanel;
|
||||
CBCreateHTML: TCheckBox;
|
||||
CBUseBrowserApp: TCheckBox;
|
||||
CBUseWASI: TCheckBox;
|
||||
CBUseBrowserConsole: TCheckBox;
|
||||
CBUseHTTPServer: TCheckBox;
|
||||
CBServerURL: TComboBox;
|
||||
CBMaintainPage: TCheckBox;
|
||||
CBRunOnReady: TCheckBox;
|
||||
cbShowUncaughtExceptions: TCheckBox;
|
||||
edtWasmProgram: TEdit;
|
||||
RBUseURL: TRadioButton;
|
||||
RBStartServerAt: TRadioButton;
|
||||
SEPort: TSpinEdit;
|
||||
procedure CBCreateHTMLChange(Sender: TObject);
|
||||
procedure CBUseBrowserAppChange(Sender: TObject);
|
||||
procedure CBUseHTTPServerChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
procedure CheckWasi;
|
||||
function GetB(AIndex: Integer): Boolean;
|
||||
function GetServerPort: Word;
|
||||
function GetURL: String;
|
||||
function GetWasmProgramURL: String;
|
||||
procedure SetB(AIndex: Integer; AValue: Boolean);
|
||||
procedure SetServerPort(AValue: Word);
|
||||
procedure SetURL(AValue: String);
|
||||
procedure SetWasmProgramURL(AValue: String);
|
||||
public
|
||||
property CreateHTML : Boolean Index 0 read GetB Write SetB;
|
||||
property MaintainHTML : Boolean Index 1 read GetB Write SetB;
|
||||
@ -45,8 +51,10 @@ type
|
||||
property UseURL : Boolean Index 5 read GetB Write SetB;
|
||||
property UseRunOnReady : Boolean Index 6 read GetB Write SetB;
|
||||
property ShowUncaughtExceptions : Boolean Index 7 read GetB Write SetB;
|
||||
property UseWASI : Boolean Index 8 read GetB Write SetB;
|
||||
Property ServerPort : Word Read GetServerPort Write SetServerPort;
|
||||
Property URL : String Read GetURL Write SetURL;
|
||||
Property WasmProgramURL : String Read GetWasmProgramURL Write SetWasmProgramURL;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -73,6 +81,18 @@ begin
|
||||
DoCB(CBMaintainPage);
|
||||
end;
|
||||
|
||||
procedure TWebBrowserProjectOptionsForm.CBUseBrowserAppChange(Sender: TObject);
|
||||
begin
|
||||
CheckWASI;
|
||||
end;
|
||||
|
||||
procedure TWebBrowserProjectOptionsForm.CheckWasi;
|
||||
|
||||
begin
|
||||
CBUseWASI.Enabled:=UseBrowserApp;
|
||||
edtWasmProgram.Enabled:=UseBrowserApp;
|
||||
end;
|
||||
|
||||
procedure TWebBrowserProjectOptionsForm.CBUseHTTPServerChange(Sender: TObject);
|
||||
|
||||
procedure disen(C : TControl);
|
||||
@ -102,6 +122,8 @@ begin
|
||||
CBUseHTTPServer.Caption:=pjsdProjectNeedsAHTTPServer;
|
||||
RBStartServerAt.Caption:=pjsdStartHTTPServerOnPort;
|
||||
RBUseURL.Caption:=pjsdUseThisURLToStartApplication;
|
||||
CBUseWASI.Caption:=pjsdUseWASIApplicationObject;
|
||||
edtWasmProgram.TextHint:=pjsWasiProgramFileTextHint;
|
||||
CBCreateHTMLChange(self);
|
||||
CBUseHTTPServerChange(Self);
|
||||
end;
|
||||
@ -124,6 +146,7 @@ begin
|
||||
5 : Result:=RBUseURL.Checked;
|
||||
6 : Result:=CBRunOnReady.Checked;
|
||||
7 : Result:=cbShowUncaughtExceptions.Checked;
|
||||
8 : Result:=cbUseWASI.Checked;
|
||||
else
|
||||
Result:=False;
|
||||
end;
|
||||
@ -140,12 +163,21 @@ begin
|
||||
Result:=CBServerURL.Text;
|
||||
end;
|
||||
|
||||
function TWebBrowserProjectOptionsForm.GetWasmProgramURL: String;
|
||||
begin
|
||||
Result:=edtWasmProgram.Text;
|
||||
end;
|
||||
|
||||
procedure TWebBrowserProjectOptionsForm.SetB(AIndex: Integer; AValue: Boolean);
|
||||
begin
|
||||
Case Aindex of
|
||||
0 : CBCreateHTML.Checked:=AValue;
|
||||
1 : CBMaintainPage.Checked:=AValue;
|
||||
2 : CBUseBrowserApp.Checked:=AValue;
|
||||
2 :
|
||||
begin
|
||||
CBUseBrowserApp.Checked:=AValue;
|
||||
CheckWASI;
|
||||
end;
|
||||
3 : CBUseBrowserConsole.Checked:=AValue;
|
||||
4 :
|
||||
begin
|
||||
@ -161,6 +193,7 @@ begin
|
||||
end;
|
||||
6 : CBRunOnReady.Checked:=Avalue;
|
||||
7 : cbShowUncaughtExceptions.Checked:=aValue;
|
||||
8 : cbUseWASI.Checked:=aValue;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -174,5 +207,10 @@ begin
|
||||
CBServerURL.Text:=AValue;
|
||||
end;
|
||||
|
||||
procedure TWebBrowserProjectOptionsForm.SetWasmProgramURL(AValue: String);
|
||||
begin
|
||||
edtWasmProgram.Text:=aValue;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -217,6 +217,10 @@ msgstr "Utiliser ce navigateur lors de l'ouverture de l'URL ou du fichier HTML d
|
||||
msgid "Use this URL to start application"
|
||||
msgstr "Utiliser cette URL pour démarrer l'application"
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr "Répertoire des modèles d'extension de code Visual Studio"
|
||||
@ -238,6 +242,10 @@ msgstr "Projet Web (pas2js)"
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr "Vous pouvez utiliser des macros de l'EDI comme $MakeExe(). Sans chemin complet, %s est recherché dans PATH."
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -219,6 +219,10 @@ msgstr "Ez a böngésző legyen használva amikor egy böngészős projekt URL-j
|
||||
msgid "Use this URL to start application"
|
||||
msgstr "Az alkalmazás indításához ezt az URL-t használja"
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr ""
|
||||
@ -242,6 +246,10 @@ msgstr "Web projekt (pas2js)"
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr "Használhatók az IDE makrók, mint a $MakeExe(). Teljes útvonal nélkül a PATH-ban felsorolt helyeken lesz keresve a(z) %s."
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -207,6 +207,10 @@ msgstr ""
|
||||
msgid "Use this URL to start application"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr ""
|
||||
@ -228,6 +232,10 @@ msgstr ""
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -218,6 +218,10 @@ msgstr "Usar este navegador ao abrir a URL ou arquivo HTML de um projeto de nave
|
||||
msgid "Use this URL to start application"
|
||||
msgstr "Usar esta URL para iniciar a aplicação"
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr "Diretório de modelos de extensão de código do Visual Studio"
|
||||
@ -241,6 +245,10 @@ msgstr "Projeto Web (pas2js)"
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr "Você pode usar macros IDE como \"$MakeExe()\". Sem um caminho completo, %s é pesquisado em \"PATH\""
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -217,6 +217,10 @@ msgstr "Браузер для открытия предназначенного
|
||||
msgid "Use this URL to start application"
|
||||
msgstr "Использовать следующий адрес для запуска приложения"
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr "Каталог шаблона расширения Visual Studio Code"
|
||||
@ -238,6 +242,10 @@ msgstr "Веб-проект (pas2js)"
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr "Можно использовать макросы IDE, например, $MakeExe(). Если полный путь не указан, поиск %s производится при помощи переменной окружения PATH."
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -219,6 +219,10 @@ msgstr ""
|
||||
msgid "Use this URL to start application"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr ""
|
||||
@ -242,6 +246,10 @@ msgstr ""
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
#, fuzzy
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
|
@ -219,6 +219,10 @@ msgstr "Для відкривання URL або HTML-файлів проєкт
|
||||
msgid "Use this URL to start application"
|
||||
msgstr "Для запуску застосунку використати цей URL"
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr "Теку шаблонів розширень Visual Studio Code"
|
||||
@ -240,6 +244,10 @@ msgstr "Веб-проєкт (pas2js)"
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr "Можна використовувати макроси ІСР на зразок $MakeExe(). Без повного шляху %s буде шукатись у PATH."
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
msgid "Pas2JS WebServers"
|
||||
|
@ -220,6 +220,10 @@ msgstr ""
|
||||
msgid "Use this URL to start application"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdusewasiapplicationobject
|
||||
msgid "Host webassembly program"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjsdvisualstudiocodeextensiontemplatedirectory
|
||||
msgid "Visual Studio Code extension template directory"
|
||||
msgstr ""
|
||||
@ -243,6 +247,10 @@ msgstr ""
|
||||
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.pjswasiprogramfiletexthint
|
||||
msgid "Name of your webassembly file"
|
||||
msgstr ""
|
||||
|
||||
#: strpas2jsdesign.spasjswebservercaption
|
||||
#, fuzzy
|
||||
msgctxt "strpas2jsdesign.spasjswebservercaption"
|
||||
|
@ -30,7 +30,8 @@ type
|
||||
baoUseBrowserConsole, // use browserconsole unit to display Writeln()
|
||||
baoStartServer, // Start simple server
|
||||
baoUseURL, // Use this URL to run/show project in browser
|
||||
baoShowException // let RTL show uncaught exceptions
|
||||
baoShowException, // let RTL show uncaught exceptions
|
||||
baoUseWASI // Use WASI browser app object
|
||||
);
|
||||
TBrowserApplicationOptions = set of TBrowserApplicationOption;
|
||||
|
||||
@ -39,6 +40,7 @@ type
|
||||
FOptions: TBrowserApplicationOptions;
|
||||
FProjectPort: integer;
|
||||
FProjectURL: String;
|
||||
FProjectWasmURL : String;
|
||||
protected
|
||||
function CreateHTMLFile(AProject: TLazProject; AFileName: String
|
||||
): TLazProjectFile; virtual;
|
||||
@ -337,10 +339,12 @@ begin
|
||||
UseBrowserConsole:=CO(baoUseBrowserConsole);
|
||||
StartHTTPServer:=CO(baoStartServer);
|
||||
UseRunOnReady:=CO(baoRunOnReady);
|
||||
UseWASI:=CO(baoUseWASI);
|
||||
ShowUncaughtExceptions:=CO(baoShowException);
|
||||
// We allocate the new port in all cases.
|
||||
ServerPort:=GetNextPort;
|
||||
URL:='';
|
||||
WasmProgramURL:='';
|
||||
if Not CO(baoStartServer) then
|
||||
UseURL:=CO(baoUseURL);
|
||||
Result:=ShowModal;
|
||||
@ -353,6 +357,7 @@ begin
|
||||
SO(StartHTTPServer,baoStartServer);
|
||||
SO(UseRunOnReady,baoRunOnReady);
|
||||
SO(ShowUncaughtExceptions,baoShowException);
|
||||
SO(UseWASI,baoUseWASI);
|
||||
DebugLN(['Start server:', CO(baoStartServer)]);
|
||||
if CO(baoStartServer) then
|
||||
begin
|
||||
@ -362,10 +367,11 @@ begin
|
||||
else
|
||||
begin
|
||||
UseURL:=CO(baoUseURL);
|
||||
if CO(baoUseURL) then
|
||||
URL:='';
|
||||
if UseURL then
|
||||
FProjectURL:=URL;
|
||||
end;
|
||||
end;
|
||||
FProjectWasmURL:=WasmProgramURL;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
@ -465,7 +471,11 @@ begin
|
||||
if baoUseBrowserConsole in Options then
|
||||
Units:=' browserconsole,';
|
||||
if baoUseBrowserApp in Options then
|
||||
begin
|
||||
Units:=Units+' browserapp,' ;
|
||||
if baoUseWASI in options then
|
||||
Units:=Units+' wasihostapp,' ;
|
||||
end;
|
||||
Units:=Units+' JS, Classes, SysUtils, Web';
|
||||
Src:=TStringList.Create;
|
||||
try
|
||||
@ -480,6 +490,9 @@ begin
|
||||
if baoUseBrowserApp in Options then
|
||||
begin
|
||||
Add('Type');
|
||||
if baoUseWASI in Options then
|
||||
Add(' TMyApplication = Class(TWASIHostApplication)')
|
||||
else
|
||||
Add(' TMyApplication = Class(TBrowserApplication)');
|
||||
AddLn(' procedure doRun; override');
|
||||
AddLn(' end');
|
||||
@ -487,7 +500,14 @@ begin
|
||||
AddLn('Procedure TMyApplication.doRun');
|
||||
Add('');
|
||||
Add('begin');
|
||||
Add(' // Your code here');
|
||||
if baoUseWASI in Options then
|
||||
begin
|
||||
if FProjectWasmURL='' then
|
||||
FProjectWasmURL:='yourwebassembly.wasm';
|
||||
AddLn(Format(' StartWebAssembly(''%s'')',[FProjectWasmURL]));
|
||||
end
|
||||
else
|
||||
Add(' // Your code here');
|
||||
AddLn(' Terminate');
|
||||
AddLn('end');
|
||||
Add('');
|
||||
|
@ -81,7 +81,8 @@ Resourcestring
|
||||
pjsdPas2JSBrowserProjectOptions = 'Pas2JS Browser project options';
|
||||
pjsdCreateInitialHTMLPage = 'Create initial HTML page';
|
||||
pjsdUseBrowserApplicationObject = 'Use Browser Application object';
|
||||
|
||||
pjsdUseWASIApplicationObject = 'Host webassembly program';
|
||||
pjsWasiProgramFileTextHint = 'Name of your webassembly file';
|
||||
|
||||
// New NodeJS project options form
|
||||
pjsdNodeJSProjectOptions = 'NodeJS project options';
|
||||
|
Loading…
Reference in New Issue
Block a user