Changeset 60 for trunk/Packages/Kernel


Ignore:
Timestamp:
Apr 7, 2024, 11:26:09 PM (8 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
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}
     1unit Kernel.API;
    42
    53interface
    64
    75uses
    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;
    108
    119type
     
    8078
    8179uses
    82   UKernel;
     80  Kernel.Core;
    8381
    8482{ TUserApi }
  • trunk/Packages/Kernel/Kernel.App.pas

    r59 r60  
    1 unit UApp;
    2 
    3 {$mode delphi}
     1unit Kernel.App;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, UList, UAPI, UScheduler;
     6  Classes, SysUtils, Kernel.List, Kernel.API, Kernel.Scheduler;
    97
    108type
  • trunk/Packages/Kernel/Kernel.Classes.pas

    r59 r60  
    1 unit UClasses;
    2 
    3 {$mode delphi}
     1unit Kernel.Classes;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, contnrs;
     6  Classes, SysUtils, Contnrs;
    97
    108type
     
    1917    destructor Destroy; override;
    2018  end;
     19
    2120
    2221implementation
     
    4241destructor TObjectQueue.Destroy;
    4342begin
    44   List.Free;
    45   inherited Destroy;
     43  FreeAndNil(List);
     44  inherited;
    4645end;
    4746
  • trunk/Packages/Kernel/Kernel.Core.pas

    r59 r60  
    1 unit UKernel;
    2 
    3 {$mode delphi}{$H+}
     1unit Kernel.Core;
    42
    53interface
    64
    75uses
    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;
    109
    1110type
     
    3029    function KernelApiExecute(Command: TApiCommand; Data: Pointer): Pointer;
    3130  public
    32     Apps: TNamedObjectList<TApp>;
    33     Drives: TNamedObjectList<TDrive>;
     31    Apps: TNamedObjects<TApp>;
     32    Drives: TNamedObjects<TDrive>;
    3433    Scheduler: TScheduler;
    3534    SchedulerClass: TSchedulerClass;
    3635    FileSystemClass: TFileSystemClass;
    37     Devices: TNamedObjectList<TDevice>;
    38     Screens: TFPGObjectList<TScreen>;
     36    Devices: TNamedObjects<TDevice>;
     37    Screens: TObjectList<TScreen>;
    3938    Desktop: TDesktop;
    4039    procedure AppExecute(AFile: TFile);
     
    4645  end;
    4746
     47
    4848implementation
    49 
    5049
    5150{ TDrive }
     
    5352constructor TDrive.Create;
    5453begin
    55 
    5654end;
    5755
    5856destructor TDrive.Destroy;
    5957begin
    60   FileSystem.Free;
    61   inherited Destroy;
     58  FreeAndNil(FileSystem);
     59  inherited;
    6260end;
    6361
     
    6967  VideoDevice: TDeviceVideo;
    7068  VideoMode: TVideoMode;
    71   Modes: TObjectList;
     69  Modes: TVideoModes;
    7270begin
    7371  VideoDevice := TDeviceVideo(Devices.FindByName('Video0'));
    7472  if Assigned(VideoDevice) then begin
    7573    NewScreen := TScreen.Create;
    76     Modes := TObjectList.Create;
     74    Modes := TVideoModes.Create;
    7775    VideoDevice.GetSupportedModes(Modes);
    7876    if Modes.Count > 0 then begin
     
    158156constructor TKernel.Create;
    159157begin
    160   Devices := TNamedObjectList<TDevice>.Create;
    161   Drives := TNamedObjectList<TDrive>.Create;
    162   Apps := TNamedObjectList<TApp>.Create;
     158  Devices := TNamedObjects<TDevice>.Create;
     159  Drives := TNamedObjects<TDrive>.Create;
     160  Apps := TNamedObjects<TApp>.Create;
    163161  Scheduler := TScheduler.Create;
    164   Screens := TFPGObjectList<TScreen>.Create;
     162  Screens := TObjectList<TScreen>.Create;
    165163  Api := TKernelApi.Create;
    166164  Api.Kernel := Self;
     
    178176  FreeAndNil(Drives);
    179177  FreeAndNil(Devices);
    180   inherited Destroy;
     178  inherited;
    181179end;
    182180
  • trunk/Packages/Kernel/Kernel.Device.pas

    r59 r60  
    1 unit UDevice;
    2 
    3 {$mode delphi}{$H+}
     1unit Kernel.Device;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs, UList, UGraphics, syncobjs;
     6  Classes, SysUtils, Generics.Collections, Kernel.List, Kernel.Graphics, syncobjs;
    97
    108type
     
    2725  end;
    2826
     27  TVideoModes = class(TObjectList<TVideoMode>)
     28  end;
     29
    2930  { TDeviceVideo }
    3031
     
    3940    constructor Create; override;
    4041    destructor Destroy; override;
    41     procedure GetSupportedModes(Modes: TObjectList); virtual;
     42    procedure GetSupportedModes(Modes: TVideoModes); virtual;
    4243    procedure VideoMemoryChange; virtual;
    4344    property VideoMode: TVideoMode read FVideoMode write SetVideoMode;
     
    5152    procedure WriteText(Text: string); virtual;
    5253  end;
     54
    5355
    5456implementation
     
    8385constructor TDeviceSerial.Create;
    8486begin
    85   inherited Create;
     87  inherited;
    8688  ClassName := 'Serial device';
    8789end;
     
    8991procedure TDeviceSerial.WriteText(Text: string);
    9092begin
    91 
    9293end;
    9394
     
    9697constructor TDevice.Create;
    9798begin
    98   inherited Create;
     99  inherited;
    99100end;
    100101
     
    111112destructor TDeviceVideo.Destroy;
    112113begin
    113   Lock.Free;
    114   FVideoMode.Free;
    115   inherited Destroy;
     114  FreeAndNil(Lock);
     115  FreeAndNil(FVideoMode);
     116  inherited;
    116117end;
    117118
     
    120121end;
    121122
    122 procedure TDeviceVideo.GetSupportedModes(Modes: TObjectList);
     123procedure TDeviceVideo.GetSupportedModes(Modes: TVideoModes);
    123124begin
    124125  Modes.Clear;
     
    132133procedure TDeviceVideo.VideoMemoryChange;
    133134begin
    134 
    135135end;
    136136
  • trunk/Packages/Kernel/Kernel.FileSystem.pas

    r59 r60  
    1 unit UFileSystem;
    2 
    3 {$mode delphi}
     1unit Kernel.FileSystem;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs, UList;
     6  Classes, SysUtils, Kernel.List;
    97
    108type
     
    2018
    2119  TDirectory = class(TFileSystemObject)
    22     Items: TNamedObjectList<TFileSystemObject>;
     20    Items: TNamedObjects<TFileSystemObject>;
    2321    constructor Create;
    2422    destructor Destroy; override;
     
    3432
    3533  TFileSystemClass = class of TFileSystem;
     34
    3635
    3736implementation
     
    5453constructor TDirectory.Create;
    5554begin
    56   Items := TNamedObjectList<TFileSystemObject>.Create;
     55  Items := TNamedObjects<TFileSystemObject>.Create;
    5756end;
    5857
    5958destructor TDirectory.Destroy;
    6059begin
    61   Items.Free;
    62   inherited Destroy;
     60  FreeAndNil(Items);
     61  inherited;
    6362end;
    6463
  • trunk/Packages/Kernel/Kernel.Graphics.pas

    r59 r60  
    1 unit UGraphics;
    2 
    3 {$mode delphi}
     1unit Kernel.Graphics;
    42
    53interface
    64
    75uses
    8   SysUtils, fgl;
     6  SysUtils, Generics.Collections;
    97
    108type
     
    1614    X: Integer;
    1715    Y: Integer;
    18     function Create(X, Y: Integer): TPoint; inline;
     16    class function Create(X, Y: Integer): TPoint; inline; static;
    1917    function Add(P: TPoint): TPoint;
    2018  end;
     
    3634    Size: TPoint;
    3735    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;
    4038    function AddPoint(P: TPoint): TRectangle;
    4139    property Left: Integer read GetLeft write SetLeft;
     
    8886
    8987  TRaster = class(TGraphicObject)
    90 
    9188  end;
    9289
    9390  TFont = class(TGraphicObject)
    94 
    9591  end;
    9692
     
    10298    CanvasLastId: Integer;
    10399  public
    104     Objects: TFPGObjectList<TGraphicObject>;
    105     Canvases: TFPGObjectList<TCanvas>;
     100    Objects: TObjectList<TGraphicObject>;
     101    Canvases: TObjectList<TCanvas>;
    106102    ParentCanvas: TCanvas;
    107103    function CreateWindow: TWindow;
     
    114110  end;
    115111
     112
    116113implementation
    117114
     
    164161end;
    165162
    166 function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle;
     163class function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle;
    167164begin
    168165  Result.Position.X := Left;
     
    172169end;
    173170
    174 function TRectangle.Create(Position, Size: TPoint): TRectangle;
     171class function TRectangle.Create(Position, Size: TPoint): TRectangle;
    175172begin
    176173  Result.Position := Position;
     
    186183{ TPoint }
    187184
    188 function TPoint.Create(X, Y: Integer): TPoint;
     185class function TPoint.Create(X, Y: Integer): TPoint;
    189186begin
    190187  Result.X := X;
     
    263260destructor TWindow.Destroy;
    264261begin
    265   inherited Destroy;
     262  inherited;
    266263end;
    267264
     
    317314constructor TDesktop.Create;
    318315begin
    319   Objects := TFPGObjectList<TGraphicObject>.Create;
    320   Canvases := TFPGObjectList<TCanvas>.Create;
     316  Objects := TObjectList<TGraphicObject>.Create;
     317  Canvases := TObjectList<TCanvas>.Create;
    321318end;
    322319
     
    325322  FreeAndNil(Canvases);
    326323  FreeAndNil(Objects);
    327   inherited Destroy;
     324  inherited;
    328325end;
    329326
  • trunk/Packages/Kernel/Kernel.IPC.pas

    r59 r60  
    1 unit UIPC;
    2 
    3 {$mode objfpc}{$H+}
     1unit Kernel.IPC;
    42
    53interface
     
    1715implementation
    1816
    19 
    20 
    2117end.
    2218
  • trunk/Packages/Kernel/Kernel.List.pas

    r59 r60  
    1 unit UList;
    2 
    3 {$mode delphi}
     1unit Kernel.List;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs, fgl;
     6  Classes, SysUtils, Generics.Collections;
    97
    108type
     
    1614  end;
    1715
    18   { TNamedObjectList }
     16  { TNamedObjects }
    1917
    20   TNamedObjectList<T> = class(TFPGObjectList<T>)
     18  TNamedObjects<T: class> = class(TObjectList<T>)
    2119    function FindByName(Name: string): T;
    2220  end;
     
    2523implementation
    2624
    27 { TNamedObjectList }
     25{ TNamedObjects }
    2826
    29 function TNamedObjectList<T>.FindByName(Name: string): T;
     27function TNamedObjects<T>.FindByName(Name: string): T;
    3028var
    3129  I: Integer;
     
    3735end;
    3836
    39 
    4037end.
    4138
  • trunk/Packages/Kernel/Kernel.Memory.pas

    r59 r60  
    1 unit UMemory;
    2 
    3 {$mode delphi}
     1unit Kernel.Memory;
    42
    53interface
  • trunk/Packages/Kernel/Kernel.Scheduler.pas

    r59 r60  
    1 unit UScheduler;
    2 
    3 {$mode delphi}{$H+}
     1unit Kernel.Scheduler;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, UList, UClasses;
     6  Classes, SysUtils, Kernel.List, Kernel.Classes;
    97
    108type
    11     TTask = class;
     9  TTask = class;
    1210  TScheduler = class;
    1311
     
    4038  TScheduler = class
    4139    TaskClass: TTaskClass;
    42     Tasks: TNamedObjectList<TTask>;
     40    Tasks: TNamedObjects<TTask>;
    4341    Running: Boolean;
    4442    function GetCurrentTask: TTask; virtual;
     
    8078destructor TTask.Destroy;
    8179begin
    82   Messages.Free;
    83   inherited Destroy;
     80  FreeAndNil(Messages);
     81  inherited;
    8482end;
    8583
     
    121119begin
    122120  TaskClass := TTask;
    123   Tasks := TNamedObjectList<TTask>.Create;
     121  Tasks := TNamedObjects<TTask>.Create;
    124122end;
    125123
  • trunk/Packages/Kernel/Kernel.Screen.pas

    r59 r60  
    1 unit UScreen;
    2 
    3 {$mode delphi}{$H+}
     1unit Kernel.Screen;
    42
    53interface
    64
    75uses
    8   SysUtils, Math, UGraphics;
     6  SysUtils, Math, Kernel.Graphics;
    97
    108type
     
    4442  end;
    4543
     44
    4645implementation
    4746
    4847uses
    49   UDevice;
     48  Kernel.Device;
    5049
    5150{ TScreenCanvas }
  • trunk/Packages/Kernel/Kernel.lpk

    r13 r60  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    3   <Package Version="4">
     3  <Package Version="5">
    44    <Name Value="Kernel"/>
    55    <Type Value="RunAndDesignTime"/>
     
    2424      </Other>
    2525    </CompilerOptions>
    26     <Files Count="12">
     26    <Files Count="13">
    2727      <Item1>
    28         <Filename Value="UAPI.pas"/>
    29         <UnitName Value="UAPI"/>
     28        <Filename Value="Kernel.API.pas"/>
     29        <UnitName Value="Kernel.API"/>
    3030      </Item1>
    3131      <Item2>
    32         <Filename Value="UApp.pas"/>
    33         <UnitName Value="UApp"/>
     32        <Filename Value="Kernel.App.pas"/>
     33        <UnitName Value="Kernel.App"/>
    3434      </Item2>
    3535      <Item3>
    36         <Filename Value="UClasses.pas"/>
    37         <UnitName Value="UClasses"/>
     36        <Filename Value="Kernel.Classes.pas"/>
     37        <UnitName Value="Kernel.Classes"/>
    3838      </Item3>
    3939      <Item4>
    40         <Filename Value="UFileSystem.pas"/>
    41         <UnitName Value="UFileSystem"/>
     40        <Filename Value="Kernel.FileSystem.pas"/>
     41        <UnitName Value="Kernel.FileSystem"/>
    4242      </Item4>
    4343      <Item5>
    44         <Filename Value="UGraphics.pas"/>
    45         <UnitName Value="UGraphics"/>
     44        <Filename Value="Kernel.Graphics.pas"/>
     45        <UnitName Value="Kernel.Graphics"/>
    4646      </Item5>
    4747      <Item6>
    48         <Filename Value="UKernel.pas"/>
    49         <UnitName Value="UKernel"/>
     48        <Filename Value="Kernel.Core.pas"/>
     49        <UnitName Value="Kernel.Core"/>
    5050      </Item6>
    5151      <Item7>
    52         <Filename Value="UList.pas"/>
    53         <UnitName Value="UList"/>
     52        <Filename Value="Kernel.List.pas"/>
     53        <UnitName Value="Kernel.List"/>
    5454      </Item7>
    5555      <Item8>
    56         <Filename Value="UMemory.pas"/>
    57         <UnitName Value="UMemory"/>
     56        <Filename Value="Kernel.Memory.pas"/>
     57        <UnitName Value="Kernel.Memory"/>
    5858      </Item8>
    5959      <Item9>
    60         <Filename Value="UDevice.pas"/>
    61         <UnitName Value="UDevice"/>
     60        <Filename Value="Kernel.Device.pas"/>
     61        <UnitName Value="Kernel.Device"/>
    6262      </Item9>
    6363      <Item10>
    64         <Filename Value="UScreen.pas"/>
    65         <UnitName Value="UScreen"/>
     64        <Filename Value="Kernel.Screen.pas"/>
     65        <UnitName Value="Kernel.Screen"/>
    6666      </Item10>
    6767      <Item11>
    68         <Filename Value="UIPC.pas"/>
    69         <UnitName Value="UIPC"/>
     68        <Filename Value="Kernel.IPC.pas"/>
     69        <UnitName Value="Kernel.IPC"/>
    7070      </Item11>
    7171      <Item12>
    72         <Filename Value="UScheduler.pas"/>
    73         <UnitName Value="UScheduler"/>
     72        <Filename Value="Kernel.Scheduler.pas"/>
     73        <UnitName Value="Kernel.Scheduler"/>
    7474      </Item12>
     75      <Item13>
     76        <Filename Value="KernelPackage.pas"/>
     77        <Type Value="Main Unit"/>
     78        <UnitName Value="KernelPackage"/>
     79      </Item13>
    7580    </Files>
     81    <CompatibilityMode Value="True"/>
    7682    <RequiredPkgs Count="1">
    7783      <Item1>
  • trunk/Packages/Kernel/KernelPackage.pas

    r59 r60  
    33 }
    44
    5 unit Kernel;
     5unit KernelPackage;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
    910uses
    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;
    1214
    1315implementation
Note: See TracChangeset for help on using the changeset viewer.