Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 20, 2024
1 parent e3b4161 commit aea0ce2
Show file tree
Hide file tree
Showing 20 changed files with 2,568 additions and 392 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
test: Simba-Linux64

- name: MacOS 64
runs-on: macos-latest
runs-on: macos-13
build-mode: MACOS64
binary: Simba-MacOS.dmg
test: Simba

- name: MacOS AArch64
runs-on: macos-14
runs-on: macos-13
build-mode: MACOS-AARCH64
binary: Simba-MacOS-AArch64.dmg
#test: Simba MatchTemplateMask test fails, investigate later
Expand Down Expand Up @@ -96,15 +96,15 @@ jobs:
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output certificate.p12
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security import certificate.p12 -k build.keychain -P "$P12_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output certificate.p12
# security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security default-keychain -s build.keychain
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security import certificate.p12 -k build.keychain -P "$P12_PASSWORD" -T /usr/bin/codesign
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
codesign --deep --sign "7ACAD7EE0AA3A0783CE9592567098A3F08FC0B0B" Simba.app
codesign -v Simba.app
# codesign --deep --sign "7ACAD7EE0AA3A0783CE9592567098A3F08FC0B0B" Simba.app
# codesign -v Simba.app
brew install create-dmg
Expand Down
1 change: 0 additions & 1 deletion DocGen/docgen.simba
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ begin
APIFiles += ['Source\script\imports\simba.import_image.pas', 'Image' ];
APIFiles += ['Source\script\imports\simba.import_dtm.pas', 'DTM' ];
APIFiles += ['Source\script\imports\simba.import_async.pas', 'ASync' ];
APIFiles += ['Source\script\imports\simba.import_stringmap.pas', 'String Map' ];
end;

