IdeIntf: Move TLazPackageType to TLazPackageID in PackageIntf. TPackageLink inherits it.

git-svn-id: trunk@56436 -
This commit is contained in:
juha 2017-11-18 15:51:05 +00:00
parent 473d851d87
commit 7f5d893c9f
6 changed files with 36 additions and 23 deletions

View File

@ -97,6 +97,20 @@ type
property RequiredIDEPackage: TIDEPackage read FRequiredPackage write SetRequiredPackage;
end;
TLazPackageType = (
lptRunTime, // Cannot register anything in the IDE. Can be used by designtime packages.
lptDesignTime, // Can register anything in the IDE but is not compiled into projects.
// The IDE calls the 'register' procedures of each unit.
lptRunAndDesignTime, // Can do anything.
lptRunTimeOnly // As lptRunTime but cannot be installed in the IDE, not even indirectly.
);
TLazPackageTypes = set of TLazPackageType;
const
LazPackageTypeIdents: array[TLazPackageType] of string = (
'RunTime', 'DesignTime', 'RunAndDesignTime', 'RunTimeOnly');
type
{ TLazPackageID }
TLazPackageID = class(TIDEProjPackBase)
@ -107,6 +121,7 @@ type
function GetIDAsWord: string;
protected
FVersion: TPkgVersion;
FPackageType: TLazPackageType;
procedure SetName(const NewName: TComponentName); override;
procedure UpdateIDAsString;
procedure VersionChanged(Sender: TObject); virtual;

View File

@ -75,6 +75,7 @@ type
property LPKUrl: string read FFilename write FFilename;
property LPLFilename: string read FLPLFilename write FLPLFilename;
property LPLFileDate: TDateTime read FLPLFileDate write FLPLFileDate;
property PackageType: TLazPackageType read FPackageType;
property Origin: TPkgLinkOrigin read FOrigin write FOrigin;
property LastUsed: TDateTime read FLastUsed write FLastUsed;
end;

View File

@ -119,7 +119,7 @@ type
FLicense: String;
FPackageState: TPackageState;
FPackageStates: TPackageStates;
FPackageType: TPackageType;
FPackageType: TPackageType; // ToDo: Replace with TLazPackageType.
FLazCompatibility: String;
FFPCCompatibility: String;
FSupportedWidgetSet: String;

View File

@ -35,11 +35,18 @@ unit ShowCompilerOpts;
interface
uses
Classes, SysUtils, Forms, Controls, Buttons, StdCtrls, ComCtrls, ExtCtrls,
LazFileUtils, LazUTF8, CodeToolsCfgScript,
LazIDEIntf, IDEImagesIntf, CompOptsIntf, ProjectIntf,
LazarusIDEStrConsts, CompilerOptions,
IDEProcs, Project, ModeMatrixOpts, PackageDefs, MiscOptions;
Classes, SysUtils,
// LCL
Forms, Controls, Buttons, StdCtrls, ComCtrls, ExtCtrls,
// LazUtils
LazFileUtils, LazUTF8,
// CodeTools
CodeToolsCfgScript,
// IdeIntf
LazIDEIntf, IDEImagesIntf, CompOptsIntf, ProjectIntf, PackageIntf,
// IDE
LazarusIDEStrConsts, IDEProcs, Project, PackageDefs,
CompilerOptions, ModeMatrixOpts, MiscOptions;
type

View File

@ -30,8 +30,13 @@ unit NewPkgComponentDlg;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
StdCtrls, PackageSystem, PackageDefs, LazarusIDEStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, StdCtrls, ButtonPanel,
// IdeIntf
PackageIntf,
// IDE
PackageSystem, PackageDefs, LazarusIDEStrConsts;
type

View File

@ -419,18 +419,6 @@ type
{ TLazPackage }
TLazPackageType = (
lptRunTime, // RunTime packages can't register anything in the IDE.
// They can be used by designtime packages.
lptDesignTime, // DesignTime packages can register anything in the IDE
// and are not compiled into projects.
// The IDE calls the 'register' procedures of each unit.
lptRunAndDesignTime,// RunAndDesignTime packages can do anything.
lptRunTimeOnly // as lptRunTime, but they can not be installed in the
// IDE, not even indirectly
);
TLazPackageTypes = set of TLazPackageType;
TLazPackageFlag = (
lpfAutoIncrementVersionOnBuild, // increment version before
lpfModified, // package needs saving
@ -529,7 +517,6 @@ type
FModifiedLock: integer;
FOutputStateFile: string;
FPackageEditor: TBasePackageEditor;
FPackageType: TLazPackageType;
FPOOutputDirectory: string;
FProvides: TStrings;
fPublishOptions: TPublishPackageOptions;
@ -794,8 +781,6 @@ const
PkgFileTypeIdents: array[TPkgFileType] of string = (
'Unit', 'Virtual Unit', 'Main Unit',
'LFM', 'LRS', 'Include', 'Issues', 'Text', 'Binary');
LazPackageTypeIdents: array[TLazPackageType] of string = (
'RunTime', 'DesignTime', 'RunAndDesignTime', 'RunTimeOnly');
AutoUpdateNames: array[TPackageUpdatePolicy] of string = (
'Manually', 'OnRebuildingAll', 'AsNeeded');