replaced codetools+gtk intf TList with faster TFPList

git-svn-id: trunk@7405 -
This commit is contained in:
mattias 2005-07-23 09:27:30 +00:00
parent c99014ca13
commit e303f8f83f
17 changed files with 133 additions and 105 deletions

View File

@ -35,7 +35,7 @@
- insert header comment for classes
ToDo:
-add code for index properties (TList, array of, Pointer array)
-add code for index properties (TList, TFPList, array of, Pointer array)
TList:
property Items[Index: integer]: AType accesstlist;
-> creates

View File

@ -172,7 +172,7 @@ type
function GetMainCode(Code: TCodeBuffer): TCodeBuffer;
function GetIncludeCodeChain(Code: TCodeBuffer;
RemoveFirstCodesWithoutTool: boolean;
var ListOfCodeBuffer: TList): boolean;
var ListOfCodeBuffer: TFPList): boolean;
function FindCodeToolForSource(Code: TCodeBuffer): TCustomCodeTool;
property OnSearchUsedUnit: TOnSearchUsedUnit
read FOnSearchUsedUnit write FOnSearchUsedUnit;
@ -244,11 +244,11 @@ type
var FPCVersion, FPCRelease, FPCPatch: integer);
// data function
procedure FreeListOfPCodeXYPosition(var List: TList);
procedure FreeListOfPCodeXYPosition(var List: TFPList);
procedure FreeTreeOfPCodeXYPosition(var Tree: TAVLTree);
function CreateTreeOfPCodeXYPosition: TAVLTree;
procedure AddListToTreeOfPCodeXYPosition(SrcList: TList; DestTree: TAVLTree;
ClearList, CreateCopies: boolean);
procedure AddListToTreeOfPCodeXYPosition(SrcList: TFPList;
DestTree: TAVLTree; ClearList, CreateCopies: boolean);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -297,7 +297,7 @@ type
const Identifier: string; var NewCode: TCodeBuffer;
var NewX, NewY, NewTopLine: integer): boolean;
function FindDeclarationsAndAncestors(Code: TCodeBuffer; X,Y: integer;
var ListOfPCodeXYPosition: TList): boolean;
var ListOfPCodeXYPosition: TFPList): boolean;
function FindMainDeclaration(Code: TCodeBuffer; X,Y: integer;
var NewCode: TCodeBuffer;
var NewX, NewY, NewTopLine: integer): boolean;
@ -311,7 +311,7 @@ type
// rename identifier
function FindReferences(IdentifierCode: TCodeBuffer;
X, Y: integer; TargetCode: TCodeBuffer; SkipComments: boolean;
var ListOfPCodeXYPosition: TList): boolean;
var ListOfPCodeXYPosition: TFPList): boolean;
function RenameIdentifier(TreeOfPCodeXYPosition: TAVLTree;
const OldIdentifier, NewIdentifier: string): boolean;
@ -745,7 +745,7 @@ begin
end;
function TCodeToolManager.GetIncludeCodeChain(Code: TCodeBuffer;
RemoveFirstCodesWithoutTool: boolean; var ListOfCodeBuffer: TList): boolean;
RemoveFirstCodesWithoutTool: boolean; var ListOfCodeBuffer: TFPList): boolean;
var
OldCode: TCodeBuffer;
begin
@ -755,7 +755,7 @@ begin
if Code=nil then exit;
Result:=true;
ListOfCodeBuffer:=TList.Create;
ListOfCodeBuffer:=TFPList.Create;
ListOfCodeBuffer.Add(Code);
// if this is an include file, find the top level source
@ -1023,7 +1023,7 @@ begin
end;
end;
procedure TCodeToolManager.FreeListOfPCodeXYPosition(var List: TList);
procedure TCodeToolManager.FreeListOfPCodeXYPosition(var List: TFPList);
var
i: Integer;
CursorPos: PCodeXYPosition;
@ -1060,7 +1060,7 @@ begin
Result:=TAVLTree.Create(TListSortCompare(@CompareCodeXYPositions));
end;
procedure TCodeToolManager.AddListToTreeOfPCodeXYPosition(SrcList: TList;
procedure TCodeToolManager.AddListToTreeOfPCodeXYPosition(SrcList: TFPList;
DestTree: TAVLTree; ClearList, CreateCopies: boolean);
var
i: Integer;
@ -1368,7 +1368,7 @@ begin
end;
function TCodeToolManager.FindDeclarationsAndAncestors(Code: TCodeBuffer; X,
Y: integer; var ListOfPCodeXYPosition: TList): boolean;
Y: integer; var ListOfPCodeXYPosition: TFPList): boolean;
var
CursorPos: TCodeXYPosition;
begin
@ -1486,7 +1486,7 @@ end;
function TCodeToolManager.FindReferences(IdentifierCode: TCodeBuffer;
X, Y: integer; TargetCode: TCodeBuffer; SkipComments: boolean;
var ListOfPCodeXYPosition: TList): boolean;
var ListOfPCodeXYPosition: TFPList): boolean;
var
CursorPos: TCodeXYPosition;
NewCode: TCodeBuffer;

