mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:09:21 +02:00
LazUtils: Move math helper functions from LCLProc to LazUtilities. Deprecate LCLProc versions.
git-svn-id: trunk@64197 -
This commit is contained in:
parent
277bee311d
commit
6813e28eef
@ -34,7 +34,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
LCLProc, LCLType, LCLIntf, Forms, Menus,
|
LCLProc, LCLType, LCLIntf, Forms, Menus,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazLoggerBase, LazTracer,
|
LazLoggerBase, LazTracer, LazMethodList,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
IDEImagesIntf;
|
IDEImagesIntf;
|
||||||
|
|
||||||
|
@ -13,12 +13,21 @@ unit LazUtilities;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils;
|
Classes, SysUtils, TypInfo;
|
||||||
|
|
||||||
procedure FreeThenNil(var obj);
|
procedure FreeThenNil(var obj);
|
||||||
function ComparePointers(p1, p2: Pointer): integer; inline;
|
function ComparePointers(p1, p2: Pointer): integer; inline;
|
||||||
function CompareBoolean(b1, b2: boolean): integer;
|
function CompareBoolean(b1, b2: boolean): integer;
|
||||||
|
|
||||||
|
function GetEnumValueDef(TypeInfo: PTypeInfo; const Name: string;
|
||||||
|
const DefaultValue: Integer): Integer;
|
||||||
|
|
||||||
|
function RoundToInt(e: Extended): integer; inline;
|
||||||
|
function RoundToCardinal(e: Extended): cardinal; inline;
|
||||||
|
function TruncToInt(e: Extended): integer; inline;
|
||||||
|
function TruncToCardinal(e: Extended): cardinal; inline;
|
||||||
|
function StrToDouble(const s: string): double; inline;
|
||||||
|
|
||||||
{ MergeSortWithLen:
|
{ MergeSortWithLen:
|
||||||
sort ascending, e.g. Compare(List[0],List[1])<0
|
sort ascending, e.g. Compare(List[0],List[1])<0
|
||||||
keeping order (for each i<j and Compare(List[i],List[j])=0) }
|
keeping order (for each i<j and Compare(List[i],List[j])=0) }
|
||||||
@ -59,6 +68,54 @@ begin
|
|||||||
Result:=-1;
|
Result:=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetEnumValueDef(TypeInfo: PTypeInfo; const Name: string;
|
||||||
|
const DefaultValue: Integer): Integer;
|
||||||
|
begin
|
||||||
|
Result:=GetEnumValue(TypeInfo,Name);
|
||||||
|
if Result<0 then
|
||||||
|
Result:=DefaultValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function RoundToInt(e: Extended): integer;
|
||||||
|
begin
|
||||||
|
Result:=integer(Round(e));
|
||||||
|
{$IFDEF VerboseRound}
|
||||||
|
DebugLn('RoundToInt ',e,' ',Result);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function RoundToCardinal(e: Extended): cardinal;
|
||||||
|
begin
|
||||||
|
Result:=cardinal(Round(e));
|
||||||
|
{$IFDEF VerboseRound}
|
||||||
|
DebugLn('RoundToCardinal ',e,' ',Result);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TruncToInt(e: Extended): integer;
|
||||||
|
begin
|
||||||
|
Result:=integer(Trunc(e));
|
||||||
|
{$IFDEF VerboseRound}
|
||||||
|
DebugLn('TruncToInt ',e,' ',Result);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TruncToCardinal(e: Extended): cardinal;
|
||||||
|
begin
|
||||||
|
Result:=cardinal(Trunc(e));
|
||||||
|
{$IFDEF VerboseRound}
|
||||||
|
DebugLn('TruncToCardinal ',e,' ',Result);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function StrToDouble(const s: string): double;
|
||||||
|
begin
|
||||||
|
{$IFDEF VerboseRound}
|
||||||
|
DebugLn('StrToDouble "',s,'"');
|
||||||
|
{$ENDIF}
|
||||||
|
Result:=Double(StrToFloat(s));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure MergeSortWithLen(List: PPointer; ListLength: PtrInt;
|
procedure MergeSortWithLen(List: PPointer; ListLength: PtrInt;
|
||||||
const Compare: TListSortCompare);
|
const Compare: TListSortCompare);
|
||||||
var
|
var
|
||||||
|
@ -6,12 +6,13 @@ unit GLGtk3GlxContext;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, ctypes, LCLProc, LCLType, X, XUtil, XLib, gl, glext,
|
Classes, SysUtils, ctypes, X, XUtil, XLib, gl, glext, glx,
|
||||||
InterfaceBase,
|
// LazUtils
|
||||||
glx,
|
LazUtilities,
|
||||||
|
// LCL
|
||||||
|
LCLType, InterfaceBase, LMessages, Controls,
|
||||||
WSLCLClasses, LCLMessageGlue,
|
WSLCLClasses, LCLMessageGlue,
|
||||||
LMessages, glib2, gtk3int, LazGdk3, LazGtk3, gtk3widgets,
|
glib2, gtk3int, LazGdk3, LazGtk3, gtk3widgets;
|
||||||
Controls;
|
|
||||||
|
|
||||||
function LBackingScaleFactor(Handle: HWND): single;
|
function LBackingScaleFactor(Handle: HWND): single;
|
||||||
procedure LOpenGLViewport({%H-}Handle: HWND; Left, Top, Width, Height: integer);
|
procedure LOpenGLViewport({%H-}Handle: HWND; Left, Top, Width, Height: integer);
|
||||||
|
@ -92,8 +92,10 @@ unit OpenGLContext;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, Forms, Controls, LCLType, LCLIntf, LResources,
|
Classes, SysUtils,
|
||||||
Graphics, LMessages, WSLCLClasses, WSControls,
|
// LCL
|
||||||
|
LCLType, LCLIntf, LResources, Forms, Controls, Graphics, LMessages,
|
||||||
|
WSLCLClasses, WSControls,
|
||||||
{$IFDEF UseGtkGLX}
|
{$IFDEF UseGtkGLX}
|
||||||
GLGtkGlxContext;
|
GLGtkGlxContext;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
Abstract:
|
Abstract:
|
||||||
Replacement of source editor tabs/pages with buttons sorted by package and name.
|
Replacement of source editor tabs/pages with buttons sorted by package and name.
|
||||||
}
|
}
|
||||||
unit packagetabs_impl;
|
unit PackageTabs_impl;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
@ -32,15 +32,15 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, Types, Contnrs,
|
Classes, SysUtils, Types, Contnrs,
|
||||||
// LCL
|
// LCL
|
||||||
LCLProc, LCLIntf, Forms, Controls, StdCtrls, Buttons, ComCtrls, ExtCtrls,
|
LCLIntf, Forms, Controls, StdCtrls, Buttons, ComCtrls, ExtCtrls,
|
||||||
Graphics, Menus, Clipbrd,
|
Graphics, Menus, Clipbrd,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils, Laz2_XMLCfg,
|
LazUtilities, LazFileUtils, Laz2_XMLCfg,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
SrcEditorIntf, PackageIntf, LazIDEIntf, IDEImagesIntf, IDECommands,
|
SrcEditorIntf, PackageIntf, LazIDEIntf, IDEImagesIntf, IDECommands,
|
||||||
IDEOptEditorIntf, ProjectIntf,
|
IDEOptEditorIntf, ProjectIntf,
|
||||||
// PackageTabs
|
// PackageTabs
|
||||||
packagetabsstr;
|
PackageTabsStr;
|
||||||
|
|
||||||
type
|
type
|
||||||
TPackageTabButton = class(TSpeedButton)
|
TPackageTabButton = class(TSpeedButton)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
unit packagetabsstr;
|
unit PackageTabsStr;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ uses
|
|||||||
LCLProc, LCLIntf, LCLType, LMessages, LResources, Messages, Controls, Graphics,
|
LCLProc, LCLIntf, LCLType, LMessages, LResources, Messages, Controls, Graphics,
|
||||||
Forms, StdCtrls, ExtCtrls, Menus, Clipbrd, StdActns,
|
Forms, StdCtrls, ExtCtrls, Menus, Clipbrd, StdActns,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazMethodList, LazLoggerBase, LazUTF8,
|
LazUtilities, LazMethodList, LazLoggerBase, LazTracer, LazUTF8,
|
||||||
// SynEdit
|
// SynEdit
|
||||||
SynEditTypes, SynEditSearch, SynEditKeyCmds, SynEditMouseCmds, SynEditMiscProcs,
|
SynEditTypes, SynEditSearch, SynEditKeyCmds, SynEditMouseCmds, SynEditMiscProcs,
|
||||||
SynEditPointClasses, SynBeautifier, SynEditMarks,
|
SynEditPointClasses, SynBeautifier, SynEditMarks,
|
||||||
|
@ -45,9 +45,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazMethodList,
|
LazMethodList, LazUtilities, LazLoggerBase,
|
||||||
// LCL
|
// LCL
|
||||||
LCLIntf, LCLType, LCLProc, Graphics, Controls, Clipbrd, ImgList,
|
LCLIntf, LCLType, Graphics, Controls, Clipbrd, ImgList,
|
||||||
// SynEdit
|
// SynEdit
|
||||||
SynEditHighlighter, SynEditMiscProcs, SynEditTypes, LazSynEditText, SynEditPointClasses;
|
SynEditHighlighter, SynEditMiscProcs, SynEditTypes, LazSynEditText, SynEditPointClasses;
|
||||||
|
|
||||||
|
@ -27,10 +27,14 @@ unit SynGutterLineOverview;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Graphics, Controls, LCLProc, LCLType, LCLIntf, Forms, LMessages,
|
Classes, sysutils, math, FPCanvas,
|
||||||
FPCanvas, sysutils, math, SynGutterBase, SynEditTypes, LazSynEditText,
|
// LCL
|
||||||
SynEditTextBuffer, SynEditMarks, SynEditMiscClasses,
|
Graphics, Controls, Forms, LCLType, LCLIntf, LMessages,
|
||||||
SynEditMouseCmds, LazUtilities;
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
|
// SynEdit
|
||||||
|
SynGutterBase, SynEditTypes, LazSynEditText, SynEditTextBuffer, SynEditMarks,
|
||||||
|
SynEditMiscClasses, SynEditMouseCmds;
|
||||||
|
|
||||||
type
|
type
|
||||||
TSynGutterLineOverview = class;
|
TSynGutterLineOverview = class;
|
||||||
|
@ -218,15 +218,15 @@ end;
|
|||||||
|
|
||||||
function GetPidForAttach: string;
|
function GetPidForAttach: string;
|
||||||
var
|
var
|
||||||
ProcessList: TRunningProcessInfoList;
|
ProcessLst: TRunningProcessInfoList;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
|
|
||||||
ProcessList := TRunningProcessInfoList.Create(True);
|
ProcessLst := TRunningProcessInfoList.Create(True);
|
||||||
try
|
try
|
||||||
// Check if we can enumerate processes.
|
// Check if we can enumerate processes.
|
||||||
if not DebugBoss.FillProcessList(ProcessList) then
|
if not DebugBoss.FillProcessList(ProcessLst) then
|
||||||
if not EnumerateProcesses(ProcessList) then
|
if not EnumerateProcesses(ProcessLst) then
|
||||||
begin
|
begin
|
||||||
// If we can't just ask PID as string.
|
// If we can't just ask PID as string.
|
||||||
InputQuery(rsAttachTo, rsEnterPID, Result);
|
InputQuery(rsAttachTo, rsEnterPID, Result);
|
||||||
@ -236,14 +236,14 @@ begin
|
|||||||
// Enumerate.
|
// Enumerate.
|
||||||
DebugAttachDialogForm := TDebugAttachDialogForm.Create(nil);
|
DebugAttachDialogForm := TDebugAttachDialogForm.Create(nil);
|
||||||
try
|
try
|
||||||
if DebugAttachDialogForm.ChooseProcess(ProcessList, Result) <> mrOK then
|
if DebugAttachDialogForm.ChooseProcess(ProcessLst, Result) <> mrOK then
|
||||||
Result := '';
|
Result := '';
|
||||||
finally
|
finally
|
||||||
FreeAndNil(DebugAttachDialogForm);
|
FreeAndNil(DebugAttachDialogForm);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
FreeAndNil(ProcessList);
|
FreeAndNil(ProcessLst);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -39,11 +39,9 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
TypInfo, Classes, SysUtils, math,
|
TypInfo, Classes, SysUtils, math,
|
||||||
// LCL
|
|
||||||
LCLProc,
|
|
||||||
// LazUtils
|
// LazUtils
|
||||||
Laz2_XMLCfg, LazFileUtils, LazStringUtils, LazLoggerBase, LazConfigStorage,
|
Laz2_XMLCfg, LazFileUtils, LazStringUtils, LazUtilities, LazLoggerBase,
|
||||||
LazClasses, Maps,
|
LazConfigStorage, LazClasses, Maps,
|
||||||
// DebuggerIntf
|
// DebuggerIntf
|
||||||
DbgIntfBaseTypes, DbgIntfMiscClasses, DbgIntfDebuggerBase;
|
DbgIntfBaseTypes, DbgIntfMiscClasses, DbgIntfDebuggerBase;
|
||||||
|
|
||||||
|
@ -38,8 +38,15 @@ unit ProcessDebugger;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, UTF8Process, LazFileUtils, DbgIntfDebuggerBase,
|
Classes, SysUtils, Process,
|
||||||
Process, Debugger, LCLProc, BaseDebugManager, Dialogs, ProcessList;
|
// LCL
|
||||||
|
Dialogs,
|
||||||
|
// LazUtils
|
||||||
|
FileUtil, UTF8Process, LazFileUtils, LazLoggerBase,
|
||||||
|
// DebuggerIntf
|
||||||
|
DbgIntfDebuggerBase,
|
||||||
|
// IDE
|
||||||
|
ProcessList, Debugger;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -25,13 +25,14 @@ unit ProcessList;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, UTF8Process;
|
Classes, SysUtils,
|
||||||
|
// LazUtils
|
||||||
|
UTF8Process, LazLoggerBase;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ The TProcessList is used by the IDE to store all running programs and
|
{ The TProcessList is used by the IDE to store all running programs and
|
||||||
external tools, that are not watched. From time to time the IDE checks,
|
external tools, that are not watched. From time to time the IDE checks,
|
||||||
if the processes has terminated and will free them cleanly to avoid
|
if the processes has terminated and will free them cleanly to avoid zombies. }
|
||||||
zombies. }
|
|
||||||
TProcessList = class
|
TProcessList = class
|
||||||
private
|
private
|
||||||
FItems: TList; // list of TProcessUTF8
|
FItems: TList; // list of TProcessUTF8
|
||||||
@ -58,7 +59,8 @@ var
|
|||||||
|
|
||||||
function GetDefaultProcessList: TProcessList;
|
function GetDefaultProcessList: TProcessList;
|
||||||
begin
|
begin
|
||||||
if DefaultProcessList=nil then DefaultProcessList:=TProcessList.Create;
|
if DefaultProcessList=nil then
|
||||||
|
DefaultProcessList:=TProcessList.Create;
|
||||||
Result:=DefaultProcessList;
|
Result:=DefaultProcessList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -131,12 +133,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
|
||||||
DefaultProcessList:=nil;
|
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
DefaultProcessList.Free;
|
FreeAndNil(DefaultProcessList);
|
||||||
DefaultProcessList:=nil;
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -35,9 +35,15 @@ unit AnchorEditor;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, Forms, Controls, Dialogs, StdCtrls, Buttons, Spin,
|
Classes, SysUtils,
|
||||||
ExtCtrls, Graphics, IDECommands, PropEdits, IDEDialogs, LazarusIDEStrConsts,
|
// LCL
|
||||||
IDEOptionDefs, IDEImagesIntf, EnvironmentOpts;
|
Forms, Controls, Dialogs, StdCtrls, Buttons, Spin, ExtCtrls, Graphics,
|
||||||
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
|
// IdeIntf
|
||||||
|
IDECommands, PropEdits, IDEDialogs, IDEImagesIntf,
|
||||||
|
// IDE
|
||||||
|
LazarusIDEStrConsts, IDEOptionDefs, EnvironmentOpts;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ uses
|
|||||||
LCLProc, LCLType, LResources, LCLIntf, LMessages, InterfaceBase,
|
LCLProc, LCLType, LResources, LCLIntf, LMessages, InterfaceBase,
|
||||||
Forms, Controls, GraphType, Graphics, Dialogs, ExtCtrls, Menus, ClipBrd,
|
Forms, Controls, GraphType, Graphics, Dialogs, ExtCtrls, Menus, ClipBrd,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils, LazFileCache,
|
LazFileUtils, LazFileCache, LazLoggerBase,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
IDEDialogs, PropEdits, PropEditUtils, ComponentEditors, MenuIntf,
|
IDEDialogs, PropEdits, PropEditUtils, ComponentEditors, MenuIntf,
|
||||||
IDEImagesIntf, FormEditingIntf, ComponentReg, IDECommands, LazIDEIntf,
|
IDEImagesIntf, FormEditingIntf, ComponentReg, IDECommands, LazIDEIntf,
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
Forms, Controls, Dialogs, LResources, LCLMemManager, LCLProc,
|
Forms, Controls, Dialogs, LResources, LCLMemManager, LCLProc,
|
||||||
//LazUtils
|
//LazUtils
|
||||||
AvgLvlTree, LazLoggerBase,
|
AvgLvlTree, LazUtilities, LazLoggerBase, LazTracer,
|
||||||
// CodeTools
|
// CodeTools
|
||||||
BasicCodeTools,
|
BasicCodeTools,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
|
@ -32,10 +32,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, Math, Laz_AVL_Tree,
|
Classes, SysUtils, Math, Laz_AVL_Tree,
|
||||||
// LCL
|
// LCL
|
||||||
LCLProc, Forms, Controls, Graphics, Dialogs, ButtonPanel, Buttons,
|
Forms, Controls, Graphics, Dialogs, ButtonPanel, Buttons, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
StdCtrls, ComCtrls, ExtCtrls,
|
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils,
|
LazFileUtils, LazUtilities, LazLoggerBase,
|
||||||
// Codetools
|
// Codetools
|
||||||
DefineTemplates, ExprEval,
|
DefineTemplates, ExprEval,
|
||||||
// SynEdit
|
// SynEdit
|
||||||
|
@ -30,7 +30,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
// LCL
|
// LCL
|
||||||
LCLProc, Forms, StdCtrls, Dialogs, Spin, ColorBox, Graphics, Buttons,
|
Forms, StdCtrls, Dialogs, Spin, ColorBox, Graphics, Buttons,
|
||||||
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
ObjectInspector, IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf,
|
ObjectInspector, IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf,
|
||||||
// IDE
|
// IDE
|
||||||
|
@ -19,7 +19,12 @@ unit ExtGraphics;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses Types, Classes, LCLProc, Graphics, Math, GraphMath;
|
uses
|
||||||
|
Types, Classes, Math,
|
||||||
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
|
// LCL
|
||||||
|
Graphics, GraphMath;
|
||||||
|
|
||||||
type
|
type
|
||||||
TShapeDirection = (atUp, atDown, atLeft, atRight);
|
TShapeDirection = (atUp, atDown, atLeft, atRight);
|
||||||
|
@ -22,8 +22,12 @@ unit CalcForm;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, Graphics,
|
Classes, SysUtils,
|
||||||
StdCtrls, ExtCtrls, Buttons, Menus, Clipbrd;
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
|
// LCL
|
||||||
|
Forms, Controls, Graphics, StdCtrls, ExtCtrls, Buttons, Menus, Clipbrd,
|
||||||
|
WSExtDlgs, LCLStrConsts;
|
||||||
|
|
||||||
const
|
const
|
||||||
CalcDefPrecision = 15;
|
CalcDefPrecision = 15;
|
||||||
@ -151,9 +155,6 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
|
||||||
LclProc, WSExtDlgs, LCLStrConsts;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TCalcBtnKind =
|
TCalcBtnKind =
|
||||||
(cbNone, cbNum0, cbNum1, cbNum2, cbNum3, cbNum4, cbNum5, cbNum6,
|
(cbNone, cbNum0, cbNum1, cbNum2, cbNum3, cbNum4, cbNum5, cbNum6,
|
||||||
|
@ -31,7 +31,8 @@ interface
|
|||||||
|
|
||||||
Uses
|
Uses
|
||||||
Types, Classes, SysUtils, Math,
|
Types, Classes, SysUtils, Math,
|
||||||
LCLProc;
|
// LazUtils
|
||||||
|
LazUtilities;
|
||||||
|
|
||||||
Type
|
Type
|
||||||
TFloatPoint = Record
|
TFloatPoint = Record
|
||||||
|
@ -29,10 +29,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Types, Classes, SysUtils, Math, FPImage,
|
Types, Classes, SysUtils, Math, FPImage,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazUTF8, IntegerList,
|
LazUTF8, IntegerList, LazUtilities, LazLoggerBase, GraphType,
|
||||||
// LCL
|
// LCL
|
||||||
LCLType, LCLProc, LMessages, LCLPlatformDef,
|
LCLProc, LCLType, LMessages, LCLPlatformDef, GraphMath, IntfGraphics, Themes;
|
||||||
GraphType, GraphMath, IntfGraphics, Themes;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
PEventHandler = type Pointer;
|
PEventHandler = type Pointer;
|
||||||
|
@ -28,10 +28,10 @@ uses
|
|||||||
// RTL
|
// RTL
|
||||||
Classes, SysUtils, glib2, gdk2pixbuf, pango, gdk2, gtk2,
|
Classes, SysUtils, glib2, gdk2pixbuf, pango, gdk2, gtk2,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
DynHashArray, LazLoggerBase,
|
DynHashArray, LazLoggerBase, LazTracer, LazUtilities,
|
||||||
// LCL
|
// LCL
|
||||||
Gtk2Extra,
|
Gtk2Extra,
|
||||||
LCLIntf, LCLProc, LCLType, LCLMemManager,
|
LCLIntf, LCLType, LCLMemManager,
|
||||||
GraphType, Gtk2Globals, Graphics {for TColor};
|
GraphType, Gtk2Globals, Graphics {for TColor};
|
||||||
|
|
||||||
{$ifdef TraceGdiCalls}
|
{$ifdef TraceGdiCalls}
|
||||||
|
@ -16,9 +16,9 @@ uses
|
|||||||
// RTL
|
// RTL
|
||||||
Classes, SysUtils, glib2, pango, Laz_AVL_Tree,
|
Classes, SysUtils, glib2, pango, Laz_AVL_Tree,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazLoggerBase,
|
LazUtilities, LazLoggerBase, LazTracer,
|
||||||
// LCL
|
// LCL
|
||||||
LCLProc, LCLType, Gtk2Def, LCLResCache;
|
LCLType, Gtk2Def, LCLResCache;
|
||||||
|
|
||||||
type
|
type
|
||||||
TGtkFontCacheDescriptor = class;
|
TGtkFontCacheDescriptor = class;
|
||||||
|
@ -39,7 +39,8 @@ uses
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
gdk2pixbuf, gtk2, gdk2, glib2, Pango,
|
gdk2pixbuf, gtk2, gdk2, glib2, Pango,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazFileUtils, LazUTF8, DynHashArray, Maps, IntegerList, LazLoggerBase, LazStringUtils,
|
LazFileUtils, LazUTF8, DynHashArray, Maps, IntegerList,
|
||||||
|
LazLoggerBase, LazTracer, LazUtilities, LazStringUtils,
|
||||||
// LCL
|
// LCL
|
||||||
Dialogs, Controls, Forms, LCLStrConsts,
|
Dialogs, Controls, Forms, LCLStrConsts,
|
||||||
LMessages, LCLProc, LCLIntf, LCLType, GraphType, GraphMath,
|
LMessages, LCLProc, LCLIntf, LCLType, GraphType, GraphMath,
|
||||||
|
@ -49,7 +49,8 @@ uses
|
|||||||
LResources, Controls, Forms, Buttons, Menus, StdCtrls, ComCtrls, ExtCtrls,
|
LResources, Controls, Forms, Buttons, Menus, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
Dialogs, ExtDlgs, ImgList, LCLMessageGlue,
|
Dialogs, ExtDlgs, ImgList, LCLMessageGlue,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
Masks, FileUtil, LazFileUtils, LazStringUtils, LazLoggerBase, LazUTF8, DynHashArray,
|
FileUtil, LazFileUtils, LazStringUtils, LazUtilities, LazLoggerBase, LazTracer,
|
||||||
|
Masks, LazUTF8, DynHashArray,
|
||||||
// Gtk2
|
// Gtk2
|
||||||
Gtk2FontCache, Gtk2Globals, Gtk2Def, Gtk2Extra, {%H-}Gtk2Debug;
|
Gtk2FontCache, Gtk2Globals, Gtk2Def, Gtk2Extra, {%H-}Gtk2Debug;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ uses
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
SysUtils, Classes, types, Math, FPImage,
|
SysUtils, Classes, types, Math, FPImage,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazUTF8, IntegerList, GraphType,
|
LazUtilities, LazLoggerBase, LazTracer, LazUTF8, IntegerList, GraphType,
|
||||||
// LCL
|
// LCL
|
||||||
LCLPlatformDef, InterfaceBase, LCLProc, LCLType, LMessages, LCLMessageGlue,
|
LCLPlatformDef, InterfaceBase, LCLProc, LCLType, LMessages, LCLMessageGlue,
|
||||||
Controls, Forms, Graphics, GraphUtil, IntfGraphics,
|
Controls, Forms, Graphics, GraphUtil, IntfGraphics,
|
||||||
|
@ -25,8 +25,9 @@ uses
|
|||||||
Classes, SysUtils, types, math,
|
Classes, SysUtils, types, math,
|
||||||
// LCL
|
// LCL
|
||||||
Controls, StdCtrls, ExtCtrls, Buttons, ComCtrls, Graphics, Dialogs, Forms, Menus, ExtDlgs,
|
Controls, StdCtrls, ExtCtrls, Buttons, ComCtrls, Graphics, Dialogs, Forms, Menus, ExtDlgs,
|
||||||
Spin, CheckLst, PairSplitter, LCLType, LCLProc, LMessages, LCLMessageGlue, LCLIntf,
|
Spin, CheckLst, PairSplitter, LCLType, LMessages, LCLMessageGlue, LCLIntf,
|
||||||
graphtype,
|
// LazUtils
|
||||||
|
LazUtilities, LazLoggerBase, GraphType,
|
||||||
// GTK3
|
// GTK3
|
||||||
LazGtk3, LazGdk3, LazGObject2, LazGLib2, LazCairo1, LazPango1, LazGdkPixbuf2,
|
LazGtk3, LazGdk3, LazGObject2, LazGLib2, LazCairo1, LazPango1, LazGdkPixbuf2,
|
||||||
gtk3objects, gtk3procs, gtk3private, Gtk3CellRenderer;
|
gtk3objects, gtk3procs, gtk3private, Gtk3CellRenderer;
|
||||||
|
@ -38,7 +38,7 @@ uses
|
|||||||
// FPC
|
// FPC
|
||||||
Classes, SysUtils, Math, Types,
|
Classes, SysUtils, Math, Types,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazUTF8, Maps, LazStringUtils,
|
LazUTF8, Maps, LazUtilities, LazStringUtils,
|
||||||
// LCL
|
// LCL
|
||||||
LCLPlatformDef, InterfaceBase, LCLProc, LCLType, LCLIntf,
|
LCLPlatformDef, InterfaceBase, LCLProc, LCLType, LCLIntf,
|
||||||
LMessages, LCLMessageGlue, LCLStrConsts,
|
LMessages, LCLMessageGlue, LCLStrConsts,
|
||||||
|
@ -37,10 +37,10 @@ uses
|
|||||||
// FPC
|
// FPC
|
||||||
Classes, SysUtils, Math, Types, maps,
|
Classes, SysUtils, Math, Types, maps,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazStringUtils,
|
LazStringUtils, LazUtilities, LazLoggerBase,
|
||||||
// LCL
|
// LCL
|
||||||
InterfaceBase, LCLPlatformDef, LCLProc, LazUTF8, LCLType, LMessages, LCLMessageGlue, LCLStrConsts,
|
InterfaceBase, LCLPlatformDef, LazUTF8, LCLProc, LCLType, LMessages,
|
||||||
Controls, ExtCtrls, Forms,
|
LCLMessageGlue, LCLStrConsts, Controls, ExtCtrls, Forms,
|
||||||
Dialogs, StdCtrls, LCLIntf, GraphType, GraphUtil, Themes,
|
Dialogs, StdCtrls, LCLIntf, GraphType, GraphUtil, Themes,
|
||||||
// WS
|
// WS
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
|
@ -26,9 +26,9 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF Darwin}MacOSAll, {$ENDIF}
|
{$IFDEF Darwin}MacOSAll, {$ENDIF}
|
||||||
Classes, SysUtils, Math, TypInfo, Types, Laz_AVL_Tree,
|
Classes, SysUtils, Math, Types, Laz_AVL_Tree,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
FPCAdds, LazFileUtils, LazUtilities, LazMethodList, LazUTF8, LazUTF8Classes,
|
LazFileUtils, LazUtilities, LazMethodList, LazUTF8, LazUTF8Classes,
|
||||||
LazLoggerBase, LazTracer,
|
LazLoggerBase, LazTracer,
|
||||||
// LCL
|
// LCL
|
||||||
LCLStrConsts, LCLType;
|
LCLStrConsts, LCLType;
|
||||||
@ -85,9 +85,6 @@ procedure MergeSort(List: TFPList; const OnCompare: TListSortCompare); overload;
|
|||||||
procedure MergeSort(List: TFPList; StartIndex, EndIndex: integer; const OnCompare: TListSortCompare); overload;
|
procedure MergeSort(List: TFPList; StartIndex, EndIndex: integer; const OnCompare: TListSortCompare); overload;
|
||||||
procedure MergeSort(List: TStrings; const OnCompare: TStringsSortCompare); overload;
|
procedure MergeSort(List: TStrings; const OnCompare: TStringsSortCompare); overload;
|
||||||
|
|
||||||
function GetEnumValueDef(TypeInfo: PTypeInfo; const Name: string;
|
|
||||||
const DefaultValue: Integer): Integer;
|
|
||||||
|
|
||||||
function KeyAndShiftStateToKeyString(Key: word; ShiftState: TShiftState): String;
|
function KeyAndShiftStateToKeyString(Key: word; ShiftState: TShiftState): String;
|
||||||
function KeyStringIsIrregular(const s: string): boolean;
|
function KeyStringIsIrregular(const s: string): boolean;
|
||||||
function ShortCutToText(ShortCut: TShortCut): string; inline; // localized output
|
function ShortCutToText(ShortCut: TShortCut): string; inline; // localized output
|
||||||
@ -135,18 +132,19 @@ function DeleteAmpersands(var Str : String) : Integer;
|
|||||||
function RemoveAmpersands(const ASource: String): String;
|
function RemoveAmpersands(const ASource: String): String;
|
||||||
function RemoveAmpersands(Src: PChar; var LineLength: Longint): PChar;
|
function RemoveAmpersands(Src: PChar; var LineLength: Longint): PChar;
|
||||||
|
|
||||||
function ComparePointers(p1, p2: Pointer): integer; inline;
|
|
||||||
function CompareHandles(h1, h2: THandle): integer;
|
function CompareHandles(h1, h2: THandle): integer;
|
||||||
function CompareRect(R1, R2: PRect): Boolean;
|
function CompareRect(R1, R2: PRect): Boolean;
|
||||||
function ComparePoints(const p1, p2: TPoint): integer;
|
function ComparePoints(const p1, p2: TPoint): integer;
|
||||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||||
function CompareMethods(const m1, m2: TMethod): boolean; inline;
|
|
||||||
|
|
||||||
function RoundToInt(const e: Extended): integer; inline;
|
// Deprecated in 2.1 / 12.12.2020 / Remove in 2.3
|
||||||
function RoundToCardinal(const e: Extended): cardinal; inline;
|
function CompareMethods(m1, m2: TMethod): boolean; deprecated 'Use LazMethodList.CompareMethods';
|
||||||
function TruncToInt(const e: Extended): integer; inline;
|
function ComparePointers(p1, p2: Pointer): integer; deprecated 'Use LazUtilities.ComparePointers';
|
||||||
function TruncToCardinal(const e: Extended): cardinal; inline;
|
function RoundToInt(e: Extended): integer; deprecated 'Use LazUtilities.RoundToInt';
|
||||||
function StrToDouble(const s: string): double; inline;
|
function RoundToCardinal(e: Extended): cardinal; deprecated 'Use LazUtilities.RoundToCardinal';
|
||||||
|
function TruncToInt(e: Extended): integer; deprecated 'Use LazUtilities.TruncToInt';
|
||||||
|
function TruncToCardinal(e: Extended): cardinal; deprecated 'Use LazUtilities.TruncToCardinal';
|
||||||
|
function StrToDouble(const s: string): double; deprecated 'Use LazUtilities.StrToDouble';
|
||||||
|
|
||||||
// Call debugging procedure in LazLoggerBase.
|
// Call debugging procedure in LazLoggerBase.
|
||||||
procedure RaiseGDBException(const Msg: string); inline;
|
procedure RaiseGDBException(const Msg: string); inline;
|
||||||
@ -328,8 +326,6 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses gettext;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
{$IFDEF WithOldDebugln}
|
{$IFDEF WithOldDebugln}
|
||||||
Str_LCL_Debug_File = 'lcldebug.log';
|
Str_LCL_Debug_File = 'lcldebug.log';
|
||||||
@ -687,14 +683,6 @@ begin
|
|||||||
Result:=ComparePointers(Item,TDebugLCLItemInfo(DebugItemInfo).Item);
|
Result:=ComparePointers(Item,TDebugLCLItemInfo(DebugItemInfo).Item);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetEnumValueDef(TypeInfo: PTypeInfo; const Name: string;
|
|
||||||
const DefaultValue: Integer): Integer;
|
|
||||||
begin
|
|
||||||
Result:=GetEnumValue(TypeInfo,Name);
|
|
||||||
if Result<0 then
|
|
||||||
Result:=DefaultValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function KeyCodeToKeyString(Key: TShortCut; Localized: boolean): string;
|
function KeyCodeToKeyString(Key: TShortCut; Localized: boolean): string;
|
||||||
begin
|
begin
|
||||||
if Key <= High(KeyCodeStrings) then
|
if Key <= High(KeyCodeStrings) then
|
||||||
@ -930,8 +918,7 @@ end;
|
|||||||
|
|
||||||
procedure OwnerFormDesignerModified(AComponent: TComponent);
|
procedure OwnerFormDesignerModified(AComponent: TComponent);
|
||||||
begin
|
begin
|
||||||
if ([csDesigning,csLoading,csDestroying]*AComponent.ComponentState
|
if ([csDesigning,csLoading,csDestroying]*AComponent.ComponentState=[csDesigning])
|
||||||
=[csDesigning])
|
|
||||||
then begin
|
then begin
|
||||||
if OwnerFormDesignerModifiedProc<>nil then
|
if OwnerFormDesignerModifiedProc<>nil then
|
||||||
OwnerFormDesignerModifiedProc(AComponent);
|
OwnerFormDesignerModifiedProc(AComponent);
|
||||||
@ -1051,11 +1038,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ComparePointers(p1, p2: Pointer): integer;
|
|
||||||
begin
|
|
||||||
Result:=LazUtilities.ComparePointers(p1, p2);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function CompareHandles(h1, h2: THandle): integer;
|
function CompareHandles(h1, h2: THandle): integer;
|
||||||
begin
|
begin
|
||||||
if h1>h2 then
|
if h1>h2 then
|
||||||
@ -1104,49 +1086,39 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareMethods(const m1, m2: TMethod): boolean;
|
function CompareMethods(m1, m2: TMethod): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=LazMethodList.CompareMethods(m1, m2);
|
Result:=LazMethodList.CompareMethods(m1, m2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RoundToInt(const e: Extended): integer;
|
function ComparePointers(p1, p2: Pointer): integer;
|
||||||
begin
|
begin
|
||||||
Result:=integer(Round(e));
|
Result:=LazUtilities.ComparePointers(p1, p2);
|
||||||
{$IFDEF VerboseRound}
|
|
||||||
DebugLn('RoundToInt ',e,' ',Result);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RoundToCardinal(const e: Extended): cardinal;
|
function RoundToInt(e: Extended): integer;
|
||||||
begin
|
begin
|
||||||
Result:=cardinal(Round(e));
|
Result:=LazUtilities.RoundToInt(e);
|
||||||
{$IFDEF VerboseRound}
|
|
||||||
DebugLn('RoundToCardinal ',e,' ',Result);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TruncToInt(const e: Extended): integer;
|
function RoundToCardinal(e: Extended): cardinal;
|
||||||
begin
|
begin
|
||||||
Result:=integer(Trunc(e));
|
Result:=LazUtilities.RoundToCardinal(e);
|
||||||
{$IFDEF VerboseRound}
|
|
||||||
DebugLn('TruncToInt ',e,' ',Result);
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TruncToCardinal(const e: Extended): cardinal;
|
function TruncToInt(e: Extended): integer;
|
||||||
begin
|
begin
|
||||||
Result:=cardinal(Trunc(e));
|
Result:=LazUtilities.TruncToInt(e);
|
||||||
{$IFDEF VerboseRound}
|
end;
|
||||||
DebugLn('TruncToCardinal ',e,' ',Result);
|
|
||||||
{$ENDIF}
|
function TruncToCardinal(e: Extended): cardinal;
|
||||||
|
begin
|
||||||
|
Result:=LazUtilities.TruncToCardinal(e);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function StrToDouble(const s: string): double;
|
function StrToDouble(const s: string): double;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseRound}
|
Result:=LazUtilities.StrToDouble(s);
|
||||||
DebugLn('StrToDouble "',s,'"');
|
|
||||||
{$ENDIF}
|
|
||||||
Result:=Double(StrToFloat(s));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure MergeSort(List: TFPList; const OnCompare: TListSortCompare);
|
procedure MergeSort(List: TFPList; const OnCompare: TListSortCompare);
|
||||||
|
@ -7,7 +7,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
// LCL
|
// LCL
|
||||||
Forms, Controls, StdCtrls, Spin, LCLProc,
|
Forms, Controls, StdCtrls, Spin,
|
||||||
|
// LazUtils
|
||||||
|
LazUtilities,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
PackageDependencyIntf, IDEOptionsIntf, IDEOptEditorIntf,
|
PackageDependencyIntf, IDEOptionsIntf, IDEOptEditorIntf,
|
||||||
// IDE
|
// IDE
|
||||||
|
Loading…
Reference in New Issue
Block a user