Changeset 60 for trunk/Packages/Kernel
- Timestamp:
- Apr 7, 2024, 11:26:09 PM (8 months ago)
- Location:
- trunk/Packages/Kernel
- Files:
-
- 1 edited
- 13 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Kernel/Kernel.API.pas
r59 r60 1 unit UAPI; 2 3 {$mode delphi} 1 unit Kernel.API; 4 2 5 3 interface 6 4 7 5 uses 8 SysUtils, UList, DateUtils, UMemory, UGraphics, UDevice, UIPC,9 UScheduler, UScreen;6 SysUtils, Kernel.List, DateUtils, Kernel.Memory, Kernel.Graphics, Kernel.Device, 7 Kernel.IPC, Kernel.Scheduler, Kernel.Screen; 10 8 11 9 type … … 80 78 81 79 uses 82 UKernel;80 Kernel.Core; 83 81 84 82 { TUserApi } -
trunk/Packages/Kernel/Kernel.App.pas
r59 r60 1 unit UApp; 2 3 {$mode delphi} 1 unit Kernel.App; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UList, UAPI, UScheduler;6 Classes, SysUtils, Kernel.List, Kernel.API, Kernel.Scheduler; 9 7 10 8 type -
trunk/Packages/Kernel/Kernel.Classes.pas
r59 r60 1 unit UClasses; 2 3 {$mode delphi} 1 unit Kernel.Classes; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, contnrs;6 Classes, SysUtils, Contnrs; 9 7 10 8 type … … 19 17 destructor Destroy; override; 20 18 end; 19 21 20 22 21 implementation … … 42 41 destructor TObjectQueue.Destroy; 43 42 begin 44 List.Free;45 inherited Destroy;43 FreeAndNil(List); 44 inherited; 46 45 end; 47 46 -
trunk/Packages/Kernel/Kernel.Core.pas
r59 r60 1 unit UKernel; 2 3 {$mode delphi}{$H+} 1 unit Kernel.Core; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UList, Contnrs, UFileSystem, UMemory, UScreen, UDevice, 9 fgl, UApp, UScheduler, UApi, UGraphics; 6 Classes, SysUtils, Kernel.List, Kernel.FileSystem, Kernel.Memory, 7 Kernel.Screen, Kernel.Device, Kernel.App, Kernel.Scheduler, Kernel.Api, 8 Kernel.Graphics, Generics.Collections; 10 9 11 10 type … … 30 29 function KernelApiExecute(Command: TApiCommand; Data: Pointer): Pointer; 31 30 public 32 Apps: TNamedObject List<TApp>;33 Drives: TNamedObject List<TDrive>;31 Apps: TNamedObjects<TApp>; 32 Drives: TNamedObjects<TDrive>; 34 33 Scheduler: TScheduler; 35 34 SchedulerClass: TSchedulerClass; 36 35 FileSystemClass: TFileSystemClass; 37 Devices: TNamedObject List<TDevice>;38 Screens: T FPGObjectList<TScreen>;36 Devices: TNamedObjects<TDevice>; 37 Screens: TObjectList<TScreen>; 39 38 Desktop: TDesktop; 40 39 procedure AppExecute(AFile: TFile); … … 46 45 end; 47 46 47 48 48 implementation 49 50 49 51 50 { TDrive } … … 53 52 constructor TDrive.Create; 54 53 begin 55 56 54 end; 57 55 58 56 destructor TDrive.Destroy; 59 57 begin 60 F ileSystem.Free;61 inherited Destroy;58 FreeAndNil(FileSystem); 59 inherited; 62 60 end; 63 61 … … 69 67 VideoDevice: TDeviceVideo; 70 68 VideoMode: TVideoMode; 71 Modes: T ObjectList;69 Modes: TVideoModes; 72 70 begin 73 71 VideoDevice := TDeviceVideo(Devices.FindByName('Video0')); 74 72 if Assigned(VideoDevice) then begin 75 73 NewScreen := TScreen.Create; 76 Modes := T ObjectList.Create;74 Modes := TVideoModes.Create; 77 75 VideoDevice.GetSupportedModes(Modes); 78 76 if Modes.Count > 0 then begin … … 158 156 constructor TKernel.Create; 159 157 begin 160 Devices := TNamedObject List<TDevice>.Create;161 Drives := TNamedObject List<TDrive>.Create;162 Apps := TNamedObject List<TApp>.Create;158 Devices := TNamedObjects<TDevice>.Create; 159 Drives := TNamedObjects<TDrive>.Create; 160 Apps := TNamedObjects<TApp>.Create; 163 161 Scheduler := TScheduler.Create; 164 Screens := T FPGObjectList<TScreen>.Create;162 Screens := TObjectList<TScreen>.Create; 165 163 Api := TKernelApi.Create; 166 164 Api.Kernel := Self; … … 178 176 FreeAndNil(Drives); 179 177 FreeAndNil(Devices); 180 inherited Destroy;178 inherited; 181 179 end; 182 180 -
trunk/Packages/Kernel/Kernel.Device.pas
r59 r60 1 unit UDevice; 2 3 {$mode delphi}{$H+} 1 unit Kernel.Device; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Contnrs, UList, UGraphics, syncobjs;6 Classes, SysUtils, Generics.Collections, Kernel.List, Kernel.Graphics, syncobjs; 9 7 10 8 type … … 27 25 end; 28 26 27 TVideoModes = class(TObjectList<TVideoMode>) 28 end; 29 29 30 { TDeviceVideo } 30 31 … … 39 40 constructor Create; override; 40 41 destructor Destroy; override; 41 procedure GetSupportedModes(Modes: T ObjectList); virtual;42 procedure GetSupportedModes(Modes: TVideoModes); virtual; 42 43 procedure VideoMemoryChange; virtual; 43 44 property VideoMode: TVideoMode read FVideoMode write SetVideoMode; … … 51 52 procedure WriteText(Text: string); virtual; 52 53 end; 54 53 55 54 56 implementation … … 83 85 constructor TDeviceSerial.Create; 84 86 begin 85 inherited Create;87 inherited; 86 88 ClassName := 'Serial device'; 87 89 end; … … 89 91 procedure TDeviceSerial.WriteText(Text: string); 90 92 begin 91 92 93 end; 93 94 … … 96 97 constructor TDevice.Create; 97 98 begin 98 inherited Create;99 inherited; 99 100 end; 100 101 … … 111 112 destructor TDeviceVideo.Destroy; 112 113 begin 113 Lock.Free;114 F VideoMode.Free;115 inherited Destroy;114 FreeAndNil(Lock); 115 FreeAndNil(FVideoMode); 116 inherited; 116 117 end; 117 118 … … 120 121 end; 121 122 122 procedure TDeviceVideo.GetSupportedModes(Modes: T ObjectList);123 procedure TDeviceVideo.GetSupportedModes(Modes: TVideoModes); 123 124 begin 124 125 Modes.Clear; … … 132 133 procedure TDeviceVideo.VideoMemoryChange; 133 134 begin 134 135 135 end; 136 136 -
trunk/Packages/Kernel/Kernel.FileSystem.pas
r59 r60 1 unit UFileSystem; 2 3 {$mode delphi} 1 unit Kernel.FileSystem; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Contnrs, UList;6 Classes, SysUtils, Kernel.List; 9 7 10 8 type … … 20 18 21 19 TDirectory = class(TFileSystemObject) 22 Items: TNamedObject List<TFileSystemObject>;20 Items: TNamedObjects<TFileSystemObject>; 23 21 constructor Create; 24 22 destructor Destroy; override; … … 34 32 35 33 TFileSystemClass = class of TFileSystem; 34 36 35 37 36 implementation … … 54 53 constructor TDirectory.Create; 55 54 begin 56 Items := TNamedObject List<TFileSystemObject>.Create;55 Items := TNamedObjects<TFileSystemObject>.Create; 57 56 end; 58 57 59 58 destructor TDirectory.Destroy; 60 59 begin 61 Items.Free;62 inherited Destroy;60 FreeAndNil(Items); 61 inherited; 63 62 end; 64 63 -
trunk/Packages/Kernel/Kernel.Graphics.pas
r59 r60 1 unit UGraphics; 2 3 {$mode delphi} 1 unit Kernel.Graphics; 4 2 5 3 interface 6 4 7 5 uses 8 SysUtils, fgl;6 SysUtils, Generics.Collections; 9 7 10 8 type … … 16 14 X: Integer; 17 15 Y: Integer; 18 function Create(X, Y: Integer): TPoint; inline;16 class function Create(X, Y: Integer): TPoint; inline; static; 19 17 function Add(P: TPoint): TPoint; 20 18 end; … … 36 34 Size: TPoint; 37 35 function PointInside(P: TPoint): Boolean; 38 function Create(Left, Top, Width, Height: Integer): TRectangle; overload; inline;39 function Create(Position, Size: TPoint): TRectangle; overload; inline;36 class function Create(Left, Top, Width, Height: Integer): TRectangle; overload; inline; static; 37 class function Create(Position, Size: TPoint): TRectangle; overload; inline; static; 40 38 function AddPoint(P: TPoint): TRectangle; 41 39 property Left: Integer read GetLeft write SetLeft; … … 88 86 89 87 TRaster = class(TGraphicObject) 90 91 88 end; 92 89 93 90 TFont = class(TGraphicObject) 94 95 91 end; 96 92 … … 102 98 CanvasLastId: Integer; 103 99 public 104 Objects: T FPGObjectList<TGraphicObject>;105 Canvases: T FPGObjectList<TCanvas>;100 Objects: TObjectList<TGraphicObject>; 101 Canvases: TObjectList<TCanvas>; 106 102 ParentCanvas: TCanvas; 107 103 function CreateWindow: TWindow; … … 114 110 end; 115 111 112 116 113 implementation 117 114 … … 164 161 end; 165 162 166 function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle;163 class function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle; 167 164 begin 168 165 Result.Position.X := Left; … … 172 169 end; 173 170 174 function TRectangle.Create(Position, Size: TPoint): TRectangle;171 class function TRectangle.Create(Position, Size: TPoint): TRectangle; 175 172 begin 176 173 Result.Position := Position; … … 186 183 { TPoint } 187 184 188 function TPoint.Create(X, Y: Integer): TPoint;185 class function TPoint.Create(X, Y: Integer): TPoint; 189 186 begin 190 187 Result.X := X; … … 263 260 destructor TWindow.Destroy; 264 261 begin 265 inherited Destroy;262 inherited; 266 263 end; 267 264 … … 317 314 constructor TDesktop.Create; 318 315 begin 319 Objects := T FPGObjectList<TGraphicObject>.Create;320 Canvases := T FPGObjectList<TCanvas>.Create;316 Objects := TObjectList<TGraphicObject>.Create; 317 Canvases := TObjectList<TCanvas>.Create; 321 318 end; 322 319 … … 325 322 FreeAndNil(Canvases); 326 323 FreeAndNil(Objects); 327 inherited Destroy;324 inherited; 328 325 end; 329 326 -
trunk/Packages/Kernel/Kernel.IPC.pas
r59 r60 1 unit UIPC; 2 3 {$mode objfpc}{$H+} 1 unit Kernel.IPC; 4 2 5 3 interface … … 17 15 implementation 18 16 19 20 21 17 end. 22 18 -
trunk/Packages/Kernel/Kernel.List.pas
r59 r60 1 unit UList; 2 3 {$mode delphi} 1 unit Kernel.List; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Contnrs, fgl;6 Classes, SysUtils, Generics.Collections; 9 7 10 8 type … … 16 14 end; 17 15 18 { TNamedObject List}16 { TNamedObjects } 19 17 20 TNamedObject List<T> = class(TFPGObjectList<T>)18 TNamedObjects<T: class> = class(TObjectList<T>) 21 19 function FindByName(Name: string): T; 22 20 end; … … 25 23 implementation 26 24 27 { TNamedObject List}25 { TNamedObjects } 28 26 29 function TNamedObject List<T>.FindByName(Name: string): T;27 function TNamedObjects<T>.FindByName(Name: string): T; 30 28 var 31 29 I: Integer; … … 37 35 end; 38 36 39 40 37 end. 41 38 -
trunk/Packages/Kernel/Kernel.Memory.pas
r59 r60 1 unit UMemory; 2 3 {$mode delphi} 1 unit Kernel.Memory; 4 2 5 3 interface -
trunk/Packages/Kernel/Kernel.Scheduler.pas
r59 r60 1 unit UScheduler; 2 3 {$mode delphi}{$H+} 1 unit Kernel.Scheduler; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UList, UClasses;6 Classes, SysUtils, Kernel.List, Kernel.Classes; 9 7 10 8 type 11 9 TTask = class; 12 10 TScheduler = class; 13 11 … … 40 38 TScheduler = class 41 39 TaskClass: TTaskClass; 42 Tasks: TNamedObject List<TTask>;40 Tasks: TNamedObjects<TTask>; 43 41 Running: Boolean; 44 42 function GetCurrentTask: TTask; virtual; … … 80 78 destructor TTask.Destroy; 81 79 begin 82 Messages.Free;83 inherited Destroy;80 FreeAndNil(Messages); 81 inherited; 84 82 end; 85 83 … … 121 119 begin 122 120 TaskClass := TTask; 123 Tasks := TNamedObject List<TTask>.Create;121 Tasks := TNamedObjects<TTask>.Create; 124 122 end; 125 123 -
trunk/Packages/Kernel/Kernel.Screen.pas
r59 r60 1 unit UScreen; 2 3 {$mode delphi}{$H+} 1 unit Kernel.Screen; 4 2 5 3 interface 6 4 7 5 uses 8 SysUtils, Math, UGraphics;6 SysUtils, Math, Kernel.Graphics; 9 7 10 8 type … … 44 42 end; 45 43 44 46 45 implementation 47 46 48 47 uses 49 UDevice;48 Kernel.Device; 50 49 51 50 { TScreenCanvas } -
trunk/Packages/Kernel/Kernel.lpk
r13 r60 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <Name Value="Kernel"/> 5 5 <Type Value="RunAndDesignTime"/> … … 24 24 </Other> 25 25 </CompilerOptions> 26 <Files Count="1 2">26 <Files Count="13"> 27 27 <Item1> 28 <Filename Value=" UAPI.pas"/>29 <UnitName Value=" UAPI"/>28 <Filename Value="Kernel.API.pas"/> 29 <UnitName Value="Kernel.API"/> 30 30 </Item1> 31 31 <Item2> 32 <Filename Value=" UApp.pas"/>33 <UnitName Value=" UApp"/>32 <Filename Value="Kernel.App.pas"/> 33 <UnitName Value="Kernel.App"/> 34 34 </Item2> 35 35 <Item3> 36 <Filename Value=" UClasses.pas"/>37 <UnitName Value=" UClasses"/>36 <Filename Value="Kernel.Classes.pas"/> 37 <UnitName Value="Kernel.Classes"/> 38 38 </Item3> 39 39 <Item4> 40 <Filename Value=" UFileSystem.pas"/>41 <UnitName Value=" UFileSystem"/>40 <Filename Value="Kernel.FileSystem.pas"/> 41 <UnitName Value="Kernel.FileSystem"/> 42 42 </Item4> 43 43 <Item5> 44 <Filename Value=" UGraphics.pas"/>45 <UnitName Value=" UGraphics"/>44 <Filename Value="Kernel.Graphics.pas"/> 45 <UnitName Value="Kernel.Graphics"/> 46 46 </Item5> 47 47 <Item6> 48 <Filename Value=" UKernel.pas"/>49 <UnitName Value=" UKernel"/>48 <Filename Value="Kernel.Core.pas"/> 49 <UnitName Value="Kernel.Core"/> 50 50 </Item6> 51 51 <Item7> 52 <Filename Value=" UList.pas"/>53 <UnitName Value=" UList"/>52 <Filename Value="Kernel.List.pas"/> 53 <UnitName Value="Kernel.List"/> 54 54 </Item7> 55 55 <Item8> 56 <Filename Value=" UMemory.pas"/>57 <UnitName Value=" UMemory"/>56 <Filename Value="Kernel.Memory.pas"/> 57 <UnitName Value="Kernel.Memory"/> 58 58 </Item8> 59 59 <Item9> 60 <Filename Value=" UDevice.pas"/>61 <UnitName Value=" UDevice"/>60 <Filename Value="Kernel.Device.pas"/> 61 <UnitName Value="Kernel.Device"/> 62 62 </Item9> 63 63 <Item10> 64 <Filename Value=" UScreen.pas"/>65 <UnitName Value=" UScreen"/>64 <Filename Value="Kernel.Screen.pas"/> 65 <UnitName Value="Kernel.Screen"/> 66 66 </Item10> 67 67 <Item11> 68 <Filename Value=" UIPC.pas"/>69 <UnitName Value=" UIPC"/>68 <Filename Value="Kernel.IPC.pas"/> 69 <UnitName Value="Kernel.IPC"/> 70 70 </Item11> 71 71 <Item12> 72 <Filename Value=" UScheduler.pas"/>73 <UnitName Value=" UScheduler"/>72 <Filename Value="Kernel.Scheduler.pas"/> 73 <UnitName Value="Kernel.Scheduler"/> 74 74 </Item12> 75 <Item13> 76 <Filename Value="KernelPackage.pas"/> 77 <Type Value="Main Unit"/> 78 <UnitName Value="KernelPackage"/> 79 </Item13> 75 80 </Files> 81 <CompatibilityMode Value="True"/> 76 82 <RequiredPkgs Count="1"> 77 83 <Item1> -
trunk/Packages/Kernel/KernelPackage.pas
r59 r60 3 3 } 4 4 5 unit Kernel ;5 unit KernelPackage; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9 9 10 uses 10 UAPI, UApp, UClasses, UFileSystem, UGraphics, UKernel, UList, UMemory, 11 UDevice, UScreen, UIPC, UScheduler, LazarusPackageIntf; 11 Kernel.API, Kernel.App, Kernel.Classes, Kernel.FileSystem, Kernel.Graphics, 12 Kernel.Core, Kernel.List, Kernel.Memory, Kernel.Device, Kernel.Screen, 13 Kernel.IPC, Kernel.Scheduler, LazarusPackageIntf; 12 14 13 15 implementation
Note:
See TracChangeset
for help on using the changeset viewer.