diff -Nru lazfuck-1.0.0/debian/bzr-builder.manifest lazfuck-1.0.0/debian/bzr-builder.manifest --- lazfuck-1.0.0/debian/bzr-builder.manifest 2019-05-07 11:17:03.000000000 +0000 +++ lazfuck-1.0.0/debian/bzr-builder.manifest 2019-05-12 23:46:39.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~108 -lp:lazfuck revid:svn-v4:8f951928-150e-425b-8e1e-bdb2ea7c2867:trunk:110 +# bzr-builder format 0.3 deb-version {debupstream}-0~109 +lp:lazfuck revid:svn-v4:8f951928-150e-425b-8e1e-bdb2ea7c2867:trunk:111 nest packaging lp:~chronoscz/lazfuck/debian-packaging debian revid:svn-v4:8f951928-150e-425b-8e1e-bdb2ea7c2867:trunk/Install/deb/debian:100 diff -Nru lazfuck-1.0.0/debian/changelog lazfuck-1.0.0/debian/changelog --- lazfuck-1.0.0/debian/changelog 2019-05-07 11:17:03.000000000 +0000 +++ lazfuck-1.0.0/debian/changelog 2019-05-12 23:46:39.000000000 +0000 @@ -1,8 +1,8 @@ -lazfuck (1.0.0-0~108~ubuntu19.10.1) eoan; urgency=low +lazfuck (1.0.0-0~109~ubuntu19.10.1) eoan; urgency=low * Auto build. - -- Jiří Hajda Tue, 07 May 2019 11:17:03 +0000 + -- Jiří Hajda Sun, 12 May 2019 23:46:39 +0000 lazfuck (1.0.0-0) precise; urgency=low diff -Nru lazfuck-1.0.0/Languages/LazFuck.cs.po lazfuck-1.0.0/Languages/LazFuck.cs.po --- lazfuck-1.0.0/Languages/LazFuck.cs.po 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Languages/LazFuck.cs.po 2019-05-12 23:46:39.000000000 +0000 @@ -646,3 +646,4 @@ #: utargetinterpretter.sunsupportedcommand msgid "Unsupported command" msgstr "Nepodporovaný příkaz" + diff -Nru lazfuck-1.0.0/LazFuck.lpi lazfuck-1.0.0/LazFuck.lpi --- lazfuck-1.0.0/LazFuck.lpi 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/LazFuck.lpi 2019-05-12 23:46:39.000000000 +0000 @@ -74,7 +74,7 @@ - + @@ -83,19 +83,15 @@ - - - - + + + - - - - + diff -Nru lazfuck-1.0.0/LazFuck.lpr lazfuck-1.0.0/LazFuck.lpr --- lazfuck-1.0.0/LazFuck.lpr 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/LazFuck.lpr 2019-05-12 23:46:39.000000000 +0000 @@ -11,7 +11,7 @@ Forms, UTarget, UTargetC, UTargetDelphi, UTargetInterpretter, UTargetPHP, UTargetJava, UTargetFPC, UFormCPU, UFormMain, UFormOptions, UFormTargets, UFormOutput, UFormInput, UFormMemory, UFormMessages, UFormSourceCode, - UFormTargetCode, UFormTargetOptions, UCore, Common, TemplateGenerics, + UFormTargetCode, UFormTargetOptions, UCore, Common, CoolTranslator, UFormLog, UProject, UBFTarget, SysUtils; {$R *.res} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Additional/UBinarySerializer.pas lazfuck-1.0.0/Packages/TemplateGenerics/Additional/UBinarySerializer.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Additional/UBinarySerializer.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Additional/UBinarySerializer.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -unit UBinarySerializer; - -{$mode delphi}{$H+} - -interface - -uses - Classes, SysUtils, DateUtils, SpecializedList, SpecializedStream; - -type - TEndianness = (enBig, enLittle); - - { TBinarySerializer } - - TBinarySerializer = class - private - FGrow: Boolean; - FList: TListByte; - FEndianness: TEndianness; - SwapData: Boolean; - procedure SetList(const AValue: TListByte); - procedure SetEndianness(const AValue: TEndianness); - procedure ReverseByteOrder(var Buffer; Count: Integer); - public - Position: Integer; - OwnsList: Boolean; - procedure Write(var Buffer; Count: Integer); //inline; - procedure Read(var Buffer; Count: Integer); //inline; - - procedure Assign(Source: TBinarySerializer); - procedure WriteByte(Data: Byte); - procedure WriteWord(Data: Word); - procedure WriteCardinal(Data: Cardinal); - procedure WriteInt64(Data: Int64); - procedure WriteString(Data: string); - procedure WriteShortString(Data: ShortString); - procedure WriteAnsiString(Data: string); - procedure WriteUnixTime(Data: TDateTime); - procedure WriteDouble(Value: Double); - procedure WriteSingle(Value: Single); - procedure WriteStream(AStream: TStreamByte; Count: Integer); - procedure WriteStreamPart(AStream: TStreamByte; Count: Integer); - procedure WriteList(List: TListByte; StartIndex, Count: Integer); - function ReadByte: Byte; - function ReadWord: Word; - function ReadCardinal: Cardinal; - function ReadInt64: Int64; - function ReadString(Length: Integer): string; - function ReadShortString: string; - function ReadAnsiString: string; - function ReadStringTerminated(Terminator: string = #0): string; - function ReadUnixTime: TDateTime; - function ReadDouble: Double; - function ReadSingle: Single; - procedure ReadStream(AStream: TStream; Count: Integer); - procedure ReadStreamPart(AStream: TStream; Count: Integer); - procedure ReadList(List: TListByte; StartIndex, Count: Integer); - constructor Create; overload; - procedure Clear; - destructor Destroy; override; - property Endianness: TEndianness read FEndianness write SetEndianness; - property List: TListByte read FList write SetList; - property Grow: Boolean read FGrow write FGrow; - end; - - -implementation - -{ TBinarySerializer } - -function TBinarySerializer.ReadAnsiString: string; -var - StringLength: Longint; -begin - StringLength := 0; - Read(StringLength, SizeOf(StringLength)); - Result := ReadString(StringLength); -end; - -function TBinarySerializer.ReadStringTerminated(Terminator: string = #0): string; -var - Data: Char; - I: Integer; - OldPosition: Integer; -begin - OldPosition := Position; - Result := ''; - I := 1; - repeat - if Position >= FList.Count then Break; - Data := Chr(ReadByte); - if Data <> Terminator[I] then begin - Result := Result + Data; - I := 1; - end else Inc(I); - until I > Length(Terminator); - if not (I > Length(Terminator)) then begin - Result := ''; - Position := OldPosition; - end; -end; - -function TBinarySerializer.ReadByte: Byte; -begin - Result := 0; - Read(Result, SizeOf(Byte)); -end; - -function TBinarySerializer.ReadCardinal: Cardinal; -begin - Result := 0; - Read(Result, SizeOf(Cardinal)); - if SwapData then Result := SwapEndian(Result); -end; - -function TBinarySerializer.ReadInt64: Int64; -begin - Result := 0; - Read(Result, SizeOf(Int64)); - if SwapData then Result := SwapEndian(Result); -end; - -function TBinarySerializer.ReadString(Length: Integer): string; -begin - if Length > 0 then begin - SetLength(Result, Length); - Read(Result[1], Length); - end else Result := ''; -end; - -function TBinarySerializer.ReadShortString: string; -var - Count: Byte; -begin - Count := 0; - Read(Count, 1); - Result := ReadString(Count); -end; - -procedure TBinarySerializer.ReadStream(AStream: TStream; Count: Integer); -var - Buffer: array of Byte; -begin - if Count > 0 then begin - SetLength(Buffer, Count); - Read(Buffer[0], Count); - AStream.Size := Count; - AStream.Position := 0; - AStream.Write(Buffer[0], Count); - end; -end; - -procedure TBinarySerializer.ReadStreamPart(AStream: TStream; Count: Integer); -var - Buffer: array of Byte; -begin - if Count > 0 then begin - SetLength(Buffer, Count); - Read(Buffer[0], Count); - if AStream.Size < (AStream.Position + Count) then - AStream.Size := AStream.Position + Count; - Write(Buffer[0], Count); - end; -end; - -procedure TBinarySerializer.ReadList(List: TListByte; StartIndex, Count: Integer - ); -var - Buffer: array of Byte; -begin - if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size - if Count > 0 then begin - SetLength(Buffer, Count); - Read(Pointer(Buffer)^, Count); - List.ReplaceBuffer(StartIndex, Pointer(Buffer)^, Count); - end; -end; - -procedure TBinarySerializer.WriteStreamPart(AStream: TStreamByte; Count: Integer); -var - Buffer: array of Byte; -begin - if Count > AStream.Size then Count := AStream.Size; // Limit max. stream size - if Count > 0 then begin - SetLength(Buffer, Count); - AStream.ReadBuffer(Pointer(Buffer)^, Count); - Write(Pointer(Buffer)^, Count); - end; -end; - -procedure TBinarySerializer.WriteList(List: TListByte; StartIndex, Count: Integer); -var - Buffer: array of Byte; -begin -// if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size - if Count > 0 then begin - SetLength(Buffer, Count); - List.GetBuffer(StartIndex, PByte(Buffer)^, Count); - Write(Pointer(Buffer)^, Count); - end; -end; - -constructor TBinarySerializer.Create; -begin - inherited; - Endianness := enLittle; - FList := nil; - FGrow := True; -end; - -procedure TBinarySerializer.Clear; -begin - FList.Count := 0; - Position := 0; -end; - -destructor TBinarySerializer.Destroy; -begin - if OwnsList then FList.Free; - inherited Destroy; -end; - -function TBinarySerializer.ReadUnixTime: TDateTime; -begin - Result := UnixToDateTime(ReadCardinal); -end; - -function TBinarySerializer.ReadDouble: Double; -begin - Result := 0; - Read(Result, SizeOf(Double)); -end; - -function TBinarySerializer.ReadSingle: Single; -begin - Result := 0; - Read(Result, SizeOf(Single)); -end; - -function TBinarySerializer.ReadWord: Word; -begin - Result := 0; - Read(Result, SizeOf(Word)); - if SwapData then Result := SwapEndian(Result); -end; - -procedure TBinarySerializer.SetList(const AValue: TListByte); -begin - if OwnsList then FList.Free; - FList := AValue; -end; - -procedure TBinarySerializer.SetEndianness(const AValue: TEndianness); -begin - FEndianness := AValue; - {$if defined(FPC_LITTLE_ENDIAN)} - SwapData := FEndianness = enBig; - {$elseif defined(FPC_BIG_ENDIAN)} - SwapData := FEndianness = enLittle; - {$endif} -end; - -procedure TBinarySerializer.ReverseByteOrder(var Buffer; Count: Integer); -var - I: Integer; - Temp: Byte; -type - TBytes = array of Byte; -begin - I := 0; - while I < (Count div 2) do begin - Temp := TBytes(Buffer)[Count - 1 - I]; - TBytes(Buffer)[Count - 1 - I] := TBytes(Buffer)[I]; - TBytes(Buffer)[I] := Temp; - I := I + 1; - end; -end; - -procedure TBinarySerializer.Write(var Buffer; Count: Integer); -var - NewCount: Integer; -begin - if FGrow then begin - NewCount := Position + Count; - if FList.Count < NewCount then - FList.Count := NewCount; - end; - FList.ReplaceBuffer(Position, Buffer, Count); - Inc(Position, Count); -end; - -procedure TBinarySerializer.Read(var Buffer; Count: Integer); -begin - FList.GetBuffer(Position, Buffer, Count); - Inc(Position, Count); -end; - -procedure TBinarySerializer.Assign(Source: TBinarySerializer); -begin - FList := Source.FList; -end; - -procedure TBinarySerializer.WriteAnsiString(Data: string); -var - StringLength: Longint; -begin - StringLength := Length(Data); - Write(StringLength, SizeOf(StringLength)); - Write(Data[1], StringLength); -end; - -procedure TBinarySerializer.WriteByte(Data: Byte); -begin - Write(Data, SizeOf(Byte)); -end; - -procedure TBinarySerializer.WriteCardinal(Data: Cardinal); -begin - if SwapData then Data := SwapEndian(Data); - Write(Data, SizeOf(Cardinal)); -end; - -procedure TBinarySerializer.WriteInt64(Data: Int64); -begin - if SwapData then Data := SwapEndian(Data); - Write(Data, SizeOf(Int64)); -end; - -procedure TBinarySerializer.WriteString(Data:string); -begin - if Length(Data) > 0 then - Write(Data[1], Length(Data)); -end; - -procedure TBinarySerializer.WriteShortString(Data: ShortString); -begin - WriteByte(Length(Data)); - Write(Data[1], Length(Data)); -end; - -procedure TBinarySerializer.WriteStream(AStream: TStreamByte; Count: Integer); -var - Buffer: array of Byte; -begin - if Count > AStream.Size then Count := AStream.Size; // Limit max. stream size - AStream.Position := 0; - if Count > 0 then begin - SetLength(Buffer, Count); - AStream.ReadBuffer(Pointer(Buffer)^, Count); - Write(Pointer(Buffer)^, Count); - end; -end; - -procedure TBinarySerializer.WriteDouble(Value: Double); -begin - Write(Value, SizeOf(Double)); -end; - -procedure TBinarySerializer.WriteSingle(Value: Single); -begin - Write(Value, SizeOf(Single)); -end; - -procedure TBinarySerializer.WriteUnixTime(Data: TDateTime); -var - DataUnix: Int64; -begin - DataUnix := DateTimeToUnix(Data); - WriteCardinal(DataUnix); -end; - -procedure TBinarySerializer.WriteWord(Data: Word); -begin - if SwapData then Data := SwapEndian(Data); - Write(Data, SizeOf(Word)); -end; - -end. - Binary files /tmp/tmpWSGXrO/MfGtg_FJI4/lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.ico and /tmp/tmpWSGXrO/LTKsOzeFgQ/lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.ico differ diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpi lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpi --- lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpi 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,840 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpr lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpr --- lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpr 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.lpr 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -program Demo; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Interfaces, // this includes the LCL widgetset - Forms, SysUtils, UMainForm, TemplateGenerics; - -{$R *.res} - -const - HeapTraceLogFileName = 'heaptrclog.trc'; -begin - DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLogFileName); - SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLogFileName); - Application.Initialize; - Application.CreateForm(TMainForm, MainForm); - Application.Run; -end. - Binary files /tmp/tmpWSGXrO/MfGtg_FJI4/lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.res and /tmp/tmpWSGXrO/LTKsOzeFgQ/lazfuck-1.0.0/Packages/TemplateGenerics/Demo/Demo.res differ diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.lfm lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.lfm --- lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.lfm 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.lfm 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -object MainForm: TMainForm - Left = 261 - Height = 520 - Top = 104 - Width = 692 - ActiveControl = ButtonIntegerList - Caption = 'Template generics demo' - ClientHeight = 520 - ClientWidth = 692 - OnCreate = FormCreate - OnDestroy = FormDestroy - LCLVersion = '0.9.31' - object ButtonIntegerList: TButton - Left = 8 - Height = 25 - Top = 8 - Width = 128 - Caption = 'TListInteger' - OnClick = ButtonIntegerListClick - TabOrder = 0 - end - object ButtonStringList: TButton - Left = 8 - Height = 25 - Top = 40 - Width = 128 - Caption = 'TListString' - OnClick = ButtonStringListClick - TabOrder = 1 - end - object ButtonDictionaryString: TButton - Left = 8 - Height = 25 - Top = 72 - Width = 128 - Caption = 'TDictionaryString' - OnClick = ButtonDictionaryStringClick - TabOrder = 2 - end - object ButtonQueueInteger: TButton - Left = 8 - Height = 25 - Top = 102 - Width = 128 - Caption = 'TQueueInteger' - OnClick = ButtonQueueIntegerClick - TabOrder = 3 - end - object ButtonCharList: TButton - Left = 8 - Height = 25 - Top = 134 - Width = 128 - Caption = 'TListChar(TString)' - OnClick = ButtonCharListClick - TabOrder = 4 - end - object ButtonBenchmarkListString: TButton - Left = 8 - Height = 24 - Top = 456 - Width = 128 - Anchors = [akLeft, akBottom] - Caption = 'TListString' - OnClick = ButtonBenchmarkListStringClick - TabOrder = 5 - end - object ButtonListObject: TButton - Left = 8 - Height = 25 - Top = 163 - Width = 128 - Caption = 'TListObject' - OnClick = ButtonListObjectClick - TabOrder = 6 - end - object ButtonBenchmarkDictionary: TButton - Left = 8 - Height = 25 - Top = 424 - Width = 128 - Anchors = [akLeft, akBottom] - Caption = 'TDictionaryStringString' - OnClick = ButtonBenchmarkDictionaryClick - TabOrder = 7 - end - object ButtonMatrixInteger: TButton - Left = 8 - Height = 25 - Top = 192 - Width = 128 - Caption = 'TMatrixInteger' - OnClick = ButtonMatrixIntegerClick - TabOrder = 8 - end - object ListViewOutput: TListView - Left = 144 - Height = 491 - Top = 24 - Width = 542 - Anchors = [akTop, akLeft, akRight, akBottom] - Columns = < - item - Caption = 'Action' - Width = 200 - end - item - Caption = 'Value' - Width = 321 - end> - ReadOnly = True - TabOrder = 9 - ViewStyle = vsReport - end - object LabelTestName: TLabel - Left = 144 - Height = 14 - Top = 8 - Width = 10 - Caption = ' ' - ParentColor = False - end - object Label1: TLabel - Left = 10 - Height = 14 - Top = 408 - Width = 62 - Anchors = [akLeft, akBottom] - Caption = 'Benchmarks:' - ParentColor = False - end - object ButtonBenchmarkListPointer: TButton - Left = 8 - Height = 24 - Top = 488 - Width = 128 - Anchors = [akLeft, akBottom] - Caption = 'TListPointer' - OnClick = ButtonBenchmarkListPointerClick - TabOrder = 10 - end - object ButtonStreamByte: TButton - Left = 10 - Height = 25 - Top = 224 - Width = 128 - Caption = 'TMemoryStreamByte' - OnClick = ButtonStreamByteClick - TabOrder = 11 - end -end diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.pas lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Demo/UMainForm.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,782 +0,0 @@ -unit UMainForm; - -{$mode delphi}{$H+} - -interface - -uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, - ComCtrls, SpecializedList, SpecializedDictionary, SpecializedQueue, - DateUtils, SpecializedMatrix, SpecializedStream; - -type - - { TMainForm } - - TMainForm = class(TForm) - ButtonStreamByte: TButton; - ButtonBenchmarkDictionary: TButton; - ButtonBenchmarkListPointer: TButton; - ButtonListObject: TButton; - ButtonBenchmarkListString: TButton; - ButtonCharList: TButton; - ButtonMatrixInteger: TButton; - ButtonQueueInteger: TButton; - ButtonDictionaryString: TButton; - ButtonIntegerList: TButton; - ButtonStringList: TButton; - Label1: TLabel; - LabelTestName: TLabel; - ListViewOutput: TListView; - procedure ButtonBenchmarkDictionaryClick(Sender: TObject); - procedure ButtonBenchmarkListPointerClick(Sender: TObject); - procedure ButtonBenchmarkListStringClick(Sender: TObject); - procedure ButtonCharListClick(Sender: TObject); - procedure ButtonDictionaryStringClick(Sender: TObject); - procedure ButtonIntegerListClick(Sender: TObject); - procedure ButtonMatrixIntegerClick(Sender: TObject); - procedure ButtonListObjectClick(Sender: TObject); - procedure ButtonQueueIntegerClick(Sender: TObject); - procedure ButtonStringListClick(Sender: TObject); - procedure ButtonStreamByteClick(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormDestroy(Sender: TObject); - public - MeasureDuration: TDateTime; - Bitmap: TBitmap; - procedure UpdateButtonState(Enabled: Boolean); - procedure WriteOutput(Text1: string = ''; Text2: string = ''); - end; - -var - MainForm: TMainForm; - -implementation - -{$R *.lfm} - -{ TMainForm } - -procedure TMainForm.FormCreate(Sender: TObject); -begin - MeasureDuration := 100 * OneMillisecond; -end; - -procedure TMainForm.ButtonIntegerListClick(Sender: TObject); -var - List: TListInteger; - List2: TListInteger; - I: Integer; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TListInteger test'; - List := TListInteger.Create; - List2 := TListInteger.Create; - with List do try - AddArray([10, 20, 30, 40]); - WriteOutput('AddArray([10, 20, 30, 40])', Implode(',', IntToStr)); - Clear; - WriteOutput('Clear', Implode(',', IntToStr)); - for I := 0 to 10 do Add(I); - WriteOutput('for I := 0 to 10 do Add(I)', Implode(',', IntToStr)); - WriteOutput('Count', IntToStr(Count)); - Reverse; - WriteOutput('Reverse', Implode(',', IntToStr)); - WriteOutput('First', IntToStr(First)); - WriteOutput('Last', IntToStr(Last)); - MoveItems(3, 2, 3); - WriteOutput('MoveItems(3, 2, 3)', Implode(',', IntToStr)); - Insert(5, 11); - WriteOutput('Insert(5, 11)', Implode(',', IntToStr)); - DeleteItems(0, 10); - WriteOutput('Delete(0, 10)', Implode(',', IntToStr)); - List2.SetArray([1, 0]); - WriteOutput('EqualTo([6, 11])', BoolToStr(EqualTo(List2))); - List2.SetArray([2, 0]); - WriteOutput('EqualTo([7, 11])', BoolToStr(EqualTo(List2))); - InsertCount(0, 3); - WriteOutput('InsertCount(0, 3)', Implode(',', IntToStr)); - Fill(0, 3, 9); - WriteOutput('Fill(0, 3, 9)', Implode(',', IntToStr)); - finally - Free; - List2.Free; - end; -end; - -procedure TMainForm.ButtonMatrixIntegerClick(Sender: TObject); -var - Matrix: TMatrixInteger; - I: Integer; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TMatrixInteger test'; - Matrix := TMatrixInteger.Create; - with Matrix do try - Count := CreateIndex(2, 2); - WriteOutput('Count := CreateIndex(2, 2)', '[' + Implode('; ', ', ', IntToStr) + ']'); - Fill(CreateIndex(0, 0), Count, 1); - WriteOutput('Fill(1)', '[' + Implode('; ', ', ', IntToStr) + ']'); - Count := CreateIndex(3, 3); - WriteOutput('Count := CreateIndex(3, 3)', '[' + Implode('; ', ', ', IntToStr) + ']'); - WriteOutput('Count [Y, X]', IntToStr(Count.Y) + ', ' + IntToStr(Count.X)); - Clear; - WriteOutput('Clear', '[' + Implode('; ', ', ', IntToStr) + ']'); - WriteOutput('Count [Y, X]', IntToStr(Count.Y) + ', ' + IntToStr(Count.X)); - finally - Free; - end; -end; - -procedure TMainForm.ButtonStreamByteClick(Sender: TObject); -var - Stream: TMemoryStreamByte; - I: Integer; - ByteArray: array of Byte; - ByteArrayText: string; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TStreamByte test'; - Stream := TMemoryStreamByte.Create; - with Stream do try - WriteOutput('Size := ', IntToStr(Stream.Size)); - Write(1); - WriteOutput('Write(1)', ''); - WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); - WriteArray([2, 3, 4]); - WriteOutput('WriteArray([2, 3, 4])', ''); - WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); - Position := 1; - WriteOutput('Position := 1', ''); - WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); - WriteOutput('Read', IntToStr(Read)); - WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); - ByteArray := ReadArray(2); - ByteArrayText := '['; - for I := 0 to Length(ByteArray) - 1 do begin - ByteArrayText := ByteArrayText + IntToStr(ByteArray[I]); - if I < Length(ByteArray) - 1 then ByteArrayText := ByteArrayText + ', '; - end; - ByteArrayText := ByteArrayText + ']'; - WriteOutput('ReadArray', ByteArrayText); - WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); - finally - Free; - end; -end; - -function ObjectToStr(Obj: TObject): string; -begin - Result := Obj.ClassName; -end; - -procedure TMainForm.ButtonListObjectClick(Sender: TObject); -var - List: TListObject; - I: Integer; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TListObject test'; - List := TListObject.Create; - with List do try - AddArray([TObject.Create, TObject.Create, TObject.Create, TObject.Create]); - WriteOutput('AddArray([TObject.Create, TObject.Create, TObject.Create, TObject.Create])', Implode(',', ObjectToStr)); - Clear; - WriteOutput('Clear', Implode(',', ObjectToStr)); - for I := 0 to 10 do Add(TObject.Create); - WriteOutput('for I := 0 to 10 do Add(TObject.Create)', Implode(',', ObjectToStr)); - WriteOutput('Count', IntToStr(Count)); - Reverse; - WriteOutput('Reverse', Implode(',', ObjectToStr)); - MoveItems(3, 2, 3); - WriteOutput('MoveItems(3, 2, 3)', Implode(',', ObjectToStr)); - finally - Free; - end; -end; - -procedure TMainForm.ButtonQueueIntegerClick(Sender: TObject); -var - Queue: TQueueInteger; - I: Integer; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TQueueInteger test'; - Queue := TQueueInteger.Create; - with Queue do try - Enqueue(1); - Enqueue(2); - Enqueue(3); - WriteOutput('Enqueue(1),Enqueue(2),Enqueue(3) ', List.Implode(',', IntToStr)); - Enqueue(4); - WriteOutput('Enqueue(4)', List.Implode(',', IntToStr)); - WriteOutput('Dequeued item', IntToStr(Dequeue)); - WriteOutput('Dequeue', List.Implode(',', IntToStr)); - finally - Free; - end; -end; - -function StringPairToStr(Pair: TPairStringString): string; -begin - Result := Pair.Key + ':' + Pair.Value; -end; - -procedure TMainForm.ButtonDictionaryStringClick(Sender: TObject); -var - Dictionary: TDictionaryStringString; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TDictionaryString test'; - Dictionary := TDictionaryStringString.Create; - with Dictionary do try - Add('Key1', 'Value1'); - Add('Key2', 'Value2'); - Add('Key3', 'Value3'); - WriteOutput('Add(''Key1'', ''Value1''),Add(''Key1'', ''Value1''),Add(''Key1'', ''Value1'')', Implode(',', StringPairToStr)); - WriteOutput('Values[Key2]', Values['Key2']); - WriteOutput('Values[Key2] = None'); - Values['Key2'] := 'None'; - WriteOutput('Values[Key2]', Values['Key2']); - WriteOutput('Values[Key0]', Values['Key0']); - WriteOutput('Keys[2]', Keys[2]); - finally - Free; - end; -end; - -function CharToStr(Value: Char): string; -begin - Result := Value; -end; - -procedure TMainForm.ButtonCharListClick(Sender: TObject); -var - List: TListChar; - List2: TListChar; -begin - ListViewOutput.Clear; - LabelTestName.Caption := 'TListChar test'; - List := TListChar.Create; - List2 := TListChar.Create; - with List do try - AddArray([' ', ' ', 'A', 'b', 'c', 'd', ' ']); - WriteOutput('AddArray(['' '', '' '', ''A'', ''b'', ''c'', ''d'', '' ''])', - '''' + Implode('', CharToStr) + ''''); - Reverse; - WriteOutput('Reverse', '''' + Implode('', CharToStr) + ''''); - TrimLeft; - WriteOutput('TrimLeft', '''' + Implode('', CharToStr) + ''''); - TrimRight; - WriteOutput('TrimRight', '''' + Implode('', CharToStr) + ''''); - UpperCase; - WriteOutput('UpperCase', '''' + Implode('', CharToStr) + ''''); - LowerCase; - WriteOutput('LowerCase', '''' + Implode('', CharToStr) + ''''); - WriteOutput('IndexOf(''c'')', IntToStr(IndexOf('c'))); - List2.AddArray(['c', 'b']); - WriteOutput('IndexOfList(''cb'')', IntToStr(IndexOfList(List2))); - finally - List2.Free; - Free; - end; -end; - -procedure TMainForm.ButtonBenchmarkListStringClick(Sender: TObject); -var - List: TListString; - List2: TStringList; - StartTime: TDateTime; - I: Integer; -const - SampleText: string = 'text'; - SampleCount: Integer = 100000; -begin - LabelTestName.Caption := 'Generic specialized TListString vs. classic non-generic TStringList benchmark'; - ListViewOutput.Clear; - try - UpdateButtonState(False); - List := TListString.Create; - List2 := TStringList.Create; - - StartTime := Now; - repeat - List.Add(SampleText); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.Add', IntToStr(List.Count) + ' ops'); - List.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List2.Add(SampleText); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Add', IntToStr(List2.Count) + ' ops'); - List2.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List.Insert(0, SampleText); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.Insert', IntToStr(List.Count) + ' ops'); - List.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List2.Insert(0, SampleText); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Insert', IntToStr(List2.Count) + ' ops'); - List2.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List.Delete(0); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.Delete', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List2.Delete(0); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Delete', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List.Move(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.Move', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List2.Move(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Move', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List.Exchange(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.Exchange', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(SampleText); - StartTime := Now; - I := 0; - repeat - List2.Exchange(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Exchange', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(SampleText + IntToStr(I)); - StartTime := Now; - I := 0; - repeat - List.IndexOf(SampleText + IntToStr(I mod List.Count)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListString.IndexOf', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(SampleText + IntToStr(I)); - StartTime := Now; - I := 0; - repeat - List2.IndexOf(SampleText + IntToStr(I mod List2.Count)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.IndexOf', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - finally - UpdateButtonState(True); - List.Free; - List2.Free; - end; -end; - -procedure TMainForm.ButtonBenchmarkDictionaryClick(Sender: TObject); -var - Dictionary: TDictionaryStringString; - Dictionary2: TStringList; - StartTime: TDateTime; - I: Integer; - R: string; -begin - LabelTestName.Caption := 'Generic specialized TDictionaryStringString vs. classic non-generic TStringList benchmark'; - ListViewOutput.Clear; - try - UpdateButtonState(False); - Dictionary := TDictionaryStringString.Create; - Dictionary2 := TStringList.Create; - Dictionary2.NameValueSeparator := '|'; - - I := 0; - StartTime := Now; - repeat - Dictionary.Add(IntToStr(I), IntToStr(I)); - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TDictionaryStringString.Add', IntToStr(Dictionary.Count) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - Dictionary2.Add(IntToStr(I) + Dictionary2.NameValueSeparator + IntToStr(I)); - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Add', IntToStr(Dictionary2.Count) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary.Values[IntToStr(I mod Dictionary.Count)]; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TDictionaryStringString.Values', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary2.Values[IntToStr(I mod Dictionary2.Count)]; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Values', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary.Keys[I mod Dictionary.Count]; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TDictionaryStringString.Keys', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary2.Names[I mod Dictionary2.Count]; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Keys(Names)', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary.Items[I mod Dictionary.Count].Value; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TDictionaryStringString.Items', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - I := 0; - StartTime := Now; - repeat - R := Dictionary2.ValueFromIndex[I mod Dictionary2.Count]; - I := I + 1; - until (Now - StartTime) > MeasureDuration; - WriteOutput('TStringList.Items(ValueFromIndex)', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - finally - UpdateButtonState(True); - Dictionary.Free; - Dictionary2.Free; - end; -end; - -procedure TMainForm.ButtonBenchmarkListPointerClick(Sender: TObject); -var - List: TListPointer; - List2: TFPList; - StartTime: TDateTime; - I: Integer; -const - SampleCount: Integer = 100000; -begin - LabelTestName.Caption := 'Generic specialized TListObject vs. classic non-generic TFPList benchmark'; - ListViewOutput.Clear; - try - UpdateButtonState(False); - List := TListPointer.Create; - List2 := TFPList.Create; - - WriteOutput('TListPointer.InstanceSize', IntToStr(TListPointer.InstanceSize) + ' bytes'); - WriteOutput('TFPList.InstanceSize', IntToStr(TFPList.InstanceSize) + ' bytes'); - - StartTime := Now; - repeat - List.Add(Pointer(1)); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.Add', IntToStr(List.Count) + ' ops'); - List.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List2.Add(Pointer(1)); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.Add', IntToStr(List2.Count) + ' ops'); - List2.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List.Insert(0, Pointer(1)); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.Insert', IntToStr(List.Count) + ' ops'); - List.Clear; - Application.ProcessMessages; - - StartTime := Now; - repeat - List2.Insert(0, Pointer(1)); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.Insert', IntToStr(List2.Count) + ' ops'); - List2.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List.Delete(0); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.Delete', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2.Delete(0); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.Delete', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List.Move(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.Move', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2.Move(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.Move', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List.Exchange(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.Exchange', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2.Exchange(Round(SampleCount * 0.3), Round(SampleCount * 0.7)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.Exchange', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List.IndexOf(Pointer(I mod List.Count)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer.IndexOf', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2.IndexOf(Pointer(I mod List2.Count)); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList.IndexOf', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List[I mod List.Count] := Pointer(1); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer[I] write', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2[I mod List2.Count] := Pointer(1); - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList[I] write', IntToStr(I) + ' ops'); - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List[I mod List.Count]; - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TListPointer[I] read', IntToStr(I) + ' ops'); - List.Clear; - Application.ProcessMessages; - - for I := 0 to SampleCount - 1 do - List2.Add(Pointer(1)); - StartTime := Now; - I := 0; - repeat - List2[I mod List2.Count]; - Inc(I); - until (Now - StartTime) > MeasureDuration; - WriteOutput('TFPList[I] read', IntToStr(I) + ' ops'); - Application.ProcessMessages; - finally - UpdateButtonState(True); - List.Free; - List2.Free; - end; -end; - -function StrToStr(Value: string): string; -begin - Result := Value; -end; - -procedure TMainForm.ButtonStringListClick(Sender: TObject); -var - List: TListString; -begin - ListViewOutput.Clear; - WriteOutput('TListString test'); - List := TListString.Create; - with List do try - AddArray(['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven']); - WriteOutput('Count', IntToStr(Count)); - WriteOutput('Implode', Implode(',', StrToStr)); - WriteOutput('Reverse'); - Reverse; - WriteOutput('Implode', Implode(',', StrToStr)); - WriteOutput('First', First); - WriteOutput('Last', Last); - MoveItems(2, 3, 3); - WriteOutput('Implode', Implode(',', StrToStr)); - InsertCount(0, 3); - WriteOutput('InsertCount(0, 3)', Implode(',', StrToStr)); - Fill(0, 3, 'Zero'); - WriteOutput('Fill(0, 3, ''Zero'')', Implode(',', StrToStr)); - finally - Free; - end; -end; - -procedure TMainForm.FormDestroy(Sender: TObject); -begin -end; - -procedure TMainForm.UpdateButtonState(Enabled: Boolean); -begin - ButtonBenchmarkDictionary.Enabled := Enabled; - ButtonBenchmarkListString.Enabled := Enabled; - ButtonCharList.Enabled := Enabled; - ButtonDictionaryString.Enabled := Enabled; - ButtonIntegerList.Enabled := Enabled; - ButtonListObject.Enabled := Enabled; - ButtonMatrixInteger.Enabled := Enabled; - ButtonQueueInteger.Enabled := Enabled; - ButtonStringList.Enabled := Enabled; -end; - -procedure TMainForm.WriteOutput(Text1: string = ''; Text2: string = ''); -var - NewItem: TListItem; -begin - NewItem := ListViewOutput.Items.Add; - NewItem.Caption := Text1; - NewItem.SubItems.Add(Text2); -end; - -end. - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericBitmap.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericBitmap.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericBitmap.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericBitmap.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -{$IFDEF INTERFACE} - -// TGBitmap -{$DEFINE TGMatrixIndexX := TGBitmapIndexX} -{$DEFINE TGMatrixIndexY := TGBitmapIndexY} -{$DEFINE TGMatrixItem := TGBitmapItem} -{$DEFINE TGMatrixIndex := TGBitmapIndex} -{$DEFINE TGMatrixRow := TGBitmapRow} -{$DEFINE TGMatrix := TGBitmapMatrix} -{$DEFINE INTERFACE} -{$I 'GenericMatrix.inc'} - - // TGBitmap = class - TGBitmap = class(TGMatrix) - private - function GetWidth: TGBitmapIndexX; - function GetHeight: TGBitmapIndexX; - procedure SetWidth(Value: TGBitmapIndexX); - procedure SetHeight(Value: TGBitmapIndexY); - public - property Pixels[X: TGBitmapIndexX; Y: TGBitmapIndexY]: TGBitmapItem - read GetItemXY write PutItemXY; - property Width: TGBitmapIndexX read GetWidth write SetWidth; - property Height: TGBitmapIndexY read GetHeight write SetHeight; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericMatrix.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -// TGBitmap -{$DEFINE TGMatrixIndexX := TGBitmapIndexX} -{$DEFINE TGMatrixIndexY := TGBitmapIndexY} -{$DEFINE TGMatrixItem := TGBitmapItem} -{$DEFINE TGMatrixIndex := TGBitmapIndex} -{$DEFINE TGMatrixRow := TGBitmapRow} -{$DEFINE TGMatrix := TGBitmapMatrix} -{$DEFINE IMPLEMENTATION} -{$I 'GenericMatrix.inc'} - -function TGBitmap.GetWidth: TGBitmapIndexX; -begin - Result := Count.X; -end; - -function TGBitmap.GetHeight: TGBitmapIndexX; -begin - Result := Count.Y; -end; - -procedure TGBitmap.SetWidth(Value: TGBitmapIndexX); -begin - Count := CreateIndex(Value, Count.Y); -end; - -procedure TGBitmap.SetHeight(Value: TGBitmapIndexY); -begin - Count := CreateIndex(Count.X, Value); -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericDictionary.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericDictionary.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericDictionary.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericDictionary.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -{$IFDEF INTERFACE} - - TGDictionary = class; - - TGPair = record - Key: TGPairKey; - Value: TGPairValue; - end; - -{$DEFINE TGListIndex := TGDictionaryIndex} -{$DEFINE TGListItem := TGPair} -{$DEFINE TGList := TGDictionaryList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGDictionary> = class(TGList) - TGDictionary = class(TGList) - private - function GetKey(Index: TGDictionaryIndex): TGPairKey; - function GetValue(Key: TGPairKey): TGPairValue; - procedure PutKey(Index: TGDictionaryIndex; const AValue: TGPairKey); - procedure PutValue(Key: TGPairKey; const AValue: TGPairValue); - public - function SearchKey(Key: TGPairKey): TGDictionaryIndex; - procedure Add(Key: TGPairKey; Value: TGPairValue); - property Values[Index: TGPairKey]: TGPairValue - read GetValue write PutValue; - property Keys[Index: TGDictionaryIndex]: TGPairKey - read GetKey write PutKey; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - - -{$IFDEF IMPLEMENTATION_USES} -{$I '..\Generic\GenericList.inc'} -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGDictionaryIndex} -{$DEFINE TGListItem := TGPair} -{$DEFINE TGList := TGDictionaryList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -function TGDictionary.GetKey(Index: TGDictionaryIndex): TGPairKey; -begin - Result := Items[Index].Key; -end; - -function TGDictionary.GetValue(Key: TGPairKey): TGPairValue; -begin - Result := Items[SearchKey(Key)].Value; -end; - -procedure TGDictionary.PutKey(Index: TGDictionaryIndex; - const AValue: TGPairKey); -var - Item: TGPair; -begin - //Items[Index].Key := AValue; - Item := Items[Index]; - Item.Key := AValue; - Items[Index] := Item; -end; - -procedure TGDictionary.PutValue(Key: TGPairKey; - const AValue: TGPairValue); -var - Item: TGPair; - Index: TGDictionaryIndex; -begin - //Items[SearchKey(Index)].Value := AValue; - Index := SearchKey(Key); - Item := Items[Index]; - Item.Value := AValue; - Items[Index] := Item; -end; - -function TGDictionary.SearchKey(Key: TGPairKey): TGDictionaryIndex; -begin - Result := 0; - while Result < Count do begin - if Items[Result].Key = Key then begin - Break; - end; - Result := Result + 1; - end; -end; - -procedure TGDictionary.Add(Key: TGPairKey; Value: TGPairValue); -var - NewPair: TGPair; -begin - NewPair.Key := Key; - NewPair.Value := Value; - inherited Add(NewPair); -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericFileList.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericFileList.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericFileList.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericFileList.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGFileListIndex} -{$DEFINE TGListItem := TGFileListItem} -{$DEFINE TGList := TGFileListList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGFileList - TGFileList = class(TGList) - private - FFileName: string; - FMode: Word; - FHandle: THandle; - procedure SetFileName(const Value: string); - procedure SetMode(const Value: Word); - function GetOpenned: Boolean; - public - constructor Create; override; - destructor Destroy; override; - procedure Open; - procedure Close; - property FileName: string read FFileName write SetFileName; - property Mode: Word read FMode write SetMode; - property Openned: Boolean read GetOpenned; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGFileListIndex} -{$DEFINE TGListItem := TGFileListItem} -{$DEFINE TGList := TGFileListList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -constructor TGFileList.Create; -begin - inherited; - FHandle := feInvalidHandle; -end; - -destructor TGFileList.Destroy; -begin - Close; - inherited; -end; - -procedure TGFileList.Open; -begin - If (Mode and fmCreate) > 0 then - FHandle := FileCreate(FFileName, FMode, 438) - else - FHandle := FileOpen(FFileName, FMode); -end; - -procedure TGFileList.Close; -begin - if FHandle <> feInvalidHandle then FileClose(FHandle); -end; - -procedure TGFileList.SetFileName(const Value: string); -begin - if FFileName = Value then Exit; - FFileName := Value; - if FHandle <> feInvalidHandle then begin - Close; - Open; - end; -end; - -procedure TGFileList.SetMode(const Value: Word); -begin - if FMode = Value then Exit; - FMode := Value; - if FHandle <> feInvalidHandle then begin - Close; - Open; - end; -end; - -function TGFileList.GetOpenned: Boolean; -begin - Result := FHandle <> feInvalidHandle; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListAbstract.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListAbstract.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListAbstract.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListAbstract.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -{$IFDEF INTERFACE} - - { TGAbstractList } - - TGAbstractList = class - private - FOnUpdate: TNotifyEvent; - function Get(const Index: Integer): Integer; virtual; abstract; - function GetCapacity: Integer; virtual; abstract; - function GetCount: Integer; virtual; abstract; - function GetFirst: Integer; virtual; abstract; - function GetLast: Integer; virtual; abstract; - procedure Put(const Index: Integer; const AValue: Integer); virtual; abstract; - procedure SetCapacity(const AValue: Integer); virtual; abstract; - procedure SetCount(const AValue: Integer); virtual; abstract; - procedure SetFirst(const AValue: Integer); virtual; abstract; - procedure SetLast(const AValue: Integer); virtual; abstract; - public - type - PItem = ^TGListItem; - property Count: TGListIndex read GetCount write SetCount; - property Capacity: TGListIndex read GetCapacity write SetCapacity; - property Items[Index: TGListIndex]: TGListItem read Get write Put; default; - property First: TGListItem read GetFirst write SetFirst; - property Last: TGListItem read GetLast write SetLast; - property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; - end; - - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} -{$UNDEF IMPLEMENTATION} -{$ENDIF} - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericList.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericList.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericList.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericList.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,706 +0,0 @@ -{$IFDEF INTERFACE} - - // TGList implemented using templates - // - item operations (Add, Insert, ReplaceArray, Get, Set, IndexOf, - // Extract, Delete, Exchange) - // - item range operations (DeleteItems, InsertItems, ReplaceItems, - // Move, Fill) - // - other TGList operations (AddList, InsertList, - // ReplaceList, GetList, IndexOfList) - // - dynamic array operations (AddArray, InsertArray, - // ReplaceArray, GetArray, IndexOfArray) - // - all items operations (Clear, Reverse, Sort) - - //TGAbstractList = class - - //end; - - // TGList = class - TGList = class//(TGAbstractList) - public - type - PItem = ^TGListItem; - TSortCompare = function(Item1, Item2: TGListItem): Integer of object; - TToStringConverter = function(Item: TGListItem): string; - TFromStringConverter = function(Text: string): TGListItem; - TItemArray = array of TGListItem; - private - FItems: array of TGListItem; - FCount: TGListIndex; - FUpdateCount: Integer; - FOnUpdate: TNotifyEvent; - function Get(Index: TGListIndex): TGListItem; - function GetCapacity: TGListIndex; - function GetLast: TGListItem; - function GetFirst: TGListItem; - procedure SetCapacity(const AValue: TGListIndex); - procedure SetCapacityOptimized(const NewCapacity: TGListIndex); - procedure SetLast(AValue: TGListItem); - procedure SetFirst(AValue: TGListItem); - procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare); - procedure DoUpdate; - protected - procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual; - procedure SetCount(const AValue: TGListIndex); virtual; - public - function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean; inline; - function Add(Item: TGListItem): TGListIndex; - procedure AddArray(Values: array of TGListItem); - procedure AddList(List: TGList); - procedure AddListPart(List: TGList; ItemIndex, ItemCount: TGListIndex); - procedure Assign(Source: TGList); virtual; - constructor Create; virtual; - procedure Clear; virtual; - procedure Delete(Index: TGListIndex); virtual; - procedure DeleteItems(Index, Count: TGListIndex); - function EqualTo(List: TGList): Boolean; - procedure Exchange(Index1, Index2: TGListIndex); - procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); - function Extract(Item: TGListItem): TGListItem; - property First: TGListItem read GetFirst write SetFirst; - procedure Fill(Start, Count: TGListIndex; Value: TGListItem); - function GetArray(Index, ACount: TGListIndex): TItemArray; - procedure GetList(List: TGList; Index, ACount: TGListIndex); - procedure GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); - function Implode(Separator: string; Converter: TToStringConverter): string; - function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual; - function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex; - function IndexOfArray(Values: array of TGListItem; Start: TGListIndex = 0): TGListIndex; - procedure Insert(Index: TGListIndex; Item: TGListItem); - procedure InsertList(Index: TGListIndex; List: TGList); - procedure InsertArray(Index: TGListIndex; Values: array of TGListItem); - procedure InsertCount(Index: TGListIndex; ACount: TGListIndex); - procedure Move(CurIndex, NewIndex: TGListIndex); - procedure MoveItems(CurIndex, NewIndex, Count: TGListIndex); - function Remove(Item: TGListItem): TGListIndex; - procedure Reverse; - procedure ReplaceArray(Index: TGListIndex; Values: array of TGListItem); - procedure ReplaceList(Index: TGListIndex; Source: TGList); - procedure ReplaceListPart(Index: TGListIndex; Source: TGList; - SourceIndex, SourceCount: TGListIndex); - procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); - procedure Sort(Compare: TSortCompare); - procedure SetArray(Values: array of TGListItem); - procedure BeginUpdate; - procedure EndUpdate; - procedure Update; - property Count: TGListIndex read FCount write SetCount; - property Capacity: TGListIndex read GetCapacity write SetCapacity; - property Items[Index: TGListIndex]: TGListItem read Get write Put; default; - property Last: TGListItem read GetLast write SetLast; - property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - -uses - RtlConsts; - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{ TGList } - -constructor TGList.Create; -begin - FCount := 0; - FUpdateCount := 0; -end; - -procedure TGList.GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); -var - P: PItem; - I: TGListIndex; -begin - if (Index + Count) > FCount then - raise EListError.CreateFmt(SListIndexError, [Index + Count]); - P := PItem(@Buffer); - I := 0; - while I < Count do begin - P^ := Items[Index + I]; - Inc(P, 1); - I := I + 1; - end; -end; - -procedure TGList.ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); -var - P: PItem; - I: TGListIndex; -begin - if (Index + Count) > FCount then - raise EListError.CreateFmt(SListIndexError, [Index + Count]); - P := PItem(@Buffer); - I := 0; - while I < Count do begin - Items[Index + I] := P^; - Inc(P, 1); - I := I + 1; - end; -end; - -procedure TGList.ReplaceArray(Index: TGListIndex; Values: array of TGListItem); -var - I: TGListIndex; -begin - I := 0; - while I < Length(Values) do begin - Items[Index + I] := Values[I]; - I := I + 1; - end; - Update; -end; - -procedure TGList.ReplaceList(Index: TGListIndex; Source: TGList); -var - I: TGListIndex; -begin - I := 0; - while I < Source.Count do begin - Items[Index + I] := Source[I]; - I := I + 1; - end; - Update; -end; - -procedure TGList.ReplaceListPart(Index: TGListIndex; Source: TGList; - SourceIndex, SourceCount: TGListIndex); -var - I: TGListIndex; -begin - I := 0; - while I < SourceCount do begin - Items[Index + I] := Source[SourceIndex + I]; - I := I + 1; - end; - Update; -end; - -function TGList.GetCapacity: TGListIndex; -begin - Result := Length(FItems); -end; - -procedure TGList.SetCapacity(const AValue: TGListIndex); -begin - if (AValue < FCount) then - raise EListError.CreateFmt(SListCapacityError, [AValue]); - SetLength(FItems, AValue); -end; - -procedure TGList.SetCapacityOptimized(const NewCapacity: TGListIndex); -var - IncSize: TGListIndex; -begin - if NewCapacity > Capacity then begin - IncSize := NewCapacity - Capacity; - // Expand - if IncSize = 1 then begin - IncSize := 4; - if Capacity > 3 then IncSize := IncSize + 4; - if Capacity > 8 then IncSize := IncSize + 8; - if Capacity > 63 then IncSize := IncSize + Capacity shr 2; // Grow by one quarter - end; - Capacity := Capacity + IncSize; - end else - if NewCapacity < Capacity then begin - // Contract - if (Capacity > 256) and (FCount < Capacity shr 2) then - begin - Capacity := Capacity shr 1; - end; - end; -end; - -function TGList.Get(Index: TGListIndex): TGListItem; -begin - if (Index < 0) or (Index >= Count) then - raise EListError.CreateFmt(SListIndexError, [Index]); - Result := FItems[Index]; -end; - -procedure TGList.Put(Index: TGListIndex; const AValue: TGListItem); -begin - if (Index < 0) or (Index >= Count) then - raise EListError.CreateFmt(SListIndexError, [Index]); - FItems[Index] := AValue; -end; - -procedure TGList.SetCount(const AValue: TGListIndex); -begin - if (AValue < 0) then - raise EListError.CreateFmt(SListCountError, [AValue]); - if AValue > Capacity then SetCapacityOptimized(AValue); // Before FCount change - FCount := AValue; - if AValue < Capacity then SetCapacityOptimized(AValue); // After FCount change -end; - -function TGList.GetArray(Index, ACount: TGListIndex): TItemArray; -var - I: Integer; -begin - SetLength(Result, ACount); - I := 0; - while I < Count do begin - Result[I] := FItems[Index + I]; - I := I + 1; - end; -end; - -procedure TGList.GetList(List: TGList; Index, ACount: TGListIndex); -begin - List.Clear; - List.AddListPart(Self, Index, ACount); -end; - -procedure TGList.QuickSort(L, R: TGListIndex; Compare: TSortCompare); -var - I, J: TGListIndex; - P, Q: TGListItem; -begin - repeat - I := L; - J := R; - P := FItems[(L + R) div 2]; - repeat - while Compare(P, FItems[I]) > 0 do - I := I + 1; - while Compare(P, FItems[J]) < 0 do - J := J - 1; - if I <= J then - begin - Q := FItems[I]; - FItems[I] := FItems[J]; - FItems[J] := Q; - I := I + 1; - J := J - 1; - end; - until I > J; - if L < J then - QuickSort(L, J, Compare); - L := I; - until I >= R; -end; - -procedure TGList.Assign(Source: TGList); -var - I: TGListIndex; -begin - Count := Source.Count; - I := 0; - while I < Count do begin - FItems[I] := Source[I]; - I := I + 1; - end; - Update; -end; - -function TGList.Extract(Item: TGListItem): TGListItem; -var - I: TGListIndex; -begin - I := IndexOf(Item); - if I >= 0 then begin - Result := Item; - Delete(I); - end else - raise EListError.CreateFmt(SListIndexError, [0]); -end; - -function TGList.CompareMem(P1, P2: Pointer; Length: cardinal): Boolean; -var - I: Cardinal; -begin - Result := True; - I := 0; - if (P1) <> (P2) then - while Result and (I < Length) do - begin - Result := PByte(P1)^ = PByte(P2)^; - Inc(I); - Inc(pchar(P1)); - Inc(pchar(P2)); - end; -end; - -function TGList.IndexOf(Item: TGListItem; Start: TGListIndex): TGListIndex; -begin - Result := Start; - while (Result < FCount) and -// not CompareMem(@FItems[Result], @Item, SizeOf(TGListItem)) do - not (CompareByte(FItems[Result], Item, SizeOf(TGListItem)) = 0) do - Result := Result + 1; - if Result = FCount then Result := -1; -end; - -procedure TGList.Insert(Index: TGListIndex; Item: TGListItem); -begin - if (Index < 0) or (Index > FCount) then - raise EListError.CreateFmt(SListIndexError, [Index]); - try - BeginUpdate; - InsertCount(Index, 1); - FItems[Index] := Item; - finally - EndUpdate; - end; -end; - -procedure TGList.InsertList(Index: TGListIndex; List: TGList); -begin - if (Index < 0) or (Index > FCount) then - raise EListError.CreateFmt(SListIndexError, [Index]); - InsertCount(Index, List.Count); - ReplaceList(Index, List); -end; - -procedure TGList.InsertArray(Index: TGListIndex; Values: array of TGListItem); -begin - if (Index < 0) or (Index > FCount) then - raise EListError.CreateFmt(SListIndexError, [Index]); - InsertCount(Index, Length(Values)); - ReplaceArray(Index, Values); -end; - -procedure TGList.InsertCount(Index: TGListIndex; ACount: TGListIndex); -begin - if (Index < 0) or (Index > FCount) then - raise EListError.CreateFmt(SListIndexError, [Index]); - Count := Count + ACount; - if Index < FCount then - System.Move(FItems[Index], FItems[Index + ACount], (FCount - ACount - Index) * SizeOf(TGListItem)); - Update; -end; - -function TGList.IndexOfList(List: TGList; Start: TGListIndex): TGListIndex; -var - I: TGListIndex; -begin - if List.Count > 0 then begin - Result := IndexOf(List[0], Start); - if Result <> -1 then begin - I := 1; - while I < List.Count do begin - if not CompareMem(Addr(FItems[Result + I]), Addr(List.FItems[I]), SizeOf(TGListItem)) then begin - Result := -1; - Break; - end; - I := I + 1; - end; - end; - end else Result := -1; -end; - -function TGList.IndexOfArray(Values: array of TGListItem; Start: TGListIndex): TGListIndex; -var - I: TGListIndex; -begin - if Length(Values) > 0 then begin - Result := IndexOf(Values[0], Start); - if Result <> -1 then begin - I := 1; - while I < Length(Values) do begin - if not CompareMem(Addr(FItems[Result + I]), Addr(Values[I]), SizeOf(TGListItem)) then begin - Result := -1; - Break; - end; - I := I + 1; - end; - end; - end else Result := -1; -end; - -function TGList.GetLast: TGListItem; -begin - if FCount = 0 then - raise EListError.CreateFmt(SListIndexError, [0]) - else - Result := FItems[FCount - 1]; -end; - -procedure TGList.SetLast(AValue: TGListItem); -begin - if FCount = 0 then - raise EListError.CreateFmt(SListIndexError, [0]) - else - FItems[FCount - 1] := AValue; -end; - -function TGList.GetFirst: TGListItem; -begin - if FCount = 0 then - raise EListError.CreateFmt(SListIndexError, [0]) - else - Result := FItems[0]; -end; - -procedure TGList.SetFirst(AValue: TGListItem); -begin - if FCount = 0 then - raise EListError.CreateFmt(SListIndexError, [0]) - else - FItems[0] := AValue; -end; - -procedure TGList.Move(CurIndex, NewIndex: TGListIndex); -var - Temp: TGListItem; -begin - if ((CurIndex < 0) or (CurIndex > Count - 1)) then - raise EListError.CreateFmt(SListIndexError, [CurIndex]); - if ((NewIndex < 0) or (NewIndex > Count -1)) then - raise EListError.CreateFmt(SlistIndexError, [NewIndex]); - Temp := FItems[CurIndex]; - if NewIndex > CurIndex then begin - System.Move(FItems[CurIndex + 1], FItems[CurIndex], (NewIndex - CurIndex) * SizeOf(TGListItem)); - end else - if NewIndex < CurIndex then begin - System.Move(FItems[NewIndex], FItems[NewIndex + 1], (CurIndex - NewIndex) * SizeOf(TGListItem)); - end; - FItems[NewIndex] := Temp; - //Delete(CurIndex); - //Insert(NewIndex, Temp); - Update; -end; - -procedure TGList.MoveItems(CurIndex, NewIndex, Count: TGListIndex); -var - S: Integer; - D: Integer; -begin - if CurIndex < NewIndex then begin - S := CurIndex + Count - 1; - D := NewIndex + Count - 1; - while S >= CurIndex do begin - Move(S, D); - S := S - 1; - D := D - 1; - end; - end else - if CurIndex > NewIndex then begin - S := CurIndex; - D := NewIndex; - while S < (CurIndex + Count) do begin - Move(S, D); - S := S + 1; - D := D + 1; - end; - end; - Update; -end; - -function TGList.Remove(Item: TGListItem): TGListIndex; -begin - Result := IndexOf(Item); - if Result <> -1 then - Delete(Result) - else raise Exception.CreateFmt(SItemNotFound, [0]); -end; - -function TGList.EqualTo(List: TGList): Boolean; -var - I: TGListIndex; -begin - Result := Count = List.Count; - if Result then begin - I := 0; - while I < Count do begin - if not CompareMem(Addr(FItems[I]), Addr(List.FItems[I]), SizeOf(TGListItem)) then begin - Result := False; - Break; - end; - I := I + 1; - end; - end; -end; - -procedure TGList.Reverse; -var - I: TGListIndex; -begin - I := 0; - while I < (Count div 2) do begin - Exchange(I, Count - 1 - I); - I := I + 1; - end; - Update; -end; - -procedure TGList.Sort(Compare: TSortCompare); -begin - if FCount > 1 then - QuickSort(0, FCount - 1, Compare); - Update; -end; - -procedure TGList.AddArray(Values: array of TGListItem); -var - I: TGListIndex; -begin - I := 0; - while I <= High(Values) do begin - Add(Values[I]); - I := I + 1; - end; - Update; -end; - -procedure TGList.SetArray(Values: array of TGListItem); -var - I: TGListIndex; -begin - Clear; - I := 0; - while I <= High(Values) do begin - Add(Values[I]); - I := I + 1; - end; -end; - -procedure TGList.BeginUpdate; -begin - Inc(FUpdateCount); -end; - -procedure TGList.EndUpdate; -begin - if FUpdateCount > 0 then Dec(FUpdateCount); - if FUpdateCount = 0 then DoUpdate; -end; - -procedure TGList.DoUpdate; -begin - if Assigned(FOnUpdate) then FOnUpdate(Self); -end; - -procedure TGList.Update; -begin - if FUpdateCount = 0 then DoUpdate; -end; - -function TGList.Implode(Separator: string; Converter: TToStringConverter): string; -var - I: TGListIndex; -begin - Result := ''; - I := 0; - while I < Count do begin - Result := Result + Converter(FItems[I]); - if I < (Count - 1) then - Result := Result + Separator; - I := I + 1; - end; -end; - -procedure TGList.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); -begin - Clear; - while (Pos(Separator, Text) > 0) and - ((Count < (SlicesCount - 1)) or (SlicesCount = -1)) do begin - Add(Converter(Copy(Text, 1, Pos(Separator, Text) - 1))); - System.Delete(Text, 1, Pos(Separator, Text) + Length(Separator) - 1); - end; - Add(Converter(Text)); -end; - -function TGList.Add(Item: TGListItem): TGListIndex; -begin - Count := Count + 1; - Result := FCount - 1; - FItems[Result] := Item; - Update; -end; - -procedure TGList.AddList(List: TGList); -var - I: TGListIndex; - J: TGListIndex; -begin - I := Count; - J := 0; - Count := Count + List.Count; - while I < Count do begin - Items[I] := List[J]; - I := I + 1; - J := J + 1; - end; - Update; -end; - -procedure TGList.AddListPart(List: TGList; ItemIndex, ItemCount: TGListIndex); -var - I: TGListIndex; - J: TGListIndex; -begin - I := Count; - J := ItemIndex; - Count := Count + ItemCount; - while I < Count do begin - Items[I] := List[J]; - I := I + 1; - J := J + 1; - end; - Update; -end; - -procedure TGList.Clear; -begin - Count := 0; - Capacity := 0; -end; - -procedure TGList.Delete(Index: TGListIndex); -begin - if (Index < 0) or (Index >= FCount) then - raise EListError.CreateFmt(SListIndexError, [Index]); - FCount := FCount - 1; - System.Move(FItems[Index + 1], FItems[Index], (FCount - Index) * SizeOf(TGListItem)); - SetCapacityOptimized(Capacity - 1); - Update; -end; - -procedure TGList.DeleteItems(Index, Count: TGListIndex); -var - I: TGListIndex; -begin - I := Index; - while I < (Index + Count) do begin - Delete(Index); - I := I + 1; - end; - Update; -end; - -procedure TGList.Fill(Start, Count: TGListIndex; Value: TGListItem); -var - I: TGListIndex; -begin - I := Start; - while I < Count do begin - FItems[I] := Value; - I := I + 1; - end; - Update; -end; - -procedure TGList.Exchange(Index1, Index2: TGListIndex); -var - Temp: TGListItem; -begin - if ((Index1 >= FCount) or (Index1 < 0)) then - raise EListError.CreateFmt(SListIndexError, [Index1]); - if ((Index2 >= FCount) or (Index2 < 0)) then - raise EListError.CreateFmt(SListIndexError, [Index2]); - Temp := FItems[Index1]; - FItems[Index1] := FItems[Index2]; - FItems[Index2] := Temp; - Update; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListObject.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListObject.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListObject.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListObject.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGListObjectIndex} -{$DEFINE TGListItem := TGListObjectItem} -{$DEFINE TGList := TGListObjectList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGListObject = class(TGList) - TGListObject = class(TGList) - protected - procedure Put(Index: TGListIndex; const AValue: TGListItem); override; - procedure SetCount(const AValue: TGListIndex); override; - public - OwnsObjects: Boolean; - function AddNew(NewObject: TGListItem = nil): TGListItem; - function InsertNew(Index: TGListIndex; NewObject: TGListItem = nil): TGListItem; - procedure Delete(Index: TGListObjectIndex); override; - procedure Assign(Source: TGList); override; - constructor Create; override; - destructor Destroy; override; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGListObjectIndex} -{$DEFINE TGListItem := TGListObjectItem} -{$DEFINE TGList := TGListObjectList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGListObject } - -function TGListObject.AddNew(NewObject: TGListItem = nil): TGListItem; -begin - if Assigned(NewObject) then Result := NewObject - else Result := TGListItem.Create; - Add(Result); -end; - -function TGListObject.InsertNew(Index: TGListIndex; - NewObject: TGListItem = nil): TGListItem; -begin - if Assigned(NewObject) then Result := NewObject - else Result := TGListItem.Create; - Insert(Index, Result); -end; - -procedure TGListObject.Assign(Source: TGList); -begin - Clear; - OwnsObjects := False; - inherited; -end; - -procedure TGListObject.Put(Index: TGListIndex; const AValue: TGListItem); -begin - if OwnsObjects and (FItems[Index] <> AValue) then FItems[Index].Free; - inherited Put(Index, AValue); -end; - -procedure TGListObject.Delete(Index: TGListObjectIndex); -begin - if OwnsObjects then FItems[Index].Free; - inherited Delete(Index); -end; - -procedure TGListObject.SetCount(const AValue: TGListIndex); -var - I: TGListObjectIndex; -begin - if OwnsObjects then begin - I := FCount - 1; - while I >= AValue do begin - FItems[I].Free; - I := I - 1; - end; - end; - I := FCount; - inherited; - // Nil newly allocated items - while I < AValue do begin - FItems[I] := nil; - I := I + 1; - end; -end; - -constructor TGListObject.Create; -begin - inherited; - OwnsObjects := True; -end; - -destructor TGListObject.Destroy; -begin - Clear; - inherited; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListString.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListString.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListString.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericListString.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGListStringIndex} -{$DEFINE TGListItem := TGListStringItem} -{$DEFINE TGList := TGListStringList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGListString = class(TGList) - TGListString = class(TGList) - private - public - procedure Delete(Index: TGListStringIndex); override; - procedure Clear; override; - procedure Assign(Source: TGList); override; - function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; override; - constructor Create; override; - destructor Destroy; override; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGListStringIndex} -{$DEFINE TGListItem := TGListStringItem} -{$DEFINE TGList := TGListStringList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGListString } - -procedure TGListString.Assign(Source: TGList); -begin - Clear; - inherited; -end; - -procedure TGListString.Delete(Index: TGListStringIndex); -begin - FItems[Index] := ''; - inherited Delete(Index); -end; - -procedure TGListString.Clear; -var - I: TGListStringIndex; -begin - I := 0; - while I < Count do begin - FItems[I] := ''; - I := I + 1; - end; - inherited Clear; -end; - -function TGListString.IndexOf(Item: TGListItem; Start: TGListIndex): TGListIndex; -begin - Result := Start; - while (Result < Count) and - (CompareStr(FItems[Result], Item) <> 0) do - Result := Result + 1; - if Result = FCount then Result := -1; -end; - -constructor TGListString.Create; -begin - inherited; -end; - -destructor TGListString.Destroy; -begin - Clear; - inherited Destroy; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericMatrix.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericMatrix.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericMatrix.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericMatrix.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,321 +0,0 @@ -// Work in progress... - -{$IFDEF INTERFACE} - - // TGMatrix = class - TGMatrix = class - public - type - TSortCompare = function(const Item1, Item2: TGMatrixItem): Integer of object; - TToStringConverter = function(Item: TGMatrixItem): string; - TFromStringConverter = function(Text: string): TGMatrixItem; - TRow = array of TGMatrixItem; - TMerge = function(Item1, Item2: TGMatrixItem): TGMatrixItem of object; - - TIndex = record - X: TGMatrixIndexX; - Y: TGMatrixIndexY; - end; - private - FItems: array of array of TGMatrixItem; - FCount: TIndex; - function GetItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY): TGMatrixItem; - function GetItem(Index: TIndex): TGMatrixItem; - function GetCapacity: TIndex; - procedure SetCapacity(const AValue: TIndex); - procedure PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); virtual; - procedure PutItem(Index: TIndex; const AValue: TGMatrixItem); virtual; - procedure SetCount(const AValue: TIndex); - public - procedure Assign(Source: TGMatrix); - procedure Clear; virtual; - procedure Contract; - function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex; - procedure Expand; - procedure Exchange(Index1, Index2: TIndex); - procedure FillAll(Value: TGMatrixItem); - procedure Fill(Start, Count: TIndex; Value: TGMatrixItem); - function Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string; - procedure Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge); - procedure Replace(Index: TIndex; Source: TGMatrix); - procedure Reverse; - procedure ReverseHorizontal; - procedure ReverseVertical; - property Count: TIndex read FCount write SetCount; - property Capacity: TIndex read GetCapacity write SetCapacity; - property ItemsXY[X: TGMatrixIndexX; Y: TGMatrixIndexY]: TGMatrixItem - read GetItemXY write PutItemXY; default; - property Items[Index: TIndex]: TGMatrixItem - read GetItem write PutItem; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - -resourcestring - SMatrixIndexError = 'Matrix index error [X: %d, Y: %d]'; - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{ TGMatrix } - -procedure TGMatrix.Replace(Index: TIndex; Source: TGMatrix); -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - Y := 0; - while Y < Source.Count.Y do begin - X := 0; - while X < Source.Count.X do begin - ItemsXY[Index.X + X, Index.Y + Y] := Source.ItemsXY[X, Y]; - X := X + 1; - end; - Y := Y + 1; - end; -end; - -procedure TGMatrix.Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge); -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - Y := 0; - while Y < Source.Count.Y do begin - X := 0; - while X < Source.Count.X do begin - ItemsXY[Index.X + X, Index.Y + Y] := Proc(ItemsXY[Index.X + X, Index.Y + Y], Source.ItemsXY[X, Y]); - X := X + 1; - end; - Y := Y + 1; - end; -end; - -function TGMatrix.CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex; -begin - Result.X := X; - Result.Y := Y; -end; - -function TGMatrix.GetCapacity: TIndex; -begin - Result.Y := Length(FItems); - if Result.Y > 0 then Result.X := Length(FItems[0]) else Result.X := 0; -end; - -procedure TGMatrix.SetCapacity(const AValue: TIndex); -begin - if (Capacity.X <> AValue.X) and (Capacity.Y <> AValue.Y) then begin - SetLength(FItems, AValue.Y, AValue.X); - end; -end; - -function TGMatrix.GetItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY): TGMatrixItem; -begin - if (X < 0) or (X >= Count.X) or - (Y < 0) or (Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [X, Y]); - Result := FItems[Y, X]; -end; - -function TGMatrix.GetItem(Index: TIndex): TGMatrixItem; -begin - if (Index.X < 0) or (Index.X >= Count.X) or - (Index.Y < 0) or (Index.Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [Index.X, Index.Y]); - Result := FItems[Index.Y, Index.X]; -end; - -procedure TGMatrix.PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); -begin - if (X < 0) or (X >= Count.X) or - (Y < 0) or (Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [X, Y]); - FItems[Y, X] := AValue; -end; - -procedure TGMatrix.PutItem(Index: TIndex; const AValue: TGMatrixItem); -begin - if (Index.X < 0) or (Index.X >= Count.X) or - (Index.Y < 0) or (Index.Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [Index.X, Index.Y]); - FItems[Index.Y, Index.X] := AValue; -end; - -procedure TGMatrix.SetCount(const AValue: TIndex); -begin - Capacity := AValue; - FCount := AValue; -end; - -procedure TGMatrix.Assign(Source: TGMatrix); -var - Index: TIndex; -begin - Count := Source.Count; - Index.Y := 0; - while Index.Y < Count.Y do begin - Index.X := 0; - while Index.X < Count.X do begin - Items[Index] := Source.Items[Index]; - Index.X := Index.X + 1; - end; - Index.Y := Index.Y + 1; - end; -end; - -procedure TGMatrix.Expand; -var - IncSize: TIndex; - NewCapacity: TIndex; -begin - if (FCount.X = Capacity.X) then begin - IncSize.X := 4; - if Capacity.X > 3 then IncSize.X := IncSize.X + 4; - if Capacity.X > 8 then IncSize.X := IncSize.X + 8; - if Capacity.X > 63 then IncSize.X := IncSize.X + Capacity.X shr 2; - NewCapacity.X := Capacity.X + IncSize.X; - end; - if (FCount.Y = Capacity.Y) then begin - IncSize.Y := 4; - if Capacity.Y > 3 then IncSize.Y := IncSize.Y + 4; - if Capacity.Y > 8 then IncSize.Y := IncSize.Y + 8; - if Capacity.Y > 63 then IncSize.Y := IncSize.Y + Capacity.Y shr 2; - NewCapacity.Y := Capacity.Y + IncSize.Y; - end; - Capacity := NewCapacity; -end; - -procedure TGMatrix.Contract; -var - NewCapacity: TIndex; -begin - if (Capacity.X > 256) and (FCount.X < Capacity.X shr 2) then - begin - NewCapacity.X := Capacity.X shr 1; - end; - if (Capacity.Y > 256) and (FCount.Y < Capacity.Y shr 2) then - begin - NewCapacity.Y := Capacity.Y shr 1; - end; - Capacity := NewCapacity; -end; - -procedure TGMatrix.Reverse; -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - Y := 0; - while Y < (Count.Y - 1) do begin - X := 1 + Y; - while X < Count.X do begin - Exchange(CreateIndex(X, Y), CreateIndex(Y, X)); - X := X + 1; - end; - Y := Y + 1; - end; -end; - -procedure TGMatrix.ReverseHorizontal; -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - Y := 0; - while Y < Count.Y do begin - X := 0; - while X < (Count.X div 2) do begin - Exchange(CreateIndex(X, Y), CreateIndex(Count.X - 1 - X, Y)); - X := X + 1; - end; - Y := Y + 1; - end; -end; - -procedure TGMatrix.ReverseVertical; -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - X := 0; - while X < Count.X do begin - Y := 0; - while Y < (Count.Y div 2) do begin - Exchange(CreateIndex(X, Y), CreateIndex(X, Count.Y - 1 - Y)); - Y := Y + 1; - end; - X := X + 1; - end; -end; - -function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string; -var - Y: TGMatrixIndexY; - X: TGMatrixIndexX; -begin - Result := ''; - Y := 0; - while Y < Count.Y do begin - X := 0; - while X < Count.X do begin - Result := Result + Converter(ItemsXY[X, Y]); - if X < (Count.X - 1) then - Result := Result + ColSeparator; - X := X + 1; - end; - if Y < (Count.Y - 1) then - Result := Result + RowSeparator; - Y := Y + 1; - end; -end; - -procedure TGMatrix.Clear; -begin - Count := CreateIndex(0, 0); - Capacity := CreateIndex(0, 0); -end; - -procedure TGMatrix.Fill(Start, Count: TIndex; Value: TGMatrixItem); -var - X: TGMatrixIndexX; - Y: TGMatrixIndexY; -begin - Y := Start.Y; - while Y < Count.Y do begin - X := Start.X; - while X < Count.X do begin - ItemsXY[X, Y] := Value; - X := X + 1; - end; - Y := Y + 1; - end; -end; - -procedure TGMatrix.FillAll(Value: TGMatrixItem); -begin - Fill(CreateIndex(0, 0), CreateIndex(Count.X - 1, Count.Y - 1), Value); -end; - -procedure TGMatrix.Exchange(Index1, Index2: TIndex); -var - Temp: TGMatrixItem; -begin - if (Index1.X < 0) or (Index1.X >= Count.X) or - (Index1.Y < 0) or (Index1.Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [Index1.X, Index1.Y]); - if (Index2.X < 0) or (Index2.X >= Count.X) or - (Index2.Y < 0) or (Index2.Y >= Count.Y) then - raise EListError.CreateFmt(SMatrixIndexError, [Index2.X, Index2.Y]); - Temp := FItems[Index1.Y, Index1.X]; - FItems[Index1.Y, Index1.X] := FItems[Index2.Y, Index2.X]; - FItems[Index2.Y, Index2.X] := Temp; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericPoint.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericPoint.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericPoint.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericPoint.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -{$IFDEF INTERFACE} - -// TGPoint = class -TGPoint = class - X: TGPointType; - Y: TGPointType; - procedure Add(Point: TGPoint); -end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -procedure TGPoint.Add(Point: TGPoint); -begin - X := X + Point.X; - Y := Y + Point.Y; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericQueue.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericQueue.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericQueue.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericQueue.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGQueueIndex} -{$DEFINE TGListItem := TGQueueItem} -{$DEFINE TGList := TGQueueList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGQueue = class(TGList) - TGQueue = class - private - FList: TGList; - function GetCount: TGQueueIndex; - public - procedure Enqueue(Value: TGQueueItem); - procedure EnqueueArray(Values: array of TGQueueItem); - procedure EnqueueList(List: TGList); - function Dequeue: TGQueueItem; - function Peek: TGQueueItem; - constructor Create; - destructor Destroy; override; - property List: TGList read FList; - property Count: TGQueueIndex read GetCount; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGQueueIndex} -{$DEFINE TGListItem := TGQueueItem} -{$DEFINE TGList := TGQueueList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGQueue } - -procedure TGQueue.Enqueue(Value: TGQueueItem); -begin - FList.Add(Value); -end; - -procedure TGQueue.EnqueueArray(Values: array of TGQueueItem); -begin - FList.AddArray(Values); -end; - -procedure TGQueue.EnqueueList(List: TGList); -begin - FList.AddList(List); -end; - -function TGQueue.Peek: TGQueueItem; -begin - Result := FList.First; -end; - -constructor TGQueue.Create; -begin - FList := TGList.Create; -end; - -destructor TGQueue.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TGQueue.Dequeue: TGQueueItem; -begin - Result := FList.Extract(FList.First); -end; - -function TGQueue.GetCount: TGQueueIndex; -begin - Result := FList.Count; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRange.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRange.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRange.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRange.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -{$IFDEF INTERFACE} - - // TGRange = class - TGRange = class - private - procedure SetDistance(const AValue: TRangeItem); - function GetDistance: TRangeItem; - public - A: TRangeItem; - B: TRangeItem; - procedure SetRange(NewA, NewB: TRangeItem); - property Distance: TRangeItem read GetDistance write SetDistance; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{ TGRange } - -procedure TGRange.SetDistance(const AValue: TRangeItem); -begin - B := A + AValue; -end; - -function TGRange.GetDistance: TRangeItem; -begin - Result := B - A; -end; - -procedure TGRange.SetRange(NewA, NewB: TRangeItem); -begin - if NewA > NewB then begin - A := NewB; - B := NewA; - end else begin - A := NewA; - B := NewB; - end; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} \ No newline at end of file diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRectangle.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRectangle.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRectangle.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericRectangle.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,283 +0,0 @@ -{$IFDEF INTERFACE} - -// TGRectangle = class -TGRectangle = class -private - function GetBottomLeft: TGRectanglePoint; - function GetBottomRight: TGRectanglePoint; - function GetHeight: TGRectangleDimension; - function GetSize: TGRectanglePoint; - function GetTopLeft: TGRectanglePoint; - function GetTopRight: TGRectanglePoint; - function GetWidth: TGRectangleDimension; - function GetEmpty: Boolean; - procedure SetBottom(const AValue: TGRectangleDimension); - procedure SetBottomLeft(const AValue: TGRectanglePoint); - procedure SetBottomRight(const AValue: TGRectanglePoint); - procedure SetHeight(const AValue: TGRectangleDimension); - procedure SetLeft(const AValue: TGRectangleDimension); - procedure SetRight(const AValue: TGRectangleDimension); - procedure SetSize(const AValue: TGRectanglePoint); - procedure SetTop(const AValue: TGRectangleDimension); - procedure SetTopLeft(const AValue: TGRectanglePoint); - procedure SetTopRight(const AValue: TGRectanglePoint); - procedure SetWidth(const AValue: TGRectangleDimension); - procedure SetEmpty(const AValue: Boolean); -public - FLeft: TGRectangleDimension; - FTop: TGRectangleDimension; - FRight: TGRectangleDimension; - FBottom: TGRectangleDimension; - KeepSize: Boolean; - - procedure Assign(Source: TGRectangle); - function IsPointInside(Pos: TGRectanglePoint): Boolean; - function IsRectInside(Rect: TGRectangle): Boolean; - procedure Intersect(Rect1, Rect2: TGRectangle); - procedure IntersectWith(Rect: TGRectangle); - procedure Union(Rect1, Rect2: TGRectangle); - procedure UnionWith(Rect: TGRectangle); - - procedure SetRect(Left, Top, Width, Height: TGRectangleDimension); - procedure SetBounds(Left, Top, Right, Bottom: TGRectangleDimension); - - property Left: TGRectangleDimension read FLeft write SetLeft; - property Top: TGRectangleDimension read FTop write SetTop; - property Right: TGRectangleDimension read FRight write SetRight; - property Bottom: TGRectangleDimension read FBottom write SetBottom; - - property Width: TGRectangleDimension read GetWidth write SetWidth; - property Height: TGRectangleDimension read GetHeight write SetHeight; - - property TopLeft: TGRectanglePoint read GetTopLeft write SetTopLeft; - property TopRight: TGRectanglePoint read GetTopRight write SetTopRight; - property BottomLeft: TGRectanglePoint read GetBottomLeft write SetBottomLeft; - property BottomRight: TGRectanglePoint read GetBottomRight write SetBottomRight; - - property Size: TGRectanglePoint read GetSize write SetSize; - property Empty: Boolean read GetEmpty write SetEmpty; -end; - - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - -uses Math; - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{ TGRectangle } - -function TGRectangle.GetBottomLeft: TGRectanglePoint; -begin - Result.X := Left; - Result.Y := Bottom; -end; - -function TGRectangle.GetBottomRight: TGRectanglePoint; -begin - Result.X := Right; - Result.Y := Bottom; -end; - -function TGRectangle.GetHeight: TGRectangleDimension; -begin - Result := Bottom - Top; -end; - -function TGRectangle.GetSize: TGRectanglePoint; -begin - Result.X := Width; - Result.Y := Height; -end; - -function TGRectangle.GetTopLeft: TGRectanglePoint; -begin - Result.X := Left; - Result.Y := Top; -end; - -function TGRectangle.GetTopRight: TGRectanglePoint; -begin - Result.X := Right; - Result.Y := Top; -end; - -function TGRectangle.GetWidth: TGRectangleDimension; -begin - Result := Right - Left; -end; - -procedure TGRectangle.SetBottom(const AValue: TGRectangleDimension); -begin - if FBottom = AValue then exit; - if KeepSize then FTop := FTop + (AValue - FBottom); - FBottom := AValue; -end; - -procedure TGRectangle.SetBottomLeft(const AValue: TGRectanglePoint); -begin - Left := AValue.X; - Bottom := AValue.Y; -end; - -procedure TGRectangle.SetBottomRight(const AValue: TGRectanglePoint); -begin - Right := AValue.X; - Bottom := AValue.Y; -end; - -procedure TGRectangle.SetHeight(const AValue: TGRectangleDimension); -begin - Bottom := Top + AValue; -end; - -procedure TGRectangle.SetLeft(const AValue: TGRectangleDimension); -begin - if FLeft = AValue then Exit; - if KeepSize then FRight := FRight + (AValue - FLeft); - FLeft := AValue; -end; - -procedure TGRectangle.SetRight(const AValue: TGRectangleDimension); -begin - if FRight = AValue then Exit; - if KeepSize then FLeft := FLeft + (AValue - FRight); - FRight := AValue; -end; - -procedure TGRectangle.SetSize(const AValue: TGRectanglePoint); -begin - Width := AValue.X; - Height := AValue.Y; -end; - -procedure TGRectangle.SetTop(const AValue: TGRectangleDimension); -begin - if FTop = AValue then Exit; - if KeepSize then FBottom := FBottom + (AValue - FTop); - FTop := AValue; -end; - -procedure TGRectangle.SetTopLeft(const AValue: TGRectanglePoint); -begin - Left := AValue.X; - Top := AValue.Y; -end; - -procedure TGRectangle.SetTopRight(const AValue: TGRectanglePoint); -begin - Right := AValue.X; - Top := AValue.Y; -end; - -procedure TGRectangle.SetWidth(const AValue: TGRectangleDimension); -begin - Right := Left + AValue; -end; - -procedure TGRectangle.Assign(Source: TGRectangle); -begin - Left := Source.Left; - Top := Source.Top; - Right := Source.Right; - Bottom := Source.Bottom; - KeepSize := Source.KeepSize; -end; - -function TGRectangle.IsPointInside(Pos: TGRectanglePoint): Boolean; -begin - Result := (Pos.X >= Left) and (Pos.Y >= Top) and - (Pos.X <= Right) and (Pos.Y <= Bottom); -end; - -function TGRectangle.IsRectInside(Rect: TGRectangle): Boolean; -begin - Result := (Rect.Left >= Left) and (Rect.Top >= Top) and - (Rect.Right <= Right) and (Rect.Bottom <= Bottom); -end; - -procedure TGRectangle.Intersect(Rect1, Rect2: TGRectangle); -begin - if Rect1.Empty or Rect2.Empty then Empty := True - else begin - Left := Max(Rect1.Left, Rect2.Left); - Top := Max(Rect1.Top, Rect2.Top); - Right := Min(Rect1.Right, Rect2.Right); - Bottom := Min(Rect1.Bottom, Rect2.Bottom); - end; -end; - -procedure TGRectangle.IntersectWith(Rect: TGRectangle); -begin - if Empty or Rect.Empty then Empty := True - else begin - Left := Max(Left, Rect.Left); - Top := Max(Top, Rect.Top); - Right := Min(Right, Rect.Right); - Bottom := Min(Bottom, Rect.Bottom); - end; -end; - -procedure TGRectangle.Union(Rect1, Rect2: TGRectangle); -begin - if Rect1.Empty then Assign(Rect2) - else - if Rect2.Empty then Assign(Rect1) - else begin - Left := Min(Rect1.Left, Rect2.Left); - Top := Min(Rect1.Top, Rect2.Top); - Right := Max(Rect1.Right, Rect2.Right); - Bottom := Max(Rect1.Bottom, Rect2.Bottom); - end; -end; - -procedure TGRectangle.UnionWith(Rect: TGRectangle); -begin - if Empty then Assign(Rect) - else - if not Rect.Empty then begin - Left := Min(Left, Rect.Left); - Top := Min(Top, Rect.Top); - Right := Max(Right, Rect.Right); - Bottom := Max(Bottom, Rect.Bottom); - end; -end; - -procedure TGRectangle.SetRect(Left, Top, Width, Height: TGRectangleDimension); -begin - Self.Left := Left; - Self.Top := Top; - Self.Width := Width; - Self.Height := Height; -end; - -procedure TGRectangle.SetBounds(Left, Top, Right, Bottom: TGRectangleDimension); -begin - Self.Left := Left; - Self.Top := Top; - Self.Right := Right; - Self.Bottom := Bottom; -end; - -function TGRectangle.GetEmpty: Boolean; -begin - Result := (Bottom <= Top) or (Right <= Left); -end; - -procedure TGRectangle.SetEmpty(const AValue: Boolean); -begin - Top := 0; - Bottom := 0; - Left := 0; - Right := 0; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericSet.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericSet.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericSet.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericSet.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGSetIndex} -{$DEFINE TGListItem := TGSetItem} -{$DEFINE TGList := TGSetList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGSet = class - TGSet = class - private - FList: TGList; - public - function IsIn(Item: TGSetItem): Boolean; - constructor Create; - destructor Destroy; override; - property List: TGList read FList; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGSetIndex} -{$DEFINE TGListItem := TGSetItem} -{$DEFINE TGList := TGSetList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGSet } - -function TGSet.IsIn(Item: TGSetItem): Boolean; -begin - Result := FList.IndexOf(Item) <> -1; -end; - -constructor TGSet.Create; -begin - FList := TGList.Create; -end; - -destructor TGSet.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStack.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStack.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStack.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStack.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -{$IFDEF INTERFACE} - -{$DEFINE TGListIndex := TGStackIndex} -{$DEFINE TGListItem := TGStackItem} -{$DEFINE TGList := TGStackList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGStack = class(TGList) - TGStack = class - private - FList: TGList; - public - procedure Push(Value: TGStackItem); - function Pop: TGStackItem; - constructor Create; - destructor Destroy; override; - property List: TGList read FList; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF IMPLEMENTATION_USES} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGStackIndex} -{$DEFINE TGListItem := TGStackItem} -{$DEFINE TGList := TGStackList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGStack } - -procedure TGStack.Push(Value: TGStackItem); -begin - FList.Add(Value); -end; - -function TGStack.Pop: TGStackItem; -begin - Result := FList.Extract(FList.Last); -end; - -constructor TGStack.Create; -begin - FList := TGList.Create; -end; - -destructor TGStack.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStream.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStream.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStream.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericStream.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -{$IFDEF INTERFACE} - - -// TGStream = class -TGStream = class -public - type - TItemArray = array of TGStreamItem; -private -procedure SetSize(AValue: TGStreamIndex); - function GetSize: TGStreamIndex; - procedure SetPosition(AValue: TGStreamIndex); - function GetPosition: TGStreamIndex; -public - procedure Assign(Source: TGStream); virtual; - procedure Write(Item: TGStreamItem); virtual; abstract; - procedure WriteArray(Item: array of TGStreamItem); virtual; abstract; - procedure WriteStream(Stream: TGStream; Count: TGStreamIndex); virtual; abstract; - function Read: TGStreamItem; virtual; abstract; - function ReadArray(Count: TGStreamIndex): TItemArray; virtual; abstract; - function ReadStream(Stream: TGStream; Count: TGStreamIndex): TGStreamIndex; virtual; abstract; - function Insert(Count: TGStreamIndex): TGStreamIndex; virtual; abstract; - function Remove(Count: TGStreamIndex): TGStreamIndex; virtual; abstract; - function Seek(Offset: TGStreamIndex; Origin: TSeekOrigin = soCurrent): - TGStreamIndex; virtual; abstract; - constructor Create; virtual; - property Position: TGStreamIndex read GetPosition write SetPosition; - property Size: TGStreamIndex read GetSize write SetSize; -end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION} - -procedure TGStream.Assign(Source: TGStream); -begin -end; - -procedure TGStream.SetPosition(AValue: TGStreamIndex); -begin - Seek(AValue, soBegin); -end; - -function TGStream.GetPosition: TGStreamIndex; -begin - Result := Seek(0, soCurrent); -end; - -procedure TGStream.SetSize(AValue: TGStreamIndex); -var - StreamSize: TGStreamIndex; - OldPosition: TGStreamIndex; -begin - OldPosition := Seek(0, soCurrent); - StreamSize := Size; - if AValue > StreamSize then begin - Seek(StreamSize, soBegin); - Insert(AValue - StreamSize); - end else - if AValue < StreamSize then begin - Seek(AValue, soBegin); - Remove(StreamSize - AValue); - end; - Position := OldPosition; -end; - -function TGStream.GetSize: TGStreamIndex; -var - OldPosition: Integer; -begin - OldPosition := Position; - Result := Seek(0, soEnd); - Position := OldPosition; -end; - -constructor TGStream.Create; -begin - inherited; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericTree.inc lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericTree.inc --- lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericTree.inc 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Generic/GenericTree.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -{$IFDEF INTERFACE} - - TGTreeNode = class; - -{$DEFINE TGListIndex := TGTreeIndex} -{$DEFINE TGListItem := TGTreeNode} -{$DEFINE TGList := TGTreeNodeList} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - - // TGTreeNode = class - TGTreeNode = class - Childs: TGTreeNodeList; - Value: TGTreeItem; - procedure Clear; - end; - - // TGTree = class - TGTree = class - TopItem: TGTreeNode; - procedure Clear; - end; - -{$UNDEF INTERFACE} -{$ENDIF} - -{$IFDEF IMPLEMENTATION_USES} - - {$DEFINE IMPLEMENTATION_USES} - {$I 'GenericList.inc'} - -{$UNDEF INTERFACE_USES} -{$ENDIF} - - -{$IFDEF IMPLEMENTATION} -{$UNDEF IMPLEMENTATION} - -{$DEFINE TGListIndex := TGTreeIndex} -{$DEFINE TGListItem := TGTreeNode} -{$DEFINE TGList := TGTreeNodeList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -{ TGTreeNode } - -procedure TGTreeNode.Clear; -begin - Childs.Clear; -end; - -{ TGTree } - -procedure TGTree.Clear; -begin - if Assigned(TopItem) then TopItem.Clear; -end; - -{$UNDEF IMPLEMENTATION} -{$ENDIF} diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/ReadMe.txt lazfuck-1.0.0/Packages/TemplateGenerics/ReadMe.txt --- lazfuck-1.0.0/Packages/TemplateGenerics/ReadMe.txt 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/ReadMe.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Template generics -================= - -Tutorial and basic information: - http://wiki.freepascal.org/Templates - -Version: 0.3 -Release date: 2011-01-01 -Author: Chronos -Email: robie@centrum.cz - - -Main subversion repository: -https://svn.zdechov.net/PascalClassLibrary/Generics/TemplateGenerics diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedBitmap.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedBitmap.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedBitmap.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedBitmap.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ - unit SpecializedBitmap; - -{$mode Delphi}{$H+} - -interface - -uses - Classes, SysUtils, - Graphics, FPImage; - -type - {$MACRO ON} - -// TBitmapTColor -{$DEFINE TGBitmapIndexX := Integer} -{$DEFINE TGBitmapIndexY := Integer} -{$DEFINE TGBitmapItem := TColor} -{$DEFINE TGBitmapIndex := TBitmapTColorIndex} -{$DEFINE TGBitmapRow := TBitmapTColorRow} -{$DEFINE TGBitmapMatrix := TBitmapTColorMatrix} -{$DEFINE TGBitmap := TBitmapTColor} -{$DEFINE TGBitmapSortCompare := TBitmapTColorSortCompare} -{$DEFINE TGBitmapToStringConverter := TBitmapTColorToStringConverter} -{$DEFINE TGBitmapFromStringConverter := TBitmapTColorFromStringConverter} -{$DEFINE TGBitmapMerge := TBitmapTColorMerge} -{$DEFINE INTERFACE} -{$I 'GenericBitmap.inc'} - -// TBitmapTFPColor -{$DEFINE TGBitmapIndexX := Integer} -{$DEFINE TGBitmapIndexY := Integer} -{$DEFINE TGBitmapItem := TFPColor} -{$DEFINE TGBitmapIndex := TBitmapTFPColorIndex} -{$DEFINE TGBitmapRow := TBitmapTFPColorRow} -{$DEFINE TGBitmapMatrix := TBitmapTFPColorMatrix} -{$DEFINE TGBitmap := TBitmapTFPColor} -{$DEFINE TGBitmapSortCompare := TBitmapTFPColorSortCompare} -{$DEFINE TGBitmapToStringConverter := TBitmapTFPColorToStringConverter} -{$DEFINE TGBitmapFromStringConverter := TBitmapTFPColorFromStringConverter} -{$DEFINE TGBitmapMerge := TBitmapTFPColorMerge} -{$DEFINE INTERFACE} -{$I 'GenericBitmap.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericBitmap.inc'} - -// TBitmapTColor -{$DEFINE TGBitmapIndexX := Integer} -{$DEFINE TGBitmapIndexY := Integer} -{$DEFINE TGBitmapItem := TColor} -{$DEFINE TGBitmapIndex := TBitmapTColorIndex} -{$DEFINE TGBitmapRow := TBitmapTColorRow} -{$DEFINE TGBitmapMatrix := TBitmapTColorMatrix} -{$DEFINE TGBitmap := TBitmapTColor} -{$DEFINE TGBitmapSortCompare := TBitmapTColorSortCompare} -{$DEFINE TGBitmapToStringConverter := TBitmapTColorToStringConverter} -{$DEFINE TGBitmapFromStringConverter := TBitmapTColorFromStringConverter} -{$DEFINE TGBitmapMerge := TBitmapTColorMerge} -{$DEFINE IMPLEMENTATION} -{$I 'GenericBitmap.inc'} - -// TBitmapTFPColor -{$DEFINE TGBitmapIndexX := Integer} -{$DEFINE TGBitmapIndexY := Integer} -{$DEFINE TGBitmapItem := TFPColor} -{$DEFINE TGBitmapIndex := TBitmapTFPColorIndex} -{$DEFINE TGBitmapRow := TBitmapTFPColorRow} -{$DEFINE TGBitmapMatrix := TBitmapTFPColorMatrix} -{$DEFINE TGBitmap := TBitmapTFPColor} -{$DEFINE TGBitmapSortCompare := TBitmapTFPColorSortCompare} -{$DEFINE TGBitmapToStringConverter := TBitmapTFPColorToStringConverter} -{$DEFINE TGBitmapFromStringConverter := TBitmapTFPColorFromStringConverter} -{$DEFINE TGBitmapMerge := TBitmapTFPColorMerge} -{$DEFINE IMPLEMENTATION} -{$I 'GenericBitmap.inc'} - -end. - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedDictionary.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedDictionary.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedDictionary.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedDictionary.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -unit SpecializedDictionary; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} - -// TDictionaryStringString> -{$DEFINE TGDictionaryIndex := Integer} -{$DEFINE TGPair := TPairStringString} -{$DEFINE TGPairKey := string} -{$DEFINE TGPairValue := string} -{$DEFINE TGDictionary := TDictionaryStringString} -{$DEFINE TGDictionaryList := TDictionaryStringStringList} -{$DEFINE INTERFACE} -{$I 'GenericDictionary.inc'} - -// TDictionaryIntegerString> -{$DEFINE TGDictionaryIndex := Integer} -{$DEFINE TGPair := TPairIntegerString} -{$DEFINE TGPairKey := Integer} -{$DEFINE TGPairValue := string} -{$DEFINE TGDictionary := TDictionaryIntegerString} -{$DEFINE TGDictionaryList := TDictionaryIntegerStringList} -{$DEFINE INTERFACE} -{$I 'GenericDictionary.inc'} - - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I '..\Generic\GenericDictionary.inc'} - - -// TDictionaryStringString> -{$DEFINE TGDictionaryIndex := Integer} -{$DEFINE TGPair := TPairStringString} -{$DEFINE TGPairKey := string} -{$DEFINE TGPairValue := string} -{$DEFINE TGDictionary := TDictionaryStringString} -{$DEFINE TGDictionaryList := TDictionaryStringStringList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericDictionary.inc'} - -// TDictionaryIntegerString> -{$DEFINE TGDictionaryIndex := Integer} -{$DEFINE TGPair := TPairIntegerString} -{$DEFINE TGPairKey := Integer} -{$DEFINE TGPairValue := string} -{$DEFINE TGDictionary := TDictionaryIntegerString} -{$DEFINE TGDictionaryList := TDictionaryIntegerStringList} -{$DEFINE IMPLEMENTATION} -{$I 'GenericDictionary.inc'} - - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedList.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedList.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedList.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedList.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,415 +0,0 @@ -unit SpecializedList; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} - -// TListInteger -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Integer} -{$DEFINE TGList := TListInteger} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListBoolean -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Boolean} -{$DEFINE TGList := TListBoolean} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListSmallInt -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := SmallInt} -{$DEFINE TGList := TListSmallInt} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListDouble -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Double} -{$DEFINE TGList := TListDouble} -{$DEFINE INTERFACE} -{$INCLUDE '..\Generic\GenericList.inc'} - -// TListPointer -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Pointer} -{$DEFINE TGList := TListPointer} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListString -{$DEFINE TGListStringIndex := Integer} -{$DEFINE TGListStringItem := string} -{$DEFINE TGListString := TListString} -{$DEFINE INTERFACE} -{$I 'GenericListString.inc'} - -// TListByte -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Byte} -{$DEFINE TGList := TListByteBase} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -TListByte = class(TListByteBase) - procedure WriteToStream(Stream: TStream); - procedure WriteToStreamPart(Stream: TStream; ItemIndex, ItemCount: TGListIndex); - procedure ReplaceStream(Stream: TStream); - procedure ReplaceStreamPart(Stream: TStream; ItemIndex, ItemCount: TGListIndex); - procedure AddStream(Stream: TStream); - procedure AddStreamPart(Stream: TStream; ItemCount: TGListIndex); -end; - -// TListChar -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Char} -{$DEFINE TGList := TListCharBase} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListObject -{$DEFINE TGListObjectIndex := Integer} -{$DEFINE TGListObjectItem := TObject} -{$DEFINE TGListObjectList := TListObjectList} -{$DEFINE TGListObject := TListObject} -{$DEFINE INTERFACE} -{$I 'GenericListObject.inc'} - - -{ TListChar } - -// TListByte -TListChar = class(TListCharBase) - procedure UpperCase; - procedure LowerCase; - procedure Trim; - procedure TrimLeft; - procedure TrimRight; -end; - -// TListMethodBase -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TMethod} -{$DEFINE TGList := TListMethodBase} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListMethod -TListMethod = class(TListMethodBase) - procedure CallAll; -end; - -// TListNotifyEventBase -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TNotifyEvent} -{$DEFINE TGList := TListNotifyEventBase} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListNotifyEvent -TListNotifyEvent = class(TListNotifyEventBase) - procedure CallAll(Sender: TObject); -end; - - -TBaseEvent = procedure of object; - -// TListSimpleEventBase -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TBaseEvent} -{$DEFINE TGList := TListSimpleEventBase} -{$DEFINE INTERFACE} -{$I 'GenericList.inc'} - -// TListSimpleEvent -TListSimpleEvent = class(TListSimpleEventBase) - procedure CallAll; -end; - - -// TFileListByte -{$DEFINE TGFileListIndex := Integer} -{$DEFINE TGFileListItem := Byte} -{$DEFINE TGFileListList := TFileListListByte} -{$DEFINE TGFileList := TFileListByte} -{$DEFINE INTERFACE} -{$I 'GenericFileList.inc'} - -function StrToStr(Value: string): string; - - - - - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericList.inc'} - -// TListInteger -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Integer} -{$DEFINE TGList := TListInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListSmallInt -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := SmallInt} -{$DEFINE TGList := TListSmallInt} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListBoolean -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Boolean} -{$DEFINE TGList := TListBoolean} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListDouble -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Double} -{$DEFINE TGList := TListDouble} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListPointer -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Pointer} -{$DEFINE TGList := TListPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListString -{$DEFINE TGListStringIndex := Integer} -{$DEFINE TGListStringItem := string} -{$DEFINE TGListString := TListString} -{$DEFINE IMPLEMENTATION} -{$I 'GenericListString.inc'} - -// TListByte -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Byte} -{$DEFINE TGList := TListByteBase} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListByte -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := Char} -{$DEFINE TGList := TListCharBase} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListObject -{$DEFINE TGListObjectIndex := Integer} -{$DEFINE TGListObjectItem := TObject} -{$DEFINE TGListObjectList := TListObjectList} -{$DEFINE TGListObject := TListObject} -{$DEFINE IMPLEMENTATION} -{$I 'GenericListObject.inc'} - -// TListMethod -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TMethod} -{$DEFINE TGList := TListMethodBase} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListNotifyEventBase -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TNotifyEvent} -{$DEFINE TGList := TListNotifyEventBase} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TListSimpleEventBase -{$DEFINE TGListIndex := Integer} -{$DEFINE TGListItem := TBaseEvent} -{$DEFINE TGList := TListSimpleEventBase} -{$DEFINE IMPLEMENTATION} -{$I 'GenericList.inc'} - -// TFileListByte -{$DEFINE TGFileListIndex := Integer} -{$DEFINE TGFileListItem := Byte} -{$DEFINE TGFileListList := TFileListListByte} -{$DEFINE TGFileList := TFileListByte} -{$DEFINE IMPLEMENTATION} -{$I 'GenericFileList.inc'} - - -function StrToStr(Value: string): string; -begin - Result := Value; -end; - -{ TListSimpleEvent } - -procedure TListSimpleEvent.CallAll; -var - I: TGListIndex; -begin - I := 0; - while (I < Count) do begin - TBaseEvent(Items[I])(); - I := I + 1; - end; -end; - - -{ TListChar } - -procedure TListChar.UpperCase; -var - I: TGListIndex; -begin - for I := 0 to Count - 1 do - if (FItems[I] in ['a'..'z']) then - FItems[I] := Char(Byte(FItems[I]) - 32); -end; - -procedure TListChar.LowerCase; -var - I: TGListIndex; -begin - for I := 0 to Count - 1 do - if (FItems[I] in ['A'..'Z']) then - FItems[I] := Char(Byte(FItems[I]) + 32); -end; - -procedure TListChar.Trim; -begin - TrimLeft; - TrimRight; -end; - -procedure TListChar.TrimLeft; -var - I: TGListIndex; -begin - I := 0; - while (I < Count) and (FItems[I] = ' ') do - I := I + 1; - if I < Count then - DeleteItems(0, I); -end; - -procedure TListChar.TrimRight; -var - I: TGListIndex; -begin - I := Count - 1; - while (I >= 0) and (FItems[I] = ' ') do - I := I - 1; - if I >= 0 then - DeleteItems(I + 1, Count - I - 1); -end; - -procedure TListMethod.CallAll; -var - I: TGListIndex; -begin - I := 0; - while (I < Count) do begin - Items[I]; - I := I + 1; - end; -end; - -procedure TListNotifyEvent.CallAll(Sender: TObject); -var - I: TGListIndex; -begin - I := Count - 1; - while (I >= 0) do begin - TNotifyEvent(Items[I])(Sender); - I := I - 1; - end; -end; - -{ TListByte } - -procedure TListByte.WriteToStream(Stream: TStream); -var - I: Integer; -begin - Stream.Position := 0; - I := 0; - while I < Count do begin - Stream.WriteByte(Items[I]); - I := I + 1; - end; -end; - -procedure TListByte.WriteToStreamPart(Stream: TStream; ItemIndex, ItemCount: Integer); -var - I: Integer; -begin - I := ItemIndex; - while I < ItemCount do begin - Stream.WriteByte(Items[I]); - I := I + 1; - end; -end; - -procedure TListByte.ReplaceStream(Stream: TStream); -var - I: Integer; -begin - Stream.Position := 0; - I := 0; - while I < Count do begin - Items[I] := Stream.ReadByte; - I := I + 1; - end; -end; - -procedure TListByte.ReplaceStreamPart(Stream: TStream; ItemIndex, - ItemCount: Integer); -var - I: Integer; -begin - I := ItemIndex; - while I < ItemCount do begin - Items[I] := Stream.ReadByte; - I := I + 1; - end; -end; - -procedure TListByte.AddStream(Stream: TStream); -var - I: Integer; -begin - Stream.Position := 0; - I := Count; - Count := Count + Stream.Size; - while I < Count do begin - Items[I] := Stream.ReadByte; - I := I + 1; - end; -end; - -procedure TListByte.AddStreamPart(Stream: TStream; ItemCount: Integer); -var - I: Integer; -begin - I := Count; - Count := Count + ItemCount; - while I < Count do begin - Items[I] := Stream.ReadByte; - I := I + 1; - end; -end; - - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -unit SpecializedMatrix; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils; - -type - {$MACRO ON} - -// TMatrixInteger -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := Integer} -{$DEFINE TGMatrixIndex := TMatrixIntegerIndex} -{$DEFINE TGMatrixRow := TMatrixIntegerRow} -{$DEFINE TGMatrix := TMatrixInteger} -{$DEFINE INTERFACE} -{$I 'GenericMatrix.inc'} - -// TMatrixByte -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := Byte} -{$DEFINE TGMatrixIndex := TMatrixByteIndex} -{$DEFINE TGMatrixRow := TMatrixByteRow} -{$DEFINE TGMatrix := TMatrixByte} -{$DEFINE INTERFACE} -{$I 'GenericMatrix.inc'} - -// TMatrixObject -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := TObject} -{$DEFINE TGMatrixIndex := TMatrixObjectIndex} -{$DEFINE TGMatrixRow := TMatrixObjectRow} -{$DEFINE TGMatrix := TMatrixObject} -{$DEFINE INTERFACE} -{$I 'GenericMatrix.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericMatrix.inc'} - -// TMatrixInteger -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := Integer} -{$DEFINE TGMatrixIndex := TMatrixIntegerIndex} -{$DEFINE TGMatrixRow := TMatrixIntegerRow} -{$DEFINE TGMatrix := TMatrixInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericMatrix.inc'} - -// TMatrixByte -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := Byte} -{$DEFINE TGMatrixIndex := TMatrixByteIndex} -{$DEFINE TGMatrixRow := TMatrixByteRow} -{$DEFINE TGMatrix := TMatrixByte} -{$DEFINE IMPLEMENTATION} -{$I 'GenericMatrix.inc'} - -// TMatrixObject -{$DEFINE TGMatrixIndexX := Integer} -{$DEFINE TGMatrixIndexY := Integer} -{$DEFINE TGMatrixItem := TObject} -{$DEFINE TGMatrixIndex := TMatrixObjectIndex} -{$DEFINE TGMatrixRow := TMatrixObjectRow} -{$DEFINE TGMatrix := TMatrixObject} -{$DEFINE IMPLEMENTATION} -{$I 'GenericMatrix.inc'} - -end. - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -unit SpecializedPoint; - -{$mode Delphi}{$H+} - -interface - -uses - Classes, SysUtils; - -{$MACRO ON} - -type -// TPoint -{$DEFINE TGPointType := Integer} -{$DEFINE TGPoint := TPoint} -{$DEFINE INTERFACE} -{$I 'GenericPoint.inc'} - -// TSmallPoint -{$DEFINE TGPointType := SmallInt} -{$DEFINE TGPoint := TSmallPoint} -{$DEFINE INTERFACE} -{$I 'GenericPoint.inc'} - -// TPointSingle -{$DEFINE TGPointType := Single} -{$DEFINE TGPoint := TPointSingle} -{$DEFINE INTERFACE} -{$I 'GenericPoint.inc'} - -// TPointDouble -{$DEFINE TGPointType := Double} -{$DEFINE TGPoint := TPointDouble} -{$DEFINE INTERFACE} -{$I 'GenericPoint.inc'} - -implementation - -// TPoint -{$DEFINE TGPointType := Integer} -{$DEFINE TGPoint := TPoint} -{$DEFINE IMPLEMENTATION} -{$I 'GenericPoint.inc'} - -// TSmallPoint -{$DEFINE TGPointType := SmallInt} -{$DEFINE TGPoint := TSmallPoint} -{$DEFINE IMPLEMENTATION} -{$I 'GenericPoint.inc'} - -// TPointSingle -{$DEFINE TGPointType := Single} -{$DEFINE TGPoint := TPointSingle} -{$DEFINE IMPLEMENTATION} -{$I 'GenericPoint.inc'} - -// TPointDouble -{$DEFINE TGPointType := Double} -{$DEFINE TGPoint := TPointDouble} -{$DEFINE IMPLEMENTATION} -{$I 'GenericPoint.inc'} -end. - \ No newline at end of file diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -unit SpecializedQueue; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} - -// TQueueInteger -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Integer} -{$DEFINE TGQueue := TQueueInteger} -{$DEFINE TGQueueList := TQueueListInteger} -{$DEFINE INTERFACE} -{$I 'GenericQueue.inc'} - -// TQueueInteger -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Pointer} -{$DEFINE TGQueue := TQueuePointer} -{$DEFINE TGQueueList := TQueueListPointer} -{$DEFINE INTERFACE} -{$I 'GenericQueue.inc'} - -// TQueueByte -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Byte} -{$DEFINE TGQueue := TQueueByte} -{$DEFINE TGQueueList := TQueueListByte} -{$DEFINE INTERFACE} -{$I 'GenericQueue.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericQueue.inc'} - -// TQueueInteger -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Integer} -{$DEFINE TGQueue := TQueueInteger} -{$DEFINE TGQueueList := TQueueListInteger} -{$DEFINE IMPLEMENTATION} -{$I '..\Generic\GenericQueue.inc'} - -// TQueueInteger -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Pointer} -{$DEFINE TGQueue := TQueuePointer} -{$DEFINE TGQueueList := TQueueListPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericQueue.inc'} - -// TQueueByte -{$DEFINE TGQueueIndex := Integer} -{$DEFINE TGQueueItem := Byte} -{$DEFINE TGQueue := TQueueByte} -{$DEFINE TGQueueList := TQueueListByte} -{$DEFINE IMPLEMENTATION} -{$I 'GenericQueue.inc'} - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedRectangle.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedRectangle.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedRectangle.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedRectangle.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -unit SpecializedRectangle; - -{$mode Delphi}{$H+} - -interface - -uses - Classes, SysUtils, SpecializedPoint, Types; - -type -{$MACRO ON} - -// TRectangle = TGRectangle -{$DEFINE TGRectangleDimension := Integer} -{$DEFINE TGRectangle := TBaseRectangle} -{$DEFINE TGRectanglePoint := TPoint} -{$DEFINE INTERFACE} -{$I 'GenericRectangle.inc'} - TRectangle = class(TBaseRectangle) - private - procedure SetTRect(const AValue: TRect); - function GetTRect: TRect; - public - property AsTRect: TRect read GetTRect write SetTRect; - end; - -// TRectangleDouble = TGRectangle -{$DEFINE TGRectangleDimension := Double} -{$DEFINE TGRectangle := TRectangleDouble} -{$DEFINE TGRectanglePoint := TPointDouble} -{$DEFINE INTERFACE} -{$I 'GenericRectangle.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericRectangle.inc'} - -// TRectangleInteger = TGRectangle -{$DEFINE TGRectangleDimension := Integer} -{$DEFINE TGRectangle := TBaseRectangle} -{$DEFINE TGRectanglePoint := TPoint} -{$DEFINE IMPLEMENTATION} -{$I 'GenericRectangle.inc'} - -function TRectangle.GetTRect: TRect; -begin - Result.Left := Left; - Result.Top := Top; - Result.Bottom := Bottom; - Result.Right := Right; -end; - -procedure TRectangle.SetTRect(const AValue: TRect); -begin - Left := AValue.Left; - Top := AValue.Top; - Bottom := AValue.Bottom; - Right := AValue.Right; -end; - -// TRectangleDouble = TGRectangle -{$DEFINE TGRectangleDimension := Double} -{$DEFINE TGRectangle := TRectangleDouble} -{$DEFINE TGRectanglePoint := TPointDouble} -{$DEFINE IMPLEMENTATION} -{$I 'GenericRectangle.inc'} - -end. - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedSet.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedSet.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedSet.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedSet.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -unit SpecializedSet; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} - -// TSetInteger -{$DEFINE TGSetIndex := Integer} -{$DEFINE TGSetItem := Integer} -{$DEFINE TGSetList := TSetListInteger} -{$DEFINE TGSet := TSetInteger} -{$DEFINE INTERFACE} -{$I 'GenericSet.inc'} - -// TSetPointer -{$DEFINE TGSetIndex := Integer} -{$DEFINE TGSetItem := Pointer} -{$DEFINE TGSetList := TSetListPointer} -{$DEFINE TGSet := TSetPointer} -{$DEFINE INTERFACE} -{$I 'GenericSet.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericSet.inc'} - -// TSetInteger -{$DEFINE TGSetIndex := Integer} -{$DEFINE TGSetItem := Integer} -{$DEFINE TGSetList := TSetListInteger} -{$DEFINE TGSet := TSetInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericSet.inc'} - -// TSetPointer -{$DEFINE TGSetIndex := Integer} -{$DEFINE TGSetItem := Pointer} -{$DEFINE TGSetList := TSetListPointer} -{$DEFINE TGSet := TSetPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericSet.inc'} - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStack.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStack.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStack.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStack.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -unit SpecializedStack; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} - -// TStackInteger -{$DEFINE TGStackIndex := Integer} -{$DEFINE TGStackItem := Integer} -{$DEFINE TGStackList := TListStackInteger} -{$DEFINE TGStack := TStackInteger} -{$DEFINE INTERFACE} -{$I 'GenericStack.inc'} - -// TStackInteger -{$DEFINE TGStackIndex := Integer} -{$DEFINE TGStackItem := Pointer} -{$DEFINE TGStackList := TListStackPointer} -{$DEFINE TGStack := TStackPointer} -{$DEFINE INTERFACE} -{$I 'GenericStack.inc'} - - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericStack.inc'} - -// TStackInteger -{$DEFINE TGStackIndex := Integer} -{$DEFINE TGStackItem := Integer} -{$DEFINE TGStackList := TListStackInteger} -{$DEFINE TGStack := TStackInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericStack.inc'} - -// TStackInteger -{$DEFINE TGStackIndex := Integer} -{$DEFINE TGStackItem := Pointer} -{$DEFINE TGStackList := TListStackPointer} -{$DEFINE TGStack := TStackPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericStack.inc'} -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStream.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStream.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStream.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedStream.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -unit SpecializedStream; - -{$mode delphi} - -interface - -uses - Classes, SysUtils, SpecializedList, DateUtils; - -type - TSeekOrigin = (soBegin, soCurrent, soEnd); - -{$MACRO ON} - -// TStreamInteger -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Integer} -{$DEFINE TGStreamList := TListStreamInteger} -{$DEFINE TGStream := TStreamInteger} -{$DEFINE INTERFACE} -{$I 'GenericStream.inc'} - -// TStreamByte -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Byte} -{$DEFINE TGStreamList := TListStreamByte} -{$DEFINE TGStream := TBaseStreamByte} -{$DEFINE INTERFACE} -{$I 'GenericStream.inc'} - -// TStreamPointer -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Pointer} -{$DEFINE TGStreamList := TListStreamPointer} -{$DEFINE TGStream := TStreamPointer} -{$DEFINE INTERFACE} -{$I 'GenericStream.inc'} - - TStreamByte = class(TBaseStreamByte) - function ReadBuffer(var Buffer; Count: Integer): Integer; virtual; abstract; - function WriteBuffer(var Buffer; Count: Integer): Integer; virtual; abstract; - end; - - { TMemoryStreamByte } - - TMemoryStreamByte = class(TStreamByte) - private - FList: TListByte; - FOwnsList: Boolean; - FPosition: Integer; - public - procedure Assign(Source: TBaseStreamByte); override; - procedure Write(Item: Byte); override; - procedure WriteArray(Values: array of Byte); override; - procedure WriteList(List: TListByte); - function WriteBuffer(var Buffer; Count: Integer): Integer; override; - procedure WriteStream(Stream: TBaseStreamByte; Count: Integer); override; - function Read: Byte; override; - function ReadArray(Count: Integer): TItemArray; override; - function ReadList(List: TListByte; Count: Integer): Integer; - function ReadBuffer(var Buffer; Count: Integer): Integer; override; - function ReadStream(Stream: TBaseStreamByte; Count: Integer): Integer; override; - function Insert(Count: Integer): Integer; override; - function Remove(Count: Integer): Integer; override; - function Seek(Offset: Integer; Origin: TSeekOrigin = soCurrent): Integer; override; - constructor Create; override; overload; - constructor Create(AList: TListByte); overload; - destructor Destroy; override; - property OwnsList: Boolean read FOwnsList write FOwnsList; - property List: TListByte read FList; - end; - - -implementation - -{ TMemoryStreamByte } - -procedure TMemoryStreamByte.Assign(Source: TBaseStreamByte); -begin - inherited; - if Source is TMemoryStreamByte then begin - FList.Assign(TMemoryStreamByte(Source).FList); - FPosition := TMemoryStreamByte(Source).FPosition; - end; -end; - -procedure TMemoryStreamByte.Write(Item: Byte); -begin - if FList.Count < (FPosition + 1) then - FList.Count := FPosition + 1; - FList[FPosition] := Item; - Inc(FPosition); -end; - -procedure TMemoryStreamByte.WriteArray(Values: array of Byte); -begin - if FList.Count < (FPosition + Length(Values)) then - FList.Count := FPosition + Length(Values); - FList.ReplaceArray(FPosition, Values); - Inc(FPosition, Length(Values)); -end; - -procedure TMemoryStreamByte.WriteList(List: TListByte); -begin - FList.ReplaceList(FPosition, List); -end; - -procedure TMemoryStreamByte.WriteStream(Stream: TBaseStreamByte; Count: Integer); -begin - -end; - -function TMemoryStreamByte.WriteBuffer(var Buffer; Count: Integer): Integer; -begin - Result := 0; -end; - -function TMemoryStreamByte.Read: Byte; -begin - Result := FList[FPosition]; - Inc(FPosition); -end; - -function TMemoryStreamByte.ReadArray(Count: Integer): TItemArray; -begin - Result := FList.GetArray(FPosition, Count); -end; - -function TMemoryStreamByte.ReadList(List: TListByte; Count: Integer): Integer; -begin - if (FPosition + Count) > FList.Count then - Count := FList.Count - FPosition; - FList.GetList(List, FPosition, Count); - Result := Count; -end; - -function TMemoryStreamByte.ReadBuffer(var Buffer; Count: Integer): Integer; -begin - Result := 0; -end; - -function TMemoryStreamByte.ReadStream(Stream: TBaseStreamByte; Count: Integer - ): Integer; -begin - Result := 0; -end; - -function TMemoryStreamByte.Insert(Count: Integer): Integer; -begin - FList.InsertCount(FPosition, Count); - Result := Count; -end; - -function TMemoryStreamByte.Remove(Count: Integer): Integer; -begin - Result := FList.Count - FPosition; - if Count < Result then Result := Count; - FList.DeleteItems(FPosition, Count); -end; - -function TMemoryStreamByte.Seek(Offset: Integer; Origin: TSeekOrigin): Integer; -begin - case Origin of - soBegin: FPosition := Offset; - soCurrent: FPosition := FPosition + Offset; - soEnd: FPosition := FList.Count + Offset; - end; - if FPosition > FList.Count then FPosition := FList.Count; - if FPosition < 0 then FPosition := 0; - Result := FPosition; -end; - -constructor TMemoryStreamByte.Create; -begin - inherited; - FList := TListByte.Create; - OwnsList := True; -end; - -constructor TMemoryStreamByte.Create(AList: TListByte); -begin - inherited Create; - FList := AList; - OwnsList := False; -end; - -destructor TMemoryStreamByte.Destroy; -begin - if OwnsList then FList.Free; - inherited Destroy; -end; - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericStream.inc'} - -// TStreamInteger -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Integer} -{$DEFINE TGStreamList := TListStreamInteger} -{$DEFINE TGStream := TStreamInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericStream.inc'} - -// TStreamByte -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Byte} -{$DEFINE TGStreamList := TListStreamByte} -{$DEFINE TGStream := TBaseStreamByte} -{$DEFINE IMPLEMENTATION} -{$I 'GenericStream.inc'} - -// TStreamPointer -{$DEFINE TGStreamIndex := Integer} -{$DEFINE TGStreamItem := Pointer} -{$DEFINE TGStreamList := TListStreamPointer} -{$DEFINE TGStream := TStreamPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericStream.inc'} - - - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedTree.pas lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedTree.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedTree.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/Specialized/SpecializedTree.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -unit SpecializedTree; - -{$mode delphi} - -interface - -uses - Classes, SysUtils; - -type -{$MACRO ON} -// TTreeInteger -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := Integer} -{$DEFINE TGTree := TTreeInteger} -{$DEFINE TGTreeNode := TTreeNodeInteger} -{$DEFINE TGTreeNodeList := TTreeNodeListInteger} -{$DEFINE INTERFACE} -{$I 'GenericTree.inc'} - -// TTreeString -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := string} -{$DEFINE TGTree := TTreeString} -{$DEFINE TGTreeNode := TTreeNodeString} -{$DEFINE TGTreeNodeList := TTreeNodeListString} -{$DEFINE INTERFACE} -{$I 'GenericTree.inc'} - -// TTreePointer -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := Pointer} -{$DEFINE TGTree := TTreePointer} -{$DEFINE TGTreeNode := TTreeNodePointer} -{$DEFINE TGTreeNodeList := TTreeNodeListPointer} -{$DEFINE INTERFACE} -{$I 'GenericTree.inc'} - -implementation - -{$DEFINE IMPLEMENTATION_USES} -{$I 'GenericTree.inc'} - -// TTreeInteger -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := Integer} -{$DEFINE TGTree := TTreeInteger} -{$DEFINE TGTreeNode := TTreeNodeInteger} -{$DEFINE TGTreeNodeList := TTreeNodeListInteger} -{$DEFINE IMPLEMENTATION} -{$I 'GenericTree.inc'} - -// TTreeString -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := string} -{$DEFINE TGTree := TTreeString} -{$DEFINE TGTreeNode := TTreeNodeString} -{$DEFINE TGTreeNodeList := TTreeNodeListString} -{$DEFINE IMPLEMENTATION} -{$I 'GenericTree.inc'} - -// TTreePointer -{$DEFINE TGTreeIndex := Integer} -{$DEFINE TGTreeItem := Pointer} -{$DEFINE TGTree := TTreePointer} -{$DEFINE TGTreeNode := TTreeNodePointer} -{$DEFINE TGTreeNodeList := TTreeNodeListPointer} -{$DEFINE IMPLEMENTATION} -{$I 'GenericTree.inc'} - -end. diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.lpk lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.lpk --- lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.lpk 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.lpk 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ExternHelp Items="Count"/> - - - diff -Nru lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.pas lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.pas --- lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/Packages/TemplateGenerics/TemplateGenerics.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -{ This file was automatically created by Lazarus. Do not edit! - This source is only used to compile and install the package. - } - -unit TemplateGenerics; - -interface - -uses - SpecializedList, SpecializedDictionary, SpecializedStack, SpecializedTree, - SpecializedQueue, SpecializedSet, SpecializedPoint, SpecializedMatrix, - SpecializedBitmap, SpecializedStream, SpecializedRectangle, - UBinarySerializer, LazarusPackageIntf; - -implementation - -procedure Register; -begin -end; - -initialization - RegisterPackage('TemplateGenerics', @Register); -end. diff -Nru lazfuck-1.0.0/UCore.lfm lazfuck-1.0.0/UCore.lfm --- lazfuck-1.0.0/UCore.lfm 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/UCore.lfm 2019-05-12 23:46:39.000000000 +0000 @@ -2,11 +2,11 @@ OnCreate = DataModuleCreate OnDestroy = DataModuleDestroy OldCreateOrder = False - Height = 361 - HorizontalOffset = 661 - VerticalOffset = 370 - Width = 424 - PPI = 120 + Height = 433 + HorizontalOffset = 793 + VerticalOffset = 444 + Width = 509 + PPI = 144 object ApplicationInfo: TApplicationInfo Identification = 1 VersionMajor = 1 @@ -24,28 +24,28 @@ RegistryKey = '\Software\Chronosoft\LazFuck' RegistryRoot = rrKeyCurrentUser License = 'CC0' - left = 90 - top = 20 + left = 108 + top = 24 end object CoolTranslator1: TCoolTranslator POFilesFolder = 'Languages' - left = 90 - top = 90 + left = 108 + top = 108 end object LastOpenedList: TLastOpenedList MaxCount = 10 - left = 90 - top = 160 + left = 108 + top = 192 end object PersistentForm1: TPersistentForm MinVisiblePart = 50 EntireVisible = False - left = 90 - top = 230 + left = 108 + top = 276 end object ImageListMain: TImageList - left = 310 - top = 20 + left = 372 + top = 24 Bitmap = { 4C691D0000001000000010000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -980,11 +980,11 @@ end object ScaleDPI1: TScaleDPI AutoDetect = False - left = 310 - top = 100 + left = 372 + top = 120 end object ThemeManager: TThemeManager - left = 302 - top = 174 + left = 362 + top = 209 end end diff -Nru lazfuck-1.0.0/UTarget.pas lazfuck-1.0.0/UTarget.pas --- lazfuck-1.0.0/UTarget.pas 2019-05-07 11:17:02.000000000 +0000 +++ lazfuck-1.0.0/UTarget.pas 2019-05-12 23:46:39.000000000 +0000 @@ -5,7 +5,7 @@ interface uses - Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList, Dialogs, + Classes, SysUtils, StrUtils, Registry, URegistry, fgl, Dialogs, FileUtil, Process, Menus, LazFileUtils; type @@ -27,7 +27,7 @@ { TDebugStepList } - TDebugStepList = class(TListObject) + TDebugStepList = class(TFPGObjectList) function SearchBySourcePos(Pos: Integer): TDebugStep; function SearchByTargetPos(Pos: Integer): TDebugStep; procedure AddStep(SourcePos, TargetPos: Integer; Operation: TStepOperation); @@ -41,7 +41,7 @@ { TBreakPointList } - TBreakPointList = class(TListObject) + TBreakPointList = class(TFPGObjectList) procedure AddItem(TargetAddress: Integer); procedure SetSystem(TargetAddress: Integer); procedure AddSystem(TargetAddress: Integer); @@ -56,7 +56,7 @@ { TMessageList } - TMessageList = class(TListObject) + TMessageList = class(TFPGObjectList) private FOnChange: TNotifyEvent; procedure DoChange; @@ -132,7 +132,7 @@ { TTargetList } - TTargetList = class(TListObject) + TTargetList = class(TFPGObjectList) procedure LoadFromRegistry(Context: TRegistryContext); procedure SaveToRegistry(Context: TRegistryContext); function FindByName(Name: string): TTarget;