procedure H2ToH3(Dir: String);
Expand Down
10 changes: 7 additions & 3 deletions Source/Simba.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
</CompilerOptions>
</Item5>
<Item6 Name="MACOS64">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
Expand All @@ -263,9 +266,7 @@
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<DebugInfoType Value="dsDwarf2Set"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
Expand All @@ -291,6 +292,9 @@
</CompilerOptions>
</Item6>
<Item7 Name="MACOS-AARCH64">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
Expand Down Expand Up @@ -343,7 +347,7 @@
</CompilerOptions>
</Item7>
<SharedMatrixOptions Count="1">
<Item1 ID="760724751738" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
<Item1 ID="760724751738" Modes="MACOS64,MACOS-AARCH64" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
</SharedMatrixOptions>
</BuildModes>
<PublishOptions>
Expand Down
4 changes: 2 additions & 2 deletions Source/ide/simba.ide_editor_paramhint.pas
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ procedure TSimbaParamHint.DoEditorCommand(Sender: TObject; AfterProcessing: Bool

if (Length(Decls) > 0) then
begin
if (Decl is TDeclaration_Method) then
FDisplayPoint.X := FDisplayPoint.X - Length(Decl.Name);
if (Decls[0] is TDeclaration_Method) and (Length(Decls[0].Name) > 0) then
FDisplayPoint.X := FDisplayPoint.X - Length(Decls[0].Name);

FHintForm.Font := Font;
FHintForm.Font.Color := Editor.Highlighter.IdentifierAttribute.Foreground;
Expand Down
192 changes: 55 additions & 137 deletions Source/script/imports/lcl/simba.import_lcl_form.pas
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ procedure _LapeCustomForm_CloseQuery(const Params: PParamArray; const Result: Po
end;

procedure _LapeCustomForm_EnsureVisible(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV

procedure Execute;
begin
PCustomForm(Params^[0])^.EnsureVisible(PBoolean(Params^[1])^);
end;

begin
PCustomForm(Params^[0])^.EnsureVisible(PBoolean(Params^[1])^);
RunInMainThread(@Execute);
end;

procedure _LapeCustomForm_FocusControl(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
Expand Down Expand Up @@ -177,23 +183,36 @@ procedure _LapeCustomForm_StayOnTop_Write(const Params: PParamArray); LAPE_WRAPP
end;

procedure _LapeCustomForm_Show(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV

procedure Execute;
begin
PCustomForm(Params^[0])^.Show();
end;

begin
PCustomForm(Params^[0])^.Show();
RunInMainThread(@Execute);
end;

procedure _LapeCustomForm_ShowModal(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV

procedure Execute;
begin
PInteger(Result)^ := PCustomForm(Params^[0])^.ShowModal();
end;

begin
PInteger(Result)^ := PCustomForm(Params^[0])^.ShowModal();
RunInMainThread(@Execute);
end;

procedure _LapeCustomForm_ShowOnTop(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PCustomForm(Params^[0])^.ShowOnTop();
end;

procedure _LapeCustomForm_ProcessMessages(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
procedure Execute;
begin
PCustomForm(Params^[0])^.ShowOnTop();
end;

begin
Application.ProcessMessages();
RunInMainThread(@Execute);
end;

procedure _LapeCustomForm_Active_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
Expand Down Expand Up @@ -343,13 +362,30 @@ procedure _LapeCustomForm_ShowInTaskBar_Write(const Params: PParamArray); LAPE_W

procedure _LapeForm_Create(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
if not IsMainThread() then
SimbaException('Forms must be created and run on the main thread, use RunInMainThread');

PForm(Result)^ := TForm.CreateNew(PComponent(Params^[0])^);
PForm(Result)^.ShowInTaskBar := stAlways;
end;

procedure _LapeFormThread_Run(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
RunInMainThread(TThreadMethod(Params^[0]^));
end;

procedure _LapeFormThread_Queue(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
QueueOnMainThread(TThreadMethod(Params^[0]^));
end;

procedure _LapeFormThread_IsCurrentThread(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PBoolean(Result)^ := IsMainThread();
end;

procedure _LapeFormThread_ProcessMessages(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
Application.ProcessMessages();
end;

procedure _LapeForm_SaveSession(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV

function ArrToSessionProperties(const Arr: TStringArray): String;
Expand Down Expand Up @@ -396,41 +432,6 @@ procedure _LapeForm_RestoreSession(const Params: PParamArray); LAPE_WRAPPER_CALL
end;
end;

procedure _LapeForm_Show(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Show();
end;

procedure _LapeForm_Close(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Close();
end;

procedure _LapeForm_Hide(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Hide();
end;

procedure _LapeForm_ClientWidth_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.ClientWidth;
end;

procedure _LapeForm_ClientWidth_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.ClientWidth := PInteger(Params^[1])^;
end;

procedure _LapeForm_ClientHeight_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.ClientHeight;
end;

procedure _LapeForm_ClientHeight_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.ClientHeight := PInteger(Params^[1])^;
end;

procedure _LapeForm_OnActivate_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PNotifyEvent(Result)^ := PForm(Params^[0])^.OnActivate;
Expand Down Expand Up @@ -641,96 +642,6 @@ procedure _LapeForm_OnResize_Write(const Params: PParamArray); LAPE_WRAPPER_CALL
PForm(Params^[0])^.OnResize := PNotifyEvent(Params^[1])^;
end;

procedure _LapeForm_Enabled_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PBoolean(Result)^ := PForm(Params^[0])^.Enabled;
end;

procedure _LapeForm_Enabled_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Enabled := PBoolean(Params^[1])^;
end;

procedure _LapeForm_Font_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PFont(Result)^ := PForm(Params^[0])^.Font;
end;

procedure _LapeForm_Font_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Font := PFont(Params^[1])^;
end;

procedure _LapeForm_Visible_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PBoolean(Result)^ := PForm(Params^[0])^.Visible;
end;

procedure _LapeForm_Visible_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Visible := PBoolean(Params^[1])^;
end;

procedure _LapeForm_Canvas_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PCanvas(Result)^ := PForm(Params^[0])^.Canvas;
end;

procedure _LapeForm_Canvas_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Canvas := PCanvas(Params^[1])^;
end;

procedure _LapeForm_Left_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.Left;
end;

procedure _LapeForm_Left_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Left := PInteger(Params^[1])^;
end;

procedure _LapeForm_Height_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.Height;
end;

procedure _LapeForm_Height_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Height := PInteger(Params^[1])^;
end;

procedure _LapeForm_Top_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.Top;
end;

procedure _LapeForm_Top_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Top := PInteger(Params^[1])^;
end;

procedure _LapeForm_Width_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PInteger(Result)^ := PForm(Params^[0])^.Width;
end;

procedure _LapeForm_Width_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Width := PInteger(Params^[1])^;
end;

procedure _LapeForm_Caption_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PString(Result)^ := PForm(Params^[0])^.Caption;
end;

procedure _LapeForm_Caption_Write(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PForm(Params^[0])^.Caption := PString(Params^[1])^;
end;

procedure _LapeCustomForm_Position_Read(const Params: PParamArray; const Result: Pointer); LAPE_WRAPPER_CALLING_CONV
begin
PPosition(Result)^ := PCustomForm(Params^[0])^.Position;
Expand Down Expand Up @@ -1079,7 +990,6 @@ procedure ImportLCLForm(Compiler: TSimbaScript_Compiler);
addGlobalFunc('procedure TLazCustomForm.SetRestoredBounds(ALeft, ATop, AWidth, AHeight: Integer);', @_LapeCustomForm_SetRestoredBounds);
addGlobalFunc('function TLazCustomForm.ShowModal: Integer;', @_LapeCustomForm_ShowModal);
addGlobalFunc('procedure TLazCustomForm.ShowOnTop;', @_LapeCustomForm_ShowOnTop);
addGlobalFunc('procedure TLazCustomForm.ProcessMessages; static;', @_LapeCustomForm_ProcessMessages);
addProperty('TLazCustomForm', 'BorderStyle', 'ELazFormBorderStyle', @_LapeCustomForm_Read_BorderStyle, @_LapeCustomForm_Write_BorderStyle);
addProperty('TLazCustomForm', 'BorderIcons', 'ELazFormBorderIcons', @_LapeCustomForm_Read_BorderIcons, @_LapeCustomForm_Write_BorderIcons);
addProperty('TLazCustomForm', 'Active', 'Boolean', @_LapeCustomForm_Active_Read);
Expand All @@ -1102,6 +1012,14 @@ procedure ImportLCLForm(Compiler: TSimbaScript_Compiler);

addClass('TLazForm', 'TLazCustomForm');
addClassConstructor('TLazForm', '(AOwner: TLazComponent = nil)', @_LapeForm_Create);

addGlobalType('record end;', 'LazFormThread');
addGlobalType('procedure() of object', 'TLazFormThreadMethod', FFI_DEFAULT_ABI);
addGlobalFunc('procedure LazFormThread.Run(Method: TLazFormThreadMethod); static', @_LapeFormThread_Run);
addGlobalFunc('procedure LazFormThread.Queue(Method: TLazFormThreadMethod); static', @_LapeFormThread_Queue);
addGlobalFunc('function LazFormThread.IsCurrentThread: Boolean; static', @_LapeFormThread_IsCurrentThread);
addGlobalFunc('procedure LazFormThread.ProcessMessages; static', @_LapeFormThread_ProcessMessages);

addGlobalFunc('procedure TLazForm.SaveSession(FileName: String; Things: TStringArray);', @_LapeForm_SaveSession);
addGlobalFunc('procedure TLazForm.RestoreSession(FileName: String; Things: TStringArray);', @_LapeForm_RestoreSession);

Expand Down
Loading

0 comments on commit aea0ce2

Please sign in to comment.