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; property RequiredIDEPackage: TIDEPackage read FRequiredPackage write SetRequiredPackage;
end; 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 }
TLazPackageID = class(TIDEProjPackBase) TLazPackageID = class(TIDEProjPackBase)
@ -107,6 +121,7 @@ type
function GetIDAsWord: string; function GetIDAsWord: string;
protected protected
FVersion: TPkgVersion; FVersion: TPkgVersion;
FPackageType: TLazPackageType;
procedure SetName(const NewName: TComponentName); override; procedure SetName(const NewName: TComponentName); override;
procedure UpdateIDAsString; procedure UpdateIDAsString;
procedure VersionChanged(Sender: TObject); virtual; procedure VersionChanged(Sender: TObject); virtual;

View File

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

View File

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

View File

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

View File

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

View File

@ -419,18 +419,6 @@ type
{ TLazPackage } { 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 = ( TLazPackageFlag = (
lpfAutoIncrementVersionOnBuild, // increment version before lpfAutoIncrementVersionOnBuild, // increment version before
lpfModified, // package needs saving lpfModified, // package needs saving
@ -529,7 +517,6 @@ type
FModifiedLock: integer; FModifiedLock: integer;
FOutputStateFile: string; FOutputStateFile: string;
FPackageEditor: TBasePackageEditor; FPackageEditor: TBasePackageEditor;
FPackageType: TLazPackageType;
FPOOutputDirectory: string; FPOOutputDirectory: string;
FProvides: TStrings; FProvides: TStrings;
fPublishOptions: TPublishPackageOptions; fPublishOptions: TPublishPackageOptions;
@ -794,8 +781,6 @@ const
PkgFileTypeIdents: array[TPkgFileType] of string = ( PkgFileTypeIdents: array[TPkgFileType] of string = (
'Unit', 'Virtual Unit', 'Main Unit', 'Unit', 'Virtual Unit', 'Main Unit',
'LFM', 'LRS', 'Include', 'Issues', 'Text', 'Binary'); 'LFM', 'LRS', 'Include', 'Issues', 'Text', 'Binary');
LazPackageTypeIdents: array[TLazPackageType] of string = (
'RunTime', 'DesignTime', 'RunAndDesignTime', 'RunTimeOnly');
AutoUpdateNames: array[TPackageUpdatePolicy] of string = ( AutoUpdateNames: array[TPackageUpdatePolicy] of string = (
'Manually', 'OnRebuildingAll', 'AsNeeded'); 'Manually', 'OnRebuildingAll', 'AsNeeded');