View File

@ -663,9 +663,9 @@ type
function FindBaseTypeOfNode(Params: TFindDeclarationParams;
Node: TCodeTreeNode): TFindContext;
function FindDeclarationsAndAncestors(const CursorPos: TCodeXYPosition;
var ListOfPCodeXYPosition: TList): boolean;
var ListOfPCodeXYPosition: TFPList): boolean;
function FindReferences(const CursorPos: TCodeXYPosition;
SkipComments: boolean; var ListOfPCodeXYPosition: TList): boolean;
SkipComments: boolean; var ListOfPCodeXYPosition: TFPList): boolean;
function CleanPosIsDeclarationIdentifier(CleanPos: integer;
Node: TCodeTreeNode): boolean;
@ -2897,13 +2897,14 @@ begin
end;
function TFindDeclarationTool.FindDeclarationsAndAncestors(
const CursorPos: TCodeXYPosition; var ListOfPCodeXYPosition: TList): boolean;
const CursorPos: TCodeXYPosition; var ListOfPCodeXYPosition: TFPList
): boolean;
procedure AddCodePosition(const NewCodePos: TCodeXYPosition);
var
AddCodePos: PCodeXYPosition;
begin
if ListOfPCodeXYPosition=nil then ListOfPCodeXYPosition:=TList.Create;
if ListOfPCodeXYPosition=nil then ListOfPCodeXYPosition:=TFPList.Create;
New(AddCodePos);
AddCodePos^:=NewCodePos;
ListOfPCodeXYPosition.Add(AddCodePos);
@ -2972,13 +2973,13 @@ end;
{-------------------------------------------------------------------------------
function TFindDeclarationTool.FindReferences(const CursorPos: TCodeXYPosition;
SkipComments: boolean; var ListOfPCodeXYPosition: TList): boolean;
SkipComments: boolean; var ListOfPCodeXYPosition: TFPList): boolean;
Search for all identifiers in current unit, referring to the declaration
at CursorPos.
-------------------------------------------------------------------------------}
function TFindDeclarationTool.FindReferences(const CursorPos: TCodeXYPosition;
SkipComments: boolean; var ListOfPCodeXYPosition: TList): boolean;
SkipComments: boolean; var ListOfPCodeXYPosition: TFPList): boolean;
var
Identifier: string;
DeclarationTool: TFindDeclarationTool;
@ -3010,7 +3011,7 @@ var
var
AddCodePos: PCodeXYPosition;
begin
if ListOfPCodeXYPosition=nil then ListOfPCodeXYPosition:=TList.Create;
if ListOfPCodeXYPosition=nil then ListOfPCodeXYPosition:=TFPList.Create;
New(AddCodePos);
AddCodePos^:=NewCodePos;
ListOfPCodeXYPosition.Add(AddCodePos);

View File

