skia: icon

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9342 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
mgaertner 2024-04-25 09:10:00 +00:00
parent ea8eb141c2
commit 089bb3babb
10 changed files with 50 additions and 12 deletions

View File

@ -0,0 +1,3 @@
Skia.LCL.Design.res was created with:
lazarus/tools/lazres Skia.LCL.Design.res icons/*

View File

@ -7,7 +7,7 @@
<CompilerOptions> <CompilerOptions>
<Version Value="11"/> <Version Value="11"/>
<SearchPaths> <SearchPaths>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
</CompilerOptions> </CompilerOptions>
<Description Value="IDE addon to install LCL components for Skia in Lazarus, requires FPC 3.3.1+"/> <Description Value="IDE addon to install LCL components for Skia in Lazarus, requires FPC 3.3.1+"/>
@ -23,9 +23,7 @@
<RequiredPkgs> <RequiredPkgs>
<Item> <Item>
<PackageName Value="Skia.LCL"/> <PackageName Value="Skia.LCL"/>
</Item> <DefaultFilename Value="../src/skia.lcl.lpk" Prefer="True"/>
<Item>
<PackageName Value="FCL"/>
</Item> </Item>
</RequiredPkgs> </RequiredPkgs>
<UsageOptions> <UsageOptions>

View File

@ -0,0 +1,22 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit Skia.LCL.Design;
{$warn 5023 off : no warning about unused units}
interface
uses
SkiaLCLRegister, LazarusPackageIntf;
implementation
procedure Register;
begin
RegisterUnit('SkiaLCLRegister', @SkiaLCLRegister.Register);
end;
initialization
RegisterPackage('Skia.LCL.Design', @Register);
end.

Binary file not shown.

View File

@ -8,12 +8,14 @@ unit SkiaLCLRegister;
interface interface
uses uses
LCL.Skia; LCL.Skia, classes;
procedure Register; procedure Register;
implementation implementation
{$R Skia.LCL.Design.res}
procedure Register; procedure Register;
begin begin
RegisterComponents('Skia', [TSkPaintBox]); RegisterComponents('Skia', [TSkPaintBox]);

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -48,7 +48,6 @@ type
property DrawCacheKind: TSkDrawCacheKind read FDrawCacheKind write SetDrawCacheKind default TSkDrawCacheKind.Raster; property DrawCacheKind: TSkDrawCacheKind read FDrawCacheKind write SetDrawCacheKind default TSkDrawCacheKind.Raster;
property OnDraw: TSkDrawEvent read FOnDraw write SetOnDraw; property OnDraw: TSkDrawEvent read FOnDraw write SetOnDraw;
public public
class function GetControlClassDefaultSize: TSize; override;
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure Redraw; virtual; procedure Redraw; virtual;
@ -60,7 +59,10 @@ type
{ TSkPaintBox } { TSkPaintBox }
TSkPaintBox = class(TSkCustomControl) TSkPaintBox = class(TSkCustomControl)
protected
class function GetControlClassDefaultSize: TSize; override;
public public
constructor Create(AOwner: TComponent); override;
property DrawCacheKind; property DrawCacheKind;
published published
property Align; property Align;
@ -505,12 +507,6 @@ begin
inherited Resize; inherited Resize;
end; end;
class function TSkCustomControl.GetControlClassDefaultSize: TSize;
begin
Result.CX := 50;
Result.CY := 50;
end;
constructor TSkCustomControl.Create(AOwner: TComponent); constructor TSkCustomControl.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
@ -538,6 +534,22 @@ begin
inherited Invalidate; inherited Invalidate;
end; end;
{ TSkPaintBox }
class function TSkPaintBox.GetControlClassDefaultSize: TSize;
begin
Result.CX := 50;
Result.CY := 50;
end;
constructor TSkPaintBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle := ControlStyle + [csReplicatable];
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
end;
{ TSkSvgBrush } { TSkSvgBrush }
function TSkSvgBrush.GetDOM: ISkSVGDOM; function TSkSvgBrush.GetDOM: ISkSVGDOM;

View File

@ -29,6 +29,7 @@
<RequiredPkgs> <RequiredPkgs>
<Item> <Item>
<PackageName Value="Skia"/> <PackageName Value="Skia"/>
<DefaultFilename Value="../skia4d_package/Skia.lpk"/>
</Item> </Item>
<Item> <Item>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>