@ -324,7 +324,7 @@ type
function WholeRangeIsWritable(CleanStartPos, CleanEndPos: integer;
ErrorOnFail: boolean): boolean;
procedure FindCodeInRange(CleanStartPos, CleanEndPos: integer;
UniqueSortedCodeList: TList);
UniqueSortedCodeList: TFPList);
procedure DeleteRange(CleanStartPos,CleanEndPos: integer);
// scanning
@ -462,7 +462,7 @@ var
PSourceChangeStepMemManager: TPSourceChangeStepMemManager;
procedure AddCodeToUniqueList(ACode: Pointer; UniqueSortedCodeList: TList);
procedure AddCodeToUniqueList(ACode: Pointer; UniqueSortedCodeList: TFPList);
function IndexOfCodeInUniqueList(ACode: Pointer;
UniqueSortedCodeList: TList): integer;
function IndexOfCodeInUniqueList(ACode: Pointer;
@ -516,7 +516,7 @@ begin
Result:=-1;
end;
procedure AddCodeToUniqueList(ACode: Pointer; UniqueSortedCodeList: TList);
procedure AddCodeToUniqueList(ACode: Pointer; UniqueSortedCodeList: TFPList);
var l,m,r: integer;
begin
l:=0;
@ -1742,7 +1742,7 @@ function TLinkScanner.GuessMisplacedIfdefEndif(StartCursorPos: integer;
Result:=false;
end;
procedure FreeIfStack(var IfStack: TList);
procedure FreeIfStack(var IfStack: TFPList);
var
i: integer;
AnIf: PIf;
@ -1810,7 +1810,7 @@ function TLinkScanner.GuessMisplacedIfdefEndif(StartCursorPos: integer;
end;
end;
procedure PushIfOnStack(const ASrc: string; AToken: TToken; IfStack: TList);
procedure PushIfOnStack(const ASrc: string; AToken: TToken; IfStack: TFPList);
var
NewIf: PIf;
begin
@ -1825,7 +1825,7 @@ function TLinkScanner.GuessMisplacedIfdefEndif(StartCursorPos: integer;
IfStack.Add(NewIf);
end;
procedure PopIfFromStack(IfStack: TList);
procedure PopIfFromStack(IfStack: TFPList);
var Topif: PIf;
begin
TopIf:=PIf(IfStack[IfStack.Count-1]);
@ -1840,13 +1840,13 @@ function TLinkScanner.GuessMisplacedIfdefEndif(StartCursorPos: integer;
ASrc: string;
ASrcLen: integer;
CurToken: TToken;
IfStack: TList;
IfStack: TFPList;
DirectiveType: TDirectiveType;
begin
Result:=false;
if not InitGuessMisplaced(CurToken,ACode,ASrc,ASrcLen) then exit;
IfStack:=TList.Create;
IfStack:=TFPList.Create;
try
repeat
if (not FindNextToken(ASrc,CurToken)) then begin
@ -1909,7 +1909,7 @@ function TLinkScanner.GuessMisplacedIfdefEndif(StartCursorPos: integer;
var
LinkID, i, BestSrcPos: integer;
LastCode: Pointer;
SearchedCodes: TList;
SearchedCodes: TFPList;
begin
Result:=false;
@ -1927,7 +1927,7 @@ begin
if LinkID<0 then exit;
// go through all following sources and guess misplaced ifdef/endif
SearchedCodes:=TList.Create;
SearchedCodes:=TFPList.Create;
try
while LinkId<LinkCount do begin
Result:=GuessMisplacedIfdefEndifInCode(FLinks[LinkID].Code,
@ -2887,7 +2887,7 @@ begin
end;
procedure TLinkScanner.FindCodeInRange(CleanStartPos, CleanEndPos: integer;
UniqueSortedCodeList: TList);
UniqueSortedCodeList: TFPList);
var ACode: Pointer;
LinkIndex: integer;
begin

View File

@ -170,7 +170,7 @@ type
private
FMainScanner: TLinkScanner;
FEntries: TAVLTree;
FBuffersToModify: TList; // sorted list of TCodeBuffer
FBuffersToModify: TFPList; // sorted list of TCodeBuffer
FBuffersToModifyNeedsUpdate: boolean;
FMainScannerNeeded: boolean;
FOnBeforeApplyChanges: TOnBeforeApplyChanges;
@ -379,7 +379,7 @@ begin
inherited Create;
FEntries:=TAVLTree.Create(@CompareSourceChangeCacheEntry);
MainScanner:=nil;
FBuffersToModify:=TList.Create;
FBuffersToModify:=TFPList.Create;
FBuffersToModifyNeedsUpdate:=false;
BeautifyCodeOptions:=TBeautifyCodeOptions.Create;
end;

View File

@ -2304,7 +2304,7 @@ function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
end;
var
SourceList: TList;
SourceList: TFPList;
i: integer;
begin
Result:=false;
@ -2313,7 +2313,7 @@ begin
BuildTree(false);
if Scanner=nil then exit;
SourceChangeCache.MainScanner:=Scanner;
SourceList:=TList.Create;
SourceList:=TFPList.Create;
try
Scanner.FindCodeInRange(1,SrcLen,SourceList);
for i:=0 to SourceList.Count-1 do begin

View File

@ -123,7 +123,7 @@ var
i: Integer;
LoadResult: TModalResult;
Code: TCodeBuffer;
ListOfPCodeXYPosition: TList;
ListOfPCodeXYPosition: TFPList;
begin
Result:=mrCancel;
ListOfPCodeXYPosition:=nil;
@ -368,7 +368,7 @@ procedure TFindRenameIdentifierDialog.SetIdentifier(
var
s: String;
ACodeBuffer: TCodeBuffer;
ListOfCodeBuffer: TList;
ListOfCodeBuffer: TFPList;
i: Integer;
CurCode: TCodeBuffer;
NewIdentifier: String;

View File

@ -562,7 +562,7 @@ function THelpManager.ShowHelpForSourcePosition(const Filename: string;
CleanPos: integer;
i: Integer;
Node: TCodeTreeNode;
IncludeChain: TList;
IncludeChain: TFPList;
ConversionResult: LongInt;
begin
Result:=nil;
@ -613,7 +613,7 @@ var
CodeBuffer: TCodeBuffer;
i: Integer;
CurCodePos: PCodeXYPosition;
ListOfPCodeXYPosition: TList;
ListOfPCodeXYPosition: TFPList;
PascalHelpContextLists: TList;
NewList: TPascalHelpContextList;
begin

View File

@ -12,6 +12,26 @@ msgstr ""
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid " Do not show splash screen"
msgstr " Eröffnungslogo nicht anzeigen"
#: lazarusidestrconsts:lisskiploadinglastproject
msgid " Skip loading last project"
msgstr " Altes Projekt nicht laden"
#: lazarusidestrconsts:lisfilewheredebugoutputiswritten
msgid " file, where debug output is written to. If it is not specified, debug output is written to the console."
msgstr " Datei, in die die Debugger-Ausgabe geschrieben wird. Ist sie nicht angegeben, erschein die Debug-Ausgabe auf der Konsole."
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid " primary config directory, where Lazarus stores its config files. Default is "
msgstr " Haupteinstellungsverzeichnis, dort speichert Lazarus seine Konfigurationsdateien. Standard ist"
#: lazarusidestrconsts:lissecondaryconfigdirectorywherelazarussearchesfor
msgid " secondary config directory, where Lazarus searches for config template files. Default is "
msgstr " sekundäres Konfigurationsverzeichnis, dort sucht Lazarus nach Konfigurationsschablonen. Standard ist"
#: lazarusidestrconsts:srkmcommand1
msgid " command1 \""
msgstr " Anweisung1 \""
@ -1892,10 +1912,6 @@ msgstr "Zeilennummern in Laufzeitfehler-Backtraces anzeigen"
msgid "Distinguish big and small letters e.g. A and a"
msgstr "Groß- und Kleinschreibung unterscheiden"
#: lazarusidestrconsts:lisdonotshowsplashscreen
msgid "Do not show splash screen"
msgstr ""
#: lazarusidestrconsts:dlgnotsplitlinefront
msgid "Do not split line In front of:"
msgstr "Zeile nicht teilen vor:"
@ -4484,10 +4500,6 @@ msgstr "Ausgabeverzeichnis"
msgid "Overflow"
msgstr "Überlauf"
#: lazarusidestrconsts:lisoverridelanguage
msgid "Override language. For example --language=de. For possible values see files in the languages directory."
msgstr ""
#: lazarusidestrconsts:lissvuooverridesystemvariable
msgid "Override system variable"
msgstr "Systemvariablen überschreiben"
@ -5884,10 +5896,6 @@ msgstr "Gr
msgid "Skip calling Compiler"
msgstr "Aufruf des Compilers übergehen"
#: lazarusidestrconsts:lisskiploadinglastproject
msgid "Skip loading last project"
msgstr ""
#: lazarusidestrconsts:dlgcosmaller
msgid "Smaller Code"
msgstr "Kleinerer Code"
@ -7772,10 +7780,6 @@ msgstr "Standard (%s)"
msgid "evaluate/modify"
msgstr "auswerten/ändern"
#: lazarusidestrconsts:lisfilewheredebugoutputiswritten
msgid "file, where debug output is written to. If it is not specified, debug output is written to the console."
msgstr ""
#: lazarusidestrconsts:lisuidinproject
msgid "in Project:"
msgstr "im Projekt:"
@ -7876,10 +7880,6 @@ msgstr "Pakethauptquelldatei"
msgid "pause program"
msgstr "Programm pausieren"
#: lazarusidestrconsts:lisprimaryconfigdirectorywherelazarusstoresitsconfig
msgid "primary config directory, where Lazarus stores its config files. Default is "
msgstr ""
#: lazarusidestrconsts:lisoipreadonly
msgid "readonly"
msgstr "schreibgeschützt"
@ -7932,10 +7932,6 @@ msgstr "Suche in Verzeichnissen"
msgid "sec"
msgstr "s"
#: lazarusidestrconsts:lissecondaryconfigdirectorywherelazarussearchesfor
msgid "secondary config directory, where Lazarus searches for config template files. Default is "
msgstr ""
#: lazarusidestrconsts:lisedtdefsetfpcmodetodelphi
msgid "set FPC mode to DELPHI"
msgstr "Delphi-Kompatibilitätsmodus"

View File

@ -67,6 +67,8 @@ type
TDynHashArrayOption = (dhaoCachingEnabled, dhaoCacheContains);
TDynHashArrayOptions = set of TDynHashArrayOption;
{ TDynHashArray }
TDynHashArray = class
private
FItems: ^PDynHashArrayItem;
@ -115,6 +117,7 @@ type
function GetHashItem(HashIndex: integer): PDynHashArrayItem;
procedure Delete(ADynHashArrayItem: PDynHashArrayItem);
procedure AssignTo(List: TList);
procedure AssignTo(List: TFPList);
function SlowAlternativeHashMethod(Sender: TDynHashArray;
Item: Pointer): integer;
@ -558,7 +561,23 @@ begin
end;
procedure TDynHashArray.AssignTo(List: TList);
var i: integer;
var
i: integer;
HashItem: PDynHashArrayItem;
begin
List.Count:=Count;
HashItem:=FirstHashItem;
i:=0;
while HashItem<>nil do begin
List[i]:=HashItem^.Item;
inc(i);
HashItem:=HashItem^.Next;
end;
end;
procedure TDynHashArray.AssignTo(List: TFPList);
var
i: integer;
HashItem: PDynHashArrayItem;
begin
List.Count:=Count;

View File

@ -2615,7 +2615,7 @@ end;
function GTKKeySnooper(Widget: PGtkWidget; Event: PGdkEventKey;
FuncData: gPointer): gInt; cdecl;
var
KeyStateList: TList;
KeyStateList: TFPList;
procedure UpdateToggleList(const AVKeyCode: Integer);
begin
@ -2682,7 +2682,7 @@ begin
Exit;
end;
KeyStateList := TList(FuncData);
KeyStateList := TFPList(FuncData);
if KeyStateList = nil then Exit;
UpdateList(Vkey.VKey, Pressed);
@ -2986,6 +2986,9 @@ end;
{ =============================================================================
$Log$
Revision 1.282 2005/07/23 09:27:30 mattias
replaced codetools+gtk intf TList with faster TFPList
Revision 1.281 2005/07/07 20:56:29 mattias
clean up

View File

@ -299,7 +299,7 @@ type
var
// FTimerData contains the currently running timers
FTimerData : TList; // list of PGtkITimerinfo
FTimerData : TFPList; // list of PGtkITimerinfo
var
gtk_handler_quark: TGQuark;
@ -343,7 +343,7 @@ var
// each selection has an gtk identifier (an atom)
ClipboardTypeAtoms: array[TClipboardType] of cardinal;
// each active request will procduce an TClipboardEventData stored in this list
ClipboardSelectionData: TList; // list of PClipboardEventData
ClipboardSelectionData: TFPList; // list of PClipboardEventData
// each selection can have an user defined handler (normally set by the lcl)
ClipboardHandler: array[TClipboardType] of TClipboardRequestEvent;
// boolean array, telling what gtk format is automatically supported by
@ -411,7 +411,7 @@ type
// modal windows
var
ModalWindows: TList; // list of PGtkWindow
ModalWindows: TFPList; // list of PGtkWindow
// gtk object data names

View File

@ -88,7 +88,7 @@ uses
type
TGTKWidgetSet = class(TWidgetSet)
protected
FKeyStateList_: TList; // Keeps track of which keys are pressed
FKeyStateList_: TFPList; // Keeps track of which keys are pressed
FDeviceContexts: TDynHashArray;// hasharray of HDC
FGDIObjects: TDynHashArray; // hasharray of PGdiObject
FMessageQueue: TGtkMessageQueue; // queue of PMsg
@ -362,7 +362,7 @@ begin
LastRight:=EmptyLastMouseClick;
// clipboard
ClipboardSelectionData:=TList.Create;
ClipboardSelectionData:=TFPList.Create;
for c:=Low(TClipboardType) to High(TClipboardType) do begin
ClipboardTypeAtoms[c]:=0;
ClipboardHandler[c]:=nil;
@ -441,6 +441,9 @@ end.
{ =============================================================================
$Log$
Revision 1.225 2005/07/23 09:27:30 mattias
replaced codetools+gtk intf TList with faster TFPList
Revision 1.224 2005/04/25 07:55:33 mattias
backtraces for gtk gdi objects -dTraceGdiCalls from Jesus

View File

@ -162,9 +162,9 @@ begin
FWidgetsResized.Options:=FWidgetsResized.Options+[dhaoCacheContains];
FFixWidgetsResized := TDynHashArray.Create(-1);
FTimerData := TList.Create;
FTimerData := TFPList.Create;
{$IFDEF Use_KeyStateList}
FKeyStateList_ := TList.Create;
FKeyStateList_ := TFPList.Create;
{$ENDIF}
DestroyConnectedWidgetCB:=@DestroyConnectedWidget;
@ -550,7 +550,7 @@ type
end;
var
AllWindows: TList;
AllWindows: TFPList;
List: PGList;
Window: PGTKWindow;
ATransientWindow: PTransientWindow;
@ -606,7 +606,7 @@ begin
ATransientWindow^.SortIndex:=
Screen.CustomFormIndex(TCustomForm(LCLObject));
end;
if AllWindows=nil then AllWindows:=TList.Create;
if AllWindows=nil then AllWindows:=TFPList.Create;
AllWindows.Add(ATransientWindow);
end;
end;
@ -791,7 +791,7 @@ procedure TGtkWidgetSet.SendCachedLCLMessages;
Widget, ParentFixed, ParentWidget: PGtkWidget;
LCLControl: TControl;
IsTopLevelWidget: boolean;
TopologicalList: TList; // list of PGtkWidget;
TopologicalList: TFPList; // list of PGtkWidget;
i, LCLWidth, LCLHeight: integer;
WinWidgetInfo: PWinWidgetInfo;
@ -1073,7 +1073,7 @@ procedure TGtkWidgetSet.SendCachedGtkMessages;
var
FixWidget, MainWidget: PGtkWidget;
LCLControl: TWinControl;
List: TList;
List: TFPList;
i: integer;
procedure RaiseInvalidLCLControl;
@ -1085,7 +1085,7 @@ procedure TGtkWidgetSet.SendCachedGtkMessages;
begin
if (FFixWidgetsResized.Count=0) and (FWidgetsResized.Count=0) then exit;
List:=TList.Create;
List:=TFPList.Create;
{ if any fixed widget was resized then a client area of a LCL control was
resized
@ -1263,7 +1263,7 @@ type
ClientWidget: PGtkWidget;
MainWindow: PGdkWindow;
ClientWindow: PGdkWindow;
WindowList: TList;
WindowList: TFPList;
end;
var
@ -1289,7 +1289,7 @@ var
then exit;
if Context.WindowList=nil then
Context.WindowList:=TList.Create;
Context.WindowList:=TFPList.Create;
Context.WindowList.Add(PaintWindow);
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
@ -4046,7 +4046,7 @@ end;
procedure CreateOpenDialogHistory(OpenDialog: TOpenDialog;
SelWidget: PGtkWidget);
var
HistoryList: TList; // list of THistoryListEntry
HistoryList: TFPList; // list of THistoryListEntry
AHistoryEntry: PFileSelHistoryEntry;
i: integer;
s: string;
@ -4056,7 +4056,7 @@ begin
if OpenDialog.HistoryList.Count>0 then begin
// create the HistoryList where the current state of the history is stored
HistoryList:=TList.Create;
HistoryList:=TFPList.Create;
for i:=0 to OpenDialog.HistoryList.Count-1 do begin
s:=OpenDialog.HistoryList[i];
if s<>'' then begin
@ -4124,7 +4124,7 @@ end;
Converts a Delphi file filter of the form
'description1|mask1|description2|mask2|...'
into a TList of PFileSelFilterEntry(s).
into a TFPList of PFileSelFilterEntry(s).
Multi masks:
- multi masks like '*.pas;*.pp' are converted into multiple entries.
- if the masks are found in the description they are adjusted
@ -4136,7 +4136,7 @@ end;
'Pascal files (*.pp)' + '*.pp'
'Pascal files (*.lpr)' + '*.lpr'
------------------------------------------------------------------------------}
procedure ExtractFilterList(const Filter: string; var FilterList: TList;
procedure ExtractFilterList(const Filter: string; out FilterList: TFPList;
SplitMultiMask: boolean);
var
Masks: TStringList;
@ -4227,7 +4227,7 @@ var
CurDescStart, CurDescEnd, CurMultiMaskStart, CurMultiMaskEnd: integer;
CurDesc, CurMultiMask: string;
begin
FilterList:=TList.Create;
FilterList:=TFPList.Create;
Masks:=nil;
CurFilterIndex:=0;
CurDescStart:=1;
@ -4264,7 +4264,7 @@ end;
function TGtkWidgetSet.CreateOpenDialogFilter(OpenDialog: TOpenDialog;
SelWidget: PGtkWidget): string;
var
FilterList: TList;
FilterList: TFPList;
HBox, LabelWidget, FilterPullDownWidget,
MenuWidget, MenuItemWidget: PGtkWidget;
i, j, CurMask: integer;
@ -6836,7 +6836,7 @@ var
end;
var
LinesList: TList;
LinesList: TFPList;
LineStart, LineEnd, LineLen: integer;
ArraySize, TotalSize: integer;
i: integer;
@ -6845,7 +6845,7 @@ var
begin
if IsEmptyText then exit;
InitFont;
LinesList:=TList.Create;
LinesList:=TFPList.Create;
LineStart:=0;
// find all line starts and line ends
@ -7006,6 +7006,9 @@ end;
{ =============================================================================
$Log$
Revision 1.648 2005/07/23 09:27:30 mattias
replaced codetools+gtk intf TList with faster TFPList
Revision 1.647 2005/06/23 21:24:40 marc
+ added gdk_display function for gtk2
- replaced X11Display with gdk_display

View File

@ -105,16 +105,16 @@ procedure RememberKeyEventWasHandledByLCL(Event: PGdkEventKey;
BeforeEvent: boolean);
var
HandledEvent: TLCLHandledKeyEvent;
EventList: TList;
EventList: TFPList;
begin
if KeyEventWasHandledByLCL(Event,BeforeEvent) then exit;
if BeforeEvent then begin
if LCLHandledKeyEvents=nil then
LCLHandledKeyEvents:=TList.Create;
LCLHandledKeyEvents:=TFPList.Create;
EventList:=LCLHandledKeyEvents;
end else begin
if LCLHandledKeyAfterEvents=nil then
LCLHandledKeyAfterEvents:=TList.Create;
LCLHandledKeyAfterEvents:=TFPList.Create;
EventList:=LCLHandledKeyAfterEvents;
end;
HandledEvent:=TLCLHandledKeyEvent.Create(Event);
@ -131,7 +131,7 @@ function KeyEventWasHandledByLCL(Event: PGdkEventKey; BeforeEvent: boolean
var
i: Integer;
HandledEvent: TLCLHandledKeyEvent;
EventList: TList;
EventList: TFPList;
begin
Result:=false;
if BeforeEvent then
@ -3209,8 +3209,8 @@ end;
procedure DestroyCommonDialogAddOns(ADialog: TCommonDialog);
var
DlgWindow: PGtkWidget;
HistoryList: TList; // list of TFileSelHistoryListEntry
FilterList: TList; // list of TFileSelFilterListEntry
HistoryList: TFPList; // list of TFileSelHistoryListEntry
FilterList: TFPList; // list of TFileSelFilterListEntry
AHistoryEntry: PFileSelHistoryEntry;
AFilterEntry: PFileSelFilterEntry;
i: integer;
@ -3237,8 +3237,8 @@ begin
if LCLHistoryMenu<>nil then FreeWidgetInfo(LCLHistoryMenu);
// free history
HistoryList:=TList(gtk_object_get_data(PGtkObject(DlgWindow),
'LCLHistoryList'));
HistoryList:=TFPList(gtk_object_get_data(PGtkObject(DlgWindow),
'LCLHistoryList'));
if HistoryList<>nil then begin
for i:=0 to HistoryList.Count-1 do begin
AHistoryEntry:=PFileSelHistoryEntry(HistoryList[i]);
@ -3251,8 +3251,8 @@ begin
end;
// free filter
FilterList:=TList(gtk_object_get_data(PGtkObject(DlgWindow),
'LCLFilterList'));
FilterList:=TFPList(gtk_object_get_data(PGtkObject(DlgWindow),
'LCLFilterList'));
if FilterList<>nil then begin
for i:=0 to FilterList.Count-1 do begin
AFilterEntry:=PFileSelFilterEntry(FilterList[i]);
@ -5984,9 +5984,9 @@ end;
CreateTopologicalSortedWidgets
Params: HashArray: TDynHashArray of PGtkWidget
Creates a topologically sorted TList of PGtkWidget.
Creates a topologically sorted TFPList of PGtkWidget.
-------------------------------------------------------------------------------}
function CreateTopologicalSortedWidgets(HashArray: TDynHashArray): TList;
function CreateTopologicalSortedWidgets(HashArray: TDynHashArray): TFPList;
type
PTopologicalEntry = ^TTopologicalEntry;
TTopologicalEntry = record
@ -6013,7 +6013,7 @@ var
LevelCounts: PInteger;
begin
//DebugLn(' KKK0');
Result:=TList.Create;
Result:=TFPList.Create;
if HashArray.Count=0 then exit;
// put all widgets into an array and calculate their parent levels
@ -8251,6 +8251,9 @@ end;
{ =============================================================================
$Log$
Revision 1.370 2005/07/23 09:27:30 mattias
replaced codetools+gtk intf TList with faster TFPList
Revision 1.369 2005/07/22 11:37:26 mattias
fixed gtk not container warnings and let a few gtk handled key messages pass

View File

@ -684,7 +684,7 @@ procedure UpdateStatusBarPanel(StatusBar: TObject; Index: integer;
// sizing
procedure SaveSizeNotification(Widget: PGtkWidget);
procedure SaveClientSizeNotification(FixWidget: PGtkWidget);
function CreateTopologicalSortedWidgets(HashArray: TDynHashArray): TList;
function CreateTopologicalSortedWidgets(HashArray: TDynHashArray): TFPList;
procedure GetGTKDefaultWidgetSize(AWinControl: TWinControl;
var PreferredWidth, PreferredHeight: integer);
@ -932,8 +932,8 @@ var
// LCLHandledKeyEvents stores the last handled key event (handled by the LCL)
// Reason: The gtk sends the same key event to several widgets. The gtk intf
// only wants to send them once to the LCL.
LCLHandledKeyEvents: TList; // list of TLCLHandledKeyEvent
LCLHandledKeyAfterEvents: TList; // list of TLCLHandledKeyEvent
LCLHandledKeyEvents: TFPList; // list of TLCLHandledKeyEvent
LCLHandledKeyAfterEvents: TFPList; // list of TLCLHandledKeyEvent
var
GdkTrapIsSet: Boolean;

View File

@ -624,7 +624,7 @@ begin
if (GtkWindow=nil) then exit;
TGtkWidgetSet(InterfaceObject).UnsetResizeRequest(PgtkWidget(GtkWindow));
if ModalWindows=nil then ModalWindows:=TList.Create;
if ModalWindows=nil then ModalWindows:=TFPList.Create;
ModalWindows.Add(GtkWindow);
gtk_window_set_modal(GtkWindow